|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.kms.web.controller.system; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
@ -94,8 +95,10 @@ public class CmsCallBackController { |
|
|
|
}else { |
|
|
|
user.setStatus("1"); |
|
|
|
} |
|
|
|
List<String> collect = singleUser.getRoleList().stream().map(singleRole -> singleRole.getId()).collect(Collectors.toList()); |
|
|
|
user.setRoleIds(collect.toArray(new String[collect.size()])); |
|
|
|
if(CollectionUtil.isNotEmpty(singleUser.getRoleList())) { |
|
|
|
List<String> collect = singleUser.getRoleList().stream().map(singleRole -> singleRole.getId()).collect(Collectors.toList()); |
|
|
|
user.setRoleIds(collect.toArray(new String[collect.size()])); |
|
|
|
} |
|
|
|
userService.singleInsertUser(user); |
|
|
|
}else if(type.equals(CallType.USER_UPDATE)){ |
|
|
|
SingleUser singleUser = JSONObject.parseObject(content, SingleUser.class); |
|
|
@ -122,9 +125,11 @@ public class CmsCallBackController { |
|
|
|
}else { |
|
|
|
user.setStatus("1"); |
|
|
|
} |
|
|
|
List<String> collect = singleUser.getRoleList().stream().map(singleRole -> singleRole.getId()).collect(Collectors.toList()); |
|
|
|
user.setRoleIds(collect.toArray(new String[collect.size()])); |
|
|
|
userService.singleInsertUser(user); |
|
|
|
if(CollectionUtil.isNotEmpty(singleUser.getRoleList())) { |
|
|
|
List<String> collect = singleUser.getRoleList().stream().map(singleRole -> singleRole.getId()).collect(Collectors.toList()); |
|
|
|
user.setRoleIds(collect.toArray(new String[collect.size()])); |
|
|
|
} |
|
|
|
userService.updateUser(user); |
|
|
|
}else if(type.equals(CallType.USER_DELETE)){ |
|
|
|
SingleUser singleUser = JSONObject.parseObject(content, SingleUser.class); |
|
|
|
QueryWrapper<SysUser> query = Wrappers.query(); |
|
|
|