Commit b48c7b47 authored by liucx's avatar liucx

修改时间

parent 9c06710c
package com.zfxftech.telmarket.task.followAccount;
import com.zfxf.tools.wechat.helper.api.TemplateKeyWordBuilder;
import com.zfxftech.telmarket.common.config.CommonConfig;
import com.zfxftech.telmarket.common.enums.followAccount.FollowAccountOrderTypeEnum;
import com.zfxftech.telmarket.common.enums.remind.InformTypeEnums;
import com.zfxftech.telmarket.common.pojo.dao.followAccount.FollowAccount;
import com.zfxftech.telmarket.common.pojo.dao.followAccount.FollowAccountStockOrder;
import com.zfxftech.telmarket.common.pojo.dao.followAccount.FollowAccountYieldsRecord;
import com.zfxftech.telmarket.common.pojo.dao.permission.UsAdmin;
import com.zfxftech.telmarket.common.util.DateUtil;
import com.zfxftech.telmarket.service.UsAdminService;
import com.zfxftech.telmarket.service.business.WeChatTemplateMessageService;
import com.zfxftech.telmarket.service.followAccount.FollowAccountPositionInfoService;
import com.zfxftech.telmarket.service.followAccount.FollowAccountService;
import com.zfxftech.telmarket.service.followAccount.FollowAccountYieldsRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.concurrent.CompletableFuture;
/**
* Create time: 2022/2/3
*/
@EnableScheduling
@Component
@Slf4j
public class FollowAccountYieldsRecordTask {
@Resource
FollowAccountService followAccountService;
@Resource
FollowAccountYieldsRecordService followAccountYieldsRecordService;
@Resource
CommonConfig commonConfig;
@Scheduled(cron = "0 05 15 ? * MON-FRI")
private void followAccountYieldsRecordRunTask() {
if(commonConfig.getFollowAccountDayRecordsTaskSwitch() != null && commonConfig.getFollowAccountDayRecordsTaskSwitch().equals("run")) {
try {
log.info("开始计算并生成跟投账户每日盈亏记录");
Date startTime = new Date();
List<FollowAccount> list = followAccountService.getAllFollowAccount();
for (FollowAccount followAccount : list) {
followAccountYieldsRecordService.addFollowAccountYieldsRecord(followAccount);
}
log.info("跟投账户每日盈亏记录生成完成————开始计算每日月评分各项指标排名及评分");
followAccountYieldsRecordService.orderFollowAccountYieldsRecord();
log.info("每日月评分各项指标排名计算完成————开始计算每日月评分 共耗时:" + DateUtil.calculateTimeGapSecond(startTime, new Date()));
} catch (Exception e) {
log.error("跟投账户每日盈亏记录生成失败", e);
}
}
}
}
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