Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
stockPriceTack
Project
Project
Details
Activity
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
刘长帅
stockPriceTack
Commits
08e8341c
Commit
08e8341c
authored
Jul 08, 2022
by
liucx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文字优化
parent
e36dc34c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
85 deletions
+90
-85
AssetStockPriceTask.java
...ech/telmarket/task/followAccount/AssetStockPriceTask.java
+19
-14
SmartStockPriceTask.java
...ech/telmarket/task/followAccount/SmartStockPriceTask.java
+50
-48
StockPriceTask.java
...zfxftech/telmarket/task/followAccount/StockPriceTask.java
+21
-23
No files found.
src/main/java/com/zfxftech/telmarket/task/followAccount/AssetStockPriceTask.java
View file @
08e8341c
...
...
@@ -51,7 +51,6 @@ public class AssetStockPriceTask implements ApplicationRunner {
private
CommonConfig
commonConfig
;
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
log
.
info
(
"资管计算股票统计日志开始"
,
commonConfig
.
getAssetStockPriceTask
());
...
...
@@ -83,7 +82,7 @@ public class AssetStockPriceTask implements ApplicationRunner {
List
<
AssetAccountProductRelation
>
assetAccountProductRelations
=
new
ArrayList
<>();
for
(
AssetAccountProductRelation
accountProductRelation
:
accountProductRelationList
)
{
AssetAccountProductRelation
assetAccountProductRelation
=
this
.
AccountProductRelationTask
(
accountProductRelation
);
if
(!
ObjectUtils
.
isEmpty
(
assetAccountProductRelation
)
&&
!
ObjectUtils
.
isEmpty
(
assetAccountProductRelation
.
getId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
assetAccountProductRelation
)
&&
!
ObjectUtils
.
isEmpty
(
assetAccountProductRelation
.
getId
()))
{
assetAccountProductRelations
.
add
(
assetAccountProductRelation
);
}
}
...
...
@@ -165,20 +164,26 @@ public class AssetStockPriceTask implements ApplicationRunner {
//汇总数据
AssetMarketDetailsVO
marketDetailsVO
=
stockPositionService
.
createMarketDetailsVOTask
(
stockPositions
,
funding
,
accountProductRelation
);
if
(
BigDecimalUtil
.
compare
(
new
BigDecimal
(
marketDetailsVO
.
getTotalProfitRate
()),
accountProductRelation
.
getSimulatedTotalProfit
(),
0
)){
return
null
;
}
productRelation
.
setId
(
accountProductRelation
.
getId
());
//示范盈亏比例
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getTotalProfitRate
()))
{
productRelation
.
setSimulatedTotalProfit
(
new
BigDecimal
(
marketDetailsVO
.
getTotalProfitRate
()));
}
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getTotalPrice
()))
{
//示范盘总资产
productRelation
.
setSimulatedTotalPrice
(
new
BigDecimal
(
marketDetailsVO
.
getTotalPrice
()));
}
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getPosition
()))
{
//示范持仓比
productRelation
.
setSimulatedProportion
(
new
BigDecimal
(
marketDetailsVO
.
getPosition
()));
}
//示范盘持仓数量
productRelation
.
setPositionCount
(
ObjectUtils
.
isEmpty
(
stockPositions
.
size
())
?
0
:
stockPositions
.
size
());
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getTotalProfit
()))
{
//示范盘盈亏金额
productRelation
.
setProfitAmount
(
new
BigDecimal
(
marketDetailsVO
.
getTotalProfit
()));
}
//accountProductRelationService.updateAccountProductRelation();
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/zfxftech/telmarket/task/followAccount/SmartStockPriceTask.java
View file @
08e8341c
...
...
@@ -45,8 +45,6 @@ import static com.zfxftech.telmarket.common.constant.AdminConstant.MarketTypeEnu
public
class
SmartStockPriceTask
implements
ApplicationRunner
{
@Autowired
private
SmartAccountProductRelationService
smartAccountProductRelationService
;
@Autowired
...
...
@@ -57,13 +55,9 @@ public class SmartStockPriceTask implements ApplicationRunner {
private
UsMemberBaseService
memberBaseService
;
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
log
.
info
(
"智能跟投计算股票统计日志开始"
,
commonConfig
.
getSmartStockPriceTask
()
);
log
.
info
(
"智能跟投计算股票统计日志开始"
,
commonConfig
.
getSmartStockPriceTask
()
);
//log.info("智能跟投计算股票统计日志开始配置更新开关状态:" + commonConfig.getStockPriceTask());
if
(
commonConfig
.
getSmartStockPriceTask
()
!=
null
&&
commonConfig
.
getSmartStockPriceTask
().
equals
(
"run"
))
{
// if (true) {
...
...
@@ -91,7 +85,7 @@ public class SmartStockPriceTask implements ApplicationRunner {
List
<
SmartAccountProductRelation
>
productRelations
=
new
ArrayList
<>();
for
(
SmartAccountProductRelation
accountProductRelation
:
accountProductRelationList
)
{
SmartAccountProductRelation
smartAccountProductRelation
=
this
.
AccountProductRelationTask
(
accountProductRelation
);
if
(!
ObjectUtils
.
isEmpty
(
smartAccountProductRelation
)
&&
!
ObjectUtils
.
isEmpty
(
smartAccountProductRelation
.
getId
())
)
{
if
(!
ObjectUtils
.
isEmpty
(
smartAccountProductRelation
)
&&
!
ObjectUtils
.
isEmpty
(
smartAccountProductRelation
.
getId
())
)
{
productRelations
.
add
(
smartAccountProductRelation
);
}
}
...
...
@@ -159,7 +153,10 @@ public class SmartStockPriceTask implements ApplicationRunner {
public
SmartAccountProductRelation
AccountProductRelationTask
(
SmartAccountProductRelation
accountProductRelation
)
{
SmartAccountProductRelation
smartAccountProductRelation
=
new
SmartAccountProductRelation
();
try
{
if
(!
accountProductRelation
.
getId
().
toString
().
equals
(
"232366752727043"
))
{
return
null
;
}
try
{
String
type
=
SIMULATED
.
getCode
();
OptionalUtil
.
checkNull
(
accountProductRelation
,
"当前用户产品关系不存在"
);
//查询客户信息
...
...
@@ -179,27 +176,32 @@ public class SmartStockPriceTask implements ApplicationRunner {
//获取所有买入过的股票
List
<
SmartStockPosition
>
stockPositions
=
stockPositionService
.
queryStockPositions
(
marketId
);
//汇总数据
SmartMarketDetailsVO
marketDetailsVO
=
stockPositionService
.
createMarketDetailsVOTask
(
stockPositions
,
funding
,
accountProductRelation
);
SmartMarketDetailsVO
marketDetailsVO
=
stockPositionService
.
createMarketDetailsVOTask
(
stockPositions
,
funding
,
accountProductRelation
);
if
(
ObjectUtils
.
isEmpty
(
marketDetailsVO
)
||
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getTotalProfitRate
())
||
ObjectUtils
.
isEmpty
(
accountProductRelation
.
getSimulatedTotalProfit
())
||
BigDecimalUtil
.
compare
(
new
BigDecimal
(
marketDetailsVO
.
getTotalProfitRate
()),
accountProductRelation
.
getSimulatedTotalProfit
(),
0
)){
return
null
;
}
//示范盈亏比例
smartAccountProductRelation
.
setId
(
accountProductRelation
.
getId
());
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getTotalProfitRate
()))
{
smartAccountProductRelation
.
setSimulatedTotalProfit
(
new
BigDecimal
(
marketDetailsVO
.
getTotalProfitRate
()));
}
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getTotalPrice
()))
{
//示范盘总资产
smartAccountProductRelation
.
setSimulatedTotalPrice
(
new
BigDecimal
(
marketDetailsVO
.
getTotalPrice
()));
}
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getPosition
()))
{
//示范持仓比
smartAccountProductRelation
.
setSimulatedProportion
(
new
BigDecimal
(
marketDetailsVO
.
getPosition
()));
}
//示范盘持仓数量
smartAccountProductRelation
.
setPositionCount
(
ObjectUtils
.
isEmpty
(
stockPositions
.
size
())
?
0
:
stockPositions
.
size
());
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getTotalProfit
()))
{
//示范盘盈亏金额
smartAccountProductRelation
.
setProfitAmount
(
new
BigDecimal
(
marketDetailsVO
.
getTotalProfit
()));
//accountProductRelationService.updateAccountProductRelation(smartAccountProductRelation);
}
catch
(
Exception
e
)
{
log
.
error
(
"更新数据错误:{}"
,
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"更新数据错误:{}"
,
e
);
}
return
smartAccountProductRelation
;
}
...
...
src/main/java/com/zfxftech/telmarket/task/followAccount/StockPriceTask.java
View file @
08e8341c
...
...
@@ -42,7 +42,6 @@ import static com.zfxftech.telmarket.common.constant.AdminConstant.MarketTypeEnu
public
class
StockPriceTask
implements
ApplicationRunner
{
@Autowired
private
AccountProductRelationService
accountProductRelationService
;
@Autowired
...
...
@@ -53,10 +52,6 @@ public class StockPriceTask implements ApplicationRunner {
private
UsMemberBaseService
memberBaseService
;
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
log
.
info
(
"私人定制计算股票统计日志开始"
);
...
...
@@ -88,7 +83,7 @@ public class StockPriceTask implements ApplicationRunner {
for
(
AccountProductRelation
accountProductRelation
:
accountProductRelationList
)
{
AccountProductRelation
productRelation
=
this
.
AccountProductRelationTask
(
accountProductRelation
);
if
(!
ObjectUtils
.
isEmpty
(
productRelation
)
&&
!
ObjectUtils
.
isEmpty
(
productRelation
.
getId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
productRelation
)
&&
!
ObjectUtils
.
isEmpty
(
productRelation
.
getId
()))
{
list
.
add
(
productRelation
);
}
...
...
@@ -177,26 +172,29 @@ public class StockPriceTask implements ApplicationRunner {
//汇总数据
MarketDetailsVO
marketDetailsVO
=
stockPositionService
.
createMarketDetailsVOTask
(
stockPositions
,
funding
,
accountProductRelation
);
if
(
BigDecimalUtil
.
compare
(
new
BigDecimal
(
marketDetailsVO
.
getTotalProfitRate
()),
accountProductRelation
.
getSimulatedTotalProfit
(),
0
)){
return
null
;
}
productRelation
.
setId
(
accountProductRelation
.
getId
());
//示范盈亏比例
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getTotalProfitRate
()))
{
productRelation
.
setSimulatedTotalProfit
(
new
BigDecimal
(
marketDetailsVO
.
getTotalProfitRate
()));
}
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getTotalPrice
()))
{
//示范盘总资产
productRelation
.
setSimulatedTotalPrice
(
new
BigDecimal
(
marketDetailsVO
.
getTotalPrice
()));
}
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getPosition
()))
{
//示范持仓比
productRelation
.
setSimulatedProportion
(
new
BigDecimal
(
marketDetailsVO
.
getPosition
()));
}
//示范盘持仓数量
productRelation
.
setPositionCount
(
ObjectUtils
.
isEmpty
(
stockPositions
.
size
())
?
0
:
stockPositions
.
size
());
if
(!
ObjectUtils
.
isEmpty
(
marketDetailsVO
.
getTotalProfit
()))
{
//示范盘盈亏金额
productRelation
.
setProfitAmount
(
new
BigDecimal
(
marketDetailsVO
.
getTotalProfit
()));
//accountProductRelationService.updateAccountProductRelation(productRelation);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"私人定制更新数据错误:{}"
,
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"私人定制更新数据错误:{}"
,
e
);
}
return
productRelation
;
}
...
...
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