fix用户更新修改
This commit is contained in:
@@ -56,9 +56,13 @@ public class RoleServiceImpl implements RoleService {
|
|||||||
public JSONObject queryAll(Map whereJson, Pageable page) {
|
public JSONObject queryAll(Map whereJson, Pageable page) {
|
||||||
WQLObject wo = WQLObject.getWQLObject("sys_role");
|
WQLObject wo = WQLObject.getWQLObject("sys_role");
|
||||||
WQLObject rmTab = WQLObject.getWQLObject("sys_roles_menus");
|
WQLObject rmTab = WQLObject.getWQLObject("sys_roles_menus");
|
||||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "", "update_time desc");
|
String sql = "";
|
||||||
|
Object blurry = whereJson.get("blurry");
|
||||||
|
if (blurry !=null){
|
||||||
|
sql = "name like '%"+blurry+"%'";
|
||||||
|
}
|
||||||
|
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), sql, "update_time desc");
|
||||||
final JSONObject json = rb.pageResult();
|
final JSONObject json = rb.pageResult();
|
||||||
|
|
||||||
JSONArray arr = json.getJSONArray("content");
|
JSONArray arr = json.getJSONArray("content");
|
||||||
for (int i = 0; i < arr.size(); i++) {
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
JSONObject roleObj = arr.getJSONObject(i);
|
JSONObject roleObj = arr.getJSONObject(i);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -82,17 +83,21 @@ public class UserRelateServiceImpl implements UserRelateService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void updateDeptRelate(Long user, Set<Long> deptIds) {
|
public void updateDeptRelate(Long user, Set<Long> deptIds) {
|
||||||
if (user !=null){
|
if (user !=null){
|
||||||
this.deleteDeptRelate(user,deptIds);
|
HashSet<Long> userSet = new HashSet<>();
|
||||||
|
userSet.add(user);
|
||||||
|
this.deleteDeptRelate(userSet);
|
||||||
this.inserDeptRelate(user,deptIds);
|
this.inserDeptRelate(user,deptIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateRoleRelate(Long user, Set<Long> RoleIds) {
|
public void updateRoleRelate(Long role, Set<Long> RoleIds) {
|
||||||
if (user !=null){
|
if (role !=null){
|
||||||
this.deleteRoleRelate(user,RoleIds);
|
HashSet<Long> roleSet = new HashSet<>();
|
||||||
this.inserRoleRelate(user,RoleIds);
|
roleSet.add(role);
|
||||||
|
this.deleteRoleRelate(roleSet);
|
||||||
|
this.inserRoleRelate(role,RoleIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user