Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
1580105d
Commit
1580105d
authored
Dec 13, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-customer-management' into dev
parents
d6b36b08
b33c1d66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
AppStaffUserBiz.java
...om/github/wxiaoqi/security/admin/biz/AppStaffUserBiz.java
+13
-4
AppStaffUserController.java
...b/wxiaoqi/security/admin/rest/AppStaffUserController.java
+12
-4
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppStaffUserBiz.java
View file @
1580105d
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.druid.sql.visitor.functions.If
;
import
com.github.wxiaoqi.security.admin.entity.AppStaffUser
;
import
com.github.wxiaoqi.security.admin.entity.AppStaffUserVo
;
...
...
@@ -56,9 +57,9 @@ public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> {
if
(
appStaffUser
.
getPhone
()!=
null
){
criteria
.
andEqualTo
(
"phone"
,
appStaffUser
.
getPhone
());
AppStaffUser
staffUser
=
mapper
.
selectOne
ByExample
(
example
);
if
(
staffUser
!=
null
)
{
List
<
AppStaffUser
>
appStaffUsers
=
mapper
.
select
ByExample
(
example
);
if
(
CollectionUtil
.
isNotEmpty
(
appStaffUsers
)
)
{
AppStaffUser
staffUser
=
appStaffUsers
.
get
(
0
);
AppStaffUserVo
appStaffUserVo
=
new
AppStaffUserVo
();
BeanUtils
.
copyProperties
(
staffUser
,
appStaffUserVo
);
Integer
suId
=
staffUser
.
getSuId
();
...
...
@@ -66,7 +67,6 @@ public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> {
appStaffUserVo
.
setEmployeeName
(
userInfoById
.
getRealname
());
appStaffUserVo
.
setEmployeePhone
(
userInfoById
.
getUsername
());
return
appStaffUserVo
;
}
}
...
...
@@ -74,4 +74,13 @@ public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> {
}
public
boolean
select
(
AppStaffUser
appStaffUser
)
{
Example
example
=
new
Example
(
AppStaffUser
.
class
);
example
.
createCriteria
().
andEqualTo
(
"uName"
,
appStaffUser
.
getUName
())
.
andEqualTo
(
"phone"
,
appStaffUser
.
getPhone
())
.
andEqualTo
(
"isDel"
,
0
);
List
<
AppStaffUser
>
appStaffUsers
=
mapper
.
selectByExample
(
example
);
return
CollectionUtil
.
isEmpty
(
appStaffUsers
)?
true
:
false
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppStaffUserController.java
View file @
1580105d
...
...
@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.admin.biz.AppStaffUserBiz;
import
com.github.wxiaoqi.security.admin.entity.AppStaffUser
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
...
...
@@ -52,8 +53,12 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"不能绑定本人为客户"
);
}
appStaffUser
.
setSuId
(
userDTO
.
getUserid
());
baseBiz
.
insertSelective
(
appStaffUser
);
return
ObjectRestResponse
.
succ
();
if
(
baseBiz
.
select
(
appStaffUser
))
{
baseBiz
.
insertSelective
(
appStaffUser
);
return
ObjectRestResponse
.
succ
();
}
throw
new
BaseException
(
"用户已存在"
);
}
@ApiOperation
(
"查询一条"
)
...
...
@@ -86,8 +91,11 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
if
(
appStaffUser
.
getPhone
().
equals
(
userDTO
.
getUsername
()))
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"不能绑定本人为客户"
);
}
baseBiz
.
updateSelectiveById
(
appStaffUser
);
return
ObjectRestResponse
.
succ
();
if
(
baseBiz
.
select
(
appStaffUser
))
{
baseBiz
.
updateSelectiveById
(
appStaffUser
);
return
ObjectRestResponse
.
succ
();
}
throw
new
BaseException
(
"用户已存在"
);
}
}
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