基础管理bug修改
This commit is contained in:
parent
922a21e1f1
commit
4bb7249749
|
|
@ -2,9 +2,14 @@ package com.bonus.digitalSignage.model;
|
||||||
|
|
||||||
import com.bonus.digitalSignage.base.entity.PageEntity;
|
import com.bonus.digitalSignage.base.entity.PageEntity;
|
||||||
import com.bonus.digitalSignage.system.vo.SelectVo;
|
import com.bonus.digitalSignage.system.vo.SelectVo;
|
||||||
|
import com.bonus.digitalSignage.utils.Excel;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -19,11 +24,13 @@ public class SysUser extends PageEntity {
|
||||||
/**
|
/**
|
||||||
* 登录名
|
* 登录名
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "登录名", sort = 1)
|
||||||
private String loginName;
|
private String loginName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "用户名", sort = 2)
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -34,11 +41,13 @@ public class SysUser extends PageEntity {
|
||||||
/**
|
/**
|
||||||
* 单位部门
|
* 单位部门
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String orgName;
|
private String orgName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色名称
|
* 角色名称
|
||||||
*/
|
*/
|
||||||
|
@Excel(name = "角色名称", sort = 4)
|
||||||
private String roleName;
|
private String roleName;
|
||||||
|
|
||||||
private String password;
|
private String password;
|
||||||
|
|
@ -94,6 +103,7 @@ public class SysUser extends PageEntity {
|
||||||
|
|
||||||
private List<Long> departs;
|
private List<Long> departs;
|
||||||
|
|
||||||
|
@Excel(name = "项目部", sort = 3)
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -117,9 +127,20 @@ public class SysUser extends PageEntity {
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
@Excel(name = "创建时间", sort = 5)
|
||||||
|
private String exportTime;
|
||||||
|
|
||||||
|
private static final SimpleDateFormat FORMATTER = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
this.exportTime = createTime != null ? FORMATTER.format(createTime) : null;
|
||||||
|
}
|
||||||
|
|
||||||
private String updatePasswordTime;
|
private String updatePasswordTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -8,16 +8,14 @@ import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.bonus.digitalSignage.annotation.DecryptAndVerify;
|
import com.bonus.digitalSignage.annotation.DecryptAndVerify;
|
||||||
|
import com.bonus.digitalSignage.basic.vo.TbProjectVo;
|
||||||
import com.bonus.digitalSignage.model.Role;
|
import com.bonus.digitalSignage.model.Role;
|
||||||
import com.bonus.digitalSignage.system.dao.UserDao;
|
import com.bonus.digitalSignage.system.dao.UserDao;
|
||||||
import com.bonus.digitalSignage.system.vo.*;
|
import com.bonus.digitalSignage.system.vo.*;
|
||||||
import com.bonus.digitalSignage.model.PasswordConfig;
|
import com.bonus.digitalSignage.model.PasswordConfig;
|
||||||
import com.bonus.digitalSignage.model.SysUser;
|
import com.bonus.digitalSignage.model.SysUser;
|
||||||
import com.bonus.digitalSignage.system.service.UserService;
|
import com.bonus.digitalSignage.system.service.UserService;
|
||||||
import com.bonus.digitalSignage.utils.ServerResponse;
|
import com.bonus.digitalSignage.utils.*;
|
||||||
import com.bonus.digitalSignage.utils.StringHelper;
|
|
||||||
import com.bonus.digitalSignage.utils.SystemUtils;
|
|
||||||
import com.bonus.digitalSignage.utils.UserUtil;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import org.apache.commons.codec.binary.Base64;
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
|
@ -31,6 +29,7 @@ import io.swagger.annotations.Api;
|
||||||
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -422,4 +421,20 @@ public class UserController {
|
||||||
}
|
}
|
||||||
return ServerResponse.createErroe("操作失败");
|
return ServerResponse.createErroe("操作失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*用户管理导出
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/tbProjectExport")
|
||||||
|
@DecryptAndVerify(decryptedClass = SysUser.class)
|
||||||
|
@LogAnnotation(operModul = "用户管理-导出", operation = "导出", operDesc = "系统级事件",operType="导出")
|
||||||
|
public void tbProjectExport(HttpServletResponse response, EncryptedReq<SysUser> data) {
|
||||||
|
List<SysUser> list = userService.list(data.getData());
|
||||||
|
ExcelUtil<SysUser> util = new ExcelUtil<>(SysUser.class);
|
||||||
|
util.exportExcel(response, list, "用户管理");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,19 +118,19 @@ function setOrgTree(data){
|
||||||
line: true, // 显示树线
|
line: true, // 显示树线
|
||||||
checkbar: false, //开启复选框
|
checkbar: false, //开启复选框
|
||||||
done: function (data, url, first) {
|
done: function (data, url, first) {
|
||||||
console.log($('#orgId').val())
|
// console.log($('#orgId').val())
|
||||||
if(first) {
|
// if(first) {
|
||||||
var params = dtree.dataInit("orgId", $('#orgId').val());
|
// var params = dtree.dataInit("orgId", $('#orgId').val());
|
||||||
var selectParam = dtree.selectVal("orgId");
|
// var selectParam = dtree.selectVal("orgId");
|
||||||
console.log(params)
|
// console.log(params)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function getOrgTree() {
|
function getOrgTree() {
|
||||||
let data = [];
|
let data = [];
|
||||||
let url = dataUrl + '/users/getOrg';
|
let url = dataUrl + '/users/getOrg';
|
||||||
ajaxRequest(url, "POST", null, true, function () {
|
ajaxRequest(url, "POST", null, false, function () {
|
||||||
}, function (result) {
|
}, function (result) {
|
||||||
if (result.code === 200) {
|
if (result.code === 200) {
|
||||||
console.log(result,"getOrgTree")
|
console.log(result,"getOrgTree")
|
||||||
|
|
@ -187,7 +187,6 @@ function setFormData(data) {
|
||||||
} else if (data.sex === 0) {
|
} else if (data.sex === 0) {
|
||||||
document.getElementById('sex_0').checked = true;
|
document.getElementById('sex_0').checked = true;
|
||||||
}
|
}
|
||||||
$('#orgId').val(data.dept)
|
|
||||||
$('#roleId').val(data.roleId)
|
$('#roleId').val(data.roleId)
|
||||||
dtree.dataInit("orgId", data.dept);
|
dtree.dataInit("orgId", data.dept);
|
||||||
dtree.selectVal("orgId");
|
dtree.selectVal("orgId");
|
||||||
|
|
|
||||||
|
|
@ -328,6 +328,37 @@ function setOrgTree(data) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exportUser(){
|
||||||
|
let obj = {
|
||||||
|
keyWord: $('#keyWord').val()
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
encryptedData: encryptCBC(JSON.stringify(obj))
|
||||||
|
}
|
||||||
|
let loadingMsg = layer.msg("数据导出中,请稍候...", {icon: 16, scrollbar: false, time: 0,});
|
||||||
|
let url = dataUrl + "/users/tbProjectExport?token=" + tokens + "&encryptedData=" + encodeURIComponent(encryptCBC(JSON.stringify(obj)));
|
||||||
|
let xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("post", url, true);
|
||||||
|
xhr.responseType = "blob"; // 转换流
|
||||||
|
xhr.setRequestHeader('Content-Type','application/json;charset=UTF-8')
|
||||||
|
xhr.onload = function () {
|
||||||
|
layer.close(loadingMsg);
|
||||||
|
if (this.status === 200) {
|
||||||
|
let blob = this.response;
|
||||||
|
var a = document.createElement("a");
|
||||||
|
var url = window.URL.createObjectURL(blob);
|
||||||
|
a.href = url;
|
||||||
|
a.download = "用户管理" + ".xlsx"; // 文件名
|
||||||
|
} else {
|
||||||
|
layer.msg("数据导出发生异常,请稍后重试", {icon: 16, scrollbar: false, time: 2000});
|
||||||
|
}
|
||||||
|
a.click();
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
};
|
||||||
|
// xhr.send(params);
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
|
|
||||||
/*下拉选表单赋值*/
|
/*下拉选表单赋值*/
|
||||||
function setSelectValue(list, selectName) {
|
function setSelectValue(list, selectName) {
|
||||||
let html = '<option value="" selected>单位部门</option>';
|
let html = '<option value="" selected>单位部门</option>';
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,11 @@
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="query(2)">重置
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="query(2)">重置
|
||||||
</button>
|
</button>
|
||||||
|
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm btn-1" style="background-color: #00377A;color: #ffffff"
|
||||||
|
onclick="exportUser()">
|
||||||
|
<div class="layout" style="justify-content: space-around;">
|
||||||
|
<p>导出</p></div>
|
||||||
|
</button>
|
||||||
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm btn-2" style="background-color: #00377A;color: #ffffff"
|
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm btn-2" style="background-color: #00377A;color: #ffffff"
|
||||||
onclick="addDataTemp(null)">
|
onclick="addDataTemp(null)">
|
||||||
<div class="layout" style="justify-content: space-around;">
|
<div class="layout" style="justify-content: space-around;">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue