Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
asset-distribution
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-spider
asset-distribution
Commits
128047ed
Commit
128047ed
authored
Sep 15, 2021
by
王业雄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d758bbe7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
23 deletions
+55
-23
ChannelRouteController.java
...controller/route/channelroute/ChannelRouteController.java
+4
-6
ChannelConfigInfoVo.java
.../model/entity/route/channelroute/ChannelConfigInfoVo.java
+1
-1
ChannelRouteAddVo.java
...on/model/entity/route/channelroute/ChannelRouteAddVo.java
+18
-0
ChannelRuleEntity.java
...et/distribution/service/jpa/entity/ChannelRuleEntity.java
+6
-0
FundProductEntity.java
...et/distribution/service/jpa/entity/FundProductEntity.java
+5
-0
ChannelRouteServiceImpl.java
...tribution/service/route/impl/ChannelRouteServiceImpl.java
+21
-4
FundProductServiceImpl.java
...stribution/service/route/impl/FundProductServiceImpl.java
+0
-12
No files found.
src/main/java/com/quantgroup/asset/distribution/controller/route/channelroute/ChannelRouteController.java
View file @
128047ed
package
com
.
quantgroup
.
asset
.
distribution
.
controller
.
route
.
channelroute
;
import
com.quantgroup.asset.distribution.enums.route.SystemType
;
import
com.quantgroup.asset.distribution.enums.route.UserLevel
;
import
com.quantgroup.asset.distribution.enums.route.UserTag
;
import
com.quantgroup.asset.distribution.model.entity.route.channelroute.Channel
ConfigInfo
Vo
;
import
com.quantgroup.asset.distribution.model.entity.route.channelroute.Channel
RouteAdd
Vo
;
import
com.quantgroup.asset.distribution.model.entity.route.channelroute.ChannelRouteQueryVo
;
import
com.quantgroup.asset.distribution.model.entity.route.channelroute.ChannelRouteSaveVo
;
import
com.quantgroup.asset.distribution.model.entity.route.channelroute.FundProInfoVo
;
...
...
@@ -135,16 +134,15 @@ public class ChannelRouteController {
/**
* 新增渠道配置信息
* @param channelRouteSaveVoList
* @param type 0表示新增 1表示编辑
* @param channelRouteAddVo
* @return
*/
@RequestMapping
(
"/addChannelConfig"
)
public
GlobalResponse
addChannelConfig
(
@RequestBody@Valid
@NotEmpty
List
<
ChannelRouteSaveVo
>
channelRouteSaveVoList
,
@NotNull
Integer
type
,
BindingResult
bindingResult
){
public
GlobalResponse
addChannelConfig
(
@RequestBody@Valid
ChannelRouteAddVo
channelRouteAddVo
,
BindingResult
bindingResult
){
if
(
bindingResult
.
hasErrors
()){
return
GlobalResponse
.
error
(
bindingResult
.
getFieldError
().
getDefaultMessage
());
}
channelRouteService
.
addChannelConfig
(
channelRoute
SaveVoList
,
type
);
channelRouteService
.
addChannelConfig
(
channelRoute
AddVo
.
getChannelRouteSaveVoList
(),
channelRouteAddVo
.
getType
()
);
return
GlobalResponse
.
success
();
}
...
...
src/main/java/com/quantgroup/asset/distribution/model/entity/route/channelroute/ChannelConfigInfoVo.java
View file @
128047ed
...
...
@@ -11,7 +11,7 @@ import java.sql.Timestamp;
public
class
ChannelConfigInfoVo
{
private
Long
fundId
;
private
Long
fund
Corp
Id
;
private
Long
fund
Pro
Id
;
private
String
fundName
;
private
String
fundType
;
private
String
orgType
;
...
...
src/main/java/com/quantgroup/asset/distribution/model/entity/route/channelroute/ChannelRouteAddVo.java
0 → 100644
View file @
128047ed
package
com
.
quantgroup
.
asset
.
distribution
.
model
.
entity
.
route
.
channelroute
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.NotEmpty
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@Data
public
class
ChannelRouteAddVo
{
@Valid
@NotEmpty
private
List
<
ChannelRouteSaveVo
>
channelRouteSaveVoList
;
@NotNull
private
Integer
type
;
}
src/main/java/com/quantgroup/asset/distribution/service/jpa/entity/ChannelRuleEntity.java
View file @
128047ed
package
com
.
quantgroup
.
asset
.
distribution
.
service
.
jpa
.
entity
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.*
;
import
java.sql.Timestamp
;
import
java.util.Objects
;
...
...
@@ -11,6 +14,8 @@ import java.util.Objects;
*/
@Entity
@Table
(
name
=
"channel_rule"
,
schema
=
"asset-distribution"
,
catalog
=
""
)
@DynamicInsert
@DynamicUpdate
public
class
ChannelRuleEntity
{
private
long
id
;
private
long
fundProductId
;
...
...
@@ -32,6 +37,7 @@ public class ChannelRuleEntity {
private
Timestamp
updatedAt
;
@Id
@GeneratedValue
@Column
(
name
=
"id"
,
nullable
=
false
)
public
long
getId
()
{
return
id
;
...
...
src/main/java/com/quantgroup/asset/distribution/service/jpa/entity/FundProductEntity.java
View file @
128047ed
package
com
.
quantgroup
.
asset
.
distribution
.
service
.
jpa
.
entity
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.*
;
import
java.sql.Timestamp
;
import
java.util.Objects
;
...
...
@@ -11,6 +14,8 @@ import java.util.Objects;
*/
@Entity
@Table
(
name
=
"fund_product"
,
schema
=
"asset-distribution"
,
catalog
=
""
)
@DynamicInsert
@DynamicUpdate
public
class
FundProductEntity
{
private
Long
id
;
private
Long
fundId
;
...
...
src/main/java/com/quantgroup/asset/distribution/service/route/impl/ChannelRouteServiceImpl.java
View file @
128047ed
...
...
@@ -98,6 +98,12 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
allByChannelIdEqualsaAndEnableEquals
.
stream
().
forEach
(
channelRuleEntity
->
{
ChannelConfigInfoVo
configInfoVo
=
new
ChannelConfigInfoVo
();
BeanUtils
.
copyProperties
(
channelRuleEntity
,
configInfoVo
);
String
userLevel
=
configInfoVo
.
getUserLevel
();
if
(!
StringUtils
.
isEmpty
(
userLevel
)){
configInfoVo
.
setUserLevel
(
userLevel
.
substring
(
1
,
userLevel
.
length
()
-
1
));
}
FundProductEntity
one
=
fundProductRepository
.
findOne
(
channelRuleEntity
.
getFundProductId
());
if
(
Objects
.
nonNull
(
one
)){
configInfoVo
.
setSystermType
(
one
.
getSystermType
());
...
...
@@ -148,10 +154,11 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
if
(
0
!=
type
){
channelRuleRepository
.
deleteAllByChannelIdEqualsAndEnableEquals
(
channelRouteSaveVoList
.
get
(
0
).
getChannelId
(),
Byte
.
valueOf
(
"0"
));
}
channelRouteSaveVoList
.
stream
().
forEach
(
channelRouteSaveVo
->
{
ChannelRuleEntity
channelRuleEntity
=
new
ChannelRuleEntity
();
BeanUtils
.
copyProperties
(
channelRouteSaveVo
,
channelRuleEntity
);
FundProductEntity
fundProductEntity
=
fundProductRepository
.
getByFundIdEqualsAndFundProIdEqualsAndEnableEquals
(
channelRouteSaveVo
.
getFundId
(),
channelRouteSaveVo
.
getFundProId
(),
Byte
.
valueOf
(
"1"
));
List
<
ChannelRuleEntity
>
channelRuleEntityList
=
getChannelRuleEntityList
(
channelRouteSaveVoList
);
channelRuleEntityList
.
stream
().
forEach
(
channelRuleEntity
->
{
FundProductEntity
fundProductEntity
=
fundProductRepository
.
getByFundIdEqualsAndFundProIdEqualsAndEnableEquals
(
channelRuleEntity
.
getFundId
(),
channelRuleEntity
.
getFundProId
(),
Byte
.
valueOf
(
"1"
));
if
(
Objects
.
nonNull
(
fundProductEntity
)){
channelRuleEntity
.
setFundProductId
(
fundProductEntity
.
getId
());
channelRuleEntity
.
setPublishStatus
(
Byte
.
valueOf
(
"0"
));
...
...
@@ -165,6 +172,16 @@ public class ChannelRouteServiceImpl implements IChannelRouteService {
});
}
private
List
<
ChannelRuleEntity
>
getChannelRuleEntityList
(
List
<
ChannelRouteSaveVo
>
channelRouteSaveVoList
){
List
<
ChannelRuleEntity
>
channelRuleEntityList
=
new
ArrayList
<>();
channelRouteSaveVoList
.
stream
().
forEach
(
channelRouteSaveVo
->
{
ChannelRuleEntity
channelRuleEntity
=
new
ChannelRuleEntity
();
BeanUtils
.
copyProperties
(
channelRouteSaveVo
,
channelRuleEntity
);
channelRuleEntityList
.
add
(
channelRuleEntity
);
});
return
channelRuleEntityList
;
}
@Override
public
void
publishChannelConfig
(
Long
channelId
)
{
List
<
ChannelRuleEntity
>
all
=
channelRuleRepository
.
getAllByChannelIdEqualsAndEnableEquals
(
channelId
,
Byte
.
valueOf
(
"1"
));
...
...
src/main/java/com/quantgroup/asset/distribution/service/route/impl/FundProductServiceImpl.java
View file @
128047ed
...
...
@@ -71,18 +71,6 @@ public class FundProductServiceImpl implements IFundProductService {
FundProductEntity
byFundIdEqualsAndFundProIdEquals
=
fundProductRepository
.
getByFundIdEqualsAndFundProIdEquals
(
fundProductEntity
.
getFundId
(),
fundProductEntity
.
getFundProId
());
if
(
Objects
.
isNull
(
byFundIdEqualsAndFundProIdEquals
)){
fundProductEntity
.
setEnable
(
Byte
.
valueOf
(
"1"
));
fundProductEntity
.
setFundType
(
""
);
fundProductEntity
.
setOrgType
(
""
);
fundProductEntity
.
setBusinessType
(
""
);
fundProductEntity
.
setBasicRule
(
""
);
fundProductEntity
.
setAreaTerm
(
0
);
fundProductEntity
.
setCardLimit
(
0
);
fundProductEntity
.
setTelRule
(
""
);
fundProductEntity
.
setAreaRule
(
""
);
fundProductEntity
.
setRuleList
(
""
);
fundProductEntity
.
setCreatedAt
(
Timestamp
.
valueOf
(
LocalDateTime
.
now
()));
fundProductEntity
.
setUpdatedAt
(
Timestamp
.
valueOf
(
LocalDateTime
.
now
()));
fundProductRepository
.
save
(
fundProductEntity
);
}
});
...
...
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