fix部门页面
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.nl.modules.common.base;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -18,15 +19,14 @@ public class BaseDTO implements Serializable {
|
||||
|
||||
private Long create_id;
|
||||
|
||||
|
||||
private String update_optname;
|
||||
|
||||
private Long update_optid;
|
||||
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date create_time;
|
||||
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date update_time;
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.nl.modules.common.base.BaseDTO;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -32,24 +33,25 @@ import java.util.Set;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class Dept implements Serializable {
|
||||
public class Dept extends BaseDTO implements Serializable {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long dept_id;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer dept_sort;
|
||||
|
||||
|
||||
@NotBlank
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String name;
|
||||
|
||||
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
private Boolean is_used;
|
||||
private String is_used;
|
||||
|
||||
@ApiModelProperty(value = "上级部门")
|
||||
private Long pid;
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.nl.modules.system.domain;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.nl.modules.common.base.BaseDTO;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
@@ -29,7 +30,7 @@ import java.util.Date;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class User implements Serializable {
|
||||
public class User extends BaseDTO implements Serializable {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "ID", hidden = true)
|
||||
|
||||
@@ -15,14 +15,17 @@
|
||||
*/
|
||||
package org.nl.modules.system.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.nl.modules.common.base.BaseDTO;
|
||||
import org.nl.modules.system.service.dto.MenuDto;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -31,7 +34,7 @@ import java.util.List;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class DeptVo implements Serializable {
|
||||
public class DeptVo extends BaseDTO implements Serializable {
|
||||
|
||||
|
||||
private Long dept_id;
|
||||
@@ -39,13 +42,14 @@ public class DeptVo implements Serializable {
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer dept_sort;
|
||||
|
||||
|
||||
@NotBlank
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String name;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
private Boolean is_used;
|
||||
private String is_used;
|
||||
|
||||
@ApiModelProperty(value = "上级部门")
|
||||
private Long pid;
|
||||
@@ -55,6 +59,7 @@ public class DeptVo implements Serializable {
|
||||
//前端显示
|
||||
private Boolean hasChildren =Boolean.FALSE;
|
||||
|
||||
|
||||
private List<DeptVo> children;
|
||||
|
||||
public void setSub_count(Integer sub_count) {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class DeptQueryCriteria{
|
||||
private String code;
|
||||
|
||||
@Query
|
||||
private Boolean is_used;
|
||||
private String is_used;
|
||||
|
||||
@Query
|
||||
private Long pid;
|
||||
|
||||
@@ -78,7 +78,7 @@ public class UserDetail implements Serializable {
|
||||
|
||||
private String extuser_id;
|
||||
|
||||
private Boolean is_used;
|
||||
private String is_used;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import cn.hutool.db.Entity;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -143,7 +144,9 @@ public class DeptServiceImpl implements DeptService {
|
||||
}
|
||||
Dept dept = findById(resources.getDept_id());
|
||||
resources.setDept_id(dept.getDept_id());
|
||||
WQLObject.getWQLObject("sys_dept").update((JSONObject)JSON.toJSON(resources),"dept_id = '"+resources.getDept_id()+"'");
|
||||
|
||||
// WQLObject.getWQLObject("sys_dept").update((JSONObject)JSON.toJSON(resources),"dept_id = '"+resources.getDept_id()+"'");
|
||||
WQLObject.getWQLObject("sys_dept").update(JSONObject.parseObject(JSON.toJSONString(resources)),"dept_id = '"+resources.getDept_id()+"'");
|
||||
// 更新父节点中子节点数目
|
||||
updateSubCnt(oldPid);
|
||||
updateSubCnt(newPid);
|
||||
@@ -272,7 +275,7 @@ public class DeptServiceImpl implements DeptService {
|
||||
public List<Long> getDeptChildren(List<Dept> deptList) {
|
||||
List<Long> list = new ArrayList<>();
|
||||
deptList.forEach(dept -> {
|
||||
if (dept != null && dept.getIs_used()) {
|
||||
if (dept != null && "1".equals(dept.getIs_used())) {
|
||||
List<Dept> depts = findByPid(dept.getDept_id());
|
||||
if (deptList.size() != 0) {
|
||||
list.addAll(getDeptChildren(depts));
|
||||
|
||||
@@ -151,7 +151,7 @@ public class UserServiceImpl implements UserService {
|
||||
onlineUserService.kickOutForUsername(resources.getUsername());
|
||||
}
|
||||
resources.setPassword(SaSecureUtil.md5BySalt(resources.getPassword(), "salt"));
|
||||
WQLObject.getWQLObject("sys_user").update((JSONObject)JSON.toJSON(resources),"user_id ='"+resources.getUser_id()+"'");
|
||||
WQLObject.getWQLObject("sys_user").update(JSONObject.parseObject(JSON.toJSONString(resources)),"user_id ='"+resources.getUser_id()+"'");
|
||||
// 清除缓存
|
||||
delCaches(user.getUser_id(), user.getUsername());
|
||||
//更新部门用户
|
||||
@@ -171,7 +171,7 @@ public class UserServiceImpl implements UserService {
|
||||
user.setPerson_name(resources.getPerson_name());
|
||||
user.setPhone(resources.getPhone());
|
||||
user.setGender(resources.getGender());
|
||||
WQLObject.getWQLObject("sys_user").update((JSONObject)JSON.toJSON(resources),"user_id ='"+resources.getUser_id()+"'");
|
||||
WQLObject.getWQLObject("sys_user").update(JSONObject.parseObject(JSON.toJSONString(resources)),"user_id ='"+resources.getUser_id()+"'");
|
||||
// 清理缓存
|
||||
delCaches(user.getUser_id(), user.getUsername());
|
||||
}
|
||||
|
||||
@@ -62,6 +62,9 @@
|
||||
OPTION 输入.code <> ""
|
||||
code = 输入.code
|
||||
ENDOPTION
|
||||
OPTION 输入.is_used <> ""
|
||||
is_used = 输入.is_used
|
||||
ENDOPTION
|
||||
OPTION 输入.pidIsNull <> ""
|
||||
pid is null
|
||||
ENDOPTION
|
||||
|
||||
Reference in New Issue
Block a user