+ * 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.elink.esua.epdc.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 用户部门关系表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-29
+ */
+@Data
+public class SysUserDeptDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ */
+ private Long id;
+
+ /**
+ * 用户ID
+ */
+ private Long userId;
+
+ /**
+ * 部门ID
+ */
+ private Long deptId;
+
+ /**
+ * 删除标识 0:未删除 1:删除
+ */
+ private Integer delFlag;
+
+ /**
+ * 创建者
+ */
+ private Long creator;
+
+ /**
+ * 创建时间
+ */
+ private Date createDate;
+
+ /**
+ * 更新者
+ */
+ private Long updater;
+
+ /**
+ * 更新时间
+ */
+ private Date updateDate;
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysUserDeptInfoDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysUserDeptInfoDTO.java
new file mode 100644
index 00000000..4580c6cd
--- /dev/null
+++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysUserDeptInfoDTO.java
@@ -0,0 +1,25 @@
+package com.elink.esua.epdc.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author:liuchuang
+ * @Date:2020/7/29 18:48
+ */
+@Data
+public class SysUserDeptInfoDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 关联部门ID
+ */
+ private Long relationDeptId;
+
+ /**
+ * 关联部门名称
+ */
+ private String relationDeptName;
+}
diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysUserDeptController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysUserDeptController.java
new file mode 100644
index 00000000..6279f51b
--- /dev/null
+++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysUserDeptController.java
@@ -0,0 +1,94 @@
+/**
+ * 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.elink.esua.epdc.controller;
+
+import com.elink.esua.epdc.commons.tools.page.PageData;
+import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
+import com.elink.esua.epdc.commons.tools.utils.Result;
+import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
+import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
+import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
+import com.elink.esua.epdc.dto.SysUserDeptDTO;
+import com.elink.esua.epdc.excel.SysUserDeptExcel;
+import com.elink.esua.epdc.service.SysUserDeptService;
+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 qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-29
+ */
+@RestController
+@RequestMapping("sysuserdept")
+public class SysUserDeptController {
+
+ @Autowired
+ private SysUserDeptService sysUserDeptService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = sysUserDeptService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ SysUserDeptDTO data = sysUserDeptService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody SysUserDeptDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ sysUserDeptService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody SysUserDeptDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ sysUserDeptService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ sysUserDeptService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = sysUserDeptService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, SysUserDeptExcel.class);
+ }
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysUserDeptDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysUserDeptDao.java
new file mode 100644
index 00000000..39cee950
--- /dev/null
+++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysUserDeptDao.java
@@ -0,0 +1,46 @@
+/**
+ * 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.elink.esua.epdc.dao;
+
+import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
+import com.elink.esua.epdc.dto.SysUserDeptInfoDTO;
+import com.elink.esua.epdc.entity.SysUserDeptEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 用户部门关系表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-29
+ */
+@Mapper
+public interface SysUserDeptDao extends BaseDao {
+
+ /**
+ *
+ * 根据用户ID获取用户关联部门信息
+ *
+ * @param userId
+ * @return com.elink.esua.epdc.entity.SysUserDeptEntity
+ * @author liuchuang
+ * @since 2020/7/29 18:43
+ */
+ SysUserDeptInfoDTO selectUserDeptInfoByUserId(@Param("userId") Long userId);
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysUserDeptEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysUserDeptEntity.java
new file mode 100644
index 00000000..a9fcc905
--- /dev/null
+++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/SysUserDeptEntity.java
@@ -0,0 +1,73 @@
+/**
+ * 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.elink.esua.epdc.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 用户部门关系表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-29
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("sys_user_dept")
+public class SysUserDeptEntity extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 用户ID
+ */
+ private Long userId;
+
+ /**
+ * 部门ID
+ */
+ private Long deptId;
+
+ /**
+ * 删除标识 0:未删除 1:删除
+ */
+ @TableLogic
+ @TableField(fill = FieldFill.INSERT)
+ private Integer delFlag;
+
+ /**
+ * 更新者
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Long updater;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Date updateDate;
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysUserDeptExcel.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysUserDeptExcel.java
new file mode 100644
index 00000000..65566dba
--- /dev/null
+++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/SysUserDeptExcel.java
@@ -0,0 +1,59 @@
+/**
+ * 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.elink.esua.epdc.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 用户部门关系表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-29
+ */
+@Data
+public class SysUserDeptExcel {
+
+ @Excel(name = "id")
+ private String id;
+
+ @Excel(name = "用户ID")
+ private Long userId;
+
+ @Excel(name = "部门ID")
+ private Long deptId;
+
+ @Excel(name = "删除标识 0:未删除 1:删除")
+ private Integer delFlag;
+
+ @Excel(name = "创建者")
+ private Long creator;
+
+ @Excel(name = "创建时间")
+ private Date createDate;
+
+ @Excel(name = "更新者")
+ private Long updater;
+
+ @Excel(name = "更新时间")
+ private Date updateDate;
+
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysUserDeptRedis.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysUserDeptRedis.java
new file mode 100644
index 00000000..259a6ff3
--- /dev/null
+++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysUserDeptRedis.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.elink.esua.epdc.redis;
+
+import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 用户部门关系表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-07-29
+ */
+@Component
+public class SysUserDeptRedis {
+ @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/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysUserDeptService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysUserDeptService.java
new file mode 100644
index 00000000..e8e3893c
--- /dev/null
+++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysUserDeptService.java
@@ -0,0 +1,119 @@
+/**
+ * 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.
+ *