|
@@ -26,6 +26,7 @@ using NetTaste;
|
|
|
using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
|
using NPOI.POIFS.Crypt.Dsig;
|
|
|
using EyeSoft.SequentialIdentity;
|
|
|
+using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
@@ -37,6 +38,7 @@ namespace OASystem.API.Controllers
|
|
|
public class StatisticsController : ControllerBase
|
|
|
{
|
|
|
private readonly int _decimalPlaces;
|
|
|
+ private readonly IConfiguration _config;
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly SqlSugarClient _sqlSugar;
|
|
|
private readonly DelegationInfoRepository _groupRep;
|
|
@@ -51,9 +53,10 @@ namespace OASystem.API.Controllers
|
|
|
/// <param name="sqlSugar"></param>
|
|
|
/// <param name="groupRep"></param>
|
|
|
/// <param name="setDataRep"></param>
|
|
|
- public StatisticsController(IMapper mapper, SqlSugarClient sqlSugar, DelegationInfoRepository groupRep, SetDataRepository setDataRep, TeamRateRepository teamRate, VisitingClientsRepository visitingClientsRep)
|
|
|
+ public StatisticsController(IMapper mapper, IConfiguration config, SqlSugarClient sqlSugar, DelegationInfoRepository groupRep, SetDataRepository setDataRep, TeamRateRepository teamRate, VisitingClientsRepository visitingClientsRep)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
+ _config = config;
|
|
|
_groupRep = groupRep;
|
|
|
_setDataRep = setDataRep;
|
|
|
_sqlSugar = sqlSugar;
|
|
@@ -2917,14 +2920,27 @@ Order By Count Desc");
|
|
|
55,// 大运会
|
|
|
};
|
|
|
|
|
|
+ //更改appsettings 值
|
|
|
+ //AppSettingsHelper.UpdateIntList("Dailypayment",new List<int>() { 666 });
|
|
|
+ //var listConfig = _config.GetSection("Dailypayment").GetValue<List<int>>();
|
|
|
+ //listConfig.Add(666);
|
|
|
+
|
|
|
+ //读取appsettings json DailypaymentTypeData 配置
|
|
|
+ List<int> dailypaymentTypeData = AppSettingsHelper.Get<int>("Dailypayment");
|
|
|
var _view = await _sqlSugar.Queryable<DailypaymentParentTypeView>()
|
|
|
.Includes(x => x.SubData)
|
|
|
.Where(x => defaultParentIds.Contains(x.Id))
|
|
|
.ToListAsync();
|
|
|
+ _view.ForEach(x =>
|
|
|
+ {
|
|
|
+ x.SubData.ForEach(y =>
|
|
|
+ {
|
|
|
+ int currId = dailypaymentTypeData.Find(z => z == y.Id);
|
|
|
+ y.IsChecked = currId == 0 ? false : true;
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
- //return Ok(JsonView(true, "查询成功!", _view, total));
|
|
|
- return Ok(JsonView(false, "查询失败",_view));
|
|
|
-
|
|
|
+ return Ok(JsonView(true, "查询成功!", _view));
|
|
|
}
|
|
|
else
|
|
|
{
|