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

main
15036302109 10 months ago
parent 9a7f72026c
commit 21baf76da2

@ -48,6 +48,13 @@ public class EhsDocumentServiceImpl extends ServiceImpl<EhsDocumentMapper, EhsDo
* @return
*/
@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) {
// 如果登录用户不是县级部门(即不是根节点parent_id=0),那么只能查询本部门的;县级部门(根节点)则查询全部
SysUser currentUser = SecurityUtils.getLoginUser().getUser();
@ -57,7 +64,7 @@ public class EhsDocumentServiceImpl extends ServiceImpl<EhsDocumentMapper, EhsDo
ehsDocument.setDeptId(currentUser.getDept().getDeptId().longValue());
}
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.core.conditions.query.LambdaQueryWrapper;
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.vo.FloodDroughtTeamVo;
import org.springframework.stereotype.Service;
@ -47,10 +49,17 @@ public class EhsFloodDroughtTeamServiceImpl extends ServiceImpl<EhsFloodDroughtT
*/
@Override
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);
// 给队伍设置人数信息
teamList.stream().forEach(item -> {
Long count = ehsFloodDroughtTeamMapper.getWorkerNumByTeamId(item.getId());
if (count != null){
if (count != null) {
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.toolkit.Wrappers;
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.ehsRescueTeam.domain.EhsRescueTeam;
import com.ruoyi.ehsRescueTeam.domain.RescueTeamImportTemplate;
@ -47,7 +49,15 @@ public class EhsRescueTeamServiceImpl extends ServiceImpl<EhsRescueTeamMapper, E
*/
@Override
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);
// 给队伍设置人数信息
ehsRescueTeamList.stream().forEach(item->{
Long count = ehsRescueTeamMapper.getWorkerNumByTeamId(item.getId());
if (count != null){

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

@ -1,6 +1,16 @@
<template>
<div class="app-container">
<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-input
v-model="queryParams.teamName"
@ -34,7 +44,7 @@
v-hasPermi="['ehs:ehsFloodDroughtTeam:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
@ -44,8 +54,8 @@
@click="handleUpdate"
v-hasPermi="['ehs:ehsFloodDroughtTeam:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
</el-col>-->
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
@ -55,7 +65,7 @@
@click="handleDelete"
v-hasPermi="['ehs:ehsFloodDroughtTeam:remove']"
>删除</el-button>
</el-col>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
@ -91,8 +101,8 @@
<el-table-column label="救援人员数量" align="center" prop="rescueWorkerNum" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button
<template slot-scope="scope" v-if="curDeptId == scope.row.deptId">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@ -105,7 +115,7 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ehs:ehsFloodDroughtTeam:remove']"
>删除</el-button>-->
>删除</el-button>
<el-button
size="mini"
type="text"
@ -165,6 +175,7 @@
import { listEhsFloodDroughtTeam, getEhsFloodDroughtTeam, delEhsFloodDroughtTeam, addEhsFloodDroughtTeam, updateEhsFloodDroughtTeam } from "@/api/ehs/ehsFloodDroughtTeam";
import importUpload from "@/components/upload/upload";
import tdh from "../ehsFloodDroughtWorker/index.vue";
import {listAllDept } from "@/api/system/dept";
export default {
name: "EhsFloodDroughtTeam",
components: {
@ -183,6 +194,11 @@ export default {
multiple: true,
//
showSearch: true,
//
deptShow: false,
curDeptId:-1,//
//
allDeptList: [],
//
total: 0,
//
@ -211,6 +227,9 @@ export default {
},
created() {
this.getList();
this.getListAllDept();
this.deptShow = this.$store.state.user.parentId==0 ?true :false;
this.curDeptId = this.$store.state.user.deptId;
},
methods: {
flood(){
@ -225,6 +244,15 @@ export default {
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() {
this.open = false;

@ -1,6 +1,17 @@
<template>
<div class="app-container">
<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-input
v-model="queryParams.teamName"
@ -34,7 +45,7 @@
v-hasPermi="['ehs:ehsRescueTeam:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
@ -44,8 +55,8 @@
@click="handleUpdate"
v-hasPermi="['ehs:ehsRescueTeam:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
</el-col>-->
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
@ -55,7 +66,7 @@
@click="handleDelete"
v-hasPermi="['ehs:ehsRescueTeam:remove']"
>删除</el-button>
</el-col>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
@ -92,14 +103,15 @@
<el-table-column label="救援人员数量" align="center" prop="rescueWorkerNum" />
<el-table-column label="备注" align="center" prop="remark" />
<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
size="mini"
type="text"
icon="el-icon-edit"
@click="getWorker(scope.row)"
>人员信息</el-button>
<!-- <el-button
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@ -112,7 +124,7 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ehs:ehsRescueTeam:remove']"
>删除</el-button>-->
>删除</el-button>
</template>
</el-table-column>
</el-table>
@ -168,6 +180,7 @@ import { listEhsRescueTeam, getEhsRescueTeam, delEhsRescueTeam, addEhsRescueTeam
import { listEhsRescueTeamWorker, getEhsRescueTeamWorker, delEhsRescueTeamWorker, addEhsRescueTeamWorker, updateEhsRescueTeamWorker } from "@/api/ehs/ehsRescueTeamWorker";
import importUpload from "@/components/upload/upload";
import tdh from "../ehsRescueTeamWorker/index.vue"
import {listAllDept } from "@/api/system/dept";
export default {
name: "EhsRescueTeam",
components: {
@ -186,10 +199,15 @@ export default {
multiple: true,
//
showSearch: true,
curDeptId:-1,//
//
total: 0,
//
ehsRescueTeamList: [],
//
deptShow: false,
//
allDeptList: [],
//
title: "",
//
@ -203,6 +221,7 @@ export default {
pageSize: 10,
teamName: null,
teamLevel: null,
deptId: null,
},
//
form: {},
@ -213,6 +232,9 @@ export default {
},
created() {
this.getList();
this.getListAllDept();
this.deptShow = this.$store.state.user.parentId==0 ?true :false;
this.curDeptId = this.$store.state.user.deptId;
},
methods: {
rescue() {
@ -227,6 +249,15 @@ export default {
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() {
this.open = false;

Loading…
Cancel
Save