更新用户表的登录用户名的字段
This commit is contained in:
@@ -1085,7 +1085,7 @@ DROP TABLE IF EXISTS `jsh_user`;
|
|||||||
CREATE TABLE `jsh_user` (
|
CREATE TABLE `jsh_user` (
|
||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
`username` varchar(255) NOT NULL COMMENT '用户姓名--例如张三',
|
`username` varchar(255) NOT NULL COMMENT '用户姓名--例如张三',
|
||||||
`loginame` varchar(255) DEFAULT NULL COMMENT '登录用户名--可能为空',
|
`login_name` varchar(255) NOT NULL COMMENT '登录用户名',
|
||||||
`password` varchar(50) DEFAULT NULL COMMENT '登陆密码',
|
`password` varchar(50) DEFAULT NULL COMMENT '登陆密码',
|
||||||
`position` varchar(200) DEFAULT NULL COMMENT '职位',
|
`position` varchar(200) DEFAULT NULL COMMENT '职位',
|
||||||
`department` varchar(255) DEFAULT NULL COMMENT '所属部门',
|
`department` varchar(255) DEFAULT NULL COMMENT '所属部门',
|
||||||
|
|||||||
@@ -750,3 +750,10 @@ alter table jsh_depothead drop column AllocationProjectId;
|
|||||||
alter table jsh_unit add basic_unit varchar(50) DEFAULT NULL COMMENT '基础单位' after UName;
|
alter table jsh_unit add basic_unit varchar(50) DEFAULT NULL COMMENT '基础单位' after UName;
|
||||||
alter table jsh_unit add other_unit varchar(50) DEFAULT NULL COMMENT '副单位' after basic_unit;
|
alter table jsh_unit add other_unit varchar(50) DEFAULT NULL COMMENT '副单位' after basic_unit;
|
||||||
alter table jsh_unit add ratio INT DEFAULT NULL COMMENT '比例' after other_unit;
|
alter table jsh_unit add ratio INT DEFAULT NULL COMMENT '比例' after other_unit;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- 时间:2020年03月31日
|
||||||
|
-- by jishenghua
|
||||||
|
-- 给用户表增加 登录用户名 字段
|
||||||
|
-- ----------------------------
|
||||||
|
alter table jsh_user change loginame login_name varchar(255) NOT NULL COMMENT '登录用户名';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author jishenghua
|
* @author jishenghua
|
||||||
* @version 2019-09-14
|
* @version 2019-09-14
|
||||||
*/
|
*/
|
||||||
$("#username, #password").on("focus blur", function () {
|
$("#loginName, #password").on("focus blur", function () {
|
||||||
var a = this;
|
var a = this;
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
var b = $(a).css("borderColor");
|
var b = $(a).css("borderColor");
|
||||||
@@ -14,10 +14,10 @@ $("#username, #password").on("focus blur", function () {
|
|||||||
}, 100)
|
}, 100)
|
||||||
}).blur();
|
}).blur();
|
||||||
|
|
||||||
var userName = localStorage.getItem("username");
|
var loginName = localStorage.getItem("loginName");
|
||||||
var password = localStorage.getItem("password");
|
var password = localStorage.getItem("password");
|
||||||
if(userName){
|
if(loginName){
|
||||||
$("#username").val(userName);
|
$("#loginName").val(loginName);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$("#rememberUserCode").parent().addClass("checked");
|
$("#rememberUserCode").parent().addClass("checked");
|
||||||
},200);
|
},200);
|
||||||
@@ -36,8 +36,8 @@ $(document).keydown(function (event) {
|
|||||||
var k = e.keyCode || e.which || e.charCode;
|
var k = e.keyCode || e.which || e.charCode;
|
||||||
//兼容 IE,firefox 兼容
|
//兼容 IE,firefox 兼容
|
||||||
var obj = e.srcElement ? e.srcElement : e.target;
|
var obj = e.srcElement ? e.srcElement : e.target;
|
||||||
//绑定键盘事件为 username 和password的输入框才可以触发键盘事件 13键盘事件
|
//绑定键盘事件为 loginName 和password的输入框才可以触发键盘事件 13键盘事件
|
||||||
if (k == "13" && (obj.id == "username" || obj.id == "password"))
|
if (k == "13" && (obj.id == "loginName" || obj.id == "password"))
|
||||||
loginFun();
|
loginFun();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -45,39 +45,38 @@ $(document).keydown(function (event) {
|
|||||||
$('#btnSubmit').off("click").on("click", function () {
|
$('#btnSubmit').off("click").on("click", function () {
|
||||||
var rememberUserCode = $("#rememberUserCode").parent().hasClass("checked");
|
var rememberUserCode = $("#rememberUserCode").parent().hasClass("checked");
|
||||||
var rememberMe = $("#rememberMe").parent().hasClass("checked");
|
var rememberMe = $("#rememberMe").parent().hasClass("checked");
|
||||||
localStorage.removeItem("username");
|
localStorage.removeItem("loginName");
|
||||||
localStorage.removeItem("password");
|
localStorage.removeItem("password");
|
||||||
if(rememberUserCode) {
|
if(rememberUserCode) {
|
||||||
localStorage.setItem("username",$("#username").val());
|
localStorage.setItem("loginName",$("#loginName").val());
|
||||||
}
|
}
|
||||||
if(rememberMe) {
|
if(rememberMe) {
|
||||||
localStorage.setItem("username",$("#username").val());
|
localStorage.setItem("loginName",$("#loginName").val());
|
||||||
localStorage.setItem("password",$("#password").val());
|
localStorage.setItem("password",$("#password").val());
|
||||||
}
|
}
|
||||||
loginFun();
|
loginFun();
|
||||||
});
|
});
|
||||||
//检测用户输入数据
|
//检测用户输入数据
|
||||||
function loginFun() {
|
function loginFun() {
|
||||||
var username = $.trim($('#username').val());
|
var loginName = $.trim($('#loginName').val());
|
||||||
var password = $.trim($('#password').val());
|
var password = $.trim($('#password').val());
|
||||||
if (null == username || 0 == username.length) {
|
if (null == loginName || 0 == loginName.length) {
|
||||||
$("#username").val("").focus();
|
$("#loginName").val("").focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null == password || 0 == password.length) {
|
if (null == password || 0 == password.length) {
|
||||||
$("#password").val("").focus();
|
$("#password").val("").focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (username != null && username.length != 0
|
if (loginName != null && loginName.length != 0
|
||||||
&& password != null && password.length != 0) {
|
&& password != null && password.length != 0) {
|
||||||
$("#username").focus();
|
$("#loginName").focus();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "post",
|
type: "post",
|
||||||
url: "/user/login",
|
url: "/user/login",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: ({
|
data: ({
|
||||||
loginName: username,
|
loginName: loginName,
|
||||||
password: hex_md5(password)
|
password: hex_md5(password)
|
||||||
}),
|
}),
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
@@ -85,7 +84,7 @@ function loginFun() {
|
|||||||
var loginInfoTip = res.data.msgTip;
|
var loginInfoTip = res.data.msgTip;
|
||||||
//用户名不存在,清空输入框并定位到用户名输入框
|
//用户名不存在,清空输入框并定位到用户名输入框
|
||||||
if (loginInfoTip.indexOf("user is not exist") != -1) {
|
if (loginInfoTip.indexOf("user is not exist") != -1) {
|
||||||
$("#username").val("").focus();
|
$("#loginName").val("").focus();
|
||||||
$("#password").val("");
|
$("#password").val("");
|
||||||
alert("用户名不存在");
|
alert("用户名不存在");
|
||||||
return;
|
return;
|
||||||
@@ -109,7 +108,7 @@ function loginFun() {
|
|||||||
if(res.data.user) {
|
if(res.data.user) {
|
||||||
var user = res.data.user;
|
var user = res.data.user;
|
||||||
sessionStorage.setItem("userId", user.id);
|
sessionStorage.setItem("userId", user.id);
|
||||||
sessionStorage.setItem("loginName", user.loginame);
|
sessionStorage.setItem("loginName", user.loginName);
|
||||||
top.location.href = "/index.html";
|
top.location.href = "/index.html";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<div class="login-box-body">
|
<div class="login-box-body">
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<span class="glyphicon glyphicon-user form-control-feedback" title="登录账号"></span>
|
<span class="glyphicon glyphicon-user form-control-feedback" title="登录账号"></span>
|
||||||
<input type="text" id="username" name="username" class="form-control required"
|
<input type="text" id="loginName" name="loginName" class="form-control required"
|
||||||
data-msg-required="请填写登录账号." placeholder="登录账号"/>
|
data-msg-required="请填写登录账号." placeholder="登录账号"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">登录名称:</label>
|
<label class="control-label">登录名称:</label>
|
||||||
<div class="control-inline">
|
<div class="control-inline">
|
||||||
<input type="text" id="searchLoginame" name="searchLoginame" value="" maxlength="100" class="easyui-textbox width-90"/>
|
<input type="text" id="searchLoginName" name="searchLoginName" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -51,24 +51,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>登录名称</td>
|
<td>登录名称</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
<input name="loginame" id="loginame" class="easyui-textbox"
|
<input name="loginName" id="loginName" class="easyui-textbox"
|
||||||
data-options="required:true,validType:'length[2,15]'" style="width: 120px;"/>
|
data-options="required:true,validType:'length[2,15]'" style="width: 120px;"/>
|
||||||
初始密码:123456
|
初始密码:123456
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>部门</td>
|
|
||||||
<td style="padding:5px">
|
|
||||||
<input name="orgAbr" id="orgAbr" class="easyui-textbox" style="width: 120px;"/>
|
|
||||||
<a href="javascript:void(0)" class="l-btn l-btn-plain" group="" id="lookForSelectOrganization">
|
|
||||||
<span class="l-btn-left"><span class="l-btn-text icon-search l-btn-icon-left" style="height:20px;"></span></span></a>
|
|
||||||
<input name="orgaId" id="orgaId" type="hidden"/>
|
|
||||||
<input name="selectType" id="selectType" type="hidden"/>
|
|
||||||
<input name="orgaUserRelId" id="orgaUserRelId" type="hidden"/>
|
|
||||||
<!--一个兼容input框,没有实际用处,但是必须存在-->
|
|
||||||
<input name="id" id="id" type="hidden"/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
用户姓名
|
用户姓名
|
||||||
@@ -78,6 +65,19 @@
|
|||||||
data-options="required:true,validType:'length[2,30]'" style="width: 230px;"/>
|
data-options="required:true,validType:'length[2,30]'" style="width: 230px;"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>部门</td>
|
||||||
|
<td style="padding:5px">
|
||||||
|
<input name="orgAbr" id="orgAbr" class="easyui-textbox" readonly style="width: 120px;"/>
|
||||||
|
<a href="javascript:void(0)" class="l-btn l-btn-plain" group="" id="lookForSelectOrganization">
|
||||||
|
<span class="l-btn-left"><span class="l-btn-text icon-search l-btn-icon-left" style="height:20px;"></span></span></a>
|
||||||
|
<input name="orgaId" id="orgaId" type="hidden"/>
|
||||||
|
<input name="selectType" id="selectType" type="hidden"/>
|
||||||
|
<input name="orgaUserRelId" id="orgaUserRelId" type="hidden"/>
|
||||||
|
<!--一个兼容input框,没有实际用处,但是必须存在-->
|
||||||
|
<input name="id" id="id" type="hidden"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
职位
|
职位
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{title: '登录名称', field: 'loginame', width: 80},
|
{title: '登录名称', field: 'loginName', width: 80},
|
||||||
{title: '用户姓名', field: 'username', width: 80, align: "center"},
|
{title: '用户姓名', field: 'username', width: 80, align: "center"},
|
||||||
{title: '职位', field: 'position', width: 115, align: "center"},
|
{title: '职位', field: 'position', width: 115, align: "center"},
|
||||||
{title: '部门', field: 'orgAbr', width: 115, align: "center"},
|
{title: '部门', field: 'orgAbr', width: 115, align: "center"},
|
||||||
@@ -237,7 +237,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//搜索按钮添加快捷键
|
//搜索按钮添加快捷键
|
||||||
if (k == "13" && (obj.id == "searchUsername" || obj.id == "searchLoginame" || obj.id == "searchPhonenum"
|
if (k == "13" && (obj.id == "searchUsername" || obj.id == "searchLoginName" || obj.id == "searchPhonenum"
|
||||||
|| obj.id == "searchPosition" || obj.id == "searchEmail" || obj.id == "searchDesc" || obj.id == "searchDept")) {
|
|| obj.id == "searchPosition" || obj.id == "searchEmail" || obj.id == "searchDesc" || obj.id == "searchDept")) {
|
||||||
$("#searchBtn").click();
|
$("#searchBtn").click();
|
||||||
}
|
}
|
||||||
@@ -352,8 +352,6 @@
|
|||||||
//增加用户
|
//增加用户
|
||||||
var url;
|
var url;
|
||||||
var userID = 0;
|
var userID = 0;
|
||||||
//保存编辑前的名称
|
|
||||||
var oldLoginName = "";
|
|
||||||
|
|
||||||
function addUser() {
|
function addUser() {
|
||||||
if(checkPower()){
|
if(checkPower()){
|
||||||
@@ -366,7 +364,6 @@
|
|||||||
$('#usernameFM').form('load', row);
|
$('#usernameFM').form('load', row);
|
||||||
$("#username").focus();
|
$("#username").focus();
|
||||||
$("#loginame").removeAttr("readonly");
|
$("#loginame").removeAttr("readonly");
|
||||||
oldLoginName = "";
|
|
||||||
userID = 0;
|
userID = 0;
|
||||||
/**机构选择*/
|
/**机构选择*/
|
||||||
$("#selectType").val("org");
|
$("#selectType").val("org");
|
||||||
@@ -401,40 +398,45 @@
|
|||||||
|
|
||||||
//保存用户信息
|
//保存用户信息
|
||||||
$("#saveusername").off("click").on("click", function () {
|
$("#saveusername").off("click").on("click", function () {
|
||||||
/**
|
if(!$('#usernameFM').form('validate')){
|
||||||
* 2019-03-12
|
|
||||||
* 此处用户名和登录名是否重复的校验在保存操作时处理
|
|
||||||
* */
|
|
||||||
var reg = /^([0-9])+$/;
|
|
||||||
var phonenum = $.trim($("#phonenum").val());
|
|
||||||
if (phonenum.length > 0 && !reg.test(phonenum)) {
|
|
||||||
$.messager.alert('提示', '电话号码只能是数字', 'info');
|
|
||||||
$("#phonenum").val("").focus();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$.ajax({
|
else {
|
||||||
url: url,
|
/**
|
||||||
type: "post",
|
* 2019-03-12
|
||||||
dataType: "json",
|
* 此处用户名和登录名是否重复的校验在保存操作时处理
|
||||||
data: {
|
* */
|
||||||
info: JSON.stringify($("#usernameFM").serializeObject())
|
var reg = /^([0-9])+$/;
|
||||||
},
|
var phonenum = $.trim($("#phonenum").val());
|
||||||
success: function(res) {
|
if (phonenum.length > 0 && !reg.test(phonenum)) {
|
||||||
if(res && res.code != 200) {
|
$.messager.alert('提示', '电话号码只能是数字', 'info');
|
||||||
$.messager.alert('提示', res.msg, 'error');
|
$("#phonenum").val("").focus();
|
||||||
return;
|
|
||||||
}
|
|
||||||
$('#userDlg').dialog('close');
|
|
||||||
//加载完以后重新初始化
|
|
||||||
var opts = $("#tableData").datagrid('options');
|
|
||||||
showUserDetails(opts.pageNumber, opts.pageSize);
|
|
||||||
},
|
|
||||||
//此处添加错误处理
|
|
||||||
error: function () {
|
|
||||||
$.messager.alert('提示', '网络异常,请稍后再试!', 'error');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: "post",
|
||||||
|
dataType: "json",
|
||||||
|
data: {
|
||||||
|
info: JSON.stringify($("#usernameFM").serializeObject())
|
||||||
|
},
|
||||||
|
success: function (res) {
|
||||||
|
if (res && res.code != 200) {
|
||||||
|
$.messager.alert('提示', res.msg, 'error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$('#userDlg').dialog('close');
|
||||||
|
//加载完以后重新初始化
|
||||||
|
var opts = $("#tableData").datagrid('options');
|
||||||
|
showUserDetails(opts.pageNumber, opts.pageSize);
|
||||||
|
},
|
||||||
|
//此处添加错误处理
|
||||||
|
error: function () {
|
||||||
|
$.messager.alert('提示', '网络异常,请稍后再试!', 'error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//编辑用户信息
|
//编辑用户信息
|
||||||
@@ -442,7 +444,7 @@
|
|||||||
var rowsdata = $("#tableData").datagrid("getRows")[index];
|
var rowsdata = $("#tableData").datagrid("getRows")[index];
|
||||||
var row = {
|
var row = {
|
||||||
username: rowsdata.username,
|
username: rowsdata.username,
|
||||||
loginame: rowsdata.loginame,
|
loginName: rowsdata.loginName,
|
||||||
position: rowsdata.position,
|
position: rowsdata.position,
|
||||||
email: rowsdata.email,
|
email: rowsdata.email,
|
||||||
phonenum: rowsdata.phonenum,
|
phonenum: rowsdata.phonenum,
|
||||||
@@ -452,14 +454,13 @@
|
|||||||
orgaUserRelId: rowsdata.orgaUserRelId,
|
orgaUserRelId: rowsdata.orgaUserRelId,
|
||||||
userBlngOrgaDsplSeq: rowsdata.userBlngOrgaDsplSeq
|
userBlngOrgaDsplSeq: rowsdata.userBlngOrgaDsplSeq
|
||||||
};
|
};
|
||||||
oldLoginName = rowsdata.username;
|
|
||||||
$('#userDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/pencil.png"/> 编辑用户信息');
|
$('#userDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/pencil.png"/> 编辑用户信息');
|
||||||
$(".window-mask").css({width: webW, height: webH});
|
$(".window-mask").css({width: webW, height: webH});
|
||||||
$('#usernameFM').form('load', row);
|
$('#usernameFM').form('load', row);
|
||||||
userID = rowsdata.id;
|
userID = rowsdata.id;
|
||||||
//焦点在名称输入框==定焦在输入文字后面
|
//焦点在名称输入框==定焦在输入文字后面
|
||||||
$("#username").val("").focus().val(rowsdata.username);
|
$("#username").val("").focus().val(rowsdata.username);
|
||||||
$("#loginame").attr("readonly","readonly");
|
$("#loginName").attr("readonly","readonly");
|
||||||
/**机构选择*/
|
/**机构选择*/
|
||||||
$("#selectType").val("org");
|
$("#selectType").val("org");
|
||||||
url = '/user/updateUser?id=' + rowsdata.id;
|
url = '/user/updateUser?id=' + rowsdata.id;
|
||||||
@@ -484,7 +485,7 @@
|
|||||||
|
|
||||||
function showUserDetails(pageNo, pageSize) {
|
function showUserDetails(pageNo, pageSize) {
|
||||||
var userName = $.trim($("#searchUsername").val());
|
var userName = $.trim($("#searchUsername").val());
|
||||||
var loginName = $.trim($("#searchLoginame").val());
|
var loginName = $.trim($("#searchLoginName").val());
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "get",
|
type: "get",
|
||||||
url: "/user/getUserList",
|
url: "/user/getUserList",
|
||||||
@@ -516,7 +517,7 @@
|
|||||||
$("#searchResetBtn").unbind().bind({
|
$("#searchResetBtn").unbind().bind({
|
||||||
click: function () {
|
click: function () {
|
||||||
$("#searchUsername").textbox("setValue","");
|
$("#searchUsername").textbox("setValue","");
|
||||||
$("#searchLoginame").textbox("setValue","");
|
$("#searchLoginName").textbox("setValue","");
|
||||||
$("#searchPhonenum").textbox("setValue","");
|
$("#searchPhonenum").textbox("setValue","");
|
||||||
$("#searchPosition").textbox("setValue","");
|
$("#searchPosition").textbox("setValue","");
|
||||||
$("#searchDept").textbox("setValue","");
|
$("#searchDept").textbox("setValue","");
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
<div class="register-box-body">
|
<div class="register-box-body">
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<span class="glyphicon glyphicon-user form-control-feedback" title="登录账户"></span>
|
<span class="glyphicon glyphicon-user form-control-feedback" title="登录账户"></span>
|
||||||
<input type="text" id="username" name="username" class="form-control required"
|
<input type="text" id="loginName" name="loginName" class="form-control required"
|
||||||
data-msg-required="请填写登录账号." placeholder="登录账户(请输入手机号码)"/>
|
data-msg-required="请填写登录账号." placeholder="登录账户(请输入手机号码)"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
</body>
|
</body>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$("#username, #password, #confirmPassword").on("focus blur", function () {
|
$("#loginName, #password, #confirmPassword").on("focus blur", function () {
|
||||||
var a = this;
|
var a = this;
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
var b = $(a).css("borderColor");
|
var b = $(a).css("borderColor");
|
||||||
@@ -121,10 +121,10 @@
|
|||||||
if($("#validCode").val()) {
|
if($("#validCode").val()) {
|
||||||
var res = verifyCode.validate($("#validCode").val());
|
var res = verifyCode.validate($("#validCode").val());
|
||||||
if(res){
|
if(res){
|
||||||
var userName = $("#username");
|
var loginName = $("#loginName");
|
||||||
if(!userName.val()) {
|
if(!loginName.val()) {
|
||||||
alert("登录账户不能为空!");
|
alert("登录账户不能为空!");
|
||||||
} else if(!isPhoneAvailable(userName)) {
|
} else if(!isPhoneAvailable(loginName)) {
|
||||||
alert("请输入正确的手机号码!");
|
alert("请输入正确的手机号码!");
|
||||||
} else if(!$("#password").val()) {
|
} else if(!$("#password").val()) {
|
||||||
alert("登录密码不能为空!");
|
alert("登录密码不能为空!");
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
url: "/user/registerUser",
|
url: "/user/registerUser",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: ({
|
data: ({
|
||||||
loginame: $("#username").val(),
|
loginName: $("#loginName").val(),
|
||||||
password: $("#password").val()
|
password: $("#password").val()
|
||||||
}),
|
}),
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class TenantConfig {
|
|||||||
Object userInfo = request.getSession().getAttribute("user");
|
Object userInfo = request.getSession().getAttribute("user");
|
||||||
if(userInfo != null) {
|
if(userInfo != null) {
|
||||||
User user = (User) userInfo;
|
User user = (User) userInfo;
|
||||||
loginName = user.getLoginame();
|
loginName = user.getLoginName();
|
||||||
}
|
}
|
||||||
if(("admin").equals(loginName)) {
|
if(("admin").equals(loginName)) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ public class FunctionsController {
|
|||||||
Object userInfo = request.getSession().getAttribute("user");
|
Object userInfo = request.getSession().getAttribute("user");
|
||||||
if(userInfo != null) {
|
if(userInfo != null) {
|
||||||
User user = (User) userInfo;
|
User user = (User) userInfo;
|
||||||
loginName = user.getLoginame();
|
loginName = user.getLoginName();
|
||||||
}
|
}
|
||||||
if(("admin").equals(loginName)) {
|
if(("admin").equals(loginName)) {
|
||||||
dataList.add(fun);
|
dataList.add(fun);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class UserController {
|
|||||||
User user=null;
|
User user=null;
|
||||||
BaseResponseInfo res = new BaseResponseInfo();
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
try {
|
try {
|
||||||
String username = loginName.trim();
|
loginName = loginName.trim();
|
||||||
password = password.trim();
|
password = password.trim();
|
||||||
//判断用户是否已经登录过,登录过不再处理
|
//判断用户是否已经登录过,登录过不再处理
|
||||||
Object userInfo = request.getSession().getAttribute("user");
|
Object userInfo = request.getSession().getAttribute("user");
|
||||||
@@ -75,18 +75,18 @@ public class UserController {
|
|||||||
if (userInfo != null) {
|
if (userInfo != null) {
|
||||||
sessionUser = (User) userInfo;
|
sessionUser = (User) userInfo;
|
||||||
}
|
}
|
||||||
if (sessionUser != null && username.equalsIgnoreCase(sessionUser.getLoginame())) {
|
if (sessionUser != null && loginName.equalsIgnoreCase(sessionUser.getLoginName())) {
|
||||||
logger.info("====用户 " + username + "已经登录过, login 方法调用结束====");
|
logger.info("====用户 " + loginName + "已经登录过, login 方法调用结束====");
|
||||||
msgTip = "user already login";
|
msgTip = "user already login";
|
||||||
}
|
}
|
||||||
//获取用户状态
|
//获取用户状态
|
||||||
int userStatus = -1;
|
int userStatus = -1;
|
||||||
try {
|
try {
|
||||||
request.getSession().removeAttribute("tenantId");
|
request.getSession().removeAttribute("tenantId");
|
||||||
userStatus = userService.validateUser(username, password);
|
userStatus = userService.validateUser(loginName, password);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error(">>>>>>>>>>>>>用户 " + username + " 登录 login 方法 访问服务层异常====", e);
|
logger.error(">>>>>>>>>>>>>用户 " + loginName + " 登录 login 方法 访问服务层异常====", e);
|
||||||
msgTip = "access service exception";
|
msgTip = "access service exception";
|
||||||
}
|
}
|
||||||
switch (userStatus) {
|
switch (userStatus) {
|
||||||
@@ -106,7 +106,7 @@ public class UserController {
|
|||||||
try {
|
try {
|
||||||
msgTip = "user can login";
|
msgTip = "user can login";
|
||||||
//验证通过 ,可以登录,放入session,记录登录日志
|
//验证通过 ,可以登录,放入session,记录登录日志
|
||||||
user = userService.getUserByUserName(username);
|
user = userService.getUserByLoginName(loginName);
|
||||||
request.getSession().setAttribute("user",user);
|
request.getSession().setAttribute("user",user);
|
||||||
if(user.getTenantId()!=null) {
|
if(user.getTenantId()!=null) {
|
||||||
Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId());
|
Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId());
|
||||||
@@ -126,7 +126,7 @@ public class UserController {
|
|||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error(">>>>>>>>>>>>>>>查询用户名为:" + username + " ,用户信息异常", e);
|
logger.error(">>>>>>>>>>>>>>>查询用户名为:" + loginName + " ,用户信息异常", e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ public class UserController {
|
|||||||
String oldPassword = Tools.md5Encryp(oldpwd);
|
String oldPassword = Tools.md5Encryp(oldpwd);
|
||||||
String md5Pwd = Tools.md5Encryp(password);
|
String md5Pwd = Tools.md5Encryp(password);
|
||||||
//必须和原始密码一致才可以更新密码
|
//必须和原始密码一致才可以更新密码
|
||||||
if(user.getLoginame().equals("jsh")){
|
if(user.getLoginName().equals("jsh")){
|
||||||
flag = 3; //管理员jsh不能修改密码
|
flag = 3; //管理员jsh不能修改密码
|
||||||
} else if (oldPassword.equalsIgnoreCase(user.getPassword())) {
|
} else if (oldPassword.equalsIgnoreCase(user.getPassword())) {
|
||||||
user.setPassword(md5Pwd);
|
user.setPassword(md5Pwd);
|
||||||
@@ -330,19 +330,19 @@ public class UserController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册用户
|
* 注册用户
|
||||||
* @param loginame
|
* @param loginName
|
||||||
* @param password
|
* @param password
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/registerUser")
|
@PostMapping(value = "/registerUser")
|
||||||
public Object registerUser(@RequestParam(value = "loginame", required = false) String loginame,
|
public Object registerUser(@RequestParam(value = "loginName", required = false) String loginName,
|
||||||
@RequestParam(value = "password", required = false) String password,
|
@RequestParam(value = "password", required = false) String password,
|
||||||
HttpServletRequest request)throws Exception{
|
HttpServletRequest request)throws Exception{
|
||||||
JSONObject result = ExceptionConstants.standardSuccess();
|
JSONObject result = ExceptionConstants.standardSuccess();
|
||||||
UserEx ue= new UserEx();
|
UserEx ue= new UserEx();
|
||||||
ue.setUsername(loginame);
|
ue.setUsername(loginName);
|
||||||
ue.setLoginame(loginame);
|
ue.setLoginName(loginName);
|
||||||
ue.setPassword(password);
|
ue.setPassword(password);
|
||||||
userService.checkUserNameAndLoginName(ue); //检查用户名和登录名
|
userService.checkUserNameAndLoginName(ue); //检查用户名和登录名
|
||||||
ue = userService.registerUser(ue,manageRoleId,request);
|
ue = userService.registerUser(ue,manageRoleId,request);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ public class User {
|
|||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
private String loginame;
|
private String loginName;
|
||||||
|
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
@@ -45,12 +45,12 @@ public class User {
|
|||||||
this.username = username == null ? null : username.trim();
|
this.username = username == null ? null : username.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLoginame() {
|
public String getLoginName() {
|
||||||
return loginame;
|
return loginName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLoginame(String loginame) {
|
public void setLoginName(String loginName) {
|
||||||
this.loginame = loginame == null ? null : loginame.trim();
|
this.loginName = loginName == null ? null : loginName.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPassword() {
|
public String getPassword() {
|
||||||
|
|||||||
@@ -234,73 +234,73 @@ public class UserExample {
|
|||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameIsNull() {
|
public Criteria andLoginNameIsNull() {
|
||||||
addCriterion("loginame is null");
|
addCriterion("login_name is null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameIsNotNull() {
|
public Criteria andLoginNameIsNotNull() {
|
||||||
addCriterion("loginame is not null");
|
addCriterion("login_name is not null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameEqualTo(String value) {
|
public Criteria andLoginNameEqualTo(String value) {
|
||||||
addCriterion("loginame =", value, "loginame");
|
addCriterion("login_name =", value, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameNotEqualTo(String value) {
|
public Criteria andLoginNameNotEqualTo(String value) {
|
||||||
addCriterion("loginame <>", value, "loginame");
|
addCriterion("login_name <>", value, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameGreaterThan(String value) {
|
public Criteria andLoginNameGreaterThan(String value) {
|
||||||
addCriterion("loginame >", value, "loginame");
|
addCriterion("login_name >", value, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameGreaterThanOrEqualTo(String value) {
|
public Criteria andLoginNameGreaterThanOrEqualTo(String value) {
|
||||||
addCriterion("loginame >=", value, "loginame");
|
addCriterion("login_name >=", value, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameLessThan(String value) {
|
public Criteria andLoginNameLessThan(String value) {
|
||||||
addCriterion("loginame <", value, "loginame");
|
addCriterion("login_name <", value, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameLessThanOrEqualTo(String value) {
|
public Criteria andLoginNameLessThanOrEqualTo(String value) {
|
||||||
addCriterion("loginame <=", value, "loginame");
|
addCriterion("login_name <=", value, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameLike(String value) {
|
public Criteria andLoginNameLike(String value) {
|
||||||
addCriterion("loginame like", value, "loginame");
|
addCriterion("login_name like", value, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameNotLike(String value) {
|
public Criteria andLoginNameNotLike(String value) {
|
||||||
addCriterion("loginame not like", value, "loginame");
|
addCriterion("login_name not like", value, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameIn(List<String> values) {
|
public Criteria andLoginNameIn(List<String> values) {
|
||||||
addCriterion("loginame in", values, "loginame");
|
addCriterion("login_name in", values, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameNotIn(List<String> values) {
|
public Criteria andLoginNameNotIn(List<String> values) {
|
||||||
addCriterion("loginame not in", values, "loginame");
|
addCriterion("login_name not in", values, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameBetween(String value1, String value2) {
|
public Criteria andLoginNameBetween(String value1, String value2) {
|
||||||
addCriterion("loginame between", value1, value2, "loginame");
|
addCriterion("login_name between", value1, value2, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andLoginameNotBetween(String value1, String value2) {
|
public Criteria andLoginNameNotBetween(String value1, String value2) {
|
||||||
addCriterion("loginame not between", value1, value2, "loginame");
|
addCriterion("login_name not between", value1, value2, "loginName");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public interface UserMapperEx {
|
|||||||
List<UserEx> getUserList(Map<String, Object> parameterMap);
|
List<UserEx> getUserList(Map<String, Object> parameterMap);
|
||||||
|
|
||||||
List<User> getUserListByUserNameOrLoginName(@Param("userName") String userName,
|
List<User> getUserListByUserNameOrLoginName(@Param("userName") String userName,
|
||||||
@Param("loginame") String loginame);
|
@Param("loginName") String loginName);
|
||||||
|
|
||||||
int batDeleteOrUpdateUser(@Param("ids") String ids[], @Param("status") byte status);
|
int batDeleteOrUpdateUser(@Param("ids") String ids[], @Param("status") byte status);
|
||||||
|
|
||||||
|
|||||||
@@ -155,8 +155,8 @@ public class MaterialExtendService {
|
|||||||
materialExtend.setDeleteFlag(BusinessConstants.DELETE_FLAG_EXISTS);
|
materialExtend.setDeleteFlag(BusinessConstants.DELETE_FLAG_EXISTS);
|
||||||
materialExtend.setCreateTime(new Date());
|
materialExtend.setCreateTime(new Date());
|
||||||
materialExtend.setUpdateTime(new Date().getTime());
|
materialExtend.setUpdateTime(new Date().getTime());
|
||||||
materialExtend.setCreateSerial(user.getLoginame());
|
materialExtend.setCreateSerial(user.getLoginName());
|
||||||
materialExtend.setUpdateSerial(user.getLoginame());
|
materialExtend.setUpdateSerial(user.getLoginName());
|
||||||
int result =0;
|
int result =0;
|
||||||
try{
|
try{
|
||||||
result= materialExtendMapper.insertSelective(materialExtend);
|
result= materialExtendMapper.insertSelective(materialExtend);
|
||||||
@@ -170,7 +170,7 @@ public class MaterialExtendService {
|
|||||||
public int updateMaterialExtend(MaterialExtend MaterialExtend, HttpServletRequest request) throws Exception{
|
public int updateMaterialExtend(MaterialExtend MaterialExtend, HttpServletRequest request) throws Exception{
|
||||||
User user = userService.getCurrentUser();
|
User user = userService.getCurrentUser();
|
||||||
MaterialExtend.setUpdateTime(new Date().getTime());
|
MaterialExtend.setUpdateTime(new Date().getTime());
|
||||||
MaterialExtend.setUpdateSerial(user.getLoginame());
|
MaterialExtend.setUpdateSerial(user.getLoginName());
|
||||||
int res =0;
|
int res =0;
|
||||||
try{
|
try{
|
||||||
res= materialExtendMapper.updateByPrimaryKeySelective(MaterialExtend);
|
res= materialExtendMapper.updateByPrimaryKeySelective(MaterialExtend);
|
||||||
@@ -205,7 +205,7 @@ public class MaterialExtendService {
|
|||||||
Object userInfo = request.getSession().getAttribute("user");
|
Object userInfo = request.getSession().getAttribute("user");
|
||||||
User user = (User)userInfo;
|
User user = (User)userInfo;
|
||||||
materialExtend.setUpdateTime(new Date().getTime());
|
materialExtend.setUpdateTime(new Date().getTime());
|
||||||
materialExtend.setUpdateSerial(user.getLoginame());
|
materialExtend.setUpdateSerial(user.getLoginName());
|
||||||
try{
|
try{
|
||||||
result= materialExtendMapper.updateByPrimaryKeySelective(materialExtend);
|
result= materialExtendMapper.updateByPrimaryKeySelective(materialExtend);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
|||||||
@@ -224,12 +224,12 @@ public class UserService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int validateUser(String username, String password) throws Exception {
|
public int validateUser(String loginName, String password) throws Exception {
|
||||||
/**默认是可以登录的*/
|
/**默认是可以登录的*/
|
||||||
List<User> list = null;
|
List<User> list = null;
|
||||||
try {
|
try {
|
||||||
UserExample example = new UserExample();
|
UserExample example = new UserExample();
|
||||||
example.createCriteria().andLoginameEqualTo(username).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
|
example.createCriteria().andLoginNameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
|
||||||
list = userMapper.selectByExample(example);
|
list = userMapper.selectByExample(example);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(">>>>>>>>访问验证用户姓名是否存在后台信息异常", e);
|
logger.error(">>>>>>>>访问验证用户姓名是否存在后台信息异常", e);
|
||||||
@@ -242,7 +242,7 @@ public class UserService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
UserExample example = new UserExample();
|
UserExample example = new UserExample();
|
||||||
example.createCriteria().andLoginameEqualTo(username).andPasswordEqualTo(password)
|
example.createCriteria().andLoginNameEqualTo(loginName).andPasswordEqualTo(password)
|
||||||
.andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
|
.andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
|
||||||
list = userMapper.selectByExample(example);
|
list = userMapper.selectByExample(example);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -256,9 +256,9 @@ public class UserService {
|
|||||||
return ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT;
|
return ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public User getUserByUserName(String username)throws Exception {
|
public User getUserByLoginName(String loginName)throws Exception {
|
||||||
UserExample example = new UserExample();
|
UserExample example = new UserExample();
|
||||||
example.createCriteria().andLoginameEqualTo(username).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
|
example.createCriteria().andLoginNameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
|
||||||
List<User> list=null;
|
List<User> list=null;
|
||||||
try{
|
try{
|
||||||
list= userMapper.selectByExample(example);
|
list= userMapper.selectByExample(example);
|
||||||
@@ -277,7 +277,7 @@ public class UserService {
|
|||||||
List <Byte> userStatus=new ArrayList<Byte>();
|
List <Byte> userStatus=new ArrayList<Byte>();
|
||||||
userStatus.add(BusinessConstants.USER_STATUS_DELETE);
|
userStatus.add(BusinessConstants.USER_STATUS_DELETE);
|
||||||
userStatus.add(BusinessConstants.USER_STATUS_BANNED);
|
userStatus.add(BusinessConstants.USER_STATUS_BANNED);
|
||||||
example.createCriteria().andIdNotEqualTo(id).andLoginameEqualTo(name).andStatusNotIn(userStatus);
|
example.createCriteria().andIdNotEqualTo(id).andLoginNameEqualTo(name).andStatusNotIn(userStatus);
|
||||||
List<User> list=null;
|
List<User> list=null;
|
||||||
try{
|
try{
|
||||||
list= userMapper.selectByExample(example);
|
list= userMapper.selectByExample(example);
|
||||||
@@ -317,7 +317,7 @@ public class UserService {
|
|||||||
public Long getIdByLoginName(String loginName) {
|
public Long getIdByLoginName(String loginName) {
|
||||||
Long userId = 0L;
|
Long userId = 0L;
|
||||||
UserExample example = new UserExample();
|
UserExample example = new UserExample();
|
||||||
example.createCriteria().andLoginameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
|
example.createCriteria().andLoginNameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL);
|
||||||
List<User> list = userMapper.selectByExample(example);
|
List<User> list = userMapper.selectByExample(example);
|
||||||
if(list!=null) {
|
if(list!=null) {
|
||||||
userId = list.get(0).getId();
|
userId = list.get(0).getId();
|
||||||
@@ -327,7 +327,7 @@ public class UserService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public void addUserAndOrgUserRel(UserEx ue) throws Exception{
|
public void addUserAndOrgUserRel(UserEx ue) throws Exception{
|
||||||
if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginame())) {
|
if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) {
|
||||||
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
|
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
|
||||||
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
|
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
|
||||||
} else {
|
} else {
|
||||||
@@ -353,7 +353,7 @@ public class UserService {
|
|||||||
//机构id
|
//机构id
|
||||||
oul.setOrgaId(ue.getOrgaId());
|
oul.setOrgaId(ue.getOrgaId());
|
||||||
//用户id,根据用户名查询id
|
//用户id,根据用户名查询id
|
||||||
Long userId = getIdByLoginName(ue.getLoginame());
|
Long userId = getIdByLoginName(ue.getLoginName());
|
||||||
oul.setUserId(userId);
|
oul.setUserId(userId);
|
||||||
//用户在机构中的排序
|
//用户在机构中的排序
|
||||||
oul.setUserBlngOrgaDsplSeq(ue.getUserBlngOrgaDsplSeq());
|
oul.setUserBlngOrgaDsplSeq(ue.getUserBlngOrgaDsplSeq());
|
||||||
@@ -403,7 +403,7 @@ public class UserService {
|
|||||||
* description:
|
* description:
|
||||||
* 多次创建事务,事物之间无法协同,应该在入口处创建一个事务以做协调
|
* 多次创建事务,事物之间无法协同,应该在入口处创建一个事务以做协调
|
||||||
*/
|
*/
|
||||||
if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginame())) {
|
if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) {
|
||||||
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
|
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
|
||||||
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
|
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
|
||||||
} else {
|
} else {
|
||||||
@@ -416,7 +416,7 @@ public class UserService {
|
|||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result= userMapper.insertSelective(ue);
|
result= userMapper.insertSelective(ue);
|
||||||
Long userId = getIdByLoginName(ue.getLoginame());
|
Long userId = getIdByLoginName(ue.getLoginName());
|
||||||
ue.setId(userId);
|
ue.setId(userId);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
@@ -437,7 +437,7 @@ public class UserService {
|
|||||||
//创建租户信息
|
//创建租户信息
|
||||||
JSONObject tenantObj = new JSONObject();
|
JSONObject tenantObj = new JSONObject();
|
||||||
tenantObj.put("tenantId", ue.getId());
|
tenantObj.put("tenantId", ue.getId());
|
||||||
tenantObj.put("loginName",ue.getLoginame());
|
tenantObj.put("loginName",ue.getLoginName());
|
||||||
String param = tenantObj.toJSONString();
|
String param = tenantObj.toJSONString();
|
||||||
tenantService.insertTenant(param, request);
|
tenantService.insertTenant(param, request);
|
||||||
logger.info("===============创建租户信息完成===============");
|
logger.info("===============创建租户信息完成===============");
|
||||||
@@ -461,7 +461,7 @@ public class UserService {
|
|||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public void updateUserAndOrgUserRel(UserEx ue) throws Exception{
|
public void updateUserAndOrgUserRel(UserEx ue) throws Exception{
|
||||||
if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginame())) {
|
if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) {
|
||||||
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
|
throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE,
|
||||||
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
|
ExceptionConstants.USER_NAME_LIMIT_USE_MSG);
|
||||||
} else {
|
} else {
|
||||||
@@ -535,8 +535,8 @@ public class UserService {
|
|||||||
}
|
}
|
||||||
Long userId=userEx.getId();
|
Long userId=userEx.getId();
|
||||||
//检查登录名
|
//检查登录名
|
||||||
if(!StringUtils.isEmpty(userEx.getLoginame())){
|
if(!StringUtils.isEmpty(userEx.getLoginName())){
|
||||||
String loginName=userEx.getLoginame();
|
String loginName=userEx.getLoginName();
|
||||||
list=this.getUserListByloginName(loginName);
|
list=this.getUserListByloginName(loginName);
|
||||||
if(list!=null&&list.size()>0){
|
if(list!=null&&list.size()>0){
|
||||||
if(list.size()>1){
|
if(list.size()>1){
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.User">
|
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.User">
|
||||||
<id column="id" jdbcType="BIGINT" property="id" />
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
<result column="username" jdbcType="VARCHAR" property="username" />
|
<result column="username" jdbcType="VARCHAR" property="username" />
|
||||||
<result column="loginame" jdbcType="VARCHAR" property="loginame" />
|
<result column="login_name" jdbcType="VARCHAR" property="loginName" />
|
||||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||||
<result column="position" jdbcType="VARCHAR" property="position" />
|
<result column="position" jdbcType="VARCHAR" property="position" />
|
||||||
<result column="department" jdbcType="VARCHAR" property="department" />
|
<result column="department" jdbcType="VARCHAR" property="department" />
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, username, loginame, password, position, department, email, phonenum, ismanager,
|
id, username, login_name, password, position, department, email, phonenum, ismanager,
|
||||||
isystem, Status, description, remark, tenant_id
|
isystem, Status, description, remark, tenant_id
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.UserExample" resultMap="BaseResultMap">
|
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.UserExample" resultMap="BaseResultMap">
|
||||||
@@ -110,12 +110,12 @@
|
|||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.User">
|
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.User">
|
||||||
insert into jsh_user (id, username, loginame,
|
insert into jsh_user (id, username, login_name,
|
||||||
password, position, department,
|
password, position, department,
|
||||||
email, phonenum, ismanager,
|
email, phonenum, ismanager,
|
||||||
isystem, Status, description,
|
isystem, Status, description,
|
||||||
remark, tenant_id)
|
remark, tenant_id)
|
||||||
values (#{id,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, #{loginame,jdbcType=VARCHAR},
|
values (#{id,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
|
||||||
#{password,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR},
|
#{password,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR},
|
||||||
#{email,jdbcType=VARCHAR}, #{phonenum,jdbcType=VARCHAR}, #{ismanager,jdbcType=TINYINT},
|
#{email,jdbcType=VARCHAR}, #{phonenum,jdbcType=VARCHAR}, #{ismanager,jdbcType=TINYINT},
|
||||||
#{isystem,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, #{description,jdbcType=VARCHAR},
|
#{isystem,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, #{description,jdbcType=VARCHAR},
|
||||||
@@ -130,8 +130,8 @@
|
|||||||
<if test="username != null">
|
<if test="username != null">
|
||||||
username,
|
username,
|
||||||
</if>
|
</if>
|
||||||
<if test="loginame != null">
|
<if test="loginName != null">
|
||||||
loginame,
|
login_name,
|
||||||
</if>
|
</if>
|
||||||
<if test="password != null">
|
<if test="password != null">
|
||||||
password,
|
password,
|
||||||
@@ -174,8 +174,8 @@
|
|||||||
<if test="username != null">
|
<if test="username != null">
|
||||||
#{username,jdbcType=VARCHAR},
|
#{username,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="loginame != null">
|
<if test="loginName != null">
|
||||||
#{loginame,jdbcType=VARCHAR},
|
#{loginName,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="password != null">
|
<if test="password != null">
|
||||||
#{password,jdbcType=VARCHAR},
|
#{password,jdbcType=VARCHAR},
|
||||||
@@ -227,8 +227,8 @@
|
|||||||
<if test="record.username != null">
|
<if test="record.username != null">
|
||||||
username = #{record.username,jdbcType=VARCHAR},
|
username = #{record.username,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.loginame != null">
|
<if test="record.loginName != null">
|
||||||
loginame = #{record.loginame,jdbcType=VARCHAR},
|
login_name = #{record.loginName,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.password != null">
|
<if test="record.password != null">
|
||||||
password = #{record.password,jdbcType=VARCHAR},
|
password = #{record.password,jdbcType=VARCHAR},
|
||||||
@@ -272,7 +272,7 @@
|
|||||||
update jsh_user
|
update jsh_user
|
||||||
set id = #{record.id,jdbcType=BIGINT},
|
set id = #{record.id,jdbcType=BIGINT},
|
||||||
username = #{record.username,jdbcType=VARCHAR},
|
username = #{record.username,jdbcType=VARCHAR},
|
||||||
loginame = #{record.loginame,jdbcType=VARCHAR},
|
login_name = #{record.loginName,jdbcType=VARCHAR},
|
||||||
password = #{record.password,jdbcType=VARCHAR},
|
password = #{record.password,jdbcType=VARCHAR},
|
||||||
position = #{record.position,jdbcType=VARCHAR},
|
position = #{record.position,jdbcType=VARCHAR},
|
||||||
department = #{record.department,jdbcType=VARCHAR},
|
department = #{record.department,jdbcType=VARCHAR},
|
||||||
@@ -294,8 +294,8 @@
|
|||||||
<if test="username != null">
|
<if test="username != null">
|
||||||
username = #{username,jdbcType=VARCHAR},
|
username = #{username,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="loginame != null">
|
<if test="loginName != null">
|
||||||
loginame = #{loginame,jdbcType=VARCHAR},
|
login_name = #{loginName,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="password != null">
|
<if test="password != null">
|
||||||
password = #{password,jdbcType=VARCHAR},
|
password = #{password,jdbcType=VARCHAR},
|
||||||
@@ -336,7 +336,7 @@
|
|||||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.User">
|
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.User">
|
||||||
update jsh_user
|
update jsh_user
|
||||||
set username = #{username,jdbcType=VARCHAR},
|
set username = #{username,jdbcType=VARCHAR},
|
||||||
loginame = #{loginame,jdbcType=VARCHAR},
|
login_name = #{loginName,jdbcType=VARCHAR},
|
||||||
password = #{password,jdbcType=VARCHAR},
|
password = #{password,jdbcType=VARCHAR},
|
||||||
position = #{position,jdbcType=VARCHAR},
|
position = #{position,jdbcType=VARCHAR},
|
||||||
department = #{department,jdbcType=VARCHAR},
|
department = #{department,jdbcType=VARCHAR},
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
and username like '%${userName}%'
|
and username like '%${userName}%'
|
||||||
</if>
|
</if>
|
||||||
<if test="loginName != null">
|
<if test="loginName != null">
|
||||||
and loginame like '%${loginName}%'
|
and login_name like '%${loginName}%'
|
||||||
</if>
|
</if>
|
||||||
<if test="offset != null and rows != null">
|
<if test="offset != null and rows != null">
|
||||||
limit #{offset},#{rows}
|
limit #{offset},#{rows}
|
||||||
@@ -32,11 +32,11 @@
|
|||||||
and username like '%${userName}%'
|
and username like '%${userName}%'
|
||||||
</if>
|
</if>
|
||||||
<if test="loginName != null">
|
<if test="loginName != null">
|
||||||
and loginame like '%${loginName}%'
|
and login_name like '%${loginName}%'
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getUserList" parameterType="java.util.Map" resultMap="ResultMapEx">
|
<select id="getUserList" parameterType="java.util.Map" resultMap="ResultMapEx">
|
||||||
select user.id, user.username, user.loginame, user.position, user.email, user.phonenum,
|
select user.id, user.username, user.login_name, user.position, user.email, user.phonenum,
|
||||||
user.description, user.remark,user.isystem,org.id as orgaId,user.tenant_id,org.org_abr,rel.user_blng_orga_dspl_seq,
|
user.description, user.remark,user.isystem,org.id as orgaId,user.tenant_id,org.org_abr,rel.user_blng_orga_dspl_seq,
|
||||||
rel.id as orgaUserRelId
|
rel.id as orgaUserRelId
|
||||||
FROM jsh_user user
|
FROM jsh_user user
|
||||||
@@ -50,12 +50,12 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="loginName != null and loginName != ''">
|
<if test="loginName != null and loginName != ''">
|
||||||
<bind name="loginName" value="'%' + _parameter.loginName + '%'" />
|
<bind name="loginName" value="'%' + _parameter.loginName + '%'" />
|
||||||
and user.loginame like #{loginName}
|
and user.login_name like #{loginName}
|
||||||
</if>
|
</if>
|
||||||
order by user.id desc
|
order by user.id desc
|
||||||
</select>
|
</select>
|
||||||
<select id="getUserListByUserNameOrLoginName" resultMap="com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap">
|
<select id="getUserListByUserNameOrLoginName" resultMap="com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap">
|
||||||
select user.id, user.username, user.loginame, user.position, user.email, user.phonenum,
|
select user.id, user.username, user.login_name, user.position, user.email, user.phonenum,
|
||||||
user.description, user.remark,user.isystem
|
user.description, user.remark,user.isystem
|
||||||
FROM jsh_user user
|
FROM jsh_user user
|
||||||
where 1=1
|
where 1=1
|
||||||
@@ -63,8 +63,8 @@
|
|||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
and user.userName = #{userName}
|
and user.userName = #{userName}
|
||||||
</if>
|
</if>
|
||||||
<if test="loginame != null and loginame != ''">
|
<if test="loginName != null and loginName != ''">
|
||||||
and user.loginame = #{loginame}
|
and user.login_name = #{loginName}
|
||||||
</if>
|
</if>
|
||||||
order by user.id desc
|
order by user.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user