Przeglądaj źródła

增加角色关系删除标识

hym 4 lat temu
rodzic
commit
dc27343b50

+ 2 - 0
user_center/src/main/java/com/huaxu/dto/UserGroupDto.java

@@ -12,4 +12,6 @@ public class UserGroupDto {
     private List<Long> userIds;
     @ApiModelProperty(value = "角色id")
     private Long roleId;
+    @ApiModelProperty(value = "右边全部删除标识")
+    private Integer deleteFlag;
 }

+ 7 - 2
user_center/src/main/java/com/huaxu/service/impl/UserGroupServiceImpl.java

@@ -186,8 +186,13 @@ public class UserGroupServiceImpl implements UserGroupService {
         });
 
         userGroupMapper.deleteUserRoles(userGroupDto);
-        userGroupMapper.batchInsertRoles(userRoleEntities);
-        groupUserMapper.batchInsert(groupUsers);
+        if(userGroupDto.getDeleteFlag()==1){
+            userGroupMapper.batchInsertRoles(userRoleEntities);
+            groupUserMapper.batchInsert(groupUsers);
+        }
+
+
+
         return 0;
     }
 }

+ 1 - 1
user_center/src/main/resources/mapper/UserGroupMapper.xml

@@ -223,7 +223,7 @@
         <if test="id != -1 ">
            and  b.GROUP_ID=#{id} and b.status!=0 and userrole.status!=0
         </if>
-        <if test="id == 0 ">
+        <if test="id == -1 ">
           and  b.GROUP_ID is null and userrole.status!=0
         </if>
         <if test="tenantId != null and tenantId != ''">