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
95bcf7b0
Commit
95bcf7b0
authored
Nov 08, 2018
by
wangyihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
d13b6506
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
9 deletions
+57
-9
AdministratorsController.java
...a/cn/com/fqy/controller/mgt/AdministratorsController.java
+15
-3
SysUser.java
...e-system/src/main/java/cn/com/fqy/core/model/SysUser.java
+11
-1
SysUserServiceImpl.java
...java/cn/com/fqy/core/service/impl/SysUserServiceImpl.java
+18
-2
SysUserMapper.xml
...ystem/src/main/resources/mybatis/mapper/SysUserMapper.xml
+13
-3
No files found.
2code/server/store-system/src/main/java/cn/com/fqy/controller/mgt/AdministratorsController.java
View file @
95bcf7b0
package
cn
.
com
.
fqy
.
controller
.
mgt
;
package
cn
.
com
.
fqy
.
controller
.
mgt
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -82,12 +83,23 @@ public class AdministratorsController extends BaseController{
...
@@ -82,12 +83,23 @@ public class AdministratorsController extends BaseController{
@ResponseBody
@ResponseBody
public
ResultInfo
<
List
<
Administrators
>>
getAdministrators
(){
public
ResultInfo
<
List
<
Administrators
>>
getAdministrators
(){
ResultInfo
<
List
<
Administrators
>>
result
=
new
ResultInfo
<>();
ResultInfo
<
List
<
Administrators
>>
result
=
new
ResultInfo
<>();
Administrators
administrators
=
new
Administrators
();
List
<
Administrators
>
admListQuery
=
new
ArrayList
<>();
Administrators
administrators
=
new
Administrators
();
administrators
.
setIsDeleted
(
0
);
administrators
.
setIsDeleted
(
0
);
List
<
Administrators
>
administratorsList
=
administratorsService
.
getAdministratorsList
(
new
Query
(
administrators
));
List
<
Administrators
>
administratorsList
=
administratorsService
.
getAdministratorsList
(
new
Query
(
administrators
));
if
(
administratorsList
.
size
()>
0
)
{
if
(
administratorsList
.
size
()>
0
)
{
result
.
setCode
(
"1"
);
for
(
Administrators
list:
administratorsList
)
{
result
.
setData
(
administratorsList
);
if
(
list
.
getSystemId
()
==
null
||
""
.
equals
(
list
.
getSystemId
()))
{
admListQuery
.
add
(
list
);
}
}
if
(
admListQuery
.
size
()>
0
)
{
result
.
setCode
(
"1"
);
result
.
setData
(
admListQuery
);
}
else
{
result
.
setCode
(
"0"
);
result
.
setMsg
(
"暂无可用店铺管理员数据"
);
}
}
else
{
}
else
{
result
.
setCode
(
"0"
);
result
.
setCode
(
"0"
);
result
.
setMsg
(
"暂无店铺管理员数据"
);
result
.
setMsg
(
"暂无店铺管理员数据"
);
...
...
2code/server/store-system/src/main/java/cn/com/fqy/core/model/SysUser.java
View file @
95bcf7b0
...
@@ -54,6 +54,8 @@ public class SysUser extends Entity<String> {
...
@@ -54,6 +54,8 @@ public class SysUser extends Entity<String> {
private
String
flag
;
private
String
flag
;
//店铺管理员编号
//店铺管理员编号
private
String
administratorsId
;
private
String
administratorsId
;
//店铺管理员名称
private
String
administratorsName
;
/*Auto generated properties end*/
/*Auto generated properties end*/
...
@@ -66,6 +68,14 @@ public class SysUser extends Entity<String> {
...
@@ -66,6 +68,14 @@ public class SysUser extends Entity<String> {
/*Auto generated methods start*/
/*Auto generated methods start*/
public
String
getAdministratorsName
()
{
return
administratorsName
;
}
public
void
setAdministratorsName
(
String
administratorsName
)
{
this
.
administratorsName
=
administratorsName
;
}
@Override
@Override
public
String
getPK
(){
public
String
getPK
(){
return
userId
;
return
userId
;
...
@@ -258,7 +268,7 @@ public class SysUser extends Entity<String> {
...
@@ -258,7 +268,7 @@ public class SysUser extends Entity<String> {
+
", createTimeStart="
+
createTimeStart
+
", createTimeEnd="
+
createTimeEnd
+
", updateTime="
+
", createTimeStart="
+
createTimeStart
+
", createTimeEnd="
+
createTimeEnd
+
", updateTime="
+
updateTime
+
", updateTimeStart="
+
updateTimeStart
+
", updateTimeEnd="
+
updateTimeEnd
+
updateTime
+
", updateTimeStart="
+
updateTimeStart
+
", updateTimeEnd="
+
updateTimeEnd
+
", operatorType="
+
operatorType
+
", operatorId="
+
operatorId
+
", sysRole="
+
sysRole
+
", flag="
+
", operatorType="
+
operatorType
+
", operatorId="
+
operatorId
+
", sysRole="
+
sysRole
+
", flag="
+
flag
+
", administratorsId="
+
administratorsId
+
"]"
;
+
flag
+
", administratorsId="
+
administratorsId
+
"
, administratorsName="
+
administratorsName
+
"
]"
;
}
}
}
}
2code/server/store-system/src/main/java/cn/com/fqy/core/service/impl/SysUserServiceImpl.java
View file @
95bcf7b0
...
@@ -16,8 +16,10 @@ import cn.com.fqy.common.ResultInfo;
...
@@ -16,8 +16,10 @@ import cn.com.fqy.common.ResultInfo;
import
cn.com.fqy.common.constants.Constant
;
import
cn.com.fqy.common.constants.Constant
;
import
cn.com.fqy.common.util.ECMd5Utils
;
import
cn.com.fqy.common.util.ECMd5Utils
;
import
cn.com.fqy.core.common.PageFinder
;
import
cn.com.fqy.core.common.PageFinder
;
import
cn.com.fqy.core.dao.AdministratorsDao
;
import
cn.com.fqy.core.dao.SysUserDao
;
import
cn.com.fqy.core.dao.SysUserDao
;
import
cn.com.fqy.core.dao.SysUserRoleRelDao
;
import
cn.com.fqy.core.dao.SysUserRoleRelDao
;
import
cn.com.fqy.core.model.Administrators
;
import
cn.com.fqy.core.model.Query
;
import
cn.com.fqy.core.model.Query
;
import
cn.com.fqy.core.model.SysRole
;
import
cn.com.fqy.core.model.SysRole
;
import
cn.com.fqy.core.model.SysUser
;
import
cn.com.fqy.core.model.SysUser
;
...
@@ -35,6 +37,8 @@ public class SysUserServiceImpl implements SysUserService {
...
@@ -35,6 +37,8 @@ public class SysUserServiceImpl implements SysUserService {
@Resource
@Resource
private
SysUserRoleRelDao
sysUserRoleRelDao
;
private
SysUserRoleRelDao
sysUserRoleRelDao
;
@Resource
private
AdministratorsDao
administratorsDao
;
private
ResultInfo
<
SysUser
>
resultInfo
=
new
ResultInfo
<
SysUser
>();
private
ResultInfo
<
SysUser
>
resultInfo
=
new
ResultInfo
<
SysUser
>();
...
@@ -78,7 +82,13 @@ public class SysUserServiceImpl implements SysUserService {
...
@@ -78,7 +82,13 @@ public class SysUserServiceImpl implements SysUserService {
sysUser
.
setIsDeleted
(
0
);
sysUser
.
setIsDeleted
(
0
);
sysUser
.
setCreateTime
(
now
);
sysUser
.
setCreateTime
(
now
);
sysUser
.
setUpdateTime
(
now
);
sysUser
.
setUpdateTime
(
now
);
sysUserDao
.
add
(
sysUser
);
int
count1
=
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
++)
{
for
(
int
i
=
0
;
i
<
sysUser
.
getSysRole
().
size
();
i
++)
{
SysRole
sysRole
=
sysUser
.
getSysRole
().
get
(
i
);
SysRole
sysRole
=
sysUser
.
getSysRole
().
get
(
i
);
...
@@ -106,7 +116,13 @@ public class SysUserServiceImpl implements SysUserService {
...
@@ -106,7 +116,13 @@ public class SysUserServiceImpl implements SysUserService {
sysUserRoleRel
.
setCreateTime
(
now
);
sysUserRoleRel
.
setCreateTime
(
now
);
}
}
sysUser
.
setUpdateTime
(
now
);
sysUser
.
setUpdateTime
(
now
);
sysUserDao
.
update
(
sysUser
);
int
count1
=
sysUserDao
.
update
(
sysUser
);
if
(
count1
>
0
)
{
Administrators
administrators
=
new
Administrators
();
administrators
.
setAdministratorsId
(
sysUser
.
getAdministratorsId
());
administrators
.
setSystemId
(
sysUser
.
getUserId
());
administratorsDao
.
update
(
administrators
);
}
}
}
}
else
{
}
else
{
resultInfo
.
setCode
(
Constant
.
FAIL
);
resultInfo
.
setCode
(
Constant
.
FAIL
);
...
...
2code/server/store-system/src/main/resources/mybatis/mapper/SysUserMapper.xml
View file @
95bcf7b0
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
<result
column=
"OPERATOR_ID"
property=
"operatorId"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<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=
"FLAG"
property=
"flag"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<result
column=
"ADMINISTRATORS_ID"
property=
"administratorsId"
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>
<resultMap
type=
"SysUser"
id=
"SysUserAss"
extends=
"SysUser"
>
<resultMap
type=
"SysUser"
id=
"SysUserAss"
extends=
"SysUser"
>
<association
property=
"sysRole"
column=
"USER_ID"
<association
property=
"sysRole"
column=
"USER_ID"
...
@@ -163,7 +164,11 @@
...
@@ -163,7 +164,11 @@
</select>
</select>
<select
id=
"count2"
parameterType=
"Query"
resultType=
"Long"
>
<select
id=
"count2"
parameterType=
"Query"
resultType=
"Long"
>
select count(*) from T_SYS_USER
select
count(*)
FROM
t_sys_user u
LEFT JOIN t_administrators a ON u.ADMINISTRATORS_ID = a.ADMINISTRATORS_ID
<where>
<where>
<include
refid=
"listCommonWhere2"
/>
<include
refid=
"listCommonWhere2"
/>
</where>
</where>
...
@@ -185,7 +190,12 @@
...
@@ -185,7 +190,12 @@
</select>
</select>
<select
id=
"pageList2"
parameterType=
"Query"
resultMap=
"SysUserAss"
>
<select
id=
"pageList2"
parameterType=
"Query"
resultMap=
"SysUserAss"
>
select * from T_SYS_USER
SELECT
u.*,
a.ADMINISTRATORS_NAME
FROM
t_sys_user u
LEFT JOIN t_administrators a ON u.ADMINISTRATORS_ID = a.ADMINISTRATORS_ID
<where>
<where>
<include
refid=
"listCommonWhere2"
/>
<include
refid=
"listCommonWhere2"
/>
</where>
</where>
...
@@ -278,7 +288,7 @@
...
@@ -278,7 +288,7 @@
AND IS_AVAILABLE=#{q.isAvailable}
AND IS_AVAILABLE=#{q.isAvailable}
</if>
</if>
<if
test=
"q.isDeleted!=null "
>
<if
test=
"q.isDeleted!=null "
>
AND IS_DELETED=#{q.isDeleted}
AND
u.
IS_DELETED=#{q.isDeleted}
</if>
</if>
<if
test=
"q.createTime!=null "
>
<if
test=
"q.createTime!=null "
>
AND CREATE_TIME=#{q.createTime}
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