Commit 08e8341c authored by liucx's avatar liucx

文字优化

parent e36dc34c
......@@ -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) {
......
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment