Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
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
QG
cash-loan-flow-boss
Commits
685353ae
Commit
685353ae
authored
Jul 16, 2020
by
王向伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
迭代功能
parent
309dd2d7
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
124 additions
and
10 deletions
+124
-10
ChannelConfAddModel.java
...shloanflowboss/api/channel/model/ChannelConfAddModel.java
+2
-0
ChannelConfBaseModel.java
...hloanflowboss/api/channel/model/ChannelConfBaseModel.java
+1
-3
ChannelConfVo.java
...oup/cashloanflowboss/api/channel/model/ChannelConfVo.java
+4
-0
ChannelConfService.java
...hloanflowboss/api/channel/service/ChannelConfService.java
+2
-0
ChannelConfServiceImpl.java
...nflowboss/api/channel/service/ChannelConfServiceImpl.java
+28
-5
ChannelSecurityKey.java
...p/cashloanflowboss/spi/clf/entity/ChannelSecurityKey.java
+53
-0
ChannelSecurityKeyRepository.java
...boss/spi/clf/repository/ChannelSecurityKeyRepository.java
+16
-0
CLFCenterService.java
...up/cashloanflowboss/spi/clf/service/CLFCenterService.java
+4
-0
CLFCenterServiceImpl.java
...ashloanflowboss/spi/clf/service/CLFCenterServiceImpl.java
+13
-0
ChannelApplyInfoStrategyTest.java
...owboss/service/contract/ChannelApplyInfoStrategyTest.java
+1
-2
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/model/ChannelConfAddModel.java
View file @
685353ae
...
...
@@ -18,4 +18,6 @@ public class ChannelConfAddModel {
private
String
repaymentPlanCallBackUrl
;
private
String
message
;
private
String
extendData
;
private
String
publicKey
;
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/model/ChannelConfBaseModel.java
View file @
685353ae
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
model
;
import
cn.quantgroup.cashloanflowboss.spi.clf.entity.ChannelApplyInfoStrategy
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
...
...
@@ -21,7 +19,7 @@ public class ChannelConfBaseModel {
private
Integer
fundId
;
private
Integer
p2pFundId
;
private
List
<
ChannelApplyInfoStrategy
>
channelApplyInfoStrategyList
;
/**
* 对应productId
*/
...
...
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/model/ChannelConfVo.java
View file @
685353ae
package
cn
.
quantgroup
.
cashloanflowboss
.
api
.
channel
.
model
;
import
cn.quantgroup.cashloanflowboss.spi.clf.entity.ChannelApplyInfoStrategy
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
* function:
...
...
@@ -17,4 +19,6 @@ public class ChannelConfVo {
private
ChannelConfBaseModel
basicInfo
;
@NotNull
(
message
=
"回调地址配置信息不能为空"
)
private
ChannelConfAddModel
addInfo
;
private
List
<
ChannelApplyInfoStrategy
>
applyConf
;
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/service/ChannelConfService.java
View file @
685353ae
...
...
@@ -25,4 +25,6 @@ public interface ChannelConfService {
String
exportChannelConf
(
Long
channelId
);
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/service/ChannelConfServiceImpl.java
View file @
685353ae
...
...
@@ -78,7 +78,12 @@ public class ChannelConfServiceImpl implements ChannelConfService {
channelConfVo
=
ChannelConfUtil
.
getChannelConfVoByClf
(
channelConfiguration
,
approve
,
orderStatus
,
repaymentPlan
);
}
List
<
ChannelApplyInfoStrategy
>
channelApplyInfoStrategyByChannelId
=
clfCenterService
.
findChannelApplyInfoStrategyByChannelId
(
channelId
);
channelConfVo
.
getBasicInfo
().
setChannelApplyInfoStrategyList
(
channelApplyInfoStrategyByChannelId
);
channelConfVo
.
setApplyConf
(
channelApplyInfoStrategyByChannelId
);
ChannelSecurityKey
channelSecurityKey
=
clfCenterService
.
findChannelSecurityByChannelId
(
channelId
);
if
(
Objects
.
nonNull
(
channelSecurityKey
)){
channelConfVo
.
getAddInfo
().
setPublicKey
(
channelSecurityKey
.
getChannelPublicKey
());
}
return
channelConfVo
;
}
...
...
@@ -109,6 +114,8 @@ public class ChannelConfServiceImpl implements ChannelConfService {
ClfChannelConfiguration
channelConfiguration
=
ChannelConfUtil
.
convert2ClfChannelConfiguration
(
basicInfo
);
List
<
ClfOrderCallBack
>
clfOrderCallBackList
=
ChannelConfUtil
.
convert2ClfOrderCallback
(
basicInfo
.
getChannelId
(),
addInfo
);
ClfChannelConfiguration
channelConfigurationExsit
=
clfCenterService
.
findChannelConfigurationByChannelId
(
basicInfo
.
getChannelId
());
if
(
channelConfigurationExsit
==
null
)
{
// 新保存
channelConfiguration
.
setCreatedAt
(
new
Timestamp
(
System
.
currentTimeMillis
()));
...
...
@@ -135,14 +142,24 @@ public class ChannelConfServiceImpl implements ChannelConfService {
}
//保存进件配置项
Long
channelId
=
basicInfo
.
getChannelId
();
List
<
ChannelApplyInfoStrategy
>
channelApplyInfoStrategyList
=
basicInfo
.
getChannelApplyInfoStrategyList
();
List
<
ChannelApplyInfoStrategy
>
channelApplyInfoStrategyList
=
confVo
.
getApplyConf
();
if
(
CollectionUtils
.
isNotEmpty
(
channelApplyInfoStrategyList
))
{
for
(
ChannelApplyInfoStrategy
strategy
:
channelApplyInfoStrategyList
)
{
clfCenterService
.
saveChannelApplyInfoStrategy
(
strategy
);
}
}
String
channelPublicKey
=
addInfo
.
getPublicKey
();
ChannelSecurityKey
channelSecurityKey
=
clfCenterService
.
findChannelSecurityByChannelId
(
channelConf
.
getChannelId
());
if
(
Objects
.
isNull
(
channelSecurityKey
)){
channelSecurityKey
=
new
ChannelSecurityKey
();
channelSecurityKey
.
setIsActive
(
true
);
channelSecurityKey
.
setCreatedAt
(
new
Timestamp
(
System
.
currentTimeMillis
()));
}
channelSecurityKey
.
setChannelPublicKey
(
channelPublicKey
);
clfCenterService
.
saveChannelSecurityKey
(
channelSecurityKey
);
return
true
;
}
...
...
@@ -168,9 +185,12 @@ public class ChannelConfServiceImpl implements ChannelConfService {
ClfChannelConfiguration
channelConfiguration
=
clfCenterService
.
findChannelConfigurationByChannelId
(
channelId
);
List
<
CallbackConfiguration
>
callbackConfigurations
=
clfCenterService
.
findCallbackConfigurationByChannelId
(
channelId
);
List
<
ChannelApplyInfoStrategy
>
channelApplyInfoStrategies
=
clfCenterService
.
findChannelApplyInfoStrategyByChannelId
(
channelId
);
ChannelSecurityKey
channelSecurityKey
=
clfCenterService
.
findChannelSecurityByChannelId
(
channelId
);
StringJoiner
joiner
=
new
StringJoiner
(
"\n"
);
joiner
.
add
(
generateInsertSql
(
channelConfiguration
));
if
(
Objects
.
nonNull
(
channelConfiguration
)){
joiner
.
add
(
generateInsertSql
(
channelConfiguration
));
}
if
(
CollectionUtils
.
isNotEmpty
(
callbackConfigurations
)){
for
(
CallbackConfiguration
callbackConfiguration
:
callbackConfigurations
)
{
...
...
@@ -183,6 +203,9 @@ public class ChannelConfServiceImpl implements ChannelConfService {
joiner
.
add
(
generateInsertSql
(
channelApplyInfoStrategy
));
}
}
if
(
Objects
.
nonNull
(
channelSecurityKey
)){
joiner
.
add
(
generateInsertSql
(
channelSecurityKey
));
}
return
joiner
.
toString
();
}
...
...
@@ -192,7 +215,7 @@ public class ChannelConfServiceImpl implements ChannelConfService {
private
String
generateInsertSql
(
Object
obj
){
if
(
Objects
.
isNull
(
obj
)){
throw
new
RuntimeException
(
"对象为空,无法解析"
)
;
return
null
;
}
Class
<?>
clazz
=
obj
.
getClass
();
Annotation
[]
annotations
=
clazz
.
getAnnotations
();
...
...
src/main/java/cn/quantgroup/cashloanflowboss/spi/clf/entity/ChannelSecurityKey.java
0 → 100644
View file @
685353ae
package
cn
.
quantgroup
.
cashloanflowboss
.
spi
.
clf
.
entity
;
import
lombok.Getter
;
import
lombok.Setter
;
import
javax.persistence.*
;
import
java.sql.Timestamp
;
/**
* Created by liqing on 2017/7/12 0012.
*/
@Setter
@Getter
@Entity
@Table
(
name
=
"channel_security_key"
,
catalog
=
"cash_loan_flow"
)
public
class
ChannelSecurityKey
{
@Id
@Column
(
name
=
"id"
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@Column
(
name
=
"channel_id"
)
private
Long
channelId
;
@Column
(
name
=
"private_key"
)
private
String
privateKey
;
@Column
(
name
=
"public_key"
)
private
String
publicKey
;
@Column
(
name
=
"channel_private_key"
)
private
String
channelPrivateKey
;
@Column
(
name
=
"channel_public_key"
)
private
String
channelPublicKey
;
@Column
(
name
=
"aes_key"
)
private
String
aesKey
;
@Column
(
name
=
"md5_key"
)
private
String
md5Key
;
@Column
(
name
=
"ex_data"
)
private
String
exData
;
@Column
(
name
=
"is_active"
)
private
Boolean
isActive
;
@Column
(
name
=
"created_at"
)
private
Timestamp
createdAt
;
}
src/main/java/cn/quantgroup/cashloanflowboss/spi/clf/repository/ChannelSecurityKeyRepository.java
0 → 100644
View file @
685353ae
package
cn
.
quantgroup
.
cashloanflowboss
.
spi
.
clf
.
repository
;
import
cn.quantgroup.cashloanflowboss.core.persistence.CashLoanFlowDataSource
;
import
cn.quantgroup.cashloanflowboss.spi.clf.entity.ApplyRequestHistory
;
import
cn.quantgroup.cashloanflowboss.spi.clf.entity.ChannelSecurityKey
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
@CashLoanFlowDataSource
@Repository
public
interface
ChannelSecurityKeyRepository
extends
PagingAndSortingRepository
<
ChannelSecurityKey
,
Long
>,
JpaSpecificationExecutor
<
ApplyRequestHistory
>
{
ChannelSecurityKey
findByChannelId
(
Long
channelId
);
}
\ No newline at end of file
src/main/java/cn/quantgroup/cashloanflowboss/spi/clf/service/CLFCenterService.java
View file @
685353ae
...
...
@@ -47,5 +47,9 @@ public interface CLFCenterService {
List
<
ClfChannelConfiguration
>
findAll
();
void
saveChannelSecurityKey
(
ChannelSecurityKey
securityKey
);
ChannelSecurityKey
findChannelSecurityByChannelId
(
Long
channelId
);
}
src/main/java/cn/quantgroup/cashloanflowboss/spi/clf/service/CLFCenterServiceImpl.java
View file @
685353ae
...
...
@@ -52,6 +52,9 @@ public class CLFCenterServiceImpl implements CLFCenterService {
@Autowired
private
ICallbackConfigurationRepository
callbackConfigurationRepository
;
@Autowired
private
ChannelSecurityKeyRepository
channelSecurityKeyRepository
;
@Override
public
List
<
CallbackFailRecord
>
findCallbackFailRecordByApplyNo
(
String
applyNo
)
{
...
...
@@ -178,4 +181,14 @@ public class CLFCenterServiceImpl implements CLFCenterService {
return
callbackConfigurationRepository
.
findByChannelId
(
channelId
);
}
@Override
public
void
saveChannelSecurityKey
(
ChannelSecurityKey
securityKey
)
{
channelSecurityKeyRepository
.
save
(
securityKey
);
}
@Override
public
ChannelSecurityKey
findChannelSecurityByChannelId
(
Long
channelId
)
{
return
channelSecurityKeyRepository
.
findByChannelId
(
channelId
);
}
}
src/test/java/cn/quantgroup/cashloanflowboss/service/contract/ChannelApplyInfoStrategyTest.java
View file @
685353ae
...
...
@@ -47,8 +47,7 @@ public class ChannelApplyInfoStrategyTest extends CashLoanFlowBossApplicationTes
@Test
public
void
testGetChannelInfo
(){
ChannelConfVo
channelConf
=
channelConfService
.
getChannelConf
(
159881L
);
ChannelConfVo
channelConf
=
channelConfService
.
getChannelConf
(
159889L
);
//ChannelApplyInfoStrategy channelApplyInfoStrategy = channelConf.getBasicInfo().getChannelApplyInfoStrategyList();
//channelApplyInfoStrategy.setChannelUserId(true);
...
...
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