소스 검색

fix 新增组织

Administrator 4 년 전
부모
커밋
bbd61bc578
22개의 변경된 파일848개의 추가작업 그리고 9개의 파일을 삭제
  1. 0 0
      boman-api/boman-api-system/.rebel.xml.bak
  2. 101 0
      boman-api/boman-domain/src/main/java/com.boman.domain/BomanGroup.java
  3. 100 0
      boman-api/boman-domain/src/main/java/com.boman.domain/BomanGroupUser.java
  4. 4 0
      boman-auth/src/main/resources/rebel-remote.xml
  5. 1 1
      boman-auth/src/main/resources/rebel.xml
  6. 6 0
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/SecurityUtils.java
  7. 4 0
      boman-gateway/src/main/resources/rebel-remote.xml
  8. 1 1
      boman-gateway/src/main/resources/rebel.xml
  9. 4 0
      boman-modules/boman-file/src/main/resources/rebel-remote.xml
  10. 2 2
      boman-modules/boman-file/src/main/resources/rebel.xml
  11. 1 1
      boman-modules/boman-gen/src/main/resources/rebel.xml
  12. 120 0
      boman-modules/boman-system/src/main/java/com/boman/system/controller/BomanGroupController.java
  13. 71 0
      boman-modules/boman-system/src/main/java/com/boman/system/mapper/BomanGroupMapper.java
  14. 24 0
      boman-modules/boman-system/src/main/java/com/boman/system/mapper/BomanGroupUserMapper.java
  15. 88 0
      boman-modules/boman-system/src/main/java/com/boman/system/service/IBomanGroupService.java
  16. 165 0
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BomanGroupServiceImpl.java
  17. 122 0
      boman-modules/boman-system/src/main/resources/mapper/system/BomanGroupMapper.xml
  18. 30 0
      boman-modules/boman-system/src/main/resources/mapper/system/BomanGroupUserMapper.xml
  19. 1 1
      boman-modules/boman-system/src/main/resources/mapper/system/SysDeptMapper.xml
  20. 1 1
      boman-modules/boman-system/src/main/resources/rebel.xml
  21. 0 0
      boman-web-core/src/main/resources/rebel-remote.xml
  22. 2 2
      boman-web-core/src/main/resources/rebel.xml

+ 0 - 0
boman-api/boman-api-system/src/main/resources/rebel.xml → boman-api/boman-api-system/.rebel.xml.bak


+ 101 - 0
boman-api/boman-domain/src/main/java/com.boman.domain/BomanGroup.java

@@ -0,0 +1,101 @@
+package com.boman.domain;
+
+import com.boman.domain.BaseEntity;
+import com.boman.domain.annotation.Excel;
+import com.boman.domain.annotation.Excel.ColumnType;
+
+import java.util.List;
+
+/**
+ * @author tjf
+ * @Date: 2021/06/30/15:03
+ */
+public class BomanGroup extends BaseEntity {
+    /** 参数主键 */
+    @Excel(name = "参数主键", cellType = ColumnType.NUMERIC)
+    private Long id;
+    /**
+     * 组名
+     */
+    private String groupName;
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 编号
+     */
+    private Integer number;
+
+    /**
+     * 是否删除
+     */
+    private String isDel;
+
+
+    /**
+     * 用户集合
+     */
+    private List<SysUser> sysUserList;
+
+    public List<SysUser> getSysUserList() {
+        return sysUserList;
+    }
+
+    public void setSysUserList(List<SysUser> sysUserList) {
+        this.sysUserList = sysUserList;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public Integer getNumber() {
+        return number;
+    }
+
+    public void setNumber(Integer number) {
+        this.number = number;
+    }
+
+    public String getIsDel() {
+        return isDel;
+    }
+
+    public void setIsDel(String isDel) {
+        this.isDel = isDel;
+    }
+
+    @Override
+    public String toString() {
+        return "BomanGroup{" +
+                "id=" + id +
+                ", groupName='" + groupName + '\'' +
+                ", status='" + status + '\'' +
+                ", number=" + number +
+                ", isDel='" + isDel + '\'' +
+                ", sysUserList=" + sysUserList +
+                '}';
+    }
+}

+ 100 - 0
boman-api/boman-domain/src/main/java/com.boman.domain/BomanGroupUser.java

@@ -0,0 +1,100 @@
+package com.boman.domain;
+
+import com.boman.domain.annotation.Excel;
+import com.boman.domain.annotation.Excel.ColumnType;
+
+import java.util.List;
+
+/**
+ * @author tjf
+ * @Date: 2021/06/30/15:03
+ */
+public class BomanGroupUser extends BaseEntity {
+    /** 参数主键 */
+    @Excel(name = "参数主键", cellType = ColumnType.NUMERIC)
+    private Long id;
+    /**
+     * 用户id
+     */
+    private Long userId;
+    /**
+     * 用户名
+     */
+    private String userName;
+
+    /**
+     * 组织id
+     */
+    private Long groupId;
+
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 是否删除
+     */
+    private String isDel;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Long getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Long groupId) {
+        this.groupId = groupId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getIsDel() {
+        return isDel;
+    }
+
+    public void setIsDel(String isDel) {
+        this.isDel = isDel;
+    }
+
+    @Override
+    public String toString() {
+        return "BomanGroupUser{" +
+                "id=" + id +
+                ", userId=" + userId +
+                ", userName='" + userName + '\'' +
+                ", groupId=" + groupId +
+                ", status='" + status + '\'' +
+                ", isDel='" + isDel + '\'' +
+                '}';
+    }
+}

+ 4 - 0
boman-auth/src/main/resources/rebel-remote.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rebel-remote xmlns="http://www.zeroturnaround.com/rebel/remote">
+    <id>com.boman.boman-auth</id>
+</rebel-remote>

+ 1 - 1
boman-auth/src/main/resources/rebel.xml

@@ -9,7 +9,7 @@
 	<id>boman-auth</id>
 
 	<classpath>
-		<dir name="E:/boman-framwork/boman-auth/target/classes">
+		<dir name="E:/jiaoyuju/boman-auth/target/classes">
 		</dir>
 	</classpath>
 

+ 6 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/SecurityUtils.java

@@ -86,4 +86,10 @@ public class SecurityUtils
         BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
         return passwordEncoder.matches(rawPassword, encodedPassword);
     }
+
+    public static void main(String[] args) {
+        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
+        String encode = passwordEncoder.encode("123456");
+        System.out.println(encode);
+    }
 }

+ 4 - 0
boman-gateway/src/main/resources/rebel-remote.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rebel-remote xmlns="http://www.zeroturnaround.com/rebel/remote">
+    <id>com.boman.boman-gateway</id>
+</rebel-remote>

+ 1 - 1
boman-gateway/src/main/resources/rebel.xml

@@ -9,7 +9,7 @@
 	<id>boman-gateway</id>
 
 	<classpath>
-		<dir name="E:/boman-framwork/boman-gateway/target/classes">
+		<dir name="E:/jiaoyuju/boman-gateway/target/classes">
 		</dir>
 	</classpath>
 

+ 4 - 0
boman-modules/boman-file/src/main/resources/rebel-remote.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rebel-remote xmlns="http://www.zeroturnaround.com/rebel/remote">
+    <id>com.boman.boman-modules-file</id>
+</rebel-remote>

+ 2 - 2
boman-web-core/.rebel.xml.bak → boman-modules/boman-file/src/main/resources/rebel.xml

@@ -6,10 +6,10 @@
 -->
 <application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
 
-	<id>boman-modules-system</id>
+	<id>boman-modules-file</id>
 
 	<classpath>
-		<dir name="E:/boman-framwork/boman-web-core/target/classes">
+		<dir name="E:/jiaoyuju/boman-modules/boman-file/target/classes">
 		</dir>
 	</classpath>
 

+ 1 - 1
boman-modules/boman-gen/src/main/resources/rebel.xml

@@ -9,7 +9,7 @@
 	<id>boman-modules-gen</id>
 
 	<classpath>
-		<dir name="E:/boman-framwork/boman-modules/boman-gen/target/classes">
+		<dir name="E:/jiaoyuju/boman-modules/boman-gen/target/classes">
 		</dir>
 	</classpath>
 

+ 120 - 0
boman-modules/boman-system/src/main/java/com/boman/system/controller/BomanGroupController.java

@@ -0,0 +1,120 @@
+package com.boman.system.controller;
+
+import com.boman.common.core.utils.SecurityUtils;
+import com.boman.common.core.web.controller.BaseController;
+import com.boman.common.log.annotation.Log;
+import com.boman.common.log.enums.BusinessType;
+import com.boman.common.security.annotation.PreAuthorize;
+import com.boman.domain.constant.UserConstants;
+import com.boman.domain.dto.AjaxResult;
+import com.boman.domain.BomanGroup;
+import com.boman.system.service.IBomanGroupService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
+/**
+ * 自定义组
+ * 
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/group")
+public class BomanGroupController extends BaseController
+{
+    @Autowired
+    private IBomanGroupService bomanGroupService;
+
+    /**
+     * 获取自定义组
+     */
+    @PreAuthorize(hasPermi = "system:group:list")
+    @GetMapping("/list")
+    public AjaxResult list(BomanGroup bomanGroup)
+    {
+        List<BomanGroup> bomanGroups = bomanGroupService.selectGroupList(bomanGroup);
+        return AjaxResult.success(bomanGroups);
+    }
+
+
+    /**
+     * 根据组织编号获取详细信息
+     */
+    @PreAuthorize(hasPermi = "system:group:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable Long id)
+    {
+        return AjaxResult.success(bomanGroupService.selectGroupById(id));
+    }
+
+    /**
+     * 新增组织
+     */
+    @PreAuthorize(hasPermi = "system:group:add")
+    @Log(title = "组织管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody BomanGroup bomanGroup)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(bomanGroupService.checkGroupNameUnique(bomanGroup)))
+        {
+            return AjaxResult.error("新增组织'" + bomanGroup.getGroupName() + "'失败,组织名称已存在");
+        }
+        bomanGroup.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(bomanGroupService.insertGroup(bomanGroup));
+    }
+
+    /**
+     * 修改部门
+     */
+    @PreAuthorize(hasPermi = "system:group:edit")
+    @Log(title = "部门管理", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@Validated @RequestBody BomanGroup bomanGroup)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(bomanGroupService.checkGroupNameUnique(bomanGroup)))
+        {
+            return AjaxResult.error("修改组织'" + bomanGroup.getGroupName() + "'失败,组织名称已存在");
+        }
+        bomanGroup.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(bomanGroupService.updateGroup(bomanGroup));
+    }
+
+    /**
+     * 删除组织
+     */
+    @PreAuthorize(hasPermi = "system:group:remove")
+    @Log(title = "组织管理", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        if (bomanGroupService.checkGroupExistUser(ids))
+        {
+            return AjaxResult.error("组织存在用户,不允许删除");
+        }
+        return toAjax(bomanGroupService.deleteGroupId(ids));
+    }
+
+    /**
+     * 给组添加用户
+     * @param groupId
+     * @param userIds
+     * @return
+     */
+    @GetMapping("/addGroupUser/{groupIds}/{userIds}")
+    public AjaxResult addGroupUser(@PathVariable Long groupId,@PathVariable Long[] userIds){
+        return bomanGroupService.insertUserGroup(groupId,userIds);
+    }
+
+    /**
+     * 给组删除用户
+     * @param groupId
+     * @param userIds
+     * @return
+     */
+    @GetMapping("/deleteGroupUser/{groupIds}/{userIds}")
+    public AjaxResult deleteGroupUser(@PathVariable Long groupId,@PathVariable Long[] userIds){
+        return bomanGroupService.deleteGroupUser(groupId,userIds);
+    }
+
+}

+ 71 - 0
boman-modules/boman-system/src/main/java/com/boman/system/mapper/BomanGroupMapper.java

@@ -0,0 +1,71 @@
+package com.boman.system.mapper;
+
+import com.boman.domain.SysDept;
+import com.boman.domain.BomanGroup;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 自定义组管理 数据层
+ * 
+ * @author ruoyi
+ */
+public interface BomanGroupMapper
+{
+    /**
+     * 查询自定义组数据
+     * 
+     * @param bomanGroup 自定义组
+     * @return 自定义组集合
+     */
+    public List<BomanGroup> selectGroupList(BomanGroup bomanGroup);
+
+    /**
+     * 根据组织ID查询信息
+     * 
+     * @param id 组织ID
+     * @return 组织信息
+     */
+    public BomanGroup selectGroupById(Long id);
+
+    /**
+     * 查询部门是否存在用户
+     * 
+     * @param ids 组织ID
+     * @return 结果
+     */
+    public int checkGroupExistUser(Long[] ids);
+
+    /**
+     * 校验组织名称是否唯一
+     * 
+     * @param deptName 部门名称
+     * @return 结果
+     */
+    public SysDept checkGroupNameUnique(@Param("deptName") String deptName);
+
+    /**
+     * 新增组织信息
+     * 
+     * @param bomanGroup 组织信息
+     * @return 结果
+     */
+    public int insertGroup(BomanGroup bomanGroup);
+
+    /**
+     * 修改组织信息
+     * 
+     * @param bomanGroup 部门信息
+     * @return 结果
+     */
+    public int updateGroup(BomanGroup bomanGroup);
+
+    /**
+     * 删除组织管理信息
+     * 
+     * @param ids 组织ID
+     * @return 结果
+     */
+    public int deleteGroupById(Long[] ids);
+}

+ 24 - 0
boman-modules/boman-system/src/main/java/com/boman/system/mapper/BomanGroupUserMapper.java

@@ -0,0 +1,24 @@
+package com.boman.system.mapper;
+
+import com.boman.domain.BomanGroup;
+import com.boman.domain.BomanGroupUser;
+import com.boman.domain.SysDept;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 自定义组和用户中间表管理 数据层
+ * 
+ * @author ruoyi
+ */
+public interface BomanGroupUserMapper
+{
+    /**
+     * 自定义组和用户中间表管理
+     * 
+     * @param groupId 组ID
+     * @return 自定义组和用户中间表集合
+     */
+    public List<Long> selectGroupUserList(Long groupId);
+}

+ 88 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/IBomanGroupService.java

@@ -0,0 +1,88 @@
+package com.boman.system.service;
+
+import com.boman.domain.SysDept;
+import com.boman.domain.BomanGroup;
+import com.boman.domain.dto.AjaxResult;
+import com.boman.system.domain.vo.TreeSelect;
+
+import java.util.List;
+
+/**
+ * 自定义组 服务层
+ * 
+ * @author ruoyi
+ */
+public interface IBomanGroupService
+{
+    /**
+     * 查询自定义组管理数据
+     * 
+     * @param bomanGroup 自定义组信息
+     * @return 自定义组信息集合
+     */
+    public List<BomanGroup> selectGroupList(BomanGroup bomanGroup);
+
+    /**
+     * 根据部门ID查询信息
+     * 
+     * @param id 部门ID
+     * @return 部门信息
+     */
+    public BomanGroup selectGroupById(Long id);
+
+    /**
+     * 查询组织是否存在用户
+     * 
+     * @param ids 组织ID
+     * @return 结果 true 存在 false 不存在
+     */
+    public boolean checkGroupExistUser(Long[] ids);
+
+    /**
+     * 校验组织名称是否唯一
+     * 
+     * @param bomanGroup 组织信息
+     * @return 结果
+     */
+    public String checkGroupNameUnique(BomanGroup bomanGroup);
+
+    /**
+     * 新增保存组织信息
+     * 
+     * @param bomanGroup 部门信息
+     * @return 结果
+     */
+    public int insertGroup(BomanGroup bomanGroup);
+
+    /**
+     * 修改保存组织信息
+     * 
+     * @param bomanGroup 组织信息
+     * @return 结果
+     */
+    public int updateGroup(BomanGroup bomanGroup);
+
+    /**
+     * 删除组织管理信息
+     * 
+     * @param ids 组织ID
+     * @return 结果
+     */
+    public int deleteGroupId(Long[] ids);
+
+    /**
+     *给组添加用户
+     * @param groupId
+     * @param userIds
+     * @return
+     */
+    public AjaxResult insertUserGroup(Long groupId, Long[] userIds);
+
+    /**
+     * 给组移除用户
+     * @param groupId
+     * @param userIds
+     * @return
+     */
+    public AjaxResult deleteGroupUser(Long groupId, Long[] userIds);
+}

+ 165 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BomanGroupServiceImpl.java

@@ -0,0 +1,165 @@
+package com.boman.system.service.impl;
+
+import com.boman.common.core.exception.CustomException;
+import com.boman.common.core.utils.StringUtils;
+import com.boman.common.core.utils.array.ArrayUtils;
+import com.boman.common.core.utils.obj.ObjectUtils;
+import com.boman.common.datascope.annotation.DataScope;
+import com.boman.domain.*;
+import com.boman.domain.constant.UserConstants;
+import com.boman.domain.dto.AjaxResult;
+import com.boman.system.domain.vo.TreeSelect;
+import com.boman.system.mapper.*;
+import com.boman.system.service.IBomanGroupService;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 自定义组 服务实现
+ *
+ * @author ruoyi
+ */
+@Service
+public class BomanGroupServiceImpl implements IBomanGroupService {
+    @Autowired
+    private BomanGroupMapper groupMapper;
+
+    @Autowired
+    private BomanGroupUserMapper groupUserMapper;
+
+    @Autowired
+    private SysUserMapper sysUserMapper;
+
+    /**
+     * 查询自定义组数据
+     *
+     * @param bomanGroup 自定义组
+     * @return 自定义组集合
+     */
+    @Override
+    @DataScope(deptAlias = "g")
+    public List<BomanGroup> selectGroupList(BomanGroup bomanGroup) {
+        return groupMapper.selectGroupList(bomanGroup);
+    }
+
+    /**
+     * 根据组织id查询信息
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public BomanGroup selectGroupById(Long id) {
+        return groupMapper.selectGroupById(id);
+    }
+
+    /**
+     * 查询组织是否存在用户
+     *
+     * @param ids 组织ID
+     * @return 结果 true 存在 false 不存在
+     */
+    @Override
+    public boolean checkGroupExistUser(Long[] ids) {
+        int result = groupMapper.checkGroupExistUser(ids);
+        return result > 0 ? true : false;
+    }
+
+    /**
+     * 校验组织名称是否唯一
+     *
+     * @param bomanGroup 组织信息
+     * @return 结果
+     */
+    @Override
+    public String checkGroupNameUnique(BomanGroup bomanGroup) {
+        Long id = StringUtils.isNull(bomanGroup.getId()) ? -1L : bomanGroup.getId();
+        SysDept sysDept = groupMapper.checkGroupNameUnique(bomanGroup.getGroupName());
+        if (StringUtils.isNotNull(sysDept) && sysDept.getId().longValue() != id.longValue()) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    /**
+     * 新增保存组织信息
+     *
+     * @param bomanGroup 部门信息
+     * @return
+     */
+    @Override
+    public int insertGroup(BomanGroup bomanGroup) {
+        return groupMapper.insertGroup(bomanGroup);
+    }
+
+    /**
+     * 修改保存组织信息
+     *
+     * @param bomanGroup 组织信息
+     * @return
+     */
+    @Override
+    public int updateGroup(BomanGroup bomanGroup) {
+        return groupMapper.updateGroup(bomanGroup);
+    }
+
+    /**
+     * 删除
+     *
+     * @param ids 组织ID
+     * @return
+     */
+    @Override
+    public int deleteGroupId(Long[] ids) {
+        return groupMapper.deleteGroupById(ids);
+    }
+
+
+    /**给组添加用户
+     * @param groupId
+     * @param userIds
+     * @return
+     */
+    @Override
+    public AjaxResult insertUserGroup(Long groupId, Long[] userIds) {
+        //查询改组所有用户
+        List<Long> list = groupUserMapper.selectGroupUserList(groupId);
+        List<Long> longs = Arrays.asList(userIds);
+        list.removeIf(longs::contains
+        );
+        if (list.size() > 0){
+            for (Long userId : list) {
+                BomanGroupUser bomanGroupUser = new BomanGroupUser();
+                bomanGroupUser.setUserId(userId);
+                bomanGroupUser.setGroupId(groupId);
+                SysUser user = sysUserMapper.selectUserById(userId);
+                if (user != null){
+                    bomanGroupUser.setUserName(user.getUserName());
+                }else {
+                    return AjaxResult.error("该用户不存在");
+                }
+            }
+        }
+        return AjaxResult.success();
+    }
+
+
+    /**
+     * 给组删除用户
+     * @param groupId
+     * @param userIds
+     * @return
+     */
+    @Override
+    public AjaxResult deleteGroupUser(Long groupId, Long[] userIds) {
+        return null;
+    }
+
+}

+ 122 - 0
boman-modules/boman-system/src/main/resources/mapper/system/BomanGroupMapper.xml

@@ -0,0 +1,122 @@
+<?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.boman.system.mapper.BomanGroupMapper">
+
+    <resultMap type="com.boman.domain.BomanGroup" id="BomanGroupResult">
+        <id property="id" column="id"/>
+        <result property="groupName" column="group_name"/>
+        <result property="status" column="status"/>
+        <result property="number" column="number"/>
+        <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="isDel" column="is_del"/>
+        <collection  property="sysUserList"   javaType="java.util.List"        resultMap="SysUserResult" />
+    </resultMap>
+
+    <resultMap type="com.boman.domain.SysUser" id="SysUserResult">
+        <id     property="id"       column="id"      />
+        <result property="deptId"       column="dept_id"      />
+        <result property="userName"     column="user_name"    />
+        <result property="nickName"     column="nick_name"    />
+        <result property="email"        column="email"        />
+        <result property="phonenumber"  column="phonenumber"  />
+        <result property="sex"          column="sex"          />
+        <result property="avatar"       column="avatar"       />
+        <result property="password"     column="password"     />
+        <result property="status"       column="status"       />
+        <result property="delFlag"      column="del_flag"     />
+        <result property="loginIp"      column="login_ip"     />
+        <result property="loginDate"    column="login_date"   />
+        <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="selectGroupVo">
+        select g.id, g.group_name, g.status, g.number, g.create_by, g.create_time, g.is_del
+        from boman_group g
+    </sql>
+
+    <select id="selectGroupList" parameterType="com.boman.domain.BomanGroup" resultMap="BomanGroupResult">
+        select g.id, g.group_name, g.status, g.number,  g.create_by, g.create_time, g.is_del, u.user_name , u.id
+        from boman_group g
+        left join boman_group_user gu on gu.group_id = g.id
+        where g.is_del = 'N'
+        <if test="groupName != null and groupName != ''">
+            AND g.groupName like concat('%', #{groupName}, '%')
+        </if>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        order by g.number
+    </select>
+
+    <select id="selectGroupById" parameterType="Long" resultMap="BomanGroupResult">
+        select g.id, g.group_name, g.status, g.number,  g.create_by, g.create_time, g.is_del, gu.user_name , gu.id
+        from boman_group g
+        left join boman_group_user gu on gu.group_id = g.id
+        where g.is_del = 'N'
+        and g.id = #{id}
+    </select>
+
+    <select id="checkGroupNameUnique" resultMap="BomanGroupResult">
+        <include refid="selectGroupVo"/>
+        where group_name=#{GroupName} limit 1
+    </select>
+
+    <insert id="insertGroup" parameterType="com.boman.domain.BomanGroup">
+        insert into boman_group(
+        <if test="id != null and id != 0">id,</if>
+        <if test="groupName != null and groupName != ''">group_name,</if>
+        <if test="number != null and number != ''">number,</if>
+        <if test="status != null">status,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        <if test="isDel != null and isDel != ''">is_del,</if>
+        create_time
+        )values(
+        <if test="id != null and id != 0">#{id},</if>
+        <if test="groupName != null and groupName != ''">#{groupName},</if>
+        <if test="number != null and number != ''">#{number},</if>
+        <if test="status != null">#{status},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        <if test="isDel != null and isDel != ''">#{isDel},</if>
+        sysdate()
+        )
+    </insert>
+
+    <update id="updateGroup" parameterType="com.boman.domain.BomanGroup">
+        update boman_group
+        <set>
+            <if test="groupName != null and groupName != ''">group_name = #{groupName},</if>
+            <if test="number != null and number != ''">number = #{number},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
+            update_time = sysdate()
+        </set>
+        where id = #{id}
+    </update>
+
+
+    <select id="checkGroupExistUser" parameterType="Long" resultType="int">
+        select count(1) from boman_group_user where group_id in
+        <foreach collection="array" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+        and is_del = 'N'
+    </select>
+
+
+	<update id="deleteGroupById" parameterType="Long">
+		update  boman_group_user set is_del = 'Y' where id in
+		<foreach collection="array" item="id" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</update>
+</mapper> 

+ 30 - 0
boman-modules/boman-system/src/main/resources/mapper/system/BomanGroupUserMapper.xml

@@ -0,0 +1,30 @@
+<?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.boman.system.mapper.BomanGroupUserMapper">
+
+    <resultMap type="com.boman.domain.BomanGroupUser" id="BomanGroupUserResult">
+        <id property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="userName" column="user_name"/>
+        <result property="groupId" column="group_id"/>
+        <result property="status" column="status"/>
+        <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="isDel" column="is_del"/>
+    </resultMap>
+
+
+    <sql id="selectGroupUserVo">
+        select g.id, g.user_id, g.user_name,  g.group_id, g.status, g.create_by, g.create_time, g.update_by, g.update_time, g.is_del
+        from boman_group_user g
+    </sql>
+
+    <select id="selectGroupUserList" parameterType="Long" resultType="Long">
+        select user_id from boman_group_user
+        where group_id = {groupId}
+    </select>
+</mapper> 

+ 1 - 1
boman-modules/boman-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
     
     <select id="checkDeptExistUser" parameterType="Long" resultType="int">
-		select count(1) from sys_user where id = #{id} and del_flag = '0'
+		select count(1) from sys_user where dept_id = #{id} and del_flag = '0'
 	</select>
 	
 	<select id="hasChildById" parameterType="Long" resultType="int">

+ 1 - 1
boman-modules/boman-system/src/main/resources/rebel.xml

@@ -9,7 +9,7 @@
 	<id>boman-modules-system</id>
 
 	<classpath>
-		<dir name="E:/boman-framwork/boman-modules/boman-system/target/classes">
+		<dir name="E:/jiaoyuju/boman-modules/boman-system/target/classes">
 		</dir>
 	</classpath>
 

+ 0 - 0
boman-web-core/.rebel-remote.xml.bak → boman-web-core/src/main/resources/rebel-remote.xml


+ 2 - 2
boman-web-core/src/main/resources/rebel.xml

@@ -6,10 +6,10 @@
 -->
 <application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
 
-	<id>boman-modules-system</id>
+	<id>boman-web-core</id>
 
 	<classpath>
-		<dir name="E:/boman-framwork/boman-web-core/target/classes">
+		<dir name="E:/jiaoyuju/boman-web-core/target/classes">
 		</dir>
 	</classpath>