+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 角色能进行那些操作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Data
+public class RoleOperationDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ */
+ private String id;
+
+ /**
+ * 角色ID
+ */
+ private String roleId;
+
+ /**
+ * 操作key
+ */
+ private String operationKey;
+
+ /**
+ * 是否删除,0:未删除,1:已删除
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建者id
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新者id
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationResultDTO.java
new file mode 100644
index 0000000000..dc7fc1559e
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationResultDTO.java
@@ -0,0 +1,87 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 角色能进行那些操作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Data
+public class RoleOperationResultDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ */
+ private String id;
+
+ /**
+ * 角色ID
+ */
+ private String roleId;
+
+ /**
+ * 操作key
+ */
+ private String operationKey;
+
+ /**
+ * 操作名称
+ */
+ private String operationName;
+
+ /**
+ * 是否删除,0:未删除,1:已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建者id
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新者id
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/RoleController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/RoleController.java
new file mode 100644
index 0000000000..8e9778734b
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/RoleController.java
@@ -0,0 +1,33 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.result.RoleOperationResultDTO;
+import com.epmet.service.RoleOperationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("role")
+public class RoleController {
+
+ @Autowired
+ private RoleOperationService roleOperationService;
+
+ /**
+ * 查询角色对应的操作列表
+ * @param roleId
+ * @return
+ */
+ @PostMapping("operations/{roleId}")
+ public Result> listOperationsByRoleId(@PathVariable("roleId") String roleId) {
+ List roleOperationResultDTOS = roleOperationService.listOperationsByRoleId(roleId);
+ return new Result>().ok(roleOperationResultDTOS);
+ }
+
+
+}
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDao.java
new file mode 100644
index 0000000000..a1b408ba7a
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDao.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.result.RoleOperationResultDTO;
+import com.epmet.entity.RoleOperationEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 角色能进行那些操作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Mapper
+public interface RoleOperationDao extends BaseDao {
+
+ List listOperationsByRoleId(@Param("roleId") String roleId);
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationEntity.java
new file mode 100644
index 0000000000..96f70de1be
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationEntity.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 角色能进行那些操作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("role_operation")
+public class RoleOperationEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 角色ID
+ */
+ private String roleId;
+
+ /**
+ * 操作key
+ */
+ private String operationKey;
+
+}
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/RoleOperationExcel.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/RoleOperationExcel.java
new file mode 100644
index 0000000000..4b0c4ee373
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/RoleOperationExcel.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 角色能进行那些操作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Data
+public class RoleOperationExcel {
+
+ @Excel(name = "")
+ private String id;
+
+ @Excel(name = "角色ID")
+ private String roleId;
+
+ @Excel(name = "操作key")
+ private String operationKey;
+
+ @Excel(name = "是否删除,0:未删除,1:已删除")
+ private Integer delFlag;
+
+ @Excel(name = "乐观锁")
+ private Integer revision;
+
+ @Excel(name = "创建者id")
+ private String createdBy;
+
+ @Excel(name = "创建时间")
+ private Date createdTime;
+
+ @Excel(name = "更新者id")
+ private String updatedBy;
+
+ @Excel(name = "更新时间")
+ private Date updatedTime;
+
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java
new file mode 100644
index 0000000000..d57c02ebde
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/RoleOperationRedis.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 角色能进行那些操作
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Component
+public class RoleOperationRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleOperationService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleOperationService.java
new file mode 100644
index 0000000000..ebc000a36b
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/RoleOperationService.java
@@ -0,0 +1,103 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 政府端角色表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Data
+public class GovStaffRoleDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ private String id;
+
+ /**
+ * 客户ID。如果该角色由客户定制,其下的机关和部门都不再各自定制自己的角色,这个字段会比较有用。包括通用角色以及客户定制角色。
+ */
+ private String customerId;
+
+ /**
+ * 角色key
+ */
+ private String roleKey;
+
+ /**
+ * 角色名称
+ */
+ private String roleName;
+
+ /**
+ * 角色所属体系类型:agency,department,grid
+ */
+ private String orgType;
+
+ /**
+ *
+ */
+ private Integer delFlag;
+
+ /**
+ *
+ */
+ private Integer revision;
+
+ /**
+ *
+ */
+ private String createdBy;
+
+ /**
+ *
+ */
+ private Date createdTime;
+
+ /**
+ *
+ */
+ private String updatedBy;
+
+ /**
+ *
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffRoleDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffRoleDTO.java
new file mode 100644
index 0000000000..59d649f970
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffRoleDTO.java
@@ -0,0 +1,86 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.GovStaffRoleEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 政府端角色表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Mapper
+public interface GovStaffRoleDao extends BaseDao {
+
+ List listRolesByStaffId(@Param("staffId") String staffId, @Param("orgId") String orgId);
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java
index d905202603..6869f1a5bf 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java
@@ -18,6 +18,8 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.StaffGridVisitedDTO;
+import com.epmet.dto.form.LatestGridFormDTO;
import com.epmet.entity.StaffGridVisitedEntity;
import org.apache.ibatis.annotations.Mapper;
@@ -29,5 +31,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface StaffGridVisitedDao extends BaseDao {
-
+
+ /**
+ * @Description 通过staffId和customerId查询当前用户上一次登录的网格信息
+ * @Param LatestGridFormDTO
+ * @return gridId
+ * @Author wangc
+ * @Date 2020.04.23 00:40
+ **/
+ String selectStaffLatestGrid(LatestGridFormDTO latestGridFormDTO);
+
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
new file mode 100644
index 0000000000..1a69f5a6c2
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.StaffRoleEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 工作人员-角色关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Mapper
+public interface StaffRoleDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java
new file mode 100644
index 0000000000..80ee011dcd
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GovStaffRoleEntity.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 政府端角色表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("gov_staff_role")
+public class GovStaffRoleEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID。如果该角色由客户定制,其下的机关和部门都不再各自定制自己的角色,这个字段会比较有用。包括通用角色以及客户定制角色。
+ */
+ private String customerId;
+
+ /**
+ * 角色key
+ */
+ private String roleKey;
+
+ /**
+ * 角色名称
+ */
+ private String roleName;
+
+ /**
+ * 角色所属体系类型:agency,department,grid
+ */
+ private String orgType;
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffRoleEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffRoleEntity.java
new file mode 100644
index 0000000000..20f828a52d
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffRoleEntity.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 工作人员-角色关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("staff_role")
+public class StaffRoleEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 用户ID
+ */
+ private String staffId;
+
+ /**
+ * 角色ID
+ */
+ private String roleId;
+
+ /**
+ * 角色所属类型的ID。例如,机关的角色,那该字段就是所属机关的ID;部门的角色,该字段就是所属部门的ID;网格的角色,该字段就是所属网格ID
+ */
+ private String orgId;
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GovStaffRoleExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GovStaffRoleExcel.java
new file mode 100644
index 0000000000..3448b75a7e
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GovStaffRoleExcel.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 政府端角色表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Data
+public class GovStaffRoleExcel {
+
+ @Excel(name = "ID")
+ private String id;
+
+ @Excel(name = "客户ID。如果该角色由客户定制,其下的机关和部门都不再各自定制自己的角色,这个字段会比较有用。包括通用角色以及客户定制角色。")
+ private String customerId;
+
+ @Excel(name = "角色key")
+ private String roleKey;
+
+ @Excel(name = "角色名称")
+ private String roleName;
+
+ @Excel(name = "角色所属体系类型:agency,department,grid")
+ private String orgType;
+
+ @Excel(name = "")
+ private Integer delFlag;
+
+ @Excel(name = "")
+ private Integer revision;
+
+ @Excel(name = "")
+ private String createdBy;
+
+ @Excel(name = "")
+ private Date createdTime;
+
+ @Excel(name = "")
+ private String updatedBy;
+
+ @Excel(name = "")
+ private Date updatedTime;
+
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/StaffRoleExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/StaffRoleExcel.java
new file mode 100644
index 0000000000..78def4343b
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/StaffRoleExcel.java
@@ -0,0 +1,65 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 工作人员-角色关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Data
+public class StaffRoleExcel {
+
+ @Excel(name = "")
+ private String id;
+
+ @Excel(name = "用户ID")
+ private String staffId;
+
+ @Excel(name = "角色ID")
+ private String roleId;
+
+ @Excel(name = "角色所属类型的ID。例如,机关的角色,那该字段就是所属机关的ID;部门的角色,该字段就是所属部门的ID;网格的角色,该字段就是所属网格ID")
+ private String orgId;
+
+ @Excel(name = "")
+ private Integer delFlag;
+
+ @Excel(name = "")
+ private Integer revision;
+
+ @Excel(name = "")
+ private String createdBy;
+
+ @Excel(name = "")
+ private Date createdTime;
+
+ @Excel(name = "")
+ private String updatedBy;
+
+ @Excel(name = "")
+ private Date updatedTime;
+
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java
new file mode 100644
index 0000000000..2ad77b306a
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 政府端角色表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Component
+public class GovStaffRoleRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java
new file mode 100644
index 0000000000..47714034af
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/StaffRoleRedis.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 工作人员-角色关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Component
+public class StaffRoleRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java
new file mode 100644
index 0000000000..942a001921
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java
@@ -0,0 +1,102 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dao.StaffRoleDao;
+import com.epmet.dto.StaffRoleDTO;
+import com.epmet.entity.StaffRoleEntity;
+import com.epmet.redis.StaffRoleRedis;
+import com.epmet.service.StaffRoleService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 工作人员-角色关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-04-22
+ */
+@Service
+public class StaffRoleServiceImpl extends BaseServiceImpl implements StaffRoleService {
+
+ @Autowired
+ private StaffRoleRedis staffRoleRedis;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, StaffRoleDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, StaffRoleDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public StaffRoleDTO get(String id) {
+ StaffRoleEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, StaffRoleDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(StaffRoleDTO dto) {
+ StaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, StaffRoleEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(StaffRoleDTO dto) {
+ StaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, StaffRoleEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml
new file mode 100644
index 0000000000..95949edd10
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml
index 38ce0bff3c..73978e23f3 100644
--- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml
@@ -16,5 +16,21 @@
+
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml
new file mode 100644
index 0000000000..79ad9ca489
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file