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
63f350f9
Commit
63f350f9
authored
Dec 26, 2019
by
zuoyh
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'saff_update_feature' into dev
parents
880f2272
f8cb21d7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
118 additions
and
17 deletions
+118
-17
AppShareholderDetailDTO.java
...b/wxiaoqi/security/admin/dto/AppShareholderDetailDTO.java
+1
-0
AppShareholderDetailBiz.java
...b/wxiaoqi/security/admin/biz/AppShareholderDetailBiz.java
+76
-14
AppShareholderDetailMapper.java
...oqi/security/admin/mapper/AppShareholderDetailMapper.java
+6
-0
AppShareholderDetailMapper.xml
.../src/main/resources/mapper/AppShareholderDetailMapper.xml
+33
-1
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+2
-2
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/AppShareholderDetailDTO.java
View file @
63f350f9
...
@@ -65,6 +65,7 @@ public class AppShareholderDetailDTO {
...
@@ -65,6 +65,7 @@ public class AppShareholderDetailDTO {
* 操作指令
* 操作指令
* 1:信息修改
* 1:信息修改
* 2:股权变动
* 2:股权变动
* 3:再次购买此前抛售的股权
*/
*/
private
Integer
changeState
;
private
Integer
changeState
;
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppShareholderDetailBiz.java
View file @
63f350f9
...
@@ -17,6 +17,7 @@ import com.google.common.collect.Lists;
...
@@ -17,6 +17,7 @@ import com.google.common.collect.Lists;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -95,14 +96,14 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -95,14 +96,14 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
Integer
companyId
=
Integer
.
valueOf
(
company
);
Integer
companyId
=
Integer
.
valueOf
(
company
);
if
(!(
companyId
!=
null
&&
companyId
>
0
))
if
(!(
companyId
!=
null
&&
companyId
>
0
))
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"分公司不存在"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"分公司不存在"
);
RestResponse
<
BranchCompany
>
branchCompany
=
vehicleFeign
.
get
(
companyId
);
CompanyDetail
branchCompany
=
vehicleFeign
.
getCompanyDetail
(
companyId
).
getData
(
);
if
(
branchCompany
.
getData
()
==
null
)
{
if
(
branchCompany
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"分公司不存在"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"分公司不存在"
);
}
}
appShareholderDetailDTO
.
setCompanyId
(
companyId
);
appShareholderDetailDTO
.
setCompanyId
(
companyId
);
appShareholderDetailDTO
.
setCompanyName
(
branchCompany
.
get
Data
().
get
Name
());
appShareholderDetailDTO
.
setCompanyName
(
branchCompany
.
getName
());
Integer
positionId
=
branchCompany
.
get
Data
().
get
Id
().
equals
(
1
)
?
HEADQUARTERS_SHAREHOLDER
:
BRANCH_HEADQUARTERS_SHAREHOLDER
;
Integer
positionId
=
branchCompany
.
getId
().
equals
(
1
)
?
HEADQUARTERS_SHAREHOLDER
:
BRANCH_HEADQUARTERS_SHAREHOLDER
;
//用户表更改其身份
//用户表更改其身份
Integer
userId
=
0
;
Integer
userId
=
0
;
//登陆表查询用户手机号
//登陆表查询用户手机号
...
@@ -129,7 +130,7 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -129,7 +130,7 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
Integer
id
=
appShareholderDetailDTO
.
getId
()
==
null
?
0
:
appShareholderDetailDTO
.
getId
();
Integer
id
=
appShareholderDetailDTO
.
getId
()
==
null
?
0
:
appShareholderDetailDTO
.
getId
();
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
appShareholderDetail
.
setPositionId
(
positionId
);
appShareholderDetail
.
setPositionId
(
positionId
);
appShareholderDetail
DTO
.
setUserId
(
userId
);
appShareholderDetail
.
setUserId
(
userId
);
// insertSelective(appShareholderDetail);
// insertSelective(appShareholderDetail);
addUserFindId
(
appShareholderDetail
);
addUserFindId
(
appShareholderDetail
);
//插入记录表
//插入记录表
...
@@ -163,8 +164,19 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -163,8 +164,19 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
//信息修改
//信息修改
if
(
appShareholderDetailDTO
.
getChangeState
().
equals
(
1
))
{
if
(
appShareholderDetailDTO
.
getChangeState
().
equals
(
1
))
{
updateSelectiveById
(
appShareholderDetail
);
if
(
appShareholderDetailDTO
.
getCompanyList
()
==
null
)
{
// updateById(appShareholderDetail);
for
(
String
company
:
appShareholderDetailDTO
.
getCompanyList
())
{
Integer
companyId
=
Integer
.
valueOf
(
company
);
appShareholderDetail
.
setCompanyId
(
companyId
);
CompanyDetail
branchCompany
=
vehicleFeign
.
getCompanyDetail
(
companyId
).
getData
();
String
companyName
=
branchCompany
.
getName
();
appShareholderDetail
.
setCompanyName
(
companyName
);
updateSelectiveById
(
appShareholderDetail
);
}
}
else
{
updateSelectiveById
(
appShareholderDetail
);
}
//退股操作
}
else
if
(
appShareholderDetailDTO
.
getChangeState
().
equals
(
2
))
{
}
else
if
(
appShareholderDetailDTO
.
getChangeState
().
equals
(
2
))
{
if
(
appShareholderDetailDTO
.
getCompanyList
()
==
null
)
{
if
(
appShareholderDetailDTO
.
getCompanyList
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"请传入需要退股的公司"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"请传入需要退股的公司"
);
...
@@ -177,20 +189,70 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -177,20 +189,70 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
}
}
for
(
String
company
:
appShareholderDetailDTO
.
getCompanyList
())
{
for
(
String
company
:
appShareholderDetailDTO
.
getCompanyList
())
{
Integer
companyId
=
Integer
.
valueOf
(
company
);
Integer
companyId
=
Integer
.
valueOf
(
company
);
appShareholderDetail
.
setIsQuit
(
SHAREHOLDERDE_IS_FALSE
);
//更新股东表 持股状态改为已退股
updateSelectiveById
(
appShareholderDetail
);
mapper
.
updShareHolderIsQuit
(
appShareholderDetailDTO
.
getPhone
(),
companyId
);
AppShareholderDetail
updAppShareholderDetail
=
selectById
(
appShareholderDetail
);
AppShareholderDetail
updAppShareholderDetail
=
selectById
(
appShareholderDetailDTO
);
RestResponse
<
BranchCompany
>
branchCompany
=
vehicleFeign
.
get
(
companyId
);
//查询股东表,是否为总部股东
String
companyName
=
branchCompany
.
getData
().
getName
();
Integer
oldPositionId
=
null
;
oldPositionId
=
mapper
.
selectShareHolderByUserIdOrPhone
(
updAppShareholderDetail
.
getUserId
(),
updAppShareholderDetail
.
getPhone
());
CompanyDetail
branchCompany
=
vehicleFeign
.
getCompanyDetail
(
companyId
).
getData
();
String
companyName
=
branchCompany
.
getName
();
updAppShareholderDetail
.
setCompanyName
(
companyName
);
updAppShareholderDetail
.
setCompanyName
(
companyName
);
//用户表更改其身份
Integer
userId
=
0
;
//登陆表查询用户手机号
AppUserLogin
userLogin
=
loginBiz
.
checkeUserLogin
(
appShareholderDetailDTO
.
getPhone
());
if
(
userLogin
!=
null
)
{
userId
=
userLogin
.
getId
();
//离职更新用户表身份
if
(
oldPositionId
==
null
)
{
detailBiz
.
updateUserPositionByUserId
(
userId
,
6
);
}
else
{
detailBiz
.
updateUserPositionByUserId
(
userId
,
oldPositionId
);
}
}
//插入记录表
//插入记录表
appShareholderDetailChangeRecordBiz
.
addAppShareholderDetailChangeRecord
(
updAppShareholderDetail
,
updUserId
,
SHAREHOLDERDE_IS_FALSE
);
appShareholderDetailChangeRecordBiz
.
addAppShareholderDetailChangeRecord
(
updAppShareholderDetail
,
updUserId
,
SHAREHOLDERDE_IS_FALSE
);
}
}
//复股操作
}
else
if
(
appShareholderDetailDTO
.
getChangeState
().
equals
(
3
))
{
if
(
appShareholderDetailDTO
.
getPhone
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"请输入股东号码"
);
}
if
(
appShareholderDetailDTO
.
getCompanyList
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"请输入复股公司"
);
}
for
(
String
company
:
appShareholderDetailDTO
.
getCompanyList
())
{
AppShareholderDetail
updAppShareholderDetail
=
selectById
(
appShareholderDetail
);
//查询股东表,是否为总部股东
Integer
oldPositionId
=
mapper
.
selectShareHolderByUserIdOrPhone
(
updAppShareholderDetail
.
getUserId
(),
updAppShareholderDetail
.
getPhone
());
//用户表更改其身份
Integer
userId
=
0
;
//登陆表查询用户手机号
AppUserLogin
userLogin
=
loginBiz
.
checkeUserLogin
(
appShareholderDetailDTO
.
getPhone
());
if
(
userLogin
!=
null
)
{
userId
=
userLogin
.
getId
();
//关联查询detail表 获取身份
AppUserDetail
appUserDetail
=
detailBiz
.
checkeIsAppUser
(
userId
);
if
(
oldPositionId
==
null
)
{
detailBiz
.
updateUserPositionByUserId
(
userId
,
appShareholderDetail
.
getPositionId
());
}
else
{
if
(!(
appUserDetail
.
getPositionId
().
equals
(
1
)))
{
detailBiz
.
updateUserPositionByUserId
(
userId
,
appShareholderDetail
.
getPositionId
());
}
}
}
appShareholderDetail
.
setIsQuit
(
SHAREHOLDERDE_IS_TRUE
);
//修改
Integer
companyId
=
Integer
.
valueOf
(
company
);
updateSelectiveById
(
appShareholderDetail
);
appShareholderDetailChangeRecordBiz
.
addAppShareholderDetailChangeRecord
(
updAppShareholderDetail
,
updUserId
,
SHAREHOLDERDE_IS_TRUE
);
}
}
}
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
/**
/**
* 分页查询
* 分页查询
*/
*/
...
@@ -373,7 +435,7 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -373,7 +435,7 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
Integer
id
=
appShareholderDetailDTO
.
getId
()
==
null
?
0
:
appShareholderDetailDTO
.
getId
();
Integer
id
=
appShareholderDetailDTO
.
getId
()
==
null
?
0
:
appShareholderDetailDTO
.
getId
();
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
appShareholderDetail
.
setPositionId
(
positionId
);
appShareholderDetail
.
setPositionId
(
positionId
);
appShareholderDetail
DTO
.
setUserId
(
userId
);
appShareholderDetail
.
setUserId
(
userId
);
addUserFindId
(
appShareholderDetail
);
addUserFindId
(
appShareholderDetail
);
//插入记录表
//插入记录表
appShareholderDetailChangeRecordBiz
.
addAppShareholderDetailChangeRecord
(
appShareholderDetail
,
operatorId
,
SHAREHOLDERDE_IS_TRUE
);
appShareholderDetailChangeRecordBiz
.
addAppShareholderDetailChangeRecord
(
appShareholderDetail
,
operatorId
,
SHAREHOLDERDE_IS_TRUE
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppShareholderDetailMapper.java
View file @
63f350f9
...
@@ -23,4 +23,10 @@ public interface AppShareholderDetailMapper extends Mapper<AppShareholderDetail>
...
@@ -23,4 +23,10 @@ public interface AppShareholderDetailMapper extends Mapper<AppShareholderDetail>
@Param
(
"positionId"
)
Integer
positionId
,
@Param
(
"positionId"
)
Integer
positionId
,
@Param
(
"companyId"
)
Integer
companyId
);
@Param
(
"companyId"
)
Integer
companyId
);
void
updShareHolderIsQuit
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"companyId"
)
Integer
companyId
);
Integer
selectMaxShareHolderByUserIdOrPhone
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"userId"
)
Integer
userId
);
}
}
ace-modules/ace-admin/src/main/resources/mapper/AppShareholderDetailMapper.xml
View file @
63f350f9
...
@@ -14,6 +14,38 @@
...
@@ -14,6 +14,38 @@
<result
property=
"positionId"
column=
"position_id"
/>
<result
property=
"positionId"
column=
"position_id"
/>
</resultMap>
</resultMap>
<select
id=
"selectMaxShareHolderByUserIdOrPhone"
resultType=
"java.lang.Integer"
>
select max(`position_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>
<select
id=
"updShareHolderIsQuit"
resultType=
"com.github.wxiaoqi.security.admin.entity.AppShareholderDetail"
>
UPDATE `app_shareholder_detail`
SET
<if
test=
"phone!=null"
>
`is_quit`=#{phone}
</if>
WHERE
1 = 1
<if
test=
"phone!=null"
>
and `phone`=#{phone}
</if>
<if
test=
"companyId!=null"
>
and `company_id`=#{companyId}
</if>
</select>
<select
id=
"selectShareHolderByUserIdOrPhone"
resultType=
"java.lang.Integer"
>
<select
id=
"selectShareHolderByUserIdOrPhone"
resultType=
"java.lang.Integer"
>
select min(`position_id`) from `app_shareholder_detail` where `is_quit`=0
select min(`position_id`) from `app_shareholder_detail` where `is_quit`=0
<choose>
<choose>
...
@@ -71,7 +103,7 @@
...
@@ -71,7 +103,7 @@
<if
test=
"companyId!=null"
>
<if
test=
"companyId!=null"
>
and find_in_set(#{companyId}, a.companyIdArray)
and find_in_set(#{companyId}, a.companyIdArray)
</if>
</if>
</select>
</select>
<resultMap
id=
"detail"
type=
"com.github.wxiaoqi.security.admin.entity.AppShareholderDetail"
>
<resultMap
id=
"detail"
type=
"com.github.wxiaoqi.security.admin.entity.AppShareholderDetail"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
63f350f9
...
@@ -211,6 +211,6 @@ public interface VehicleFeign {
...
@@ -211,6 +211,6 @@ public interface VehicleFeign {
@GetMapping
(
"/branchCompany/company_info"
)
@GetMapping
(
"/branchCompany/company_info"
)
Map
<
Integer
,
String
>
findCompanyMap
();
Map
<
Integer
,
String
>
findCompanyMap
();
@RequestMapping
(
value
=
"/branchCompany/{id}"
,
method
=
RequestMethod
.
GET
)
/*
@RequestMapping(value ="/branchCompany/{id}",method = RequestMethod.GET)
RestResponse
<
BranchCompany
>
get
(
@PathVariable
Integer
id
);
RestResponse<BranchCompany> get(@PathVariable Integer id);
*/
}
}
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