+ * 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 2021-03-16
+ */
+@Data
+public class GovCustomerMenuDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键ID
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * gov_menu表主键
+ */
+ private String tableId;
+
+ /**
+ * 删除标识 0未删除、1已删除
+ */
+ private String 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-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java
new file mode 100644
index 0000000000..1bd4fc67bc
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java
@@ -0,0 +1,27 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 菜单配置 - 一菜单 多 客户
+ */
+@Data
+public class MenuConfigFormDTO implements Serializable {
+ private static final long serialVersionUID = -2898130727929596798L;
+
+ /**
+ * gov_menu表主键
+ */
+ @NotBlank(message = "菜单ID不能为空")
+ private String tableId;
+
+ /**
+ * 客户id 列表
+ */
+ @NotBlank(message = "客户id 列表不能为空")
+ private List customerIds;
+}
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java
new file mode 100644
index 0000000000..5e60482a5f
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java
@@ -0,0 +1,129 @@
+/**
+ * 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.controller;
+
+import com.epmet.commons.tools.exception.RenException;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.dto.GovCustomerMenuDTO;
+import com.epmet.dto.form.MenuConfigFormDTO;
+import com.epmet.excel.GovCustomerMenuExcel;
+import com.epmet.service.GovCustomerMenuService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 客户菜单配置表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-03-16
+ */
+@RestController
+@RequestMapping("govcustomermenu")
+public class GovCustomerMenuController {
+
+ @Autowired
+ private GovCustomerMenuService govCustomerMenuService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = govCustomerMenuService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ GovCustomerMenuDTO data = govCustomerMenuService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody GovCustomerMenuDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ govCustomerMenuService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody GovCustomerMenuDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ govCustomerMenuService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ govCustomerMenuService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = govCustomerMenuService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, GovCustomerMenuExcel.class);
+ }
+
+ /**
+ * 给每个客户 配置可见菜单
+ * 先删除,后新增
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author zhangyong
+ * @Date 14:15 2021-03-16
+ **/
+ @PostMapping("addcustomermenu")
+ public Result addCustomerMenu(@RequestBody MenuConfigFormDTO formDTO) {
+ //效验数据
+ if (StringUtils.isBlank(formDTO.getTableId())) {
+ throw new RenException("菜单ID不能为空");
+ }
+ govCustomerMenuService.saveCustomerMenu(formDTO);
+ return new Result();
+ }
+
+ /**
+ * 根据gov_menu表主键,查询拥有这项菜单的所有客户(customerIds)
+ *
+ * @param tableId
+ * @return com.epmet.commons.tools.utils.Result>
+ * @Author zhangyong
+ * @Date 16:26 2021-03-16
+ **/
+ @GetMapping("getcustomerids/{tableid}")
+ public Result> getcustomerids(@PathVariable("tableid") String tableId){
+ List data = govCustomerMenuService.getcustomerIds(tableId);
+ return new Result>().ok(data);
+ }
+}
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java
new file mode 100644
index 0000000000..6daa27f116
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java
@@ -0,0 +1,55 @@
+/**
+ * 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.GovCustomerMenuEntity;
+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 2021-03-16
+ */
+@Mapper
+public interface GovCustomerMenuDao extends BaseDao {
+
+ /**
+ * 根据gov_menu表主键,先清除之前配置的客户信息
+ *
+ * @param tableId
+ * @return void
+ * @Author zhangyong
+ * @Date 14:24 2021-03-16
+ **/
+ void deleteBatchTableIds(@Param("tableId") String tableId);
+
+ /**
+ * 根据gov_menu表主键,查询拥有这项菜单的所有客户(customerIds)
+ *
+ * @param tableId
+ * @return java.util.List
+ * @Author zhangyong
+ * @Date 16:29 2021-03-16
+ **/
+ List selectListcustomerIds(@Param("tableId") String tableId);
+}
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java
index 1e36bff758..ba05556dc1 100644
--- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java
@@ -49,4 +49,13 @@ public interface GovMenuDao extends BaseDao {
* @param pid 父菜单ID
*/
List getListPid(String pid);
+
+ /**
+ * 查询客户菜单列表
+ *
+ * @param customerId 客户id
+ * @param type 菜单类型
+ * @param language 语言
+ */
+ List getCustomerMenuList(@Param("customerId") String customerId, @Param("type") Integer type, @Param("language") String language);
}
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java
new file mode 100644
index 0000000000..d0358e7124
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.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 2021-03-16
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("gov_customer_menu")
+public class GovCustomerMenuEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * gov_menu表主键
+ */
+ private String tableId;
+
+}
diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java
new file mode 100644
index 0000000000..1ac8f2d886
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.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 2021-03-16
+ */
+@Data
+public class GovCustomerMenuExcel {
+
+ @Excel(name = "主键ID")
+ private String id;
+
+ @Excel(name = "客户ID")
+ private String customerId;
+
+ @Excel(name = "gov_menu表主键")
+ private String tableId;
+
+ @Excel(name = "删除标识 0未删除、1已删除")
+ private String 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-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java
new file mode 100644
index 0000000000..2333a6bd48
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.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 2021-03-16
+ */
+@Component
+public class GovCustomerMenuRedis {
+ @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/GovCustomerMenuService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java
new file mode 100644
index 0000000000..dea2a31ca0
--- /dev/null
+++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java
@@ -0,0 +1,126 @@
+/**
+ * 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.
+ *