Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
store-system
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luoyangfei
store-system
Commits
6d880f79
Commit
6d880f79
authored
Nov 20, 2018
by
wangyihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解绑 系统用户和店铺管理员之间的联系
parent
e9324205
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
35 deletions
+25
-35
SysUserController.java
...ain/java/cn/com/fqy/controller/mgt/SysUserController.java
+1
-1
SysUserServiceImpl.java
...java/cn/com/fqy/core/service/impl/SysUserServiceImpl.java
+20
-20
AdministratorsMapper.xml
...rc/main/resources/mybatis/mapper/AdministratorsMapper.xml
+1
-1
SysUserMapper.xml
...ystem/src/main/resources/mybatis/mapper/SysUserMapper.xml
+3
-13
No files found.
2code/server/store-system/src/main/java/cn/com/fqy/controller/mgt/SysUserController.java
View file @
6d880f79
...
...
@@ -80,7 +80,7 @@ public class SysUserController extends BaseController {
sysUser
.
setMobilePhone
(
sysUserRoleIds
.
getMobilePhone
());
sysUser
.
setSex
(
sysUserRoleIds
.
getSex
());
sysUser
.
setDeptId
(
sysUserRoleIds
.
getDeptId
());
sysUser
.
setAdministratorsId
(
sysUserRoleIds
.
getAdministratorsId
());
//
sysUser.setAdministratorsId(sysUserRoleIds.getAdministratorsId());
if
(
sysUserRoleIds
.
getSysRole
()!=
null
)
{
String
[]
roleIds
=
sysUserRoleIds
.
getSysRole
();
List
<
SysRole
>
sysRoles
=
new
ArrayList
<
SysRole
>();
...
...
2code/server/store-system/src/main/java/cn/com/fqy/core/service/impl/SysUserServiceImpl.java
View file @
6d880f79
...
...
@@ -82,13 +82,13 @@ public class SysUserServiceImpl implements SysUserService {
sysUser
.
setIsDeleted
(
0
);
sysUser
.
setCreateTime
(
now
);
sysUser
.
setUpdateTime
(
now
);
int
count1
=
sysUserDao
.
add
(
sysUser
);
if
(
count1
>
0
)
{
Administrators
administrators
=
new
Administrators
();
administrators
.
setAdministratorsId
(
sysUser
.
getAdministratorsId
());
administrators
.
setSystemId
(
sysUser
.
getUserId
());
administratorsDao
.
update
(
administrators
);
}
sysUserDao
.
add
(
sysUser
);
//
if(count1>0) {
//
Administrators administrators = new Administrators();
//
administrators.setAdministratorsId(sysUser.getAdministratorsId());
//
administrators.setSystemId(sysUser.getUserId());
//
administratorsDao.update(administrators);
//
}
for
(
int
i
=
0
;
i
<
sysUser
.
getSysRole
().
size
();
i
++)
{
SysRole
sysRole
=
sysUser
.
getSysRole
().
get
(
i
);
...
...
@@ -156,19 +156,19 @@ public class SysUserServiceImpl implements SysUserService {
// 调用Dao执行更新操作,并判断更新语句执行结果
int
count
=
sysUserDao
.
update
(
sysUser
);
if
(
count
==
1
)
{
SysUser
su
=
sysUserDao
.
get
(
userId
);
if
(
null
!=
su
)
{
Administrators
admin
=
new
Administrators
();
admin
.
setAdministratorsId
(
su
.
getAdministratorsId
());
admin
.
setSystemId
(
null
);
int
count1
=
administratorsDao
.
update
(
admin
);
if
(
count1
==
1
)
{
resultInfo
.
setCode
(
Constant
.
SUCCESS
);
}
else
{
resultInfo
.
setCode
(
Constant
.
FAIL
);
resultInfo
.
setMsg
(
"未释放店铺管理员!"
);
}
}
//
SysUser su = sysUserDao.get(userId);
//
if(null != su) {
//
Administrators admin= new Administrators();
//
admin.setAdministratorsId(su.getAdministratorsId());
//
admin.setSystemId(null);
//
int count1=administratorsDao.update(admin);
//
if(count1 == 1) {
//
resultInfo.setCode(Constant.SUCCESS);
//
}else {
//
resultInfo.setCode(Constant.FAIL);
//
resultInfo.setMsg("未释放店铺管理员!");
//
}
//
}
resultInfo
.
setCode
(
Constant
.
SUCCESS
);
}
else
{
resultInfo
.
setCode
(
Constant
.
FAIL
);
...
...
2code/server/store-system/src/main/resources/mybatis/mapper/AdministratorsMapper.xml
View file @
6d880f79
...
...
@@ -99,7 +99,7 @@ POWER,SYSTEM_ID,CREATE_TIME,UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,ADMINISTRATORS
<if
test=
"power!=null and power!=''"
>
POWER=#{power,jdbcType = VARCHAR},
</if>
<if
test=
"systemId!=''"
>
<if
test=
"systemId!=
null and systemId!=
''"
>
SYSTEM_ID=#{systemId,jdbcType = VARCHAR},
</if>
<if
test=
"createTime!=null "
>
...
...
2code/server/store-system/src/main/resources/mybatis/mapper/SysUserMapper.xml
View file @
6d880f79
...
...
@@ -19,7 +19,6 @@
<result
column=
"OPERATOR_ID"
property=
"operatorId"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<result
column=
"FLAG"
property=
"flag"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<result
column=
"ADMINISTRATORS_ID"
property=
"administratorsId"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<result
column=
"ADMINISTRATORS_NAME"
property=
"administratorsName"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
</resultMap>
<resultMap
type=
"SysUser"
id=
"SysUserAss"
extends=
"SysUser"
>
<association
property=
"sysRole"
column=
"USER_ID"
...
...
@@ -164,11 +163,7 @@
</select>
<select
id=
"count2"
parameterType=
"Query"
resultType=
"Long"
>
select
count(*)
FROM
t_sys_user u
LEFT JOIN t_administrators a ON u.ADMINISTRATORS_ID = a.ADMINISTRATORS_ID
select count(*) from T_SYS_USER
<where>
<include
refid=
"listCommonWhere2"
/>
</where>
...
...
@@ -190,12 +185,7 @@
</select>
<select
id=
"pageList2"
parameterType=
"Query"
resultMap=
"SysUserAss"
>
SELECT
u.*,
a.ADMINISTRATORS_NAME
FROM
t_sys_user u
LEFT JOIN t_administrators a ON u.ADMINISTRATORS_ID = a.ADMINISTRATORS_ID
select * from T_SYS_USER
<where>
<include
refid=
"listCommonWhere2"
/>
</where>
...
...
@@ -288,7 +278,7 @@
AND IS_AVAILABLE=#{q.isAvailable}
</if>
<if
test=
"q.isDeleted!=null "
>
AND
u.
IS_DELETED=#{q.isDeleted}
AND IS_DELETED=#{q.isDeleted}
</if>
<if
test=
"q.createTime!=null "
>
AND CREATE_TIME=#{q.createTime}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment