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
6bdd7a3b
Commit
6bdd7a3b
authored
Dec 22, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
身份变更
parent
1238119a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
AppShareholderDetailBiz.java
...b/wxiaoqi/security/admin/biz/AppShareholderDetailBiz.java
+5
-0
AppUserPositionTempBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
+6
-9
AppShareholderDetailMapper.xml
.../src/main/resources/mapper/AppShareholderDetailMapper.xml
+12
-7
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppShareholderDetailBiz.java
View file @
6bdd7a3b
...
...
@@ -3,12 +3,17 @@ package com.github.wxiaoqi.security.admin.biz;
import
com.github.wxiaoqi.security.admin.entity.AppShareholderDetail
;
import
com.github.wxiaoqi.security.admin.mapper.AppShareholderDetailMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* @author zuoyihang
* @version 1.0
* @description
* @data 2019/12/21 19:52
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Service
public
class
AppShareholderDetailBiz
extends
BaseBiz
<
AppShareholderDetailMapper
,
AppShareholderDetail
>
{
public
Integer
findShareholderByUserIdOrPhone
(
Integer
userId
,
String
phone
)
{
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
View file @
6bdd7a3b
...
...
@@ -118,7 +118,7 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
//用户表更改其身份
AppUserDetail
appUserDetail
=
detailBiz
.
checkeIsAppUser
(
userPositionTemp
.
getUserId
());
if
(
appUserDetail
!=
null
)
{
loginBiz
.
updateUserPosition
(
appUserDetail
.
get
I
d
(),
appUserPositionTempDTO
.
getPositionId
());
loginBiz
.
updateUserPosition
(
appUserDetail
.
get
Useri
d
(),
appUserPositionTempDTO
.
getPositionId
());
}
return
ObjectRestResponse
.
succ
();
}
...
...
@@ -411,26 +411,23 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
appUserPositionTempDTO
.
setPositionId
(
6
);
appUserPositionChangeRecordBiz
.
addPositionChangeRecord
(
userPositionTemp
,
oldData
,
operatorId
,
appUserPositionTempDTO
.
getRelTime
());
}
//用户表更改其身份
AppUserDetail
appUserDetail
=
detailBiz
.
checkeIsAppUser
(
userPositionTemp
.
getUserId
());
if
(
appUserDetail
!=
null
)
{
loginBiz
.
updateUserPosition
(
appUserDetail
.
getId
(),
appUserPositionTempDTO
.
getPositionId
());
}
if
(
StaffChangeStatusEnum
.
needChangePostionsStatus
.
contains
(
changeStatus
))
{
//用户表更改其身份
AppUserDetail
appUserDetail
=
detailBiz
.
checkeIsAppUser
(
userPositionTemp
.
getUserId
());
//1.查询股东表 根据userid 或 手机号
Integer
postionId
=
appShareholderDetailBiz
.
findShareholderByUserIdOrPhone
(
appUserPositionTempDTO
.
getUserId
(),
appUserPositionTempDTO
.
getPhone
());
//离职
if
(
StaffChangeStatusEnum
.
JOB_SEPARATION
.
getCode
()
==
changeStatus
)
{
if
(
Objects
.
isNull
(
postionId
))
{
//更改为普通用户 6
loginBiz
.
updateUserPosition
(
appUserDetail
.
get
I
d
(),
6
);
loginBiz
.
updateUserPosition
(
appUserDetail
.
get
Useri
d
(),
6
);
}
}
//身份变更
if
(
StaffChangeStatusEnum
.
IDENTITY_CHANE
.
getCode
()
==
changeStatus
)
{
postionId
=
Objects
.
nonNull
(
postionId
)
?
postionId
:
appUserPositionTempDTO
.
getPositionId
();
//更改为股东身份
loginBiz
.
updateUserPosition
(
appUserDetail
.
get
I
d
(),
postionId
);
loginBiz
.
updateUserPosition
(
appUserDetail
.
get
Useri
d
(),
postionId
);
}
}
...
...
@@ -454,7 +451,7 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
if
(
appUserDetail
!=
null
)
{
Integer
postionId
=
appShareholderDetailBiz
.
findShareholderByUserIdOrPhone
(
appUserPositionTempDTO
.
getUserId
(),
appUserPositionTempDTO
.
getPhone
());
postionId
=
Objects
.
isNull
(
postionId
)
?
appUserPositionTempDTO
.
getPositionId
()
:
postionId
;
loginBiz
.
updateUserPosition
(
appUserDetail
.
get
I
d
(),
postionId
);
loginBiz
.
updateUserPosition
(
appUserDetail
.
get
Useri
d
(),
postionId
);
}
return
ObjectRestResponse
.
succ
();
}
...
...
ace-modules/ace-admin/src/main/resources/mapper/AppShareholderDetailMapper.xml
View file @
6bdd7a3b
...
...
@@ -15,12 +15,17 @@
</resultMap>
<select
id=
"selectShareHolderByUserIdOrPhone"
resultType=
"java.lang.Integer"
>
select `postion_id` from `app_shareholder_detail` where 1=1
<if
test=
"userId != null"
>
or `user_id`#{userId}
</if>
<if
test=
"phone != null and phone != ''"
>
or `phone`= #{phone}
</if>
select min(`postion_id`) from `app_shareholder_detail` where `is_quit`=0
<choose>
<when
test=
"userId != null and (phone == null or phone != '')"
>
and `user_id`=#{userId}
</when>
<when
test=
"phone != null and phone != '' and userId == null"
>
and `phone`=#{phone}
</when>
<otherwise>
and `user_id`=#{userId}
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
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