完成救援队伍管理,行政公文台账,公文流转三个模块权限管理

main
15036302109 12 months ago
parent 9a7f72026c
commit 21baf76da2

@ -48,6 +48,13 @@ public class EhsDocumentServiceImpl extends ServiceImpl<EhsDocumentMapper, EhsDo
* @return * @return
*/ */
@Override @Override
public List<EhsDocument> selectEhsDocumentList(EhsDocument ehsDocument) {
// 按部门区分权限,局端没有查询全部的权限
SysUser currentUser = SecurityUtils.getLoginUser().getUser();
ehsDocument.setDeptId(currentUser.getDept().getDeptId().longValue());
return ehsDocumentMapper.selectEhsDocumentList(ehsDocument);
}
/*@Override
public List<EhsDocument> selectEhsDocumentList(EhsDocument ehsDocument) { public List<EhsDocument> selectEhsDocumentList(EhsDocument ehsDocument) {
// 如果登录用户不是县级部门(即不是根节点parent_id=0),那么只能查询本部门的;县级部门(根节点)则查询全部 // 如果登录用户不是县级部门(即不是根节点parent_id=0),那么只能查询本部门的;县级部门(根节点)则查询全部
SysUser currentUser = SecurityUtils.getLoginUser().getUser(); SysUser currentUser = SecurityUtils.getLoginUser().getUser();
@ -57,7 +64,7 @@ public class EhsDocumentServiceImpl extends ServiceImpl<EhsDocumentMapper, EhsDo
ehsDocument.setDeptId(currentUser.getDept().getDeptId().longValue()); ehsDocument.setDeptId(currentUser.getDept().getDeptId().longValue());
} }
return ehsDocumentMapper.selectEhsDocumentList(ehsDocument); return ehsDocumentMapper.selectEhsDocumentList(ehsDocument);
} }*/
/** /**
* 稿 * 稿

@ -3,6 +3,8 @@ package com.ruoyi.ehsFloodDroughtTeam.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.ehsFloodDroughtTeam.domain.FloodDroughtTeamImportTemplate; import com.ruoyi.ehsFloodDroughtTeam.domain.FloodDroughtTeamImportTemplate;
import com.ruoyi.ehsFloodDroughtTeam.vo.FloodDroughtTeamVo; import com.ruoyi.ehsFloodDroughtTeam.vo.FloodDroughtTeamVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -47,10 +49,17 @@ public class EhsFloodDroughtTeamServiceImpl extends ServiceImpl<EhsFloodDroughtT
*/ */
@Override @Override
public List<EhsFloodDroughtTeam> selectEhsFloodDroughtTeamList(EhsFloodDroughtTeam ehsFloodDroughtTeam) { public List<EhsFloodDroughtTeam> selectEhsFloodDroughtTeamList(EhsFloodDroughtTeam ehsFloodDroughtTeam) {
// 如果不是局端,那么只能查询自己部门下的数据
SysUser currentUser = SecurityUtils.getLoginUser().getUser();
Long deptParentId = currentUser.getDept().getParentId();
if (deptParentId != null && deptParentId.longValue() != 0) {
ehsFloodDroughtTeam.setDeptId(currentUser.getDept().getDeptId().longValue());
}
List<EhsFloodDroughtTeam> teamList = ehsFloodDroughtTeamMapper.selectEhsFloodDroughtTeamList(ehsFloodDroughtTeam); List<EhsFloodDroughtTeam> teamList = ehsFloodDroughtTeamMapper.selectEhsFloodDroughtTeamList(ehsFloodDroughtTeam);
// 给队伍设置人数信息
teamList.stream().forEach(item -> { teamList.stream().forEach(item -> {
Long count = ehsFloodDroughtTeamMapper.getWorkerNumByTeamId(item.getId()); Long count = ehsFloodDroughtTeamMapper.getWorkerNumByTeamId(item.getId());
if (count != null){ if (count != null) {
item.setRescueWorkerNum(count); item.setRescueWorkerNum(count);
} }
}); });

@ -3,6 +3,8 @@ package com.ruoyi.ehsRescueTeam.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.ehsRescueTeam.domain.EhsRescueTeam; import com.ruoyi.ehsRescueTeam.domain.EhsRescueTeam;
import com.ruoyi.ehsRescueTeam.domain.RescueTeamImportTemplate; import com.ruoyi.ehsRescueTeam.domain.RescueTeamImportTemplate;
@ -47,7 +49,15 @@ public class EhsRescueTeamServiceImpl extends ServiceImpl<EhsRescueTeamMapper, E
*/ */
@Override @Override
public List<EhsRescueTeam> selectEhsRescueTeamList(EhsRescueTeam ehsRescueTeam) { public List<EhsRescueTeam> selectEhsRescueTeamList(EhsRescueTeam ehsRescueTeam) {
// 如果不是局端,那么只能查询自己部门下的数据
SysUser currentUser = SecurityUtils.getLoginUser().getUser();
Long deptParentId = currentUser.getDept().getParentId();
if (deptParentId != null &&
deptParentId.longValue() != 0) {
ehsRescueTeam.setDeptId(currentUser.getDept().getDeptId().longValue());
}
List<EhsRescueTeam> ehsRescueTeamList = ehsRescueTeamMapper.selectEhsRescueTeamList(ehsRescueTeam); List<EhsRescueTeam> ehsRescueTeamList = ehsRescueTeamMapper.selectEhsRescueTeamList(ehsRescueTeam);
// 给队伍设置人数信息
ehsRescueTeamList.stream().forEach(item->{ ehsRescueTeamList.stream().forEach(item->{
Long count = ehsRescueTeamMapper.getWorkerNumByTeamId(item.getId()); Long count = ehsRescueTeamMapper.getWorkerNumByTeamId(item.getId());
if (count != null){ if (count != null){

@ -5,18 +5,18 @@
<mapper namespace="com.ruoyi.ehsRescueTeam.mapper.EhsRescueTeamMapper"> <mapper namespace="com.ruoyi.ehsRescueTeam.mapper.EhsRescueTeamMapper">
<resultMap type="EhsRescueTeam" id="EhsRescueTeamResult"> <resultMap type="EhsRescueTeam" id="EhsRescueTeamResult">
<result property="id" column="id" /> <result property="id" column="id"/>
<result property="teamName" column="team_name" /> <result property="teamName" column="team_name"/>
<result property="teamLevel" column="team_level" /> <result property="teamLevel" column="team_level"/>
<!--<result property="rescueWorkerNum" column="rescue_worker_num" />--> <!--<result property="rescueWorkerNum" column="rescue_worker_num" />-->
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark" /> <result property="remark" column="remark"/>
<result property="deptId" column="dept_id" /> <result property="deptId" column="dept_id"/>
<result property="createUserId" column="create_user_id" /> <result property="createUserId" column="create_user_id"/>
<result property="updateUserId" column="update_user_id" /> <result property="updateUserId" column="update_user_id"/>
</resultMap> </resultMap>
<sql id="selectEhsRescueTeamVo"> <sql id="selectEhsRescueTeamVo">
@ -26,14 +26,15 @@
<select id="selectEhsRescueTeamList" parameterType="EhsRescueTeam" resultMap="EhsRescueTeamResult"> <select id="selectEhsRescueTeamList" parameterType="EhsRescueTeam" resultMap="EhsRescueTeamResult">
<include refid="selectEhsRescueTeamVo"/> <include refid="selectEhsRescueTeamVo"/>
<where> <where>
<if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if> <if test="teamName != null and teamName != ''">and team_name like concat('%', #{teamName}, '%')</if>
<if test="teamLevel != null and teamLevel != ''"> and team_level like concat('%', #{teamLevel}, '%')</if> <if test="teamLevel != null and teamLevel != ''">and team_level like concat('%', #{teamLevel}, '%')</if>
<if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
</where> </where>
</select> </select>
<select id="selectEhsRescueTeamById" parameterType="Long" resultMap="EhsRescueTeamResult"> <select id="selectEhsRescueTeamById" parameterType="Long" resultMap="EhsRescueTeamResult">
<include refid="selectEhsRescueTeamVo"/> <include refid="selectEhsRescueTeamVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="getWorkerNumByTeamId" resultType="java.lang.Long"> <select id="getWorkerNumByTeamId" resultType="java.lang.Long">
SELECT IFNULL( SELECT IFNULL(

@ -1,6 +1,16 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="创建者部门" prop="deptId" v-show="deptShow">
<el-select v-model="queryParams.deptId" filterable placeholder="请选择部门" clearable>
<el-option
v-for="dict in allDeptList"
:key="dict.deptId"
:label="dict.deptName"
:value="dict.deptId"
/>
</el-select>
</el-form-item>
<el-form-item label="队伍名称" prop="teamName"> <el-form-item label="队伍名称" prop="teamName">
<el-input <el-input
v-model="queryParams.teamName" v-model="queryParams.teamName"
@ -34,7 +44,7 @@
v-hasPermi="['ehs:ehsFloodDroughtTeam:add']" v-hasPermi="['ehs:ehsFloodDroughtTeam:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="success" type="success"
plain plain
@ -44,8 +54,8 @@
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['ehs:ehsFloodDroughtTeam:edit']" v-hasPermi="['ehs:ehsFloodDroughtTeam:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
plain plain
@ -55,7 +65,7 @@
@click="handleDelete" @click="handleDelete"
v-hasPermi="['ehs:ehsFloodDroughtTeam:remove']" v-hasPermi="['ehs:ehsFloodDroughtTeam:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>-->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
@ -91,8 +101,8 @@
<el-table-column label="救援人员数量" align="center" prop="rescueWorkerNum" /> <el-table-column label="救援人员数量" align="center" prop="rescueWorkerNum" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope" v-if="curDeptId == scope.row.deptId">
<!-- <el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@ -105,7 +115,7 @@
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['ehs:ehsFloodDroughtTeam:remove']" v-hasPermi="['ehs:ehsFloodDroughtTeam:remove']"
>删除</el-button>--> >删除</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -165,6 +175,7 @@
import { listEhsFloodDroughtTeam, getEhsFloodDroughtTeam, delEhsFloodDroughtTeam, addEhsFloodDroughtTeam, updateEhsFloodDroughtTeam } from "@/api/ehs/ehsFloodDroughtTeam"; import { listEhsFloodDroughtTeam, getEhsFloodDroughtTeam, delEhsFloodDroughtTeam, addEhsFloodDroughtTeam, updateEhsFloodDroughtTeam } from "@/api/ehs/ehsFloodDroughtTeam";
import importUpload from "@/components/upload/upload"; import importUpload from "@/components/upload/upload";
import tdh from "../ehsFloodDroughtWorker/index.vue"; import tdh from "../ehsFloodDroughtWorker/index.vue";
import {listAllDept } from "@/api/system/dept";
export default { export default {
name: "EhsFloodDroughtTeam", name: "EhsFloodDroughtTeam",
components: { components: {
@ -183,6 +194,11 @@ export default {
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
//
deptShow: false,
curDeptId:-1,//
//
allDeptList: [],
// //
total: 0, total: 0,
// //
@ -211,6 +227,9 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getListAllDept();
this.deptShow = this.$store.state.user.parentId==0 ?true :false;
this.curDeptId = this.$store.state.user.deptId;
}, },
methods: { methods: {
flood(){ flood(){
@ -225,6 +244,15 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
/** 单位信息列表 */
getListAllDept() {
console.log(this.$store.state.user.deptId);
this.loading = true;
listAllDept().then(response => {
this.allDeptList = response.data;
this.loading = false;
});
},
// //
cancel() { cancel() {
this.open = false; this.open = false;

@ -1,6 +1,17 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="创建者部门" prop="deptId" v-show="deptShow">
<el-select v-model="queryParams.deptId" filterable placeholder="请选择部门" clearable>
<el-option
v-for="dict in allDeptList"
:key="dict.deptId"
:label="dict.deptName"
:value="dict.deptId"
/>
</el-select>
</el-form-item>
<el-form-item label="队伍名称" prop="teamName"> <el-form-item label="队伍名称" prop="teamName">
<el-input <el-input
v-model="queryParams.teamName" v-model="queryParams.teamName"
@ -34,7 +45,7 @@
v-hasPermi="['ehs:ehsRescueTeam:add']" v-hasPermi="['ehs:ehsRescueTeam:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="success" type="success"
plain plain
@ -44,8 +55,8 @@
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['ehs:ehsRescueTeam:edit']" v-hasPermi="['ehs:ehsRescueTeam:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
plain plain
@ -55,7 +66,7 @@
@click="handleDelete" @click="handleDelete"
v-hasPermi="['ehs:ehsRescueTeam:remove']" v-hasPermi="['ehs:ehsRescueTeam:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>-->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
@ -92,14 +103,15 @@
<el-table-column label="救援人员数量" align="center" prop="rescueWorkerNum" /> <el-table-column label="救援人员数量" align="center" prop="rescueWorkerNum" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<template slot-scope="scope" v-if="curDeptId == scope.row.deptId">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="getWorker(scope.row)" @click="getWorker(scope.row)"
>人员信息</el-button> >人员信息</el-button>
<!-- <el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@ -112,7 +124,7 @@
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['ehs:ehsRescueTeam:remove']" v-hasPermi="['ehs:ehsRescueTeam:remove']"
>删除</el-button>--> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -168,6 +180,7 @@ import { listEhsRescueTeam, getEhsRescueTeam, delEhsRescueTeam, addEhsRescueTeam
import { listEhsRescueTeamWorker, getEhsRescueTeamWorker, delEhsRescueTeamWorker, addEhsRescueTeamWorker, updateEhsRescueTeamWorker } from "@/api/ehs/ehsRescueTeamWorker"; import { listEhsRescueTeamWorker, getEhsRescueTeamWorker, delEhsRescueTeamWorker, addEhsRescueTeamWorker, updateEhsRescueTeamWorker } from "@/api/ehs/ehsRescueTeamWorker";
import importUpload from "@/components/upload/upload"; import importUpload from "@/components/upload/upload";
import tdh from "../ehsRescueTeamWorker/index.vue" import tdh from "../ehsRescueTeamWorker/index.vue"
import {listAllDept } from "@/api/system/dept";
export default { export default {
name: "EhsRescueTeam", name: "EhsRescueTeam",
components: { components: {
@ -186,10 +199,15 @@ export default {
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
curDeptId:-1,//
// //
total: 0, total: 0,
// //
ehsRescueTeamList: [], ehsRescueTeamList: [],
//
deptShow: false,
//
allDeptList: [],
// //
title: "", title: "",
// //
@ -203,6 +221,7 @@ export default {
pageSize: 10, pageSize: 10,
teamName: null, teamName: null,
teamLevel: null, teamLevel: null,
deptId: null,
}, },
// //
form: {}, form: {},
@ -213,6 +232,9 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getListAllDept();
this.deptShow = this.$store.state.user.parentId==0 ?true :false;
this.curDeptId = this.$store.state.user.deptId;
}, },
methods: { methods: {
rescue() { rescue() {
@ -227,6 +249,15 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
/** 单位信息列表 */
getListAllDept() {
console.log(this.$store.state.user.deptId);
this.loading = true;
listAllDept().then(response => {
this.allDeptList = response.data;
this.loading = false;
});
},
// //
cancel() { cancel() {
this.open = false; this.open = false;

Loading…
Cancel
Save