Browse Source

Merge branch 'dev' of http://94.191.59.107:3000/wukai/lzga-doc into dev

# Conflicts:
#	lzga-ui/src/router/index.js
yxc 2 years ago
parent
commit
d00aff8e40
24 changed files with 1192 additions and 301 deletions
  1. 13 16
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocGroupController.java
  2. 26 2
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocGroupUserController.java
  3. 95 23
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/domain/DocGroupUser.java
  4. 16 10
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocGroupUserMapper.java
  5. 19 1
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocGroupUserService.java
  6. 25 14
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocGroupServiceImpl.java
  7. 45 15
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocGroupUserServiceImpl.java
  8. 153 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/system/domain/SysRole.java
  9. 50 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/system/domain/SysUserRole.java
  10. 62 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/system/mapper/SysRoleMapper.java
  11. 63 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/system/mapper/SysUserRoleMapper.java
  12. 61 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/system/service/ISysRoleService.java
  13. 61 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/system/service/ISysUserRoleService.java
  14. 96 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/system/service/impl/SysRoleServiceImpl.java
  15. 93 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/system/service/impl/SysUserRoleServiceImpl.java
  16. 46 29
      lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocGroupMapper.xml
  17. 48 20
      lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocGroupUserMapper.xml
  18. 110 0
      lzga-modules/lzga-doc/src/main/resources/mapper/system/SysRoleMapper.xml
  19. 57 0
      lzga-modules/lzga-doc/src/main/resources/mapper/system/SysUserRoleMapper.xml
  20. 1 0
      lzga-ui/src/api/doc/groupUser.js
  21. 11 12
      lzga-ui/src/router/index.js
  22. 40 32
      lzga-ui/src/views/doc/groupUser/index.vue
  23. 0 126
      lzga-ui/src/views/doc/groupUser/oo.vue
  24. 1 1
      lzga-ui/src/views/doc/groupUser/selectUser.vue

+ 13 - 16
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocGroupController.java

@@ -4,6 +4,8 @@ import java.util.List;
 import java.io.IOException;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+
+import com.jjt.system.service.ISysUserRoleService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -24,24 +26,24 @@ import com.jjt.common.core.web.page.TableDataInfo;
 
 /**
  * 分组Controller
- * 
+ *
  * @author wukai
  * @date 2023-04-20
  */
 @RestController
 @RequestMapping("/group")
-public class DocGroupController extends BaseController
-{
+public class DocGroupController extends BaseController {
     @Resource
     private IDocGroupService docGroupService;
+    @Resource
+    private ISysUserRoleService userRoleService;
 
     /**
      * 查询分组列表
      */
     @RequiresPermissions("doc:group:list")
     @GetMapping("/list")
-    public TableDataInfo list(DocGroup docGroup)
-    {
+    public TableDataInfo list(DocGroup docGroup) {
         startPage();
         List<DocGroup> list = docGroupService.selectDocGroupList(docGroup);
         return getDataTable(list);
@@ -53,8 +55,7 @@ public class DocGroupController extends BaseController
     @RequiresPermissions("doc:group:export")
     @Log(title = "分组", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, DocGroup docGroup)
-    {
+    public void export(HttpServletResponse response, DocGroup docGroup) {
         List<DocGroup> list = docGroupService.selectDocGroupList(docGroup);
         ExcelUtil<DocGroup> util = new ExcelUtil<DocGroup>(DocGroup.class);
         util.exportExcel(response, list, "分组数据");
@@ -65,8 +66,7 @@ public class DocGroupController extends BaseController
      */
     @RequiresPermissions("doc:group:query")
     @GetMapping(value = "/{groupId}")
-    public AjaxResult getInfo(@PathVariable("groupId") Long groupId)
-    {
+    public AjaxResult getInfo(@PathVariable("groupId") Long groupId) {
         return success(docGroupService.selectDocGroupByGroupId(groupId));
     }
 
@@ -76,8 +76,7 @@ public class DocGroupController extends BaseController
     @RequiresPermissions("doc:group:add")
     @Log(title = "分组", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody DocGroup docGroup)
-    {
+    public AjaxResult add(@RequestBody DocGroup docGroup) {
         return toAjax(docGroupService.insertDocGroup(docGroup));
     }
 
@@ -87,8 +86,7 @@ public class DocGroupController extends BaseController
     @RequiresPermissions("doc:group:edit")
     @Log(title = "分组", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody DocGroup docGroup)
-    {
+    public AjaxResult edit(@RequestBody DocGroup docGroup) {
         return toAjax(docGroupService.updateDocGroup(docGroup));
     }
 
@@ -97,9 +95,8 @@ public class DocGroupController extends BaseController
      */
     @RequiresPermissions("doc:group:remove")
     @Log(title = "分组", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{groupIds}")
-    public AjaxResult remove(@PathVariable Long[] groupIds)
-    {
+    @DeleteMapping("/{groupIds}")
+    public AjaxResult remove(@PathVariable Long[] groupIds) {
         return toAjax(docGroupService.deleteDocGroupByGroupIds(groupIds));
     }
 }

+ 26 - 2
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocGroupUserController.java

@@ -9,6 +9,7 @@ import com.jjt.common.security.utils.SecurityUtils;
 import com.jjt.doc.domain.DocGroup;
 import com.jjt.doc.service.IDocGroupService;
 import com.jjt.system.api.domain.SysUser;
+import com.jjt.system.service.ISysUserRoleService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -40,6 +41,8 @@ public class DocGroupUserController extends BaseController {
     private IDocGroupUserService docGroupUserService;
     @Resource
     private IDocGroupService groupService;
+    @Resource
+    private ISysUserRoleService userRoleService;
 
     /**
      * 查询分组成员列表
@@ -58,15 +61,36 @@ public class DocGroupUserController extends BaseController {
     /**
      * 查询未分配成员列表
      */
-    @RequiresPermissions("system:role:list")
+    @RequiresPermissions("doc:groupUser:list")
     @GetMapping("/unallocatedList")
     public TableDataInfo unallocatedList(DocGroupUser docGroupUser) {
         startPage();
-        List<SysUser> list = docGroupUserService.selectUnallocatedList(docGroupUser);
+        List<DocGroupUser> list = docGroupUserService.selectUnallocatedList(docGroupUser);
         return getDataTable(list);
     }
 
     /**
+     * 分配分组成员
+     */
+    @RequiresPermissions("doc:groupUser:list")
+    @Log(title = "分组成员", businessType = BusinessType.GRANT)
+    @PutMapping("/selectAll")
+    public AjaxResult selectGroupUserAll(Long groupId, Long[] userIds) {
+        return toAjax(docGroupUserService.insertGroupUsers(groupId, userIds));
+    }
+
+    /**
+     * 批量取消授权用户
+     */
+    @RequiresPermissions("doc:groupUser:list")
+    @Log(title = "分组成员", businessType = BusinessType.GRANT)
+    @PutMapping("/cancelAll")
+    public AjaxResult cancelGroupUserAll(Long groupId, Long[] userIds) {
+        return toAjax(docGroupUserService.deleteGroupUsers(groupId, userIds));
+    }
+
+
+    /**
      * 导出分组成员列表
      */
     @RequiresPermissions("doc:groupUser:export")

+ 95 - 23
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/domain/DocGroupUser.java

@@ -1,5 +1,6 @@
 package com.jjt.doc.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.jjt.common.core.annotation.Excel;
@@ -7,59 +8,130 @@ import com.jjt.common.core.web.domain.BaseEntity;
 
 /**
  * 分组成员对象 doc_group_user
- * 
+ *
  * @author wukai
  * @date 2023-04-20
  */
-public class DocGroupUser extends BaseEntity
-{
+public class DocGroupUser extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 分组ID */
+    /**
+     * 分组ID
+     */
     private Long groupId;
 
-    /** 用户ID */
+    /**
+     * 用户ID
+     */
     @Excel(name = "用户ID")
     private Long userId;
 
-    /** 用户姓名 */
+    /**
+     * 用户姓名
+     */
     @Excel(name = "用户姓名")
     private String userName;
+    /**
+     * 部门ID
+     */
+    @TableField(exist = false)
+    private Long deptId;
 
-    public void setGroupId(Long groupId) 
-    {
+    /**
+     * 用户昵称
+     */
+    @TableField(exist = false)
+    private String nickName;
+
+    /**
+     * 用户邮箱
+     */
+    @TableField(exist = false)
+    private String email;
+
+    /**
+     * 手机号码
+     */
+    @TableField(exist = false)
+    private String phonenumber;
+
+    /**
+     * 帐号状态(0正常 1停用)
+     */
+    @TableField(exist = false)
+    @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
+    private String status;
+
+    public void setGroupId(Long groupId) {
         this.groupId = groupId;
     }
 
-    public Long getGroupId() 
-    {
+    public Long getGroupId() {
         return groupId;
     }
-    public void setUserId(Long userId) 
-    {
+
+    public void setUserId(Long userId) {
         this.userId = userId;
     }
 
-    public Long getUserId() 
-    {
+    public Long getUserId() {
         return userId;
     }
-    public void setUserName(String userName) 
-    {
+
+    public void setUserName(String userName) {
         this.userName = userName;
     }
 
-    public String getUserName() 
-    {
+    public String getUserName() {
         return userName;
     }
 
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("groupId", getGroupId())
-            .append("userId", getUserId())
-            .append("userName", getUserName())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("groupId", getGroupId())
+                .append("userId", getUserId())
+                .append("userName", getUserName())
+                .toString();
     }
 }

+ 16 - 10
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocGroupUserMapper.java

@@ -1,20 +1,21 @@
 package com.jjt.doc.mapper;
 
 import java.util.List;
+
 import com.jjt.doc.domain.DocGroupUser;
 import com.jjt.system.api.domain.SysUser;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 分组成员Mapper接口
- * 
+ *
  * @author wukai
  * @date 2023-04-20
  */
-public interface DocGroupUserMapper 
-{
+public interface DocGroupUserMapper {
     /**
      * 查询分组成员
-     * 
+     *
      * @param groupId 分组成员主键
      * @return 分组成员
      */
@@ -22,7 +23,7 @@ public interface DocGroupUserMapper
 
     /**
      * 查询分组成员列表
-     * 
+     *
      * @param docGroupUser 分组成员
      * @return 分组成员集合
      */
@@ -30,7 +31,7 @@ public interface DocGroupUserMapper
 
     /**
      * 新增分组成员
-     * 
+     *
      * @param docGroupUser 分组成员
      * @return 结果
      */
@@ -38,7 +39,7 @@ public interface DocGroupUserMapper
 
     /**
      * 修改分组成员
-     * 
+     *
      * @param docGroupUser 分组成员
      * @return 结果
      */
@@ -46,7 +47,7 @@ public interface DocGroupUserMapper
 
     /**
      * 删除分组成员
-     * 
+     *
      * @param groupId 分组成员主键
      * @return 结果
      */
@@ -54,15 +55,20 @@ public interface DocGroupUserMapper
 
     /**
      * 批量删除分组成员
-     * 
+     *
      * @param groupIds 需要删除的数据主键集合
      * @return 结果
      */
     public int deleteDocGroupUserByGroupIds(Long[] groupIds);
+
     /**
      * 查询未分配成员列表
      *
      * @param docGroupUser
      */
-    List<SysUser> selectUnallocatedList(DocGroupUser docGroupUser);
+    List<DocGroupUser> selectUnallocatedList(DocGroupUser docGroupUser);
+
+    int batchGroupUser(List<DocGroupUser> list);
+
+    int deleteGroupUsers(@Param("groupId") Long groupId, @Param("userIds") Long[] userIds);
 }

+ 19 - 1
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocGroupUserService.java

@@ -63,5 +63,23 @@ public interface IDocGroupUserService {
     /**
      * 查询未分配成员列表
      */
-    public List<SysUser> selectUnallocatedList(DocGroupUser docGroupUser);
+    public List<DocGroupUser> selectUnallocatedList(DocGroupUser docGroupUser);
+
+    /**
+     * 分配分组成员
+     *
+     * @param groupId 分组ID
+     * @param userIds 用户ID列表
+     * @return
+     */
+    public int insertGroupUsers(Long groupId, Long[] userIds);
+
+    /**
+     * 删除分组成员
+     *
+     * @param groupId 分组ID
+     * @param userIds 用户ID列表
+     * @return
+     */
+    public int deleteGroupUsers(Long groupId, Long[] userIds);
 }

+ 25 - 14
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocGroupServiceImpl.java

@@ -1,11 +1,19 @@
 package com.jjt.doc.service.impl;
 
 import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.jjt.common.core.utils.DateUtils;
+import com.jjt.system.domain.SysRole;
+import com.jjt.system.domain.SysUserRole;
+import com.jjt.system.mapper.SysRoleMapper;
+import com.jjt.system.mapper.SysUserRoleMapper;
 import org.springframework.stereotype.Service;
 import com.jjt.doc.mapper.DocGroupMapper;
 import com.jjt.doc.domain.DocGroup;
+
 import javax.annotation.Resource;
+
 import com.jjt.doc.service.IDocGroupService;
 
 /**
@@ -15,10 +23,13 @@ import com.jjt.doc.service.IDocGroupService;
  * @date 2023-04-20
  */
 @Service
-public class DocGroupServiceImpl implements IDocGroupService
-{
+public class DocGroupServiceImpl implements IDocGroupService {
     @Resource
     private DocGroupMapper docGroupMapper;
+    @Resource
+    private SysUserRoleMapper userRoleMapper;
+    @Resource
+    private SysRoleMapper roleMapper;
 
     /**
      * 查询分组
@@ -27,8 +38,7 @@ public class DocGroupServiceImpl implements IDocGroupService
      * @return 分组
      */
     @Override
-    public DocGroup selectDocGroupByGroupId(Long groupId)
-    {
+    public DocGroup selectDocGroupByGroupId(Long groupId) {
         return docGroupMapper.selectDocGroupByGroupId(groupId);
     }
 
@@ -39,8 +49,7 @@ public class DocGroupServiceImpl implements IDocGroupService
      * @return 分组
      */
     @Override
-    public List<DocGroup> selectDocGroupList(DocGroup docGroup)
-    {
+    public List<DocGroup> selectDocGroupList(DocGroup docGroup) {
         return docGroupMapper.selectDocGroupList(docGroup);
     }
 
@@ -51,8 +60,13 @@ public class DocGroupServiceImpl implements IDocGroupService
      * @return 结果
      */
     @Override
-    public int insertDocGroup(DocGroup docGroup)
-    {
+    public int insertDocGroup(DocGroup docGroup) {
+        QueryWrapper<SysRole> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("role_key", "group.manager");
+//        queryWrapper.eq("role_key", "group.user");
+
+        SysRole role = roleMapper.selectOne(queryWrapper);
+
         docGroup.setCreateTime(DateUtils.getNowDate());
         return docGroupMapper.insertDocGroup(docGroup);
     }
@@ -64,8 +78,7 @@ public class DocGroupServiceImpl implements IDocGroupService
      * @return 结果
      */
     @Override
-    public int updateDocGroup(DocGroup docGroup)
-    {
+    public int updateDocGroup(DocGroup docGroup) {
         docGroup.setUpdateTime(DateUtils.getNowDate());
         return docGroupMapper.updateDocGroup(docGroup);
     }
@@ -77,8 +90,7 @@ public class DocGroupServiceImpl implements IDocGroupService
      * @return 结果
      */
     @Override
-    public int deleteDocGroupByGroupIds(Long[] groupIds)
-    {
+    public int deleteDocGroupByGroupIds(Long[] groupIds) {
         return docGroupMapper.deleteDocGroupByGroupIds(groupIds);
     }
 
@@ -89,8 +101,7 @@ public class DocGroupServiceImpl implements IDocGroupService
      * @return 结果
      */
     @Override
-    public int deleteDocGroupByGroupId(Long groupId)
-    {
+    public int deleteDocGroupByGroupId(Long groupId) {
         return docGroupMapper.deleteDocGroupByGroupId(groupId);
     }
 }

+ 45 - 15
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocGroupUserServiceImpl.java

@@ -1,12 +1,16 @@
 package com.jjt.doc.service.impl;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import com.jjt.system.api.domain.SysUser;
+import com.jjt.system.service.ISysUserRoleService;
 import org.springframework.stereotype.Service;
 import com.jjt.doc.mapper.DocGroupUserMapper;
 import com.jjt.doc.domain.DocGroupUser;
+
 import javax.annotation.Resource;
+
 import com.jjt.doc.service.IDocGroupUserService;
 
 /**
@@ -16,11 +20,11 @@ import com.jjt.doc.service.IDocGroupUserService;
  * @date 2023-04-20
  */
 @Service
-public class DocGroupUserServiceImpl implements IDocGroupUserService
-{
+public class DocGroupUserServiceImpl implements IDocGroupUserService {
     @Resource
     private DocGroupUserMapper docGroupUserMapper;
 
+
     /**
      * 查询分组成员
      *
@@ -28,8 +32,7 @@ public class DocGroupUserServiceImpl implements IDocGroupUserService
      * @return 分组成员
      */
     @Override
-    public DocGroupUser selectDocGroupUserByGroupId(Long groupId)
-    {
+    public DocGroupUser selectDocGroupUserByGroupId(Long groupId) {
         return docGroupUserMapper.selectDocGroupUserByGroupId(groupId);
     }
 
@@ -40,8 +43,7 @@ public class DocGroupUserServiceImpl implements IDocGroupUserService
      * @return 分组成员
      */
     @Override
-    public List<DocGroupUser> selectDocGroupUserList(DocGroupUser docGroupUser)
-    {
+    public List<DocGroupUser> selectDocGroupUserList(DocGroupUser docGroupUser) {
         return docGroupUserMapper.selectDocGroupUserList(docGroupUser);
     }
 
@@ -52,8 +54,7 @@ public class DocGroupUserServiceImpl implements IDocGroupUserService
      * @return 结果
      */
     @Override
-    public int insertDocGroupUser(DocGroupUser docGroupUser)
-    {
+    public int insertDocGroupUser(DocGroupUser docGroupUser) {
         return docGroupUserMapper.insertDocGroupUser(docGroupUser);
     }
 
@@ -64,8 +65,7 @@ public class DocGroupUserServiceImpl implements IDocGroupUserService
      * @return 结果
      */
     @Override
-    public int updateDocGroupUser(DocGroupUser docGroupUser)
-    {
+    public int updateDocGroupUser(DocGroupUser docGroupUser) {
         return docGroupUserMapper.updateDocGroupUser(docGroupUser);
     }
 
@@ -76,8 +76,7 @@ public class DocGroupUserServiceImpl implements IDocGroupUserService
      * @return 结果
      */
     @Override
-    public int deleteDocGroupUserByGroupIds(Long[] groupIds)
-    {
+    public int deleteDocGroupUserByGroupIds(Long[] groupIds) {
         return docGroupUserMapper.deleteDocGroupUserByGroupIds(groupIds);
     }
 
@@ -88,8 +87,7 @@ public class DocGroupUserServiceImpl implements IDocGroupUserService
      * @return 结果
      */
     @Override
-    public int deleteDocGroupUserByGroupId(Long groupId)
-    {
+    public int deleteDocGroupUserByGroupId(Long groupId) {
         return docGroupUserMapper.deleteDocGroupUserByGroupId(groupId);
     }
 
@@ -99,7 +97,39 @@ public class DocGroupUserServiceImpl implements IDocGroupUserService
      * @param docGroupUser
      */
     @Override
-    public List<SysUser> selectUnallocatedList(DocGroupUser docGroupUser) {
+    public List<DocGroupUser> selectUnallocatedList(DocGroupUser docGroupUser) {
         return docGroupUserMapper.selectUnallocatedList(docGroupUser);
     }
+
+    /**
+     * 分配分组成员
+     *
+     * @param groupId 分组ID
+     * @param userIds 用户ID列表
+     * @return
+     */
+    @Override
+    public int insertGroupUsers(Long groupId, Long[] userIds) {
+        // 新增用户与角色管理
+        List<DocGroupUser> list = new ArrayList<>();
+        for (Long userId : userIds) {
+            DocGroupUser gu = new DocGroupUser();
+            gu.setUserId(userId);
+            gu.setGroupId(groupId);
+            list.add(gu);
+        }
+        return docGroupUserMapper.batchGroupUser(list);
+    }
+
+    /**
+     * 删除分组成员
+     *
+     * @param groupId 分组ID
+     * @param userIds 用户ID列表
+     * @return
+     */
+    @Override
+    public int deleteGroupUsers(Long groupId, Long[] userIds) {
+        return docGroupUserMapper.deleteGroupUsers(groupId, userIds);
+    }
 }

+ 153 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/system/domain/SysRole.java

@@ -0,0 +1,153 @@
+package com.jjt.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.jjt.common.core.annotation.Excel;
+import com.jjt.common.core.web.domain.BaseEntity;
+
+/**
+ * 角色信息对象 sys_role
+ * 
+ * @author wukai
+ * @date 2023-04-21
+ */
+public class SysRole extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 角色ID */
+    private Long roleId;
+
+    /** 角色名称 */
+    @Excel(name = "角色名称")
+    private String roleName;
+
+    /** 角色权限字符串 */
+    @Excel(name = "角色权限字符串")
+    private String roleKey;
+
+    /** 显示顺序 */
+    @Excel(name = "显示顺序")
+    private Long roleSort;
+
+    /** 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) */
+    @Excel(name = "数据范围", readConverterExp = "1=:全部数据权限,2=:自定数据权限,3=:本部门数据权限,4=:本部门及以下数据权限")
+    private String dataScope;
+
+    /** 菜单树选择项是否关联显示 */
+    @Excel(name = "菜单树选择项是否关联显示")
+    private Integer menuCheckStrictly;
+
+    /** 部门树选择项是否关联显示 */
+    @Excel(name = "部门树选择项是否关联显示")
+    private Integer deptCheckStrictly;
+
+    /** 角色状态(0正常 1停用) */
+    @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
+    private String status;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    public void setRoleId(Long roleId) 
+    {
+        this.roleId = roleId;
+    }
+
+    public Long getRoleId() 
+    {
+        return roleId;
+    }
+    public void setRoleName(String roleName) 
+    {
+        this.roleName = roleName;
+    }
+
+    public String getRoleName() 
+    {
+        return roleName;
+    }
+    public void setRoleKey(String roleKey) 
+    {
+        this.roleKey = roleKey;
+    }
+
+    public String getRoleKey() 
+    {
+        return roleKey;
+    }
+    public void setRoleSort(Long roleSort) 
+    {
+        this.roleSort = roleSort;
+    }
+
+    public Long getRoleSort() 
+    {
+        return roleSort;
+    }
+    public void setDataScope(String dataScope) 
+    {
+        this.dataScope = dataScope;
+    }
+
+    public String getDataScope() 
+    {
+        return dataScope;
+    }
+    public void setMenuCheckStrictly(Integer menuCheckStrictly) 
+    {
+        this.menuCheckStrictly = menuCheckStrictly;
+    }
+
+    public Integer getMenuCheckStrictly() 
+    {
+        return menuCheckStrictly;
+    }
+    public void setDeptCheckStrictly(Integer deptCheckStrictly) 
+    {
+        this.deptCheckStrictly = deptCheckStrictly;
+    }
+
+    public Integer getDeptCheckStrictly() 
+    {
+        return deptCheckStrictly;
+    }
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("roleId", getRoleId())
+            .append("roleName", getRoleName())
+            .append("roleKey", getRoleKey())
+            .append("roleSort", getRoleSort())
+            .append("dataScope", getDataScope())
+            .append("menuCheckStrictly", getMenuCheckStrictly())
+            .append("deptCheckStrictly", getDeptCheckStrictly())
+            .append("status", getStatus())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 50 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/system/domain/SysUserRole.java

@@ -0,0 +1,50 @@
+package com.jjt.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.jjt.common.core.annotation.Excel;
+import com.jjt.common.core.web.domain.BaseEntity;
+
+/**
+ * 用户和角色关联对象 sys_user_role
+ * 
+ * @author wukai
+ * @date 2023-04-21
+ */
+public class SysUserRole extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 用户ID */
+    private Long userId;
+
+    /** 角色ID */
+    private Long roleId;
+
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setRoleId(Long roleId) 
+    {
+        this.roleId = roleId;
+    }
+
+    public Long getRoleId() 
+    {
+        return roleId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("userId", getUserId())
+            .append("roleId", getRoleId())
+            .toString();
+    }
+}

+ 62 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/system/mapper/SysRoleMapper.java

@@ -0,0 +1,62 @@
+package com.jjt.system.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jjt.system.domain.SysRole;
+
+/**
+ * 角色信息Mapper接口
+ *
+ * @author wukai
+ * @date 2023-04-21
+ */
+public interface SysRoleMapper extends BaseMapper<SysRole> {
+    /**
+     * 查询角色信息
+     *
+     * @param roleId 角色信息主键
+     * @return 角色信息
+     */
+    public SysRole selectSysRoleByRoleId(Long roleId);
+
+    /**
+     * 查询角色信息列表
+     *
+     * @param sysRole 角色信息
+     * @return 角色信息集合
+     */
+    public List<SysRole> selectSysRoleList(SysRole sysRole);
+
+    /**
+     * 新增角色信息
+     *
+     * @param sysRole 角色信息
+     * @return 结果
+     */
+    public int insertSysRole(SysRole sysRole);
+
+    /**
+     * 修改角色信息
+     *
+     * @param sysRole 角色信息
+     * @return 结果
+     */
+    public int updateSysRole(SysRole sysRole);
+
+    /**
+     * 删除角色信息
+     *
+     * @param roleId 角色信息主键
+     * @return 结果
+     */
+    public int deleteSysRoleByRoleId(Long roleId);
+
+    /**
+     * 批量删除角色信息
+     *
+     * @param roleIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysRoleByRoleIds(Long[] roleIds);
+}

+ 63 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/system/mapper/SysUserRoleMapper.java

@@ -0,0 +1,63 @@
+package com.jjt.system.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jjt.system.domain.SysRole;
+import com.jjt.system.domain.SysUserRole;
+
+/**
+ * 用户和角色关联Mapper接口
+ *
+ * @author wukai
+ * @date 2023-04-21
+ */
+public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
+    /**
+     * 查询用户和角色关联
+     *
+     * @param userId 用户和角色关联主键
+     * @return 用户和角色关联
+     */
+    public SysUserRole selectSysUserRoleByUserId(Long userId);
+
+    /**
+     * 查询用户和角色关联列表
+     *
+     * @param sysUserRole 用户和角色关联
+     * @return 用户和角色关联集合
+     */
+    public List<SysUserRole> selectSysUserRoleList(SysUserRole sysUserRole);
+
+    /**
+     * 新增用户和角色关联
+     *
+     * @param sysUserRole 用户和角色关联
+     * @return 结果
+     */
+    public int insertSysUserRole(SysUserRole sysUserRole);
+
+    /**
+     * 修改用户和角色关联
+     *
+     * @param sysUserRole 用户和角色关联
+     * @return 结果
+     */
+    public int updateSysUserRole(SysUserRole sysUserRole);
+
+    /**
+     * 删除用户和角色关联
+     *
+     * @param userId 用户和角色关联主键
+     * @return 结果
+     */
+    public int deleteSysUserRoleByUserId(Long userId);
+
+    /**
+     * 批量删除用户和角色关联
+     *
+     * @param userIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysUserRoleByUserIds(Long[] userIds);
+}

+ 61 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/system/service/ISysRoleService.java

@@ -0,0 +1,61 @@
+package com.jjt.system.service;
+
+import java.util.List;
+import com.jjt.system.domain.SysRole;
+
+/**
+ * 角色信息Service接口
+ * 
+ * @author wukai
+ * @date 2023-04-21
+ */
+public interface ISysRoleService 
+{
+    /**
+     * 查询角色信息
+     * 
+     * @param roleId 角色信息主键
+     * @return 角色信息
+     */
+    public SysRole selectSysRoleByRoleId(Long roleId);
+
+    /**
+     * 查询角色信息列表
+     * 
+     * @param sysRole 角色信息
+     * @return 角色信息集合
+     */
+    public List<SysRole> selectSysRoleList(SysRole sysRole);
+
+    /**
+     * 新增角色信息
+     * 
+     * @param sysRole 角色信息
+     * @return 结果
+     */
+    public int insertSysRole(SysRole sysRole);
+
+    /**
+     * 修改角色信息
+     * 
+     * @param sysRole 角色信息
+     * @return 结果
+     */
+    public int updateSysRole(SysRole sysRole);
+
+    /**
+     * 批量删除角色信息
+     * 
+     * @param roleIds 需要删除的角色信息主键集合
+     * @return 结果
+     */
+    public int deleteSysRoleByRoleIds(Long[] roleIds);
+
+    /**
+     * 删除角色信息信息
+     * 
+     * @param roleId 角色信息主键
+     * @return 结果
+     */
+    public int deleteSysRoleByRoleId(Long roleId);
+}

+ 61 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/system/service/ISysUserRoleService.java

@@ -0,0 +1,61 @@
+package com.jjt.system.service;
+
+import java.util.List;
+import com.jjt.system.domain.SysUserRole;
+
+/**
+ * 用户和角色关联Service接口
+ * 
+ * @author wukai
+ * @date 2023-04-21
+ */
+public interface ISysUserRoleService 
+{
+    /**
+     * 查询用户和角色关联
+     * 
+     * @param userId 用户和角色关联主键
+     * @return 用户和角色关联
+     */
+    public SysUserRole selectSysUserRoleByUserId(Long userId);
+
+    /**
+     * 查询用户和角色关联列表
+     * 
+     * @param sysUserRole 用户和角色关联
+     * @return 用户和角色关联集合
+     */
+    public List<SysUserRole> selectSysUserRoleList(SysUserRole sysUserRole);
+
+    /**
+     * 新增用户和角色关联
+     * 
+     * @param sysUserRole 用户和角色关联
+     * @return 结果
+     */
+    public int insertSysUserRole(SysUserRole sysUserRole);
+
+    /**
+     * 修改用户和角色关联
+     * 
+     * @param sysUserRole 用户和角色关联
+     * @return 结果
+     */
+    public int updateSysUserRole(SysUserRole sysUserRole);
+
+    /**
+     * 批量删除用户和角色关联
+     * 
+     * @param userIds 需要删除的用户和角色关联主键集合
+     * @return 结果
+     */
+    public int deleteSysUserRoleByUserIds(Long[] userIds);
+
+    /**
+     * 删除用户和角色关联信息
+     * 
+     * @param userId 用户和角色关联主键
+     * @return 结果
+     */
+    public int deleteSysUserRoleByUserId(Long userId);
+}

+ 96 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/system/service/impl/SysRoleServiceImpl.java

@@ -0,0 +1,96 @@
+package com.jjt.system.service.impl;
+
+import java.util.List;
+import com.jjt.common.core.utils.DateUtils;
+import org.springframework.stereotype.Service;
+import com.jjt.system.mapper.SysRoleMapper;
+import com.jjt.system.domain.SysRole;
+import javax.annotation.Resource;
+import com.jjt.system.service.ISysRoleService;
+
+/**
+ * 角色信息Service业务层处理
+ *
+ * @author wukai
+ * @date 2023-04-21
+ */
+@Service
+public class SysRoleServiceImpl implements ISysRoleService
+{
+    @Resource
+    private SysRoleMapper sysRoleMapper;
+
+    /**
+     * 查询角色信息
+     *
+     * @param roleId 角色信息主键
+     * @return 角色信息
+     */
+    @Override
+    public SysRole selectSysRoleByRoleId(Long roleId)
+    {
+        return sysRoleMapper.selectSysRoleByRoleId(roleId);
+    }
+
+    /**
+     * 查询角色信息列表
+     *
+     * @param sysRole 角色信息
+     * @return 角色信息
+     */
+    @Override
+    public List<SysRole> selectSysRoleList(SysRole sysRole)
+    {
+        return sysRoleMapper.selectSysRoleList(sysRole);
+    }
+
+    /**
+     * 新增角色信息
+     *
+     * @param sysRole 角色信息
+     * @return 结果
+     */
+    @Override
+    public int insertSysRole(SysRole sysRole)
+    {
+        sysRole.setCreateTime(DateUtils.getNowDate());
+        return sysRoleMapper.insertSysRole(sysRole);
+    }
+
+    /**
+     * 修改角色信息
+     *
+     * @param sysRole 角色信息
+     * @return 结果
+     */
+    @Override
+    public int updateSysRole(SysRole sysRole)
+    {
+        sysRole.setUpdateTime(DateUtils.getNowDate());
+        return sysRoleMapper.updateSysRole(sysRole);
+    }
+
+    /**
+     * 批量删除角色信息
+     *
+     * @param roleIds 需要删除的角色信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysRoleByRoleIds(Long[] roleIds)
+    {
+        return sysRoleMapper.deleteSysRoleByRoleIds(roleIds);
+    }
+
+    /**
+     * 删除角色信息信息
+     *
+     * @param roleId 角色信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysRoleByRoleId(Long roleId)
+    {
+        return sysRoleMapper.deleteSysRoleByRoleId(roleId);
+    }
+}

+ 93 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/system/service/impl/SysUserRoleServiceImpl.java

@@ -0,0 +1,93 @@
+package com.jjt.system.service.impl;
+
+import java.util.List;
+import org.springframework.stereotype.Service;
+import com.jjt.system.mapper.SysUserRoleMapper;
+import com.jjt.system.domain.SysUserRole;
+import javax.annotation.Resource;
+import com.jjt.system.service.ISysUserRoleService;
+
+/**
+ * 用户和角色关联Service业务层处理
+ *
+ * @author wukai
+ * @date 2023-04-21
+ */
+@Service
+public class SysUserRoleServiceImpl implements ISysUserRoleService
+{
+    @Resource
+    private SysUserRoleMapper sysUserRoleMapper;
+
+    /**
+     * 查询用户和角色关联
+     *
+     * @param userId 用户和角色关联主键
+     * @return 用户和角色关联
+     */
+    @Override
+    public SysUserRole selectSysUserRoleByUserId(Long userId)
+    {
+        return sysUserRoleMapper.selectSysUserRoleByUserId(userId);
+    }
+
+    /**
+     * 查询用户和角色关联列表
+     *
+     * @param sysUserRole 用户和角色关联
+     * @return 用户和角色关联
+     */
+    @Override
+    public List<SysUserRole> selectSysUserRoleList(SysUserRole sysUserRole)
+    {
+        return sysUserRoleMapper.selectSysUserRoleList(sysUserRole);
+    }
+
+    /**
+     * 新增用户和角色关联
+     *
+     * @param sysUserRole 用户和角色关联
+     * @return 结果
+     */
+    @Override
+    public int insertSysUserRole(SysUserRole sysUserRole)
+    {
+        return sysUserRoleMapper.insertSysUserRole(sysUserRole);
+    }
+
+    /**
+     * 修改用户和角色关联
+     *
+     * @param sysUserRole 用户和角色关联
+     * @return 结果
+     */
+    @Override
+    public int updateSysUserRole(SysUserRole sysUserRole)
+    {
+        return sysUserRoleMapper.updateSysUserRole(sysUserRole);
+    }
+
+    /**
+     * 批量删除用户和角色关联
+     *
+     * @param userIds 需要删除的用户和角色关联主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysUserRoleByUserIds(Long[] userIds)
+    {
+        return sysUserRoleMapper.deleteSysUserRoleByUserIds(userIds);
+    }
+
+    /**
+     * 删除用户和角色关联信息
+     *
+     * @param userId 用户和角色关联主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysUserRoleByUserId(Long userId)
+    {
+        return sysUserRoleMapper.deleteSysUserRoleByUserId(userId);
+    }
+}

+ 46 - 29
lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocGroupMapper.xml

@@ -1,41 +1,55 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jjt.doc.mapper.DocGroupMapper">
-    
+
     <resultMap type="DocGroup" id="DocGroupResult">
-        <result property="groupId"    column="GROUP_ID"    />
-        <result property="groupName"    column="GROUP_NAME"    />
-        <result property="groupManager"    column="GROUP_MANAGER"    />
-        <result property="groupManagerName"    column="GROUP_MANAGER_NAME"    />
-        <result property="creater"    column="CREATER"    />
-        <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="isDel"    column="IS_DEL"    />
+        <result property="groupId" column="GROUP_ID"/>
+        <result property="groupName" column="GROUP_NAME"/>
+        <result property="groupManager" column="GROUP_MANAGER"/>
+        <result property="groupManagerName" column="GROUP_MANAGER_NAME"/>
+        <result property="creater" column="CREATER"/>
+        <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="isDel" column="IS_DEL"/>
     </resultMap>
 
     <sql id="selectDocGroupVo">
-        select GROUP_ID, GROUP_NAME, GROUP_MANAGER, GROUP_MANAGER_NAME, CREATER, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK, IS_DEL from doc_group
+        select GROUP_ID,
+               GROUP_NAME,
+               GROUP_MANAGER,
+               GROUP_MANAGER_NAME,
+               CREATER,
+               CREATE_BY,
+               CREATE_TIME,
+               UPDATE_BY,
+               UPDATE_TIME,
+               REMARK,
+               IS_DEL
+        from doc_group
     </sql>
 
     <select id="selectDocGroupList" parameterType="DocGroup" resultMap="DocGroupResult">
         <include refid="selectDocGroupVo"/>
-        <where>  
-            <if test="groupName != null  and groupName != ''"> and GROUP_NAME like concat('%', #{groupName}, '%')</if>
-            <if test="groupManager != null "> and GROUP_MANAGER = #{groupManager}</if>
-            <if test="groupManagerName != null  and groupManagerName != ''"> and GROUP_MANAGER_NAME like concat('%', #{groupManagerName}, '%')</if>
+        <where>
+            is_del!='1'
+            <if test="groupName != null  and groupName != ''">and GROUP_NAME like concat('%', #{groupName}, '%')</if>
+            <if test="groupManager != null ">and GROUP_MANAGER = #{groupManager}</if>
+            <if test="groupManagerName != null  and groupManagerName != ''">and GROUP_MANAGER_NAME like concat('%',
+                #{groupManagerName}, '%')
+            </if>
         </where>
     </select>
-    
+
     <select id="selectDocGroupByGroupId" parameterType="Long" resultMap="DocGroupResult">
         <include refid="selectDocGroupVo"/>
         where GROUP_ID = #{groupId}
     </select>
-        
+
     <insert id="insertDocGroup" parameterType="DocGroup" useGeneratedKeys="true" keyProperty="groupId">
         insert into doc_group
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -49,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">UPDATE_TIME,</if>
             <if test="remark != null">REMARK,</if>
             <if test="isDel != null">IS_DEL,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="groupName != null">#{groupName},</if>
             <if test="groupManager != null">#{groupManager},</if>
@@ -61,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
             <if test="isDel != null">#{isDel},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateDocGroup" parameterType="DocGroup">
@@ -81,14 +95,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where GROUP_ID = #{groupId}
     </update>
 
-    <delete id="deleteDocGroupByGroupId" parameterType="Long">
-        delete from doc_group where GROUP_ID = #{groupId}
-    </delete>
+    <update id="deleteDocGroupByGroupId" parameterType="Long">
+        update
+            doc_group
+        set is_del='1'
+        where GROUP_ID = #{groupId}
+    </update>
 
-    <delete id="deleteDocGroupByGroupIds" parameterType="String">
-        delete from doc_group where GROUP_ID in 
+    <update id="deleteDocGroupByGroupIds" parameterType="String">
+        update doc_group set is_del='1' where GROUP_ID in
         <foreach item="groupId" collection="array" open="(" separator="," close=")">
             #{groupId}
         </foreach>
-    </delete>
+    </update>
 </mapper>

+ 48 - 20
lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocGroupUserMapper.xml

@@ -15,30 +15,46 @@
         from doc_group_user
     </sql>
 
-    <select id="selectDocGroupUserList" parameterType="DocGroupUser" resultMap="DocGroupUserResult">
-        <include refid="selectDocGroupUserVo"/>
-        <where>
-            <if test="userId != null ">and USER_ID = #{userId}</if>
-            <if test="userName != null  and userName != ''">and USER_NAME like concat('%', #{userName}, '%')</if>
-        </where>
+    <select id="selectDocGroupUserList" parameterType="DocGroupUser" resultType="com.jjt.doc.domain.DocGroupUser">
+        select distinct u.user_id,
+                        u.dept_id,
+                        u.user_name,
+                        u.nick_name,
+                        u.email,
+                        u.phonenumber,
+                        u.status
+        from sys_user u,
+             doc_group_user du
+        where u.user_id = du.user_id
+          and du.group_id = #{groupId}
     </select>
 
-    <select id="selectDocGroupUserByGroupId" parameterType="Long" resultMap="DocGroupUserResult">
-        <include refid="selectDocGroupUserVo"/>
-        where GROUP_ID = #{groupId}
+    <select id="selectDocGroupUserByGroupId" parameterType="Long" resultType="com.jjt.doc.domain.DocGroupUser">
+        select distinct u.user_id,
+                        u.dept_id,
+                        u.user_name,
+                        u.nick_name,
+                        u.email,
+                        u.phonenumber,
+                        u.status,
+                        du.group_id
+        from sys_user u,
+             doc_group_user du
+        where u.user_id = du.user_id
+          and du.group_id = #{groupId}
     </select>
-    <select id="selectUnallocatedList" resultType="com.jjt.system.api.domain.SysUser">
-        select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
+    <select id="selectUnallocatedList" resultType="com.jjt.doc.domain.DocGroupUser">
+        select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status
         from sys_user u
-        where u.del_flag = '0' and u.user_id not in (select u.user_id from doc_group_user where group_id= #{groupId})
-<!--        <if test="userName != null and userName != ''">-->
-<!--            AND u.user_name like concat('%', #{userName}, '%')-->
-<!--        </if>-->
-<!--        <if test="phonenumber != null and phonenumber != ''">-->
-<!--            AND u.phonenumber like concat('%', #{phonenumber}, '%')-->
-<!--        </if>-->
-<!--        &lt;!&ndash; 数据范围过滤 &ndash;&gt;-->
-<!--        ${params.dataScope}-->
+        where u.del_flag = '0' and u.user_id not in (select user_id from doc_group_user where group_id= #{groupId})
+        <!--        <if test="userName != null and userName != ''">-->
+        <!--            AND u.user_name like concat('%', #{userName}, '%')-->
+        <!--        </if>-->
+        <!--        <if test="phonenumber != null and phonenumber != ''">-->
+        <!--            AND u.phonenumber like concat('%', #{phonenumber}, '%')-->
+        <!--        </if>-->
+        <!--        &lt;!&ndash; 数据范围过滤 &ndash;&gt;-->
+        <!--        ${params.dataScope}-->
     </select>
 
     <insert id="insertDocGroupUser" parameterType="DocGroupUser">
@@ -54,6 +70,12 @@
             <if test="userName != null">#{userName},</if>
         </trim>
     </insert>
+    <insert id="batchGroupUser">
+        insert into doc_group_user(user_id, group_id) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            (#{item.userId},#{item.groupId})
+        </foreach>
+    </insert>
 
     <update id="updateDocGroupUser" parameterType="DocGroupUser">
         update doc_group_user
@@ -76,4 +98,10 @@
             #{groupId}
         </foreach>
     </delete>
+    <delete id="deleteGroupUsers">
+        delete from doc_group_user where GROUP_ID =#{groupId} and user_id in
+        <foreach collection="userIds" item="userId" open="(" separator="," close=")">
+            #{userId}
+        </foreach>
+    </delete>
 </mapper>

+ 110 - 0
lzga-modules/lzga-doc/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jjt.system.mapper.SysRoleMapper">
+    
+    <resultMap type="SysRole" id="SysRoleResult">
+        <result property="roleId"    column="role_id"    />
+        <result property="roleName"    column="role_name"    />
+        <result property="roleKey"    column="role_key"    />
+        <result property="roleSort"    column="role_sort"    />
+        <result property="dataScope"    column="data_scope"    />
+        <result property="menuCheckStrictly"    column="menu_check_strictly"    />
+        <result property="deptCheckStrictly"    column="dept_check_strictly"    />
+        <result property="status"    column="status"    />
+        <result property="delFlag"    column="del_flag"    />
+        <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"    />
+    </resultMap>
+
+    <sql id="selectSysRoleVo">
+        select role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark from sys_role
+    </sql>
+
+    <select id="selectSysRoleList" parameterType="SysRole" resultMap="SysRoleResult">
+        <include refid="selectSysRoleVo"/>
+        <where>  
+            <if test="roleName != null  and roleName != ''"> and role_name like concat('%', #{roleName}, '%')</if>
+            <if test="roleKey != null  and roleKey != ''"> and role_key = #{roleKey}</if>
+            <if test="roleSort != null "> and role_sort = #{roleSort}</if>
+            <if test="dataScope != null  and dataScope != ''"> and data_scope = #{dataScope}</if>
+            <if test="menuCheckStrictly != null "> and menu_check_strictly = #{menuCheckStrictly}</if>
+            <if test="deptCheckStrictly != null "> and dept_check_strictly = #{deptCheckStrictly}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+        </where>
+    </select>
+    
+    <select id="selectSysRoleByRoleId" parameterType="Long" resultMap="SysRoleResult">
+        <include refid="selectSysRoleVo"/>
+        where role_id = #{roleId}
+    </select>
+        
+    <insert id="insertSysRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
+        insert into sys_role
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="roleName != null and roleName != ''">role_name,</if>
+            <if test="roleKey != null and roleKey != ''">role_key,</if>
+            <if test="roleSort != null">role_sort,</if>
+            <if test="dataScope != null">data_scope,</if>
+            <if test="menuCheckStrictly != null">menu_check_strictly,</if>
+            <if test="deptCheckStrictly != null">dept_check_strictly,</if>
+            <if test="status != null and status != ''">status,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="roleName != null and roleName != ''">#{roleName},</if>
+            <if test="roleKey != null and roleKey != ''">#{roleKey},</if>
+            <if test="roleSort != null">#{roleSort},</if>
+            <if test="dataScope != null">#{dataScope},</if>
+            <if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
+            <if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
+            <if test="status != null and status != ''">#{status},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateSysRole" parameterType="SysRole">
+        update sys_role
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
+            <if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
+            <if test="roleSort != null">role_sort = #{roleSort},</if>
+            <if test="dataScope != null">data_scope = #{dataScope},</if>
+            <if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
+            <if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where role_id = #{roleId}
+    </update>
+
+    <delete id="deleteSysRoleByRoleId" parameterType="Long">
+        delete from sys_role where role_id = #{roleId}
+    </delete>
+
+    <delete id="deleteSysRoleByRoleIds" parameterType="String">
+        delete from sys_role where role_id in 
+        <foreach item="roleId" collection="array" open="(" separator="," close=")">
+            #{roleId}
+        </foreach>
+    </delete>
+</mapper>

+ 57 - 0
lzga-modules/lzga-doc/src/main/resources/mapper/system/SysUserRoleMapper.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jjt.system.mapper.SysUserRoleMapper">
+    
+    <resultMap type="SysUserRole" id="SysUserRoleResult">
+        <result property="userId"    column="user_id"    />
+        <result property="roleId"    column="role_id"    />
+    </resultMap>
+
+    <sql id="selectSysUserRoleVo">
+        select user_id, role_id from sys_user_role
+    </sql>
+
+    <select id="selectSysUserRoleList" parameterType="SysUserRole" resultMap="SysUserRoleResult">
+        <include refid="selectSysUserRoleVo"/>
+        <where>  
+        </where>
+    </select>
+    
+    <select id="selectSysUserRoleByUserId" parameterType="Long" resultMap="SysUserRoleResult">
+        <include refid="selectSysUserRoleVo"/>
+        where user_id = #{userId}
+    </select>
+        
+    <insert id="insertSysUserRole" parameterType="SysUserRole">
+        insert into sys_user_role
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="roleId != null">role_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="roleId != null">#{roleId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateSysUserRole" parameterType="SysUserRole">
+        update sys_user_role
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="roleId != null">role_id = #{roleId},</if>
+        </trim>
+        where user_id = #{userId}
+    </update>
+
+    <delete id="deleteSysUserRoleByUserId" parameterType="Long">
+        delete from sys_user_role where user_id = #{userId}
+    </delete>
+
+    <delete id="deleteSysUserRoleByUserIds" parameterType="String">
+        delete from sys_user_role where user_id in 
+        <foreach item="userId" collection="array" open="(" separator="," close=")">
+            #{userId}
+        </foreach>
+    </delete>
+</mapper>

+ 1 - 0
lzga-ui/src/api/doc/groupUser.js

@@ -72,6 +72,7 @@ export function groupUserCancel(data) {
 
 // 批量取消用户授权角色
 export function groupUserCancelAll(data) {
+  console.log(data);
   return request({
     url: '/doc/groupUser/cancelAll',
     method: 'put',

+ 11 - 12
lzga-ui/src/router/index.js

@@ -30,14 +30,14 @@ import Layout from '@/layout'
 
 // 公共路由
 export const constantRoutes = [{
-    path: '/redirect',
-    component: Layout,
-    hidden: true,
-    children: [{
-      path: '/redirect/:path(.*)',
-      component: () => import('@/views/redirect')
-    }]
-  },
+  path: '/redirect',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/redirect/:path(.*)',
+    component: () => import('@/views/redirect')
+  }]
+},
   {
     path: '/login',
     component: () => import('@/views/login'),
@@ -93,9 +93,9 @@ export const constantRoutes = [{
     component: () => import('@/views1/HomeView.vue'),
     hidden: true,
     children: [{
-        path: "/home/page",
-        component: () => import('@/views1/Page/PageView.vue')
-      },
+      path: "/home/page",
+      component: () => import('@/views1/Page/PageView.vue')
+    },
       {
         path: "/home/retrieval",
         component: () => import('@/views1/Retrieval/RetrievalView.vue')
@@ -218,7 +218,6 @@ export const constantRoutes = [{
   },
 ]
 
-
 // 动态路由,基于用户权限动态去加载
 export const dynamicRoutes = [{
   path: '/system/user-auth',

+ 40 - 32
lzga-ui/src/views/doc/groupUser/index.vue

@@ -20,7 +20,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button type="danger" plain icon="el-icon-circle-close" size="mini" :disabled="multiple"
-          @click="handleDelete" v-hasPermi="['doc:groupUser:remove']">批量取消分配</el-button>
+          @click="cancelGroupUserAll" v-hasPermi="['doc:groupUser:remove']">删除成员</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button type="warning" plain icon="el-icon-close" size="mini" @click="handleClose">关闭</el-button>
@@ -30,15 +30,19 @@
 
     <el-table v-loading="loading" :data="groupUserList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="分组ID" align="center" prop="groupId" />
-      <el-table-column label="用户ID" align="center" prop="userId" />
-      <el-table-column label="用户姓名" align="center" prop="userName" />
+      <el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
+      <el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
+      <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
+      <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
+      <el-table-column label="状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" />
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
-            v-hasPermi="['doc:groupUser:edit']">修改</el-button>
-          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
-            v-hasPermi="['doc:groupUser:remove']">删除</el-button>
+          <el-button size="mini" type="text" icon="el-icon-circle-close" @click="cancelGroupUser(scope.row)"
+            v-hasPermi="['doc:groupUser:remove']">删除成员</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -55,11 +59,13 @@
     getGroupUser,
     delGroupUser,
     addGroupUser,
-    updateGroupUser
+    updateGroupUser,
+    groupUserCancelAll
   } from "@/api/doc/groupUser";
   import selectUser from "./selectUser";
   export default {
     name: "GroupUser",
+    dicts: ['sys_normal_disable'],
     components: {
       selectUser
     },
@@ -146,7 +152,7 @@
       },
       // 多选框选中数据
       handleSelectionChange(selection) {
-        this.ids = selection.map(item => item.groupId)
+        this.ids = selection.map(item => item.userId)
         this.single = selection.length !== 1
         this.multiple = !selection.length
       },
@@ -154,16 +160,6 @@
       handleAdd() {
         this.$refs.select.show();
       },
-      /** 修改按钮操作 */
-      handleUpdate(row) {
-        this.reset();
-        const groupId = row.groupId || this.ids
-        getGroupUser(groupId).then(response => {
-          this.form = response.data;
-          this.open = true;
-          this.title = "修改分组成员";
-        });
-      },
       /** 提交按钮 */
       submitForm() {
         this.$refs["form"].validate(valid => {
@@ -185,21 +181,33 @@
         });
       },
       /** 删除按钮操作 */
-      handleDelete(row) {
-        const groupIds = row.groupId || this.ids;
-        this.$modal.confirm('是否确认删除分组成员编号为"' + groupIds + '"的数据项?').then(function() {
-          return delGroupUser(groupIds);
+      cancelGroupUserAll(row) {
+        const groupId = this.queryParams.groupId;
+        const userIds = this.ids.join(",");
+        this.$modal.confirm('是否确认删除选中的分组成员?').then(function() {
+          return groupUserCancelAll({
+            groupId: groupId,
+            userIds: userIds
+          });
         }).then(() => {
           this.getList();
           this.$modal.msgSuccess("删除成功");
         }).catch(() => {});
       },
-      /** 导出按钮操作 */
-      handleExport() {
-        this.download('doc/groupUser/export', {
-          ...this.queryParams
-        }, `groupUser_${new Date().getTime()}.xlsx`)
-      }
-    }
+      /** 删除按钮操作 */
+      cancelGroupUser(row) {
+        const groupId = this.queryParams.groupId;
+        const userIds = row.userId
+        this.$modal.confirm('是否确认删除分组成员"' + row.userName + '"的数据项?').then(function() {
+          return groupUserCancelAll({
+            groupId: groupId,
+            userIds: userIds
+          });
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      },
+    },
   };
-</script>
+</script>

+ 0 - 126
lzga-ui/src/views/doc/groupUser/oo.vue

@@ -1,126 +0,0 @@
-<!--onlyoffice 编辑器-->
-<template>
-  <div id='vabOnlyOffice'></div>
-</template>
-
-<script>
-  export default {
-    name: 'VabOnlyOffice',
-    props: {
-      option: {
-        type: Object,
-        default: () => {
-          return {}
-        },
-      },
-    },
-    data() {
-      return {
-        doctype: '',
-        docEditor: null,
-      }
-    },
-    beforeDestroy() {
-      if (this.docEditor !== null) {
-        this.docEditor.destroyEditor();
-        this.docEditor = null;
-      }
-    },
-    watch: {
-      option: {
-        handler: function(n) {
-          this.setEditor(n)
-          this.doctype = this.getFileType(n.fileType)
-        },
-        deep: true,
-      },
-    },
-    mounted() {
-      if (this.option.url) {
-        this.setEditor(this.option)
-      }
-    },
-    methods: {
-      async setEditor(option) {
-        if (this.docEditor !== null) {
-          this.docEditor.destroyEditor();
-          this.docEditor = null;
-        }
-
-        this.doctype =this.getFileType(option.fileType);
-        let config = {
-          document: {
-            //后缀
-            fileType: option.fileType,
-            key: option.key || '',
-            title: option.title,
-            permissions: {
-              edit: option.isEdit, //是否可以编辑: 只能查看,传false
-              print: option.isPrint, //是否可以打印
-              download: option.isEdit, //是否可以下载
-              // "fillForms": true,//是否可以填写表格,如果将mode参数设置为edit,则填写表单仅对文档编辑器可用。 默认值与edit或review参数的值一致。
-              // "review": true //跟踪变化
-            },
-            url: option.url,
-          },
-          documentType: this.doctype,
-          editorConfig: {
-            callbackUrl: option.editUrl, //"编辑word后保存时回调的地址,这个api需要自己写了,将编辑后的文件通过这个api保存到自己想要的位置
-            lang: option.lang, //语言设置
-            //定制
-            customization: {
-              autosave: false, //是否自动保存
-              chat: false,
-              comments: false,
-              help: false,
-              // "hideRightMenu": false,//定义在第一次加载时是显示还是隐藏右侧菜单。 默认值为false
-              //是否显示插件
-              plugins: false,
-            },
-            user: {
-              id: option.user.id,
-              name: option.user.name
-            },
-            mode: option.model ? option.model : 'edit',
-             // 定义共享编辑模式(快速fast/严格strict), change为控制是否允许修改
-            coEditing: {
-              mode: 'fast',
-              change: false
-            }
-          },
-          width: '100%',
-          height: document.body.clientHeight-110,
-          token: option.token || ''
-        }
-
-        // eslint-disable-next-line no-undef,no-unused-vars
-        this.docEditor = new DocsAPI.DocEditor('vabOnlyOffice', config)
-
-      },
-      getFileType(fileType) {
-        let docType = ''
-
-        let fileTypesDoc = [
-          'doc', 'docm', 'docx', 'dot', 'dotm', 'dotx', 'epub', 'fodt', 'htm', 'html', 'mht', 'odt', 'ott', 'pdf',
-          'rtf', 'txt', 'djvu', 'xps',
-        ]
-        let fileTypesCsv = [
-          'csv', 'fods', 'ods', 'ots', 'xls', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx',
-        ]
-        let fileTypesPPt = [
-          'fodp', 'odp', 'otp', 'pot', 'potm', 'potx', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx',
-        ]
-        if (fileTypesDoc.includes(fileType)) {
-          docType = 'word'
-        }
-        if (fileTypesCsv.includes(fileType)) {
-          docType = 'cell'
-        }
-        if (fileTypesPPt.includes(fileType)) {
-          docType = 'slide'
-        }
-        return docType
-      }
-    },
-  }
-</script>

+ 1 - 1
lzga-ui/src/views/doc/groupUser/selectUser.vue

@@ -126,7 +126,7 @@ export default {
         this.$modal.msgError("请选择要分配的用户");
         return;
       }
-      authUserSelectAll({ groupId: groupId, userIds: userIds }).then(res => {
+      groupUserSelectAll({ groupId: groupId, userIds: userIds }).then(res => {
         this.$modal.msgSuccess(res.msg);
         if (res.code === 200) {
           this.visible = false;