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
34e9223e
Commit
34e9223e
authored
Dec 25, 2019
by
zuoyh
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'saff_update_feature' into dev
parents
2011e08c
b8b3dba9
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
382 additions
and
25 deletions
+382
-25
AppShareholderDetailChangeRecordDTO.java
...curity/admin/dto/AppShareholderDetailChangeRecordDTO.java
+66
-0
AppShareholderDetailDTO.java
...b/wxiaoqi/security/admin/dto/AppShareholderDetailDTO.java
+7
-0
AppShareholderDetail.java
...b/wxiaoqi/security/admin/entity/AppShareholderDetail.java
+7
-1
AppShareholderDetailChangeRecord.java
...curity/admin/entity/AppShareholderDetailChangeRecord.java
+59
-0
AppShareholderDetailVo.java
...hub/wxiaoqi/security/admin/vo/AppShareholderDetailVo.java
+2
-0
AppShareholderDetailBiz.java
...b/wxiaoqi/security/admin/biz/AppShareholderDetailBiz.java
+105
-13
AppShareholderDetailChangeRecordBiz.java
...curity/admin/biz/AppShareholderDetailChangeRecordBiz.java
+53
-0
AppShareholderDetailChangeRecordMapper.java
.../admin/mapper/AppShareholderDetailChangeRecordMapper.java
+7
-0
AppShareholderDetailController.java
...rity/admin/rest/admin/AppShareholderDetailController.java
+35
-5
AppShareholderDetailChangeRecord.xml
...ain/resources/mapper/AppShareholderDetailChangeRecord.xml
+18
-0
AppShareholderDetailMapper.xml
.../src/main/resources/mapper/AppShareholderDetailMapper.xml
+23
-6
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/AppShareholderDetailChangeRecordDTO.java
0 → 100644
View file @
34e9223e
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
@Data
public
class
AppShareholderDetailChangeRecordDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
private
Integer
id
;
/**
* 股东手机号
*/
private
String
phone
;
/**
* 股东名称
*/
private
String
userName
;
/**
* 公司ID
*/
private
Integer
CompanyId
;
/**
* 公司名称
*/
private
String
CompanyName
;
/**
* 操作人名称
*/
private
Integer
operatorId
;
/**
* 入股时间
*/
private
Timestamp
relTime
;
/**
* 股东id
*/
private
Integer
userId
;
/**
* 操作指令
*/
private
Integer
changeState
;
/**
* 0:入股 1:退股
*/
private
Integer
isQuit
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/AppShareholderDetailDTO.java
View file @
34e9223e
...
@@ -61,5 +61,12 @@ public class AppShareholderDetailDTO {
...
@@ -61,5 +61,12 @@ public class AppShareholderDetailDTO {
@ApiModelProperty
(
"股东身份ID"
)
@ApiModelProperty
(
"股东身份ID"
)
private
Integer
positionId
;
private
Integer
positionId
;
/**
* 操作指令
* 1:信息修改
* 2:股权变动
*/
private
Integer
changeState
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppShareholderDetail.java
View file @
34e9223e
...
@@ -7,11 +7,14 @@ import javax.persistence.Column;
...
@@ -7,11 +7,14 @@ import javax.persistence.Column;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
@Table
(
name
=
"app_shareholder_detail"
)
@Table
(
name
=
"app_shareholder_detail"
)
@Data
@Data
public
class
AppShareholderDetail
{
public
class
AppShareholderDetail
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
//此处加上注解
@GeneratedValue
(
generator
=
"JDBC"
)
//此处加上注解
private
Integer
id
;
private
Integer
id
;
...
@@ -55,4 +58,7 @@ public class AppShareholderDetail {
...
@@ -55,4 +58,7 @@ public class AppShareholderDetail {
@Column
(
name
=
"position_id"
)
@Column
(
name
=
"position_id"
)
private
Integer
positionId
;
private
Integer
positionId
;
private
String
companyIdArray
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppShareholderDetailChangeRecord.java
0 → 100644
View file @
34e9223e
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.Date
;
@Data
@Table
(
name
=
"app_shareholder_detail_change_record"
)
public
class
AppShareholderDetailChangeRecord
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
//此处加上注解
private
Integer
id
;
@ApiModelProperty
(
"用户id"
)
@Column
(
name
=
"user_id"
)
private
Integer
userId
;
@ApiModelProperty
(
"公司名称"
)
@Column
(
name
=
"company_name"
)
private
String
companyName
;
@ApiModelProperty
(
"公司ID"
)
@Column
(
name
=
"company_id"
)
private
Integer
companyId
;
@ApiModelProperty
(
"用户手机号"
)
@Column
(
name
=
"phone"
)
private
String
phone
;
@ApiModelProperty
(
"股东名称"
)
@Column
(
name
=
"name"
)
private
String
name
;
@ApiModelProperty
(
"持股状态 0:持股中 1:已退股"
)
@Column
(
name
=
"is_quit"
)
private
Integer
isQuit
;
@ApiModelProperty
(
"创建时间"
)
@Column
(
name
=
"crt_time"
)
private
Long
crtTime
;
@ApiModelProperty
(
"实际入股时间时间"
)
@Column
(
name
=
"rel_time"
)
private
Date
relTime
;
@ApiModelProperty
(
"操作人"
)
@Column
(
name
=
"operator_id"
)
private
Integer
operatorId
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/AppShareholderDetailVo.java
View file @
34e9223e
...
@@ -53,4 +53,6 @@ public class AppShareholderDetailVo {
...
@@ -53,4 +53,6 @@ public class AppShareholderDetailVo {
@ApiModelProperty
(
"股东身份名称"
)
@ApiModelProperty
(
"股东身份名称"
)
private
List
<
String
>
companyList
;
private
List
<
String
>
companyList
;
private
String
companyIdArray
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppShareholderDetailBiz.java
View file @
34e9223e
...
@@ -18,12 +18,14 @@ import com.xxfc.platform.vehicle.feign.VehicleFeign;
...
@@ -18,12 +18,14 @@ import com.xxfc.platform.vehicle.feign.VehicleFeign;
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
;
import
org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -48,6 +50,9 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -48,6 +50,9 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
@Autowired
@Autowired
private
AppUserPositionBiz
appUserPositionBiz
;
private
AppUserPositionBiz
appUserPositionBiz
;
@Autowired
private
AppShareholderDetailChangeRecordBiz
appShareholderDetailChangeRecordBiz
;
@Autowired
@Autowired
private
ThreadPoolTaskExecutor
threadPoolTaskExecutor
;
private
ThreadPoolTaskExecutor
threadPoolTaskExecutor
;
...
@@ -56,6 +61,10 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -56,6 +61,10 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
public
static
int
BRANCH_HEADQUARTERS_SHAREHOLDER
=
2
;
public
static
int
BRANCH_HEADQUARTERS_SHAREHOLDER
=
2
;
public
static
int
SHAREHOLDERDE_IS_TRUE
=
0
;
public
static
int
SHAREHOLDERDE_IS_FALSE
=
1
;
private
final
int
BORDER_NUM
=
250
;
private
final
int
BORDER_NUM
=
250
;
...
@@ -89,6 +98,8 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -89,6 +98,8 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
if
(
branchCompany
.
getData
()
==
null
)
{
if
(
branchCompany
.
getData
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"分公司不存在"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"分公司不存在"
);
}
}
appShareholderDetailDTO
.
setCompanyId
(
companyId
);
appShareholderDetailDTO
.
setCompanyId
(
companyId
);
appShareholderDetailDTO
.
setCompanyName
(
branchCompany
.
getData
().
getName
());
appShareholderDetailDTO
.
setCompanyName
(
branchCompany
.
getData
().
getName
());
Integer
positionId
=
branchCompany
.
getData
().
getId
().
equals
(
1
)
?
HEADQUARTERS_SHAREHOLDER
:
BRANCH_HEADQUARTERS_SHAREHOLDER
;
Integer
positionId
=
branchCompany
.
getData
().
getId
().
equals
(
1
)
?
HEADQUARTERS_SHAREHOLDER
:
BRANCH_HEADQUARTERS_SHAREHOLDER
;
...
@@ -101,20 +112,84 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -101,20 +112,84 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
//关联查询detail表 获取身份
//关联查询detail表 获取身份
AppUserDetail
appUserDetail
=
detailBiz
.
checkeIsAppUser
(
userId
);
AppUserDetail
appUserDetail
=
detailBiz
.
checkeIsAppUser
(
userId
);
if
(!(
appUserDetail
.
getPositionId
().
equals
(
1
)))
{
if
(!(
appUserDetail
.
getPositionId
().
equals
(
1
)))
{
if
(
positionId
.
equals
(
1
))
{
detailBiz
.
updateUserPositionByUserId
(
userId
,
positionId
);
detailBiz
.
updateUserPositionByUserId
(
userId
,
positionId
);
}
}
}
}
}
Integer
id
=
appShareholderDetailDTO
.
getId
()
==
null
?
0
:
appShareholderDetailDTO
.
getId
();
//判断股东表是否有数据,有则不插入
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
Example
example
=
new
Example
(
AppShareholderDetail
.
class
);
appShareholderDetail
.
setPositionId
(
positionId
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
appShareholderDetailDTO
.
setUserId
(
userId
);
criteria
.
andEqualTo
(
"userId"
,
userId
);
insertSelective
(
appShareholderDetail
);
criteria
.
andEqualTo
(
"companyId"
,
companyId
);
if
(
appShareholderDetailDTO
.
getPhone
()
!=
null
)
{
criteria
.
andEqualTo
(
"phone"
,
appShareholderDetailDTO
.
getPhone
());
}
List
<
AppShareholderDetail
>
listappShareholderDetai
=
selectByExample
(
example
);
if
(
listappShareholderDetai
.
size
()
==
0
)
{
Integer
id
=
appShareholderDetailDTO
.
getId
()
==
null
?
0
:
appShareholderDetailDTO
.
getId
();
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
appShareholderDetail
.
setPositionId
(
positionId
);
appShareholderDetailDTO
.
setUserId
(
userId
);
// insertSelective(appShareholderDetail);
addUserFindId
(
appShareholderDetail
);
//插入记录表
appShareholderDetailChangeRecordBiz
.
addAppShareholderDetailChangeRecord
(
appShareholderDetail
,
updUserId
,
SHAREHOLDERDE_IS_TRUE
);
}
}
}
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
//分开事务,先新增股东表 ,获取自增长ID ,存入股东变更记录表
public
AppShareholderDetail
addUserFindId
(
AppShareholderDetail
appShareholderDetail
)
{
AppShareholderDetail
appShareholderDetailNew
=
new
AppShareholderDetail
();
insertSelective
(
appShareholderDetail
);
BeanUtils
.
copyProperties
(
appShareholderDetail
,
appShareholderDetailNew
);
return
appShareholderDetailNew
;
}
/**
* 编辑股东信息
*/
public
ObjectRestResponse
updSharehoder
(
AppShareholderDetailDTO
appShareholderDetailDTO
,
Integer
updUserId
)
{
if
(
appShareholderDetailDTO
.
getChangeState
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"请输入操作指令"
);
}
if
(
appShareholderDetailDTO
.
getId
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"请传入修改股东ID"
);
}
AppShareholderDetail
appShareholderDetail
=
new
AppShareholderDetail
();
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
//信息修改
if
(
appShareholderDetailDTO
.
getChangeState
().
equals
(
1
))
{
updateSelectiveById
(
appShareholderDetail
);
// updateById(appShareholderDetail);
}
else
if
(
appShareholderDetailDTO
.
getChangeState
().
equals
(
2
))
{
if
(
appShareholderDetailDTO
.
getCompanyList
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"请传入需要退股的公司"
);
}
if
(
appShareholderDetailDTO
.
getRelTime
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"请输入退股时间"
);
}
if
(
appShareholderDetailDTO
.
getPhone
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"请输入股东号码"
);
}
for
(
String
company
:
appShareholderDetailDTO
.
getCompanyList
())
{
Integer
companyId
=
Integer
.
valueOf
(
company
);
appShareholderDetail
.
setIsQuit
(
SHAREHOLDERDE_IS_FALSE
);
updateSelectiveById
(
appShareholderDetail
);
AppShareholderDetail
updAppShareholderDetail
=
selectById
(
appShareholderDetail
);
RestResponse
<
BranchCompany
>
branchCompany
=
vehicleFeign
.
get
(
companyId
);
String
companyName
=
branchCompany
.
getData
().
getName
();
updAppShareholderDetail
.
setCompanyName
(
companyName
);
//插入记录表
appShareholderDetailChangeRecordBiz
.
addAppShareholderDetailChangeRecord
(
updAppShareholderDetail
,
updUserId
,
SHAREHOLDERDE_IS_FALSE
);
}
}
return
ObjectRestResponse
.
succ
();
}
/**
/**
* 分页查询
* 分页查询
...
@@ -190,9 +265,9 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -190,9 +265,9 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
* 批量导入
* 批量导入
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
int
importShareholder
(
List
<
String
[]>
shareholderData
)
{
public
int
importShareholder
(
List
<
String
[]>
shareholderData
,
Integer
operatorId
)
{
List
<
AppShareholderDetail
>
appShareholderDetail
=
new
ArrayList
<>();
List
<
AppShareholderDetail
>
appShareholderDetail
=
new
ArrayList
<>();
int
size
=
wrapperData
(
shareholderData
);
int
size
=
wrapperData
(
shareholderData
,
operatorId
);
/*int threadNums = shareholderData.size() / BORDER_NUM == 0 ? 1 : shareholderData.size() / BORDER_NUM;
/*int threadNums = shareholderData.size() / BORDER_NUM == 0 ? 1 : shareholderData.size() / BORDER_NUM;
CountDownLatch latch = new CountDownLatch(threadNums);
CountDownLatch latch = new CountDownLatch(threadNums);
...
@@ -216,9 +291,9 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -216,9 +291,9 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
/**
/**
* @param subResultDate
* @param subResultDate
*/
*/
private
int
wrapperData
(
List
<
String
[]>
subResultDate
)
{
private
int
wrapperData
(
List
<
String
[]>
subResultDate
,
Integer
operatorId
)
{
int
size
=
subResultDate
.
get
(
0
).
length
;
int
size
=
subResultDate
.
get
(
0
).
length
;
int
total
=
0
;
int
total
=
0
;
subResultDate
.
remove
(
0
);
subResultDate
.
remove
(
0
);
for
(
String
[]
data
:
subResultDate
)
{
for
(
String
[]
data
:
subResultDate
)
{
data
=
Arrays
.
copyOf
(
data
,
size
);
data
=
Arrays
.
copyOf
(
data
,
size
);
...
@@ -262,7 +337,24 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
...
@@ -262,7 +337,24 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
appShareholderDetailDTO
.
setCrtTime
(
System
.
currentTimeMillis
());
appShareholderDetailDTO
.
setCrtTime
(
System
.
currentTimeMillis
());
AppShareholderDetail
appShareholderDetail
=
new
AppShareholderDetail
();
AppShareholderDetail
appShareholderDetail
=
new
AppShareholderDetail
();
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
mapper
.
insertSelective
(
appShareholderDetail
);
//判断股东表是否有数据,有则不插入
Example
example
=
new
Example
(
AppShareholderDetail
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"userId"
,
userId
);
criteria
.
andEqualTo
(
"companyId"
,
branchCompany
.
getId
());
if
(
appShareholderDetailDTO
.
getPhone
()
!=
null
)
{
criteria
.
andEqualTo
(
"phone"
,
appShareholderDetailDTO
.
getPhone
());
}
List
<
AppShareholderDetail
>
listappShareholderDetai
=
selectByExample
(
example
);
if
(
listappShareholderDetai
.
size
()
==
0
)
{
Integer
id
=
appShareholderDetailDTO
.
getId
()
==
null
?
0
:
appShareholderDetailDTO
.
getId
();
BeanUtils
.
copyProperties
(
appShareholderDetailDTO
,
appShareholderDetail
);
appShareholderDetail
.
setPositionId
(
positionId
);
appShareholderDetailDTO
.
setUserId
(
userId
);
addUserFindId
(
appShareholderDetail
);
//插入记录表
appShareholderDetailChangeRecordBiz
.
addAppShareholderDetailChangeRecord
(
appShareholderDetail
,
operatorId
,
SHAREHOLDERDE_IS_TRUE
);
}
}
}
}
}
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppShareholderDetailChangeRecordBiz.java
0 → 100644
View file @
34e9223e
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.dto.AppShareholderDetailChangeRecordDTO
;
import
com.github.wxiaoqi.security.admin.dto.AppShareholderDetailDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppShareholderDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppShareholderDetailChangeRecord
;
import
com.github.wxiaoqi.security.admin.mapper.AppShareholderDetailChangeRecordMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.apache.commons.beanutils.BeanUtils
;
import
tk.mybatis.mapper.entity.Example
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.ArrayList
;
import
java.util.List
;
@Slf4j
@Transactional
@Service
(
"appShareholderDetailChangeRecordBiz"
)
public
class
AppShareholderDetailChangeRecordBiz
extends
BaseBiz
<
AppShareholderDetailChangeRecordMapper
,
AppShareholderDetailChangeRecord
>
{
/**
* 股东变变更记录插入
*/
public
void
addAppShareholderDetailChangeRecord
(
AppShareholderDetail
appShareholderDetail
,
Integer
operatorId
,
Integer
changeState
)
{
AppShareholderDetailChangeRecord
appShareholderDetailChangeRecord
=
new
AppShareholderDetailChangeRecord
();
appShareholderDetailChangeRecord
.
setRelTime
(
appShareholderDetail
.
getRelTime
());
appShareholderDetailChangeRecord
.
setName
(
appShareholderDetail
.
getName
());
appShareholderDetailChangeRecord
.
setPhone
(
appShareholderDetail
.
getPhone
());
appShareholderDetailChangeRecord
.
setCompanyId
(
appShareholderDetail
.
getCompanyId
());
appShareholderDetailChangeRecord
.
setCompanyName
(
appShareholderDetail
.
getCompanyName
());
appShareholderDetailChangeRecord
.
setOperatorId
(
operatorId
);
appShareholderDetailChangeRecord
.
setIsQuit
(
changeState
);
appShareholderDetailChangeRecord
.
setUserId
(
appShareholderDetail
.
getId
());
appShareholderDetailChangeRecord
.
setCrtTime
(
System
.
currentTimeMillis
());
mapper
.
insertSelective
(
appShareholderDetailChangeRecord
);
}
/**
* 查询员工信息变更记录表
*/
public
List
<
AppShareholderDetailChangeRecord
>
findShareholderChangeRecord
(
AppShareholderDetail
appShareholderDetail
)
{
Example
example
=
new
Example
(
AppShareholderDetailChangeRecord
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"userId"
,
appShareholderDetail
.
getId
());
if
(
appShareholderDetail
.
getPhone
()
!=
null
)
{
criteria
.
andEqualTo
(
"phone"
,
appShareholderDetail
.
getPhone
());
}
List
<
AppShareholderDetailChangeRecord
>
list
=
mapper
.
selectByExample
(
example
);
return
list
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppShareholderDetailChangeRecordMapper.java
0 → 100644
View file @
34e9223e
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppShareholderDetailChangeRecord
;
import
tk.mybatis.mapper.common.Mapper
;
public
interface
AppShareholderDetailChangeRecordMapper
extends
Mapper
<
AppShareholderDetailChangeRecord
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/admin/AppShareholderDetailController.java
View file @
34e9223e
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
.
admin
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
.
admin
;
import
com.github.wxiaoqi.security.admin.biz.AppShareholderDetailBiz
;
import
com.github.wxiaoqi.security.admin.biz.AppShareholderDetailBiz
;
import
com.github.wxiaoqi.security.admin.biz.AppShareholderDetailChangeRecordBiz
;
import
com.github.wxiaoqi.security.admin.dto.AppShareholderDetailDTO
;
import
com.github.wxiaoqi.security.admin.dto.AppShareholderDetailDTO
;
import
com.github.wxiaoqi.security.admin.dto.AppShareholderDetailFindDTO
;
import
com.github.wxiaoqi.security.admin.dto.AppShareholderDetailFindDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppShareholderDetail
;
import
com.github.wxiaoqi.security.admin.vo.AppShareholderDetailVo
;
import
com.github.wxiaoqi.security.admin.vo.AppShareholderDetailVo
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
...
@@ -35,18 +37,22 @@ public class AppShareholderDetailController {
...
@@ -35,18 +37,22 @@ public class AppShareholderDetailController {
@Autowired
@Autowired
private
AppShareholderDetailBiz
appShareholderDetailBiz
;
private
AppShareholderDetailBiz
appShareholderDetailBiz
;
@Autowired
private
AppShareholderDetailChangeRecordBiz
appShareholderDetailChangeRecordBiz
;
@ApiOperation
(
"批量导入股东"
)
@ApiOperation
(
"批量导入股东"
)
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
public
ObjectRestResponse
importAppShareholder
(
@RequestPart
(
"file"
)
MultipartFile
appShareholderExcel
,
HttpServletRequest
request
)
{
public
ObjectRestResponse
importAppShareholder
(
@RequestPart
(
"file"
)
MultipartFile
appShareholderExcel
,
HttpServletRequest
request
)
{
try
{
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
Integer
operatorId
=
Integer
.
valueOf
(
infoFromToken
.
getId
());
List
<
String
[]>
appShareholderData
=
ExcelImport
.
getExcelData
(
appShareholderExcel
);
List
<
String
[]>
appShareholderData
=
ExcelImport
.
getExcelData
(
appShareholderExcel
);
if
(
appShareholderData
.
size
()
<
1
)
{
if
(
appShareholderData
.
size
()
<
1
)
{
return
ObjectRestResponse
.
createFailedResult
(
1001
,
"导入不能没数据!!!"
);
return
ObjectRestResponse
.
createFailedResult
(
1001
,
"导入不能没数据!!!"
);
}
}
// appShareholderData.remove(0);
// appShareholderData.remove(0);
try
{
try
{
int
effectSize
=
appShareholderDetailBiz
.
importShareholder
(
appShareholderData
);
int
effectSize
=
appShareholderDetailBiz
.
importShareholder
(
appShareholderData
,
operatorId
);
return
ObjectRestResponse
.
succ
(
effectSize
);
return
ObjectRestResponse
.
succ
(
effectSize
);
}
catch
(
BaseException
ex
)
{
}
catch
(
BaseException
ex
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
...
@@ -67,9 +73,8 @@ public class AppShareholderDetailController {
...
@@ -67,9 +73,8 @@ public class AppShareholderDetailController {
}
}
/**
/**
* 新增
或编辑身份
信息
* 新增
股东
信息
*
*
* @return
* @return
*/
*/
...
@@ -77,13 +82,38 @@ public class AppShareholderDetailController {
...
@@ -77,13 +82,38 @@ public class AppShareholderDetailController {
public
ObjectRestResponse
<
Void
>
addUserPostion
(
@RequestBody
AppShareholderDetailDTO
appShareholderDetailDTO
,
HttpServletRequest
request
)
{
public
ObjectRestResponse
<
Void
>
addUserPostion
(
@RequestBody
AppShareholderDetailDTO
appShareholderDetailDTO
,
HttpServletRequest
request
)
{
try
{
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
Integer
updUse
rId
=
Integer
.
valueOf
(
infoFromToken
.
getId
());
Integer
operato
rId
=
Integer
.
valueOf
(
infoFromToken
.
getId
());
return
appShareholderDetailBiz
.
add
(
appShareholderDetailDTO
,
updUse
rId
);
return
appShareholderDetailBiz
.
add
(
appShareholderDetailDTO
,
operato
rId
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"新增失败【{}】"
,
e
);
log
.
error
(
"新增失败【{}】"
,
e
);
throw
new
BaseException
(
"新增失败"
);
throw
new
BaseException
(
"新增失败"
);
}
}
}
}
/**
* 股东身份信息变更
*
* @return
*/
@PostMapping
(
"/updUserPostion"
)
public
ObjectRestResponse
<
Void
>
updUserPostion
(
@RequestBody
AppShareholderDetailDTO
appShareholderDetailDTO
,
HttpServletRequest
request
)
{
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
Integer
operatorId
=
Integer
.
valueOf
(
infoFromToken
.
getId
());
return
appShareholderDetailBiz
.
updSharehoder
(
appShareholderDetailDTO
,
operatorId
);
}
catch
(
Exception
e
)
{
log
.
error
(
"修改失败【{}】"
,
e
);
throw
new
BaseException
(
"修改失败"
);
}
}
/**
* 查询股東信息变更记录表
*/
@GetMapping
(
"/findShareholderChangeRecord"
)
public
ObjectRestResponse
findShareholderChangeRecord
(
AppShareholderDetail
appShareholderDetail
)
{
return
ObjectRestResponse
.
succ
(
appShareholderDetailChangeRecordBiz
.
findShareholderChangeRecord
(
appShareholderDetail
));
}
}
}
ace-modules/ace-admin/src/main/resources/mapper/AppShareholderDetailChangeRecord.xml
0 → 100644
View file @
34e9223e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.github.wxiaoqi.security.admin.mapper.AppShareholderDetailChangeRecordMapper"
>
<resultMap
id=
"appShareholderDetailMap"
type=
"com.github.wxiaoqi.security.admin.entity.AppShareholderDetailChangeRecord"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"companyName"
column=
"company_name"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"phone"
column=
"phone"
/>
<result
property=
"companyId"
column=
"company_id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"isQuit"
column=
"is_quit"
/>
<result
property=
"relTime"
column=
"rel_time"
/>
</resultMap>
</mapper>
ace-modules/ace-admin/src/main/resources/mapper/AppShareholderDetailMapper.xml
View file @
34e9223e
...
@@ -28,27 +28,30 @@
...
@@ -28,27 +28,30 @@
</otherwise>
</otherwise>
</choose>
</choose>
</select>
</select>
<select
id=
"findPage"
resultMap=
"detail"
>
<select
id=
"findPage"
resultType=
"com.github.wxiaoqi.security.admin.entity.AppShareholderDetail"
>
select * from (
select * from (
select max(id) as id,max(name) as `name`,max(is_quit) as `isQuit`,max(position_id) as `positionId`,phone as
select max(id) as id,max(name) as `name`,max(is_quit) as `isQuit`,max(position_id) as `positionId`,phone as
`phone`,group_concat(company_name) as `companyName`,max(company_id) as `companyId` from app_shareholder_detail
`phone`,group_concat(company_name) as `companyName`,group_concat(company_id) as `companyIdArray` from
app_shareholder_detail
where is_quit=0 and
where is_quit=0 and
position_id=1 group by phone
position_id=1 group by phone
union ALL
union ALL
select max(id) as id,max(name) as `name`,max(is_quit) as `isQuit`,max(position_id) as `positionId`,phone as
select max(id) as id,max(name) as `name`,max(is_quit) as `isQuit`,max(position_id) as `positionId`,phone as
`phone`,group_concat(company_name) as `companyName` ,max(company_id) as `companyId`from app_shareholder_detail
`phone`,group_concat(company_name) as `companyName` ,group_concat(company_id) as `companyIdArray` from
app_shareholder_detail
where is_quit=0 and
where is_quit=0 and
position_id=2 group by phone
position_id=2 group by phone
union ALL
union ALL
select max(id) as id,max(name) as `name`,max(is_quit) as `isQuit`,max(position_id) as `positionId`,phone as
select max(id) as id,max(name) as `name`,max(is_quit) as `isQuit`,max(position_id) as `positionId`,phone as
`phone`,group_concat(company_name) as `companyName` ,max(company_id) as `companyId`from app_shareholder_detail
`phone`,group_concat(company_name) as `companyName` ,group_concat(company_id) as `companyIdArray`from
app_shareholder_detail
where is_quit=1 and position_id
where is_quit=1 and position_id
=1 group by phone
=1 group by phone
union all
union all
select max(id) as id,max(name) as `name`,max(is_quit) as `isQuit`,max(position_id) as `positionId`,phone as
select max(id) as id,max(name) as `name`,max(is_quit) as `isQuit`,max(position_id) as `positionId`,phone as
`phone`,group_concat(company_name) as `companyName` ,max(company_id) as `companyId`from app_shareholder_detail
`phone`,group_concat(company_name) as `companyName` ,group_concat(company_id) as `companyIdArray`from
app_shareholder_detail
where is_quit=1 and position_id
where is_quit=1 and position_id
=2 group by phone
=2 group by phone
) a
) a
...
@@ -66,4 +69,18 @@
...
@@ -66,4 +69,18 @@
and a.companyId=#{companyId}
and a.companyId=#{companyId}
</if>
</if>
</select>
</select>
<resultMap
id=
"detail"
type=
"com.github.wxiaoqi.security.admin.entity.AppShareholderDetail"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"companyName"
column=
"companyName"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"phone"
column=
"phone"
/>
<result
property=
"companyId"
column=
"company_id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"isQuit"
column=
"is_quit"
/>
<result
property=
"updTime"
column=
"upd_time"
/>
<result
property=
"positionId"
column=
"positionId"
/>
<result
property=
"companyIdArray"
column=
"companyIdArray"
/>
</resultMap>
</mapper>
</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