Commit 08e8341c authored by liucx's avatar liucx

文字优化

parent e36dc34c
...@@ -51,7 +51,6 @@ public class AssetStockPriceTask implements ApplicationRunner { ...@@ -51,7 +51,6 @@ public class AssetStockPriceTask implements ApplicationRunner {
private CommonConfig commonConfig; private CommonConfig commonConfig;
@Override @Override
public void run(ApplicationArguments args) throws Exception { public void run(ApplicationArguments args) throws Exception {
log.info("资管计算股票统计日志开始", commonConfig.getAssetStockPriceTask()); log.info("资管计算股票统计日志开始", commonConfig.getAssetStockPriceTask());
...@@ -83,7 +82,7 @@ public class AssetStockPriceTask implements ApplicationRunner { ...@@ -83,7 +82,7 @@ public class AssetStockPriceTask implements ApplicationRunner {
List<AssetAccountProductRelation> assetAccountProductRelations = new ArrayList<>(); List<AssetAccountProductRelation> assetAccountProductRelations = new ArrayList<>();
for (AssetAccountProductRelation accountProductRelation : accountProductRelationList) { for (AssetAccountProductRelation accountProductRelation : accountProductRelationList) {
AssetAccountProductRelation assetAccountProductRelation = this.AccountProductRelationTask(accountProductRelation); AssetAccountProductRelation assetAccountProductRelation = this.AccountProductRelationTask(accountProductRelation);
if(!ObjectUtils.isEmpty(assetAccountProductRelation) && !ObjectUtils.isEmpty(assetAccountProductRelation.getId())){ if (!ObjectUtils.isEmpty(assetAccountProductRelation) && !ObjectUtils.isEmpty(assetAccountProductRelation.getId())) {
assetAccountProductRelations.add(assetAccountProductRelation); assetAccountProductRelations.add(assetAccountProductRelation);
} }
} }
...@@ -165,20 +164,26 @@ public class AssetStockPriceTask implements ApplicationRunner { ...@@ -165,20 +164,26 @@ public class AssetStockPriceTask implements ApplicationRunner {
//汇总数据 //汇总数据
AssetMarketDetailsVO marketDetailsVO = stockPositionService.createMarketDetailsVOTask(stockPositions, funding, accountProductRelation); AssetMarketDetailsVO marketDetailsVO = stockPositionService.createMarketDetailsVOTask(stockPositions, funding, accountProductRelation);
if(BigDecimalUtil.compare(new BigDecimal(marketDetailsVO.getTotalProfitRate()),accountProductRelation.getSimulatedTotalProfit(),0)){
return null;
}
productRelation.setId(accountProductRelation.getId()); productRelation.setId(accountProductRelation.getId());
//示范盈亏比例
if (!ObjectUtils.isEmpty(marketDetailsVO.getTotalProfitRate())) {
productRelation.setSimulatedTotalProfit(new BigDecimal(marketDetailsVO.getTotalProfitRate())); productRelation.setSimulatedTotalProfit(new BigDecimal(marketDetailsVO.getTotalProfitRate()));
}
if (!ObjectUtils.isEmpty(marketDetailsVO.getTotalPrice())) {
//示范盘总资产 //示范盘总资产
productRelation.setSimulatedTotalPrice(new BigDecimal(marketDetailsVO.getTotalPrice())); productRelation.setSimulatedTotalPrice(new BigDecimal(marketDetailsVO.getTotalPrice()));
}
if (!ObjectUtils.isEmpty(marketDetailsVO.getPosition())) {
//示范持仓比 //示范持仓比
productRelation.setSimulatedProportion(new BigDecimal(marketDetailsVO.getPosition())); productRelation.setSimulatedProportion(new BigDecimal(marketDetailsVO.getPosition()));
}
//示范盘持仓数量 //示范盘持仓数量
productRelation.setPositionCount(ObjectUtils.isEmpty(stockPositions.size()) ? 0 : stockPositions.size()); productRelation.setPositionCount(ObjectUtils.isEmpty(stockPositions.size()) ? 0 : stockPositions.size());
if (!ObjectUtils.isEmpty(marketDetailsVO.getTotalProfit())) {
//示范盘盈亏金额 //示范盘盈亏金额
productRelation.setProfitAmount(new BigDecimal(marketDetailsVO.getTotalProfit())); productRelation.setProfitAmount(new BigDecimal(marketDetailsVO.getTotalProfit()));
}
//accountProductRelationService.updateAccountProductRelation(); //accountProductRelationService.updateAccountProductRelation();
} catch (Exception e) { } catch (Exception e) {
......
...@@ -45,8 +45,6 @@ import static com.zfxftech.telmarket.common.constant.AdminConstant.MarketTypeEnu ...@@ -45,8 +45,6 @@ import static com.zfxftech.telmarket.common.constant.AdminConstant.MarketTypeEnu
public class SmartStockPriceTask implements ApplicationRunner { public class SmartStockPriceTask implements ApplicationRunner {
@Autowired @Autowired
private SmartAccountProductRelationService smartAccountProductRelationService; private SmartAccountProductRelationService smartAccountProductRelationService;
@Autowired @Autowired
...@@ -57,13 +55,9 @@ public class SmartStockPriceTask implements ApplicationRunner { ...@@ -57,13 +55,9 @@ public class SmartStockPriceTask implements ApplicationRunner {
private UsMemberBaseService memberBaseService; private UsMemberBaseService memberBaseService;
@Override @Override
public void run(ApplicationArguments args) throws Exception { public void run(ApplicationArguments args) throws Exception {
log.info("智能跟投计算股票统计日志开始",commonConfig.getSmartStockPriceTask() ); log.info("智能跟投计算股票统计日志开始", commonConfig.getSmartStockPriceTask());
//log.info("智能跟投计算股票统计日志开始配置更新开关状态:" + commonConfig.getStockPriceTask()); //log.info("智能跟投计算股票统计日志开始配置更新开关状态:" + commonConfig.getStockPriceTask());
if (commonConfig.getSmartStockPriceTask() != null && commonConfig.getSmartStockPriceTask().equals("run")) { if (commonConfig.getSmartStockPriceTask() != null && commonConfig.getSmartStockPriceTask().equals("run")) {
// if (true) { // if (true) {
...@@ -91,7 +85,7 @@ public class SmartStockPriceTask implements ApplicationRunner { ...@@ -91,7 +85,7 @@ public class SmartStockPriceTask implements ApplicationRunner {
List<SmartAccountProductRelation> productRelations = new ArrayList<>(); List<SmartAccountProductRelation> productRelations = new ArrayList<>();
for (SmartAccountProductRelation accountProductRelation : accountProductRelationList) { for (SmartAccountProductRelation accountProductRelation : accountProductRelationList) {
SmartAccountProductRelation smartAccountProductRelation = this.AccountProductRelationTask(accountProductRelation); SmartAccountProductRelation smartAccountProductRelation = this.AccountProductRelationTask(accountProductRelation);
if(!ObjectUtils.isEmpty(smartAccountProductRelation) && !ObjectUtils.isEmpty(smartAccountProductRelation.getId()) ) { if (!ObjectUtils.isEmpty(smartAccountProductRelation) && !ObjectUtils.isEmpty(smartAccountProductRelation.getId())) {
productRelations.add(smartAccountProductRelation); productRelations.add(smartAccountProductRelation);
} }
} }
...@@ -159,7 +153,10 @@ public class SmartStockPriceTask implements ApplicationRunner { ...@@ -159,7 +153,10 @@ public class SmartStockPriceTask implements ApplicationRunner {
public SmartAccountProductRelation AccountProductRelationTask(SmartAccountProductRelation accountProductRelation) { public SmartAccountProductRelation AccountProductRelationTask(SmartAccountProductRelation accountProductRelation) {
SmartAccountProductRelation smartAccountProductRelation = new SmartAccountProductRelation(); SmartAccountProductRelation smartAccountProductRelation = new SmartAccountProductRelation();
try{ if (!accountProductRelation.getId().toString().equals("232366752727043")) {
return null;
}
try {
String type = SIMULATED.getCode(); String type = SIMULATED.getCode();
OptionalUtil.checkNull(accountProductRelation, "当前用户产品关系不存在"); OptionalUtil.checkNull(accountProductRelation, "当前用户产品关系不存在");
//查询客户信息 //查询客户信息
...@@ -179,27 +176,32 @@ public class SmartStockPriceTask implements ApplicationRunner { ...@@ -179,27 +176,32 @@ public class SmartStockPriceTask implements ApplicationRunner {
//获取所有买入过的股票 //获取所有买入过的股票
List<SmartStockPosition> stockPositions = stockPositionService.queryStockPositions(marketId); 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()); smartAccountProductRelation.setId(accountProductRelation.getId());
if (!ObjectUtils.isEmpty(marketDetailsVO.getTotalProfitRate())) {
smartAccountProductRelation.setSimulatedTotalProfit(new BigDecimal(marketDetailsVO.getTotalProfitRate())); smartAccountProductRelation.setSimulatedTotalProfit(new BigDecimal(marketDetailsVO.getTotalProfitRate()));
}
if (!ObjectUtils.isEmpty(marketDetailsVO.getTotalPrice())) {
//示范盘总资产 //示范盘总资产
smartAccountProductRelation.setSimulatedTotalPrice(new BigDecimal(marketDetailsVO.getTotalPrice())); smartAccountProductRelation.setSimulatedTotalPrice(new BigDecimal(marketDetailsVO.getTotalPrice()));
}
if (!ObjectUtils.isEmpty(marketDetailsVO.getPosition())) {
//示范持仓比 //示范持仓比
smartAccountProductRelation.setSimulatedProportion(new BigDecimal(marketDetailsVO.getPosition())); smartAccountProductRelation.setSimulatedProportion(new BigDecimal(marketDetailsVO.getPosition()));
}
//示范盘持仓数量 //示范盘持仓数量
smartAccountProductRelation.setPositionCount(ObjectUtils.isEmpty(stockPositions.size()) ? 0 : stockPositions.size()); smartAccountProductRelation.setPositionCount(ObjectUtils.isEmpty(stockPositions.size()) ? 0 : stockPositions.size());
if (!ObjectUtils.isEmpty(marketDetailsVO.getTotalProfit())) {
//示范盘盈亏金额 //示范盘盈亏金额
smartAccountProductRelation.setProfitAmount(new BigDecimal(marketDetailsVO.getTotalProfit())); smartAccountProductRelation.setProfitAmount(new BigDecimal(marketDetailsVO.getTotalProfit()));
//accountProductRelationService.updateAccountProductRelation(smartAccountProductRelation);
} }
catch (Exception e){ } catch (Exception e) {
log.error("更新数据错误:{}",e); log.error("更新数据错误:{}", e);
} }
return smartAccountProductRelation; return smartAccountProductRelation;
} }
......
...@@ -42,7 +42,6 @@ import static com.zfxftech.telmarket.common.constant.AdminConstant.MarketTypeEnu ...@@ -42,7 +42,6 @@ import static com.zfxftech.telmarket.common.constant.AdminConstant.MarketTypeEnu
public class StockPriceTask implements ApplicationRunner { public class StockPriceTask implements ApplicationRunner {
@Autowired @Autowired
private AccountProductRelationService accountProductRelationService; private AccountProductRelationService accountProductRelationService;
@Autowired @Autowired
...@@ -53,10 +52,6 @@ public class StockPriceTask implements ApplicationRunner { ...@@ -53,10 +52,6 @@ public class StockPriceTask implements ApplicationRunner {
private UsMemberBaseService memberBaseService; private UsMemberBaseService memberBaseService;
@Override @Override
public void run(ApplicationArguments args) throws Exception { public void run(ApplicationArguments args) throws Exception {
log.info("私人定制计算股票统计日志开始"); log.info("私人定制计算股票统计日志开始");
...@@ -88,7 +83,7 @@ public class StockPriceTask implements ApplicationRunner { ...@@ -88,7 +83,7 @@ public class StockPriceTask implements ApplicationRunner {
for (AccountProductRelation accountProductRelation : accountProductRelationList) { for (AccountProductRelation accountProductRelation : accountProductRelationList) {
AccountProductRelation productRelation = this.AccountProductRelationTask(accountProductRelation); AccountProductRelation productRelation = this.AccountProductRelationTask(accountProductRelation);
if(!ObjectUtils.isEmpty(productRelation) && !ObjectUtils.isEmpty(productRelation.getId())){ if (!ObjectUtils.isEmpty(productRelation) && !ObjectUtils.isEmpty(productRelation.getId())) {
list.add(productRelation); list.add(productRelation);
} }
...@@ -177,26 +172,29 @@ public class StockPriceTask implements ApplicationRunner { ...@@ -177,26 +172,29 @@ public class StockPriceTask implements ApplicationRunner {
//汇总数据 //汇总数据
MarketDetailsVO marketDetailsVO = stockPositionService.createMarketDetailsVOTask(stockPositions, funding, accountProductRelation); MarketDetailsVO marketDetailsVO = stockPositionService.createMarketDetailsVOTask(stockPositions, funding, accountProductRelation);
if(BigDecimalUtil.compare(new BigDecimal(marketDetailsVO.getTotalProfitRate()),accountProductRelation.getSimulatedTotalProfit(),0)){
return null;
}
productRelation.setId(accountProductRelation.getId()); productRelation.setId(accountProductRelation.getId());
//示范盈亏比例
if (!ObjectUtils.isEmpty(marketDetailsVO.getTotalProfitRate())) {
productRelation.setSimulatedTotalProfit(new BigDecimal(marketDetailsVO.getTotalProfitRate())); productRelation.setSimulatedTotalProfit(new BigDecimal(marketDetailsVO.getTotalProfitRate()));
}
if (!ObjectUtils.isEmpty(marketDetailsVO.getTotalPrice())) {
//示范盘总资产 //示范盘总资产
productRelation.setSimulatedTotalPrice(new BigDecimal(marketDetailsVO.getTotalPrice())); productRelation.setSimulatedTotalPrice(new BigDecimal(marketDetailsVO.getTotalPrice()));
}
if (!ObjectUtils.isEmpty(marketDetailsVO.getPosition())) {
//示范持仓比 //示范持仓比
productRelation.setSimulatedProportion(new BigDecimal(marketDetailsVO.getPosition())); productRelation.setSimulatedProportion(new BigDecimal(marketDetailsVO.getPosition()));
}
//示范盘持仓数量 //示范盘持仓数量
productRelation.setPositionCount(ObjectUtils.isEmpty(stockPositions.size()) ? 0 : stockPositions.size()); productRelation.setPositionCount(ObjectUtils.isEmpty(stockPositions.size()) ? 0 : stockPositions.size());
if (!ObjectUtils.isEmpty(marketDetailsVO.getTotalProfit())) {
//示范盘盈亏金额 //示范盘盈亏金额
productRelation.setProfitAmount(new BigDecimal(marketDetailsVO.getTotalProfit())); productRelation.setProfitAmount(new BigDecimal(marketDetailsVO.getTotalProfit()));
//accountProductRelationService.updateAccountProductRelation(productRelation); }
}catch (Exception e){ } catch (Exception e) {
log.error("私人定制更新数据错误:{}",e); log.error("私人定制更新数据错误:{}", e);
} }
return productRelation; 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