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
bd72559e
Commit
bd72559e
authored
Mar 30, 2020
by
郑建
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
量子魔方6.6第二期
parent
b67fddea
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
422 additions
and
10 deletions
+422
-10
DataSourceConfig.java
...sset/distribution/config/datasource/DataSourceConfig.java
+3
-6
FundModuleController.java
...p/asset/distribution/controller/FundModuleController.java
+29
-0
RuleOperator.java
...com/quantgroup/asset/distribution/enums/RuleOperator.java
+4
-0
FundConfigCondition.java
...t/distribution/model/entity/fund/FundConfigCondition.java
+29
-0
IFundModuleService.java
...sset/distribution/service/funding/IFundModuleService.java
+8
-0
FundModuleServiceImpl.java
...tribution/service/funding/impl/FundModuleServiceImpl.java
+325
-3
NiwodaiTest.java
...om/quantgroup/asset/distribution/niwodai/NiwodaiTest.java
+24
-1
No files found.
src/main/java/com/quantgroup/asset/distribution/config/datasource/DataSourceConfig.java
View file @
bd72559e
...
...
@@ -21,12 +21,9 @@ import com.alibaba.druid.pool.DruidDataSource;
@Configuration
public
class
DataSourceConfig
{
@Value
(
"${spring.datasource.primary.url}"
)
private
String
dbUrl
;
@Value
(
"${spring.datasource.primary.username}"
)
private
String
username
;
@Value
(
"${spring.datasource.primary.password}"
)
private
String
password
;
private
String
dbUrl
=
"jdbc:mysql://172.17.5.9:31024/asset_distribution?useUnicode=true&characterEncoding=utf-8"
;
private
String
username
=
"qa"
;
private
String
password
=
"qatest"
;
@Value
(
"${spring.datasource.primary.driver-class-name}"
)
private
String
driverClassName
;
...
...
src/main/java/com/quantgroup/asset/distribution/controller/FundModuleController.java
View file @
bd72559e
package
com
.
quantgroup
.
asset
.
distribution
.
controller
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
com.quantgroup.asset.distribution.model.entity.fund.FundConfigCondition
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -109,6 +112,10 @@ public class FundModuleController {
return
findChannelFundConfigCommon
(
configId
,
2
);
}
@RequestMapping
(
"/simulation/conditions"
)
public
GlobalResponse
allConditions
(
Long
configId
){
return
fundConfigConditions
(
configId
);
}
private
GlobalResponse
saveChannelFundsConfigCommon
(
Integer
type
,
Long
id
,
String
bizChannel
,
String
funds
,
String
remarks
,
String
auditor
,
String
proposer
,
int
oldOrNew
)
{
...
...
@@ -182,4 +189,26 @@ public class FundModuleController {
log
.
info
(
"资方模块接口, 根据id获取资方配置, configId : {} 耗时 : {}, response : {}"
,
configId
,
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
),
JSON
.
toJSONString
(
response
));
return
response
;
}
private
GlobalResponse
fundConfigConditions
(
Long
configId
){
log
.
info
(
"资方模块接口,根据id获取所有案例, configId : {}"
,
configId
);
if
(
configId
==
null
)
{
return
GlobalResponse
.
create
(
FundModuleResponse
.
ID_IS_EMPTY
);
}
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
GlobalResponse
response
=
fundModuleService
.
getAllConditionsOfFundConfig
(
configId
);
log
.
info
(
"资方模块接口,根据id获取所有案例, configId : {} 耗时 : {}, response : {}"
,
configId
,
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
),
JSON
.
toJSONString
(
response
));
return
response
;
}
private
GlobalResponse
simulation
(
List
<
FundConfigCondition
>
configConditions
,
Long
configId
){
log
.
info
(
"资方模块接口,根据案例进行空泡, configConditions : {}"
,
configConditions
);
if
(
CollectionUtils
.
isEmpty
(
configConditions
))
{
return
GlobalResponse
.
create
(
FundModuleResponse
.
ID_IS_EMPTY
);
}
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
GlobalResponse
response
=
fundModuleService
.
simulationCases
(
configConditions
,
configId
);
log
.
info
(
"资方模块接口,根据id获取所有案例, configConditions : {} 耗时 : {}, response : {}"
,
configConditions
,
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
),
JSON
.
toJSONString
(
response
));
return
response
;
}
}
src/main/java/com/quantgroup/asset/distribution/enums/RuleOperator.java
View file @
bd72559e
...
...
@@ -43,4 +43,8 @@ public enum RuleOperator {
log
.
error
(
"枚举不存在,code={}"
,
code
);
throw
new
QGException
(
QGExceptionType
.
COMMON_ILLEGAL_PARAM
);
}
public
String
getCode
()
{
return
this
.
code
;
}
}
src/main/java/com/quantgroup/asset/distribution/model/entity/fund/FundConfigCondition.java
0 → 100644
View file @
bd72559e
package
com
.
quantgroup
.
asset
.
distribution
.
model
.
entity
.
fund
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
FundConfigCondition
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
conditionTempId
;
private
List
<
Condition
>
condition
;
private
Result
result
;
@Data
public
static
class
Condition
{
private
String
conditionCode
;
private
String
conditionName
;
private
String
conditionValue
;
}
@Data
public
static
class
Result
{
private
Boolean
success
;
private
String
fundInfo
;
}
}
src/main/java/com/quantgroup/asset/distribution/service/funding/IFundModuleService.java
View file @
bd72559e
package
com
.
quantgroup
.
asset
.
distribution
.
service
.
funding
;
import
com.quantgroup.asset.distribution.config.annotation.HandleException
;
import
com.quantgroup.asset.distribution.model.entity.fund.FundConfigCondition
;
import
com.quantgroup.asset.distribution.model.response.GlobalResponse
;
import
java.util.List
;
/**
* 资方模块Service
* @author liwenbin
...
...
@@ -99,4 +103,8 @@ public interface IFundModuleService {
* @return
*/
public
GlobalResponse
audit
(
Long
id
,
Integer
auditStatus
);
GlobalResponse
getAllConditionsOfFundConfig
(
Long
configId
);
GlobalResponse
simulationCases
(
List
<
FundConfigCondition
>
configConditions
,
Long
configId
);
}
src/main/java/com/quantgroup/asset/distribution/service/funding/impl/FundModuleServiceImpl.java
View file @
bd72559e
This diff is collapsed.
Click to expand it.
src/test/java/com/quantgroup/asset/distribution/niwodai/NiwodaiTest.java
View file @
bd72559e
...
...
@@ -6,6 +6,9 @@ import cn.quantgroup.user.IUserSdkService;
import
cn.quantgroup.user.UserSdkServiceFactory
;
import
com.alibaba.fastjson.JSON
;
import
com.quantgroup.asset.distribution.AssetDistributionBootstrap
;
import
com.quantgroup.asset.distribution.model.entity.fund.FundConfigCondition
;
import
com.quantgroup.asset.distribution.model.entity.fund.FundConfigSimulationVO
;
import
com.quantgroup.asset.distribution.service.funding.IFundModuleService
;
import
com.quantgroup.asset.distribution.service.niwodai.INiwodaiAssetService
;
import
com.quantgroup.asset.distribution.service.niwodai.INiwodaiService
;
import
com.quantgroup.asset.distribution.service.niwodai.vo.*
;
...
...
@@ -21,6 +24,7 @@ import org.springframework.test.context.junit4.SpringRunner;
import
javax.annotation.PostConstruct
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
@RunWith
(
SpringRunner
.
class
)
...
...
@@ -37,6 +41,8 @@ public class NiwodaiTest {
@Value
(
"${user.sdk.url}"
)
private
String
userSysUrl
;
private
IUserSdkService
userSdkService
;
@Autowired
private
IFundModuleService
fundModuleService
;
@PostConstruct
private
void
init
()
{
userSdkService
=
UserSdkServiceFactory
.
generateSDKService
(
userSysUrl
,
httpClient
);
...
...
@@ -63,8 +69,25 @@ public class NiwodaiTest {
@Test
public
void
testIncoming
()
{
NiwodaiIncomingResponseVO
vo
=
niwodaiAssetService
.
incoming
(
"ae7d04bf-1c5a-475b-98d2-b193be88cf2f"
,
"1028791648161"
,
"10000"
,
12
);
NiwodaiIncomingResponseVO
vo
=
niwodaiAssetService
.
incoming
(
"2f0c65a8-c94e-4e03-87c6-b0ae99b100f0"
,
"AN000000135399103854755840"
,
"10000"
,
12
);
System
.
out
.
println
(
JSON
.
toJSONString
(
vo
));
}
@Test
public
void
testResult
(){
NiwodaiIncomingResultResponseVO
vo
=
niwodaiAssetService
.
incomingResult
(
"AN000000135399103854755840"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
vo
));
}
@Test
public
void
testFund
(){
fundModuleService
.
getAllConditionsOfFundConfig
(
1L
);
}
@Test
public
void
testFundResult
(){
List
<
FundConfigCondition
>
list
=
((
FundConfigSimulationVO
)
fundModuleService
.
getAllConditionsOfFundConfig
(
7L
).
getBody
()).
getConditionsCase
();
fundModuleService
.
simulationCases
(
list
,
7L
);
}
}
郑建
@jian.zheng
mentioned in commit
d1ad451e
·
Mar 31, 2020
mentioned in commit
d1ad451e
mentioned in commit d1ad451ed5c500f0ab11b8fb287525e3311c163e
Toggle commit list
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