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
39e36472
Commit
39e36472
authored
May 27, 2020
by
zhengjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4fbbc727
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
FundModuleServiceImpl.java
...tribution/service/funding/impl/FundModuleServiceImpl.java
+10
-3
FundModuleTest.java
...om/quantgroup/asset/distribution/fund/FundModuleTest.java
+13
-0
No files found.
src/main/java/com/quantgroup/asset/distribution/service/funding/impl/FundModuleServiceImpl.java
View file @
39e36472
...
...
@@ -340,9 +340,16 @@ public class FundModuleServiceImpl implements IFundModuleService{
}
result
.
setSuccess
(
true
);
fundArray
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
fundArray
.
stream
().
sorted
(
Comparator
.
comparingInt
(
o
->
((
JSONObject
)
o
).
getInteger
(
"priority"
))).
collect
(
Collectors
.
toList
())));
String
fundProductId
=
fundArray
.
getJSONObject
(
0
).
getString
(
"fundProductId"
);
String
fundId
=
fundArray
.
getJSONObject
(
0
).
getString
(
"fundId"
);
result
.
setFundInfo
((
"null"
.
equals
(
fundProductId
)
||
StringUtils
.
isEmpty
(
fundProductId
))?
fundId:
fundId
+
"_"
+
fundProductId
);
StringBuilder
fundInfo
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
fundArray
.
size
();
i
++){
String
fundProductId
=
fundArray
.
getJSONObject
(
i
).
getString
(
"fundProductId"
);
String
fundId
=
fundArray
.
getJSONObject
(
i
).
getString
(
"fundId"
);
fundInfo
.
append
((
"null"
.
equals
(
fundProductId
)
||
StringUtils
.
isEmpty
(
fundProductId
))
?
fundId
:
fundId
+
"_"
+
fundProductId
).
append
(
","
);
}
if
(
fundInfo
.
length
()
>
1
){
fundInfo
.
deleteCharAt
(
fundInfo
.
length
()
-
1
);
}
result
.
setFundInfo
(
fundInfo
.
toString
());
configCondition
.
setResult
(
result
);
}
FundConfigSimulationVO
vo
=
new
FundConfigSimulationVO
();
...
...
src/test/java/com/quantgroup/asset/distribution/fund/FundModuleTest.java
View file @
39e36472
package
com
.
quantgroup
.
asset
.
distribution
.
fund
;
import
com.alibaba.fastjson.JSON
;
import
com.quantgroup.asset.distribution.model.entity.fund.FundConfigSimulationVO
;
import
com.quantgroup.asset.distribution.model.response.GlobalResponse
;
import
com.quantgroup.asset.distribution.service.funding.IFundModuleService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
...
...
@@ -17,6 +21,8 @@ public class FundModuleTest {
@Autowired
private
IFundModuleChannelFundConfigService
channelFundConfigService
;
@Autowired
private
IFundModuleService
service
;
@Test
public
void
testFindBy
()
{
...
...
@@ -27,4 +33,11 @@ public class FundModuleTest {
// System.out.println(channelFundConfigService.getChannelFundConfigsByChannelOrFundId("1", null, 0, 20));
// System.out.println(channelFundConfigService.getChannelFundConfigsByChannelOrFundId("1", null, 0, 20));
}
@Test
public
void
testS
(){
FundConfigSimulationVO
vo
=
(
FundConfigSimulationVO
)
service
.
getAllConditionsOfFundConfig
(
50L
).
getBody
();
GlobalResponse
response
=
service
.
simulationCases
(
vo
.
getConditionsCase
(),
50L
);
System
.
out
.
println
(
JSON
.
toJSONString
(
response
));
}
}
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