feat: 添加利息趋势图
This commit is contained in:
@@ -13,14 +13,15 @@ namespace Yi.Framework.Bbs.Application.Jobs
|
||||
JobDetail = JobBuilder.Create<InterestRecordsJob>().WithIdentity(nameof(InterestRecordsJob)).Build();
|
||||
|
||||
//每个小时整点执行一次
|
||||
Trigger = TriggerBuilder.Create().WithIdentity(nameof(InterestRecordsJob)).WithCronSchedule("0 */1 * * *").Build();
|
||||
|
||||
Trigger = TriggerBuilder.Create().WithIdentity(nameof(InterestRecordsJob)).WithCronSchedule("* 0 * * * ?").Build();
|
||||
|
||||
//测试
|
||||
// Trigger = TriggerBuilder.Create().WithIdentity(nameof(InterestRecordsJob))
|
||||
//.WithSimpleSchedule(x => x
|
||||
// .WithIntervalInSeconds(5)
|
||||
// .RepeatForever())
|
||||
//.Build();
|
||||
// Trigger = TriggerBuilder.Create().WithIdentity(nameof(InterestRecordsJob))
|
||||
//.WithSimpleSchedule(x => x
|
||||
// .WithIntervalInSeconds(10)
|
||||
// .RepeatForever())
|
||||
//.Build();
|
||||
}
|
||||
public override async Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Yi.Framework.Bbs.Application.Services.Bank
|
||||
[HttpGet("bank/interest")]
|
||||
public async Task<List<InterestRecordsDto>> GetInterestRecordsAsync()
|
||||
{
|
||||
var entities = await _interestRepository._DbQueryable.OrderByDescending(x => x.CreationTime).ToPageListAsync(1, 24);
|
||||
var entities = await _interestRepository._DbQueryable.OrderBy(x => x.CreationTime).ToPageListAsync(1, 24);
|
||||
var output = entities.Adapt<List<InterestRecordsDto>>();
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -51,6 +51,10 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
output.ComparisonValue = currentInterestRecords.ComparisonValue;
|
||||
output.CreationTime = currentInterestRecords.CreationTime;
|
||||
output.Value = currentInterestRecords.Value;
|
||||
|
||||
_currentRateStore=new BankInterestRecordDto() { ComparisonValue= currentInterestRecords .ComparisonValue,
|
||||
CreationTime=currentInterestRecords.CreationTime,Value=currentInterestRecords.Value};
|
||||
|
||||
}
|
||||
return output;
|
||||
}
|
||||
@@ -101,7 +105,7 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
|
||||
|
||||
//根据上一次的老值进行变化率比较
|
||||
var currentValue = oldValue * changeRate;
|
||||
var currentValue = oldValue + (oldValue* changeRate);
|
||||
|
||||
var entity = new InterestRecordsEntity(lastThirdPartyStandardValue, currentValue);
|
||||
var output = await _interestRepository.InsertReturnEntityAsync(entity);
|
||||
|
||||
Reference in New Issue
Block a user