Merge branch 'feature/sso_function_v1205' of http://121.40.234.130:8899/root/lanzhouhailiang_one into feature/sso_function_v1205
This commit is contained in:
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
6
.idea/compiler.xml
generated
Normal file
6
.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<bytecodeTargetLevel target="8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/dictionaries
generated
Normal file
6
.idea/dictionaries
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectDictionaryState">
|
||||||
|
<dictionary name="mima0000" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
37
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
37
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="TOP_LEVEL_CLASS_OPTIONS">
|
||||||
|
<value>
|
||||||
|
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||||
|
<option name="REQUIRED_TAGS" value="" />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="INNER_CLASS_OPTIONS">
|
||||||
|
<value>
|
||||||
|
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||||
|
<option name="REQUIRED_TAGS" value="" />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="METHOD_OPTIONS">
|
||||||
|
<value>
|
||||||
|
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||||
|
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="FIELD_OPTIONS">
|
||||||
|
<value>
|
||||||
|
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||||
|
<option name="REQUIRED_TAGS" value="" />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="IGNORE_DEPRECATED" value="false" />
|
||||||
|
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
|
||||||
|
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
|
||||||
|
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
|
||||||
|
<option name="myAdditionalJavadocTags" value="date" />
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
9
.idea/lanzhouhailiang_one.iml
generated
Normal file
9
.idea/lanzhouhailiang_one.iml
generated
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/lanzhouhailiang_one.iml" filepath="$PROJECT_DIR$/.idea/lanzhouhailiang_one.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
1.数据库数据同步
|
1.数据库数据同步
|
||||||
sys_dept,sys_dict,sys_dict_detail,sys_param,
|
sys_dept,sys_dict,sys_dict_detail,sys_param,
|
||||||
sys_role,sys_users_roles,sys_menus,sys_role_menus,
|
sys_role,sys_users_roles,sys_menus,sys_role_menus,
|
||||||
sys_user,sys_user_dept
|
sys_user(自增),sys_user_dept,
|
||||||
|
|
||||||
代码移动至sso包下
|
代码移动至sso包下
|
||||||
2.前端移动模块包括:用户,角色,菜单,部门,字典 param,grid ,登入页面
|
2.前端移动模块包括:用户,角色,菜单,部门,字典 param,grid ,登入页面
|
||||||
|
|||||||
@@ -19,11 +19,14 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.sso.base.BaseDto;
|
import org.nl.sso.base.BaseDto;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Zheng Jie
|
* @author Zheng Jie
|
||||||
@@ -38,15 +41,12 @@ public class User extends BaseDto implements Serializable {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
private Long user_id;
|
private Long user_id;
|
||||||
@JsonFormat
|
|
||||||
private String roles;
|
|
||||||
|
|
||||||
private String depts;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
|
private List<Long> roles;
|
||||||
|
|
||||||
|
private List<Long> depts;
|
||||||
|
|
||||||
private String person_name;
|
private String person_name;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.nl.sso.system.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.nl.sso.base.BaseDto;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Zheng Jie
|
||||||
|
* @date 2018-11-22
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UserVo extends BaseDto implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID", hidden = true)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long user_id;
|
||||||
|
|
||||||
|
private List<Long> roles;
|
||||||
|
|
||||||
|
private List<Long> depts;
|
||||||
|
|
||||||
|
|
||||||
|
private String deptnames;
|
||||||
|
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
|
||||||
|
private String person_name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "邮箱")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电话号码")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户性别")
|
||||||
|
private String gender;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像真实名称",hidden = true)
|
||||||
|
private String avatarName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像存储的路径", hidden = true)
|
||||||
|
private String avatarPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@ApiModelProperty(value = "是否启用")
|
||||||
|
private String is_used;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否为admin账号", hidden = true)
|
||||||
|
private Boolean isAdmin = false;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "最后修改密码的时间", hidden = true)
|
||||||
|
private Date pwdResetTime;
|
||||||
|
|
||||||
|
public void setRoles(String roles) {
|
||||||
|
if (StringUtils.isNotEmpty(roles)){
|
||||||
|
String[] split = roles.split(",");
|
||||||
|
this.roles = Arrays.stream(split).map(a->Long.valueOf(a)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDepts(String depts) {
|
||||||
|
if (StringUtils.isNotEmpty(depts)){
|
||||||
|
String[] split = depts.split(",");
|
||||||
|
this.depts = Arrays.stream(split).map(a->Long.valueOf(a)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,6 +38,12 @@ public class RoleController {
|
|||||||
return new ResponseEntity<>(roleService.queryAll(criteria, pageable), HttpStatus.OK);
|
return new ResponseEntity<>(roleService.queryAll(criteria, pageable), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询所有角色")
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<Object> query() {
|
||||||
|
return new ResponseEntity<>(roleService.queryAll(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Log("新增角色")
|
@Log("新增角色")
|
||||||
@ApiOperation("新增角色")
|
@ApiOperation("新增角色")
|
||||||
|
|||||||
@@ -15,8 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.nl.sso.system.service;
|
package org.nl.sso.system.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import org.nl.sso.system.domain.vo.RoleVo;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -37,6 +39,8 @@ public interface RoleService {
|
|||||||
*/
|
*/
|
||||||
JSONObject queryAll(Map whereJson, Pageable page);
|
JSONObject queryAll(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
List<RoleVo> queryAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建
|
* 创建
|
||||||
* @param form /
|
* @param form /
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
package org.nl.sso.system.service;
|
package org.nl.sso.system.service;
|
||||||
|
|
||||||
import org.nl.sso.system.domain.User;
|
import org.nl.sso.system.domain.User;
|
||||||
|
import org.nl.sso.system.domain.vo.UserVo;
|
||||||
import org.nl.sso.system.service.dto.UserQueryCriteria;
|
import org.nl.sso.system.service.dto.UserQueryCriteria;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@@ -96,7 +97,7 @@ public interface UserService {
|
|||||||
* @param criteria 条件
|
* @param criteria 条件
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
List<User> queryAll(UserQueryCriteria criteria);
|
List<UserVo> queryAll(UserQueryCriteria criteria);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.sso.system.domain.vo.RoleVo;
|
||||||
import org.nl.sso.system.service.RoleService;
|
import org.nl.sso.system.service.RoleService;
|
||||||
import org.nl.sso.tools.IdUtil;
|
import org.nl.sso.tools.IdUtil;
|
||||||
import org.nl.sso.tools.SecurityUtils;
|
import org.nl.sso.tools.SecurityUtils;
|
||||||
@@ -44,6 +45,13 @@ import java.util.*;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class RoleServiceImpl implements RoleService {
|
public class RoleServiceImpl implements RoleService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RoleVo> queryAll() {
|
||||||
|
JSONArray sysRoles = WQLObject.getWQLObject("sys_role").query("is_used =1 and is_delete = 0").getResultJSONArray(0);
|
||||||
|
List<RoleVo> roleVos = sysRoles.toJavaList(RoleVo.class);
|
||||||
|
return roleVos;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
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");
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import org.nl.modules.common.utils.RedisUtils;
|
|||||||
import org.nl.sso.security.dto.CurrentUser;
|
import org.nl.sso.security.dto.CurrentUser;
|
||||||
import org.nl.sso.security.service.OnlineUserService;
|
import org.nl.sso.security.service.OnlineUserService;
|
||||||
import org.nl.sso.system.domain.User;
|
import org.nl.sso.system.domain.User;
|
||||||
|
import org.nl.sso.system.domain.vo.UserVo;
|
||||||
import org.nl.sso.system.service.DeptService;
|
import org.nl.sso.system.service.DeptService;
|
||||||
import org.nl.sso.system.service.UserRelateService;
|
import org.nl.sso.system.service.UserRelateService;
|
||||||
import org.nl.sso.system.service.UserService;
|
import org.nl.sso.system.service.UserService;
|
||||||
@@ -95,11 +96,14 @@ public class UserServiceImpl implements UserService {
|
|||||||
}
|
}
|
||||||
map.put("flag","1");
|
map.put("flag","1");
|
||||||
JSONObject jsonObject = WQL.getWO("SYS_USER").addParamMap(map).pageQuery(WqlUtil.getHttpContext(pageable),"user_id desc");
|
JSONObject jsonObject = WQL.getWO("SYS_USER").addParamMap(map).pageQuery(WqlUtil.getHttpContext(pageable),"user_id desc");
|
||||||
|
JSONArray array = (JSONArray) jsonObject.get("content");
|
||||||
|
List<UserVo> users = array.toJavaList(UserVo.class);
|
||||||
|
jsonObject.put("content",users);
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<User> queryAll(UserQueryCriteria criteria) {
|
public List<UserVo> queryAll(UserQueryCriteria criteria) {
|
||||||
JSONObject o = (JSONObject)JSON.toJSON(criteria);
|
JSONObject o = (JSONObject)JSON.toJSON(criteria);
|
||||||
HashMap map = MapOf.of("user_id", MapUtil.getStr(o, "user_id")
|
HashMap map = MapOf.of("user_id", MapUtil.getStr(o, "user_id")
|
||||||
, "blurry", MapUtil.getStr(o, "blurry")
|
, "blurry", MapUtil.getStr(o, "blurry")
|
||||||
@@ -114,7 +118,7 @@ public class UserServiceImpl implements UserService {
|
|||||||
}
|
}
|
||||||
map.put("flag","1");
|
map.put("flag","1");
|
||||||
JSONArray array = WQL.getWO("SYS_USER").addParamMap(map).process().getResultJSONArray(0);
|
JSONArray array = WQL.getWO("SYS_USER").addParamMap(map).process().getResultJSONArray(0);
|
||||||
List<User> users = array.toJavaList(User.class);
|
List<UserVo> users = array.toJavaList(UserVo.class);
|
||||||
return users;
|
return users;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,20 +143,13 @@ public class UserServiceImpl implements UserService {
|
|||||||
resources.setCreate_name(user.getUsername());
|
resources.setCreate_name(user.getUsername());
|
||||||
ResultBean sys_user = WQLObject.getWQLObject("sys_user").insert(JSONObject.parseObject(JSON.toJSONString(resources)));
|
ResultBean sys_user = WQLObject.getWQLObject("sys_user").insert(JSONObject.parseObject(JSON.toJSONString(resources)));
|
||||||
//更新用户部门表,更新用户角色表
|
//更新用户部门表,更新用户角色表
|
||||||
String depts = resources.getDepts();
|
List<Long> depts = resources.getDepts();
|
||||||
String roles = resources.getRoles();
|
List<Long> roles = resources.getRoles();
|
||||||
JSONObject currentUser = WQLObject.getWQLObject("sys_user").query("username = '" + resources.getUsername() + "'").uniqueResult(0);
|
JSONObject currentUser = WQLObject.getWQLObject("sys_user").query("username = '" + resources.getUsername() + "'").uniqueResult(0);
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(depts)){
|
userRelateService.inserDeptRelate(currentUser.getLong("user_id"),new HashSet(depts));
|
||||||
String[] split = depts.split(",");
|
userRelateService.inserRoleRelate(currentUser.getLong("user_id"),new HashSet(roles));
|
||||||
Set<Long> collect = Arrays.stream(split).map(a -> Long.valueOf(a)).collect(Collectors.toSet());
|
|
||||||
userRelateService.inserDeptRelate(currentUser.getLong("user_id"),collect);
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(roles)){
|
|
||||||
String[] split = roles.split(",");
|
|
||||||
Set<Long> collect = Arrays.stream(split).map(a -> Long.valueOf(a)).collect(Collectors.toSet());
|
|
||||||
userRelateService.inserRoleRelate(currentUser.getLong("user_id"),collect);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -173,18 +170,12 @@ public class UserServiceImpl implements UserService {
|
|||||||
// 清除缓存
|
// 清除缓存
|
||||||
delCaches(user.getUser_id(), user.getUsername());
|
delCaches(user.getUser_id(), user.getUsername());
|
||||||
//更新部门用户
|
//更新部门用户
|
||||||
String depts = resources.getDepts();
|
List<Long> depts = resources.getDepts();
|
||||||
String roles = resources.getRoles();
|
List<Long> roles = resources.getRoles();
|
||||||
if (StringUtils.isNotEmpty(depts)){
|
userRelateService.updateDeptRelate(resources.getUser_id(),new HashSet(depts));
|
||||||
String[] split = depts.split(",");
|
userRelateService.updateRoleRelate(resources.getUser_id(),new HashSet(roles));
|
||||||
Set<Long> collect = Arrays.stream(split).map(a -> Long.valueOf(a)).collect(Collectors.toSet());
|
|
||||||
userRelateService.updateDeptRelate(resources.getUser_id(),collect);
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(roles)){
|
|
||||||
String[] split = roles.split(",");
|
|
||||||
Set<Long> collect = Arrays.stream(split).map(a -> Long.valueOf(a)).collect(Collectors.toSet());
|
|
||||||
userRelateService.updateRoleRelate(resources.getUser_id(),collect);
|
|
||||||
}
|
|
||||||
// 如果用户的角色改变
|
// 如果用户的角色改变
|
||||||
if (!resources.getRoles().equals(user.getRoles())) {
|
if (!resources.getRoles().equals(user.getRoles())) {
|
||||||
redisUtils.del(CacheKey.DATA_USER + resources.getUser_id());
|
redisUtils.del(CacheKey.DATA_USER + resources.getUser_id());
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class WorkteamServiceImpl implements WorkteamService {
|
|||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
CurrentUser currentUser = SecurityUtils.getCurrentUser();
|
CurrentUser currentUser = SecurityUtils.getCurrentUser();
|
||||||
String depts = currentUser.getUser().getDepts();
|
List<Long> depts = currentUser.getUser().getDepts();
|
||||||
|
|
||||||
//编码唯一性校验
|
//编码唯一性校验
|
||||||
String team_code = dto.getTeam_code();
|
String team_code = dto.getTeam_code();
|
||||||
@@ -99,8 +99,8 @@ public class WorkteamServiceImpl implements WorkteamService {
|
|||||||
dto.setUpdate_optname(nickName);
|
dto.setUpdate_optname(nickName);
|
||||||
dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
dto.setSyscompanyid(Long.valueOf(depts));
|
dto.setSyscompanyid(Long.valueOf(depts.get(0)));
|
||||||
dto.setSysdeptid(Long.valueOf(depts));
|
dto.setSysdeptid(Long.valueOf(depts.get(0)));
|
||||||
|
|
||||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_workteam");
|
WQLObject wo = WQLObject.getWQLObject("pdm_bi_workteam");
|
||||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||||
|
|||||||
@@ -77,7 +77,8 @@
|
|||||||
<el-form-item label="邮箱" prop="email">
|
<el-form-item label="邮箱" prop="email">
|
||||||
<el-input v-model="form.email" style="width: 200px;" />
|
<el-input v-model="form.email" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="部门" prop="depts" :rules="[{ required: true, message: '请选择部门', trigger: 'change' }]">
|
<br v-if="!crud.status.edit">
|
||||||
|
<el-form-item v-if="crud.status.add" label="部门" prop="depts" :rules="[{ required: true, message: '请选择部门', trigger: 'change' }]">
|
||||||
<treeselect
|
<treeselect
|
||||||
v-model="form.depts"
|
v-model="form.depts"
|
||||||
:load-options="loadDepts"
|
:load-options="loadDepts"
|
||||||
@@ -108,7 +109,8 @@
|
|||||||
inactive-value="0"
|
inactive-value="0"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="margin-bottom: 0;" label="角色" prop="roles">
|
<br v-if="!crud.status.edit">
|
||||||
|
<el-form-item v-if="crud.status.add" style="margin-bottom: 0;" label="角色" prop="roles">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="roleDatas"
|
v-model="roleDatas"
|
||||||
style="width: 512px"
|
style="width: 512px"
|
||||||
@@ -168,8 +170,8 @@
|
|||||||
width="200"
|
width="200"
|
||||||
>
|
>
|
||||||
<template v-if="scope.row.userId !== 1" slot-scope="scope">
|
<template v-if="scope.row.userId !== 1" slot-scope="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="crud.toEdit(scope.row)(scope.row)">修改</el-button>
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handdeleted(scope.row)">删除</el-button>
|
||||||
<el-dropdown v-hasPermi="['system:user:resetPwd', 'system:user:edit']" size="mini" @command="(command) => handleCommand(command, scope.row)">
|
<el-dropdown v-hasPermi="['system:user:resetPwd', 'system:user:edit']" size="mini" @command="(command) => handleCommand(command, scope.row)">
|
||||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
@@ -241,7 +243,7 @@ const defaultForm = {
|
|||||||
person_name: null,
|
person_name: null,
|
||||||
gender: '男',
|
gender: '男',
|
||||||
email: null,
|
email: null,
|
||||||
enabled: 'true',
|
is_used: '1',
|
||||||
roles: [],
|
roles: [],
|
||||||
phone: null,
|
phone: null,
|
||||||
password: null
|
password: null
|
||||||
@@ -316,6 +318,17 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handdeleted(datas) {
|
||||||
|
this.$confirm(`确认删除选中的1条数据?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.crud.delAllLoading = true
|
||||||
|
this.crud.doDelete(datas)
|
||||||
|
}).catch(() => {
|
||||||
|
})
|
||||||
|
},
|
||||||
// 新增与编辑前做的操作
|
// 新增与编辑前做的操作
|
||||||
[CRUD.HOOK.afterToCU](crud, form) {
|
[CRUD.HOOK.afterToCU](crud, form) {
|
||||||
this.getRoles()
|
this.getRoles()
|
||||||
@@ -324,7 +337,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.getSupDepts(form.dept_id)
|
this.getSupDepts(form.dept_id)
|
||||||
}
|
}
|
||||||
this.getRoleLevel()
|
// this.getRoleLevel() 暂时不用
|
||||||
form.is_used = form.enabled.toString()
|
form.is_used = form.enabled.toString()
|
||||||
},
|
},
|
||||||
// 新增前将多选的值设置为空
|
// 新增前将多选的值设置为空
|
||||||
@@ -334,15 +347,17 @@ export default {
|
|||||||
},
|
},
|
||||||
// 初始化编辑时候的角色与岗位
|
// 初始化编辑时候的角色与岗位
|
||||||
[CRUD.HOOK.beforeToEdit](crud, form) {
|
[CRUD.HOOK.beforeToEdit](crud, form) {
|
||||||
|
crud.status.edit
|
||||||
this.roleDatas = []
|
this.roleDatas = []
|
||||||
userRoles = []
|
userRoles = []
|
||||||
const _this = this
|
const _this = this
|
||||||
const arr = form.roles.split(',')
|
if (form.roles !== null && form.roles.length > 0) {
|
||||||
arr.forEach(function(role, index) {
|
form.roles.forEach(function(role, index) {
|
||||||
_this.roleDatas.push(role.id)
|
_this.roleDatas.push(role)
|
||||||
const rol = { id: role.id }
|
const rol = { id: role }
|
||||||
userRoles.push(rol)
|
userRoles.push(rol)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 提交前做的操作
|
// 提交前做的操作
|
||||||
[CRUD.HOOK.afterValidateCU](crud) {
|
[CRUD.HOOK.afterValidateCU](crud) {
|
||||||
@@ -363,8 +378,7 @@ export default {
|
|||||||
userRoles.forEach(function(data, index) {
|
userRoles.forEach(function(data, index) {
|
||||||
roles.push(data.id)
|
roles.push(data.id)
|
||||||
})
|
})
|
||||||
crud.form.roles = roles.toString()
|
crud.form.roles = roles
|
||||||
crud.form.depts = crud.form.depts.toString()
|
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
// 获取左侧部门数据
|
// 获取左侧部门数据
|
||||||
@@ -477,7 +491,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
checkboxT(row, rowIndex) {
|
checkboxT(row, rowIndex) {
|
||||||
return row.id !== this.user.id
|
// return row.id !== this.user.id
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
resetPassword(row) {
|
resetPassword(row) {
|
||||||
row.password = null
|
row.password = null
|
||||||
|
|||||||
Reference in New Issue
Block a user