|
@@ -27,6 +27,9 @@ using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
|
using NPOI.POIFS.Crypt.Dsig;
|
|
|
using EyeSoft.SequentialIdentity;
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
+using System.Text.Json;
|
|
|
+using OASystem.RedisRepository;
|
|
|
+using OASystem.RedisRepository.RedisAsyncHelper;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
@@ -2920,13 +2923,10 @@ Order By Count Desc");
|
|
|
55,// 大运会
|
|
|
};
|
|
|
|
|
|
- //更改appsettings 值
|
|
|
- //AppSettingsHelper.UpdateIntList("Dailypayment",new List<int>() { 666 });
|
|
|
- //var listConfig = _config.GetSection("Dailypayment").GetValue<List<int>>();
|
|
|
- //listConfig.Add(666);
|
|
|
+ var dailypaymentTypeData = await RedisRepository.RedisFactory
|
|
|
+ .CreateRedisRepository()
|
|
|
+ .StringGetAsync<List<int>>("DailypaymentTypeData") ?? new List<int>();
|
|
|
|
|
|
- //读取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))
|
|
@@ -2940,13 +2940,94 @@ Order By Count Desc");
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- return Ok(JsonView(true, "查询成功!", _view));
|
|
|
+ return Ok(JsonView(true, "查询成功!", _view, _view.Count));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
return Ok(JsonView(false, "查询失败"));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 日付类型数据 Save
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="_dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("DailypaymentTypeDataSave")]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> DailypaymentTypeDataSave(DailypaymentTypeDataSaveDto _dto)
|
|
|
+ {
|
|
|
+ #region 参数验证
|
|
|
+ if (_dto.PortType < 1 || _dto.PortType > 3) return Ok(JsonView(false, msg: MsgTips.Port));
|
|
|
+
|
|
|
+ PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
+ #region 页面操作权限验证
|
|
|
+ //pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+
|
|
|
+ //if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限"));
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ if (_dto.PortType == 1 || _dto.PortType == 2 || _dto.PortType == 3) // web/Android/IOS
|
|
|
+ {
|
|
|
+ if (_dto.TypeIds.Count < 1) return Ok(JsonView(false, "请传入需要保存的TypeIds"));
|
|
|
+
|
|
|
+ var res = await RedisRepository.RedisFactory
|
|
|
+ .CreateRedisRepository()
|
|
|
+ .StringSetAsync(
|
|
|
+ key:"DailypaymentTypeData",
|
|
|
+ _dto.TypeIds,
|
|
|
+ timeout:null );
|
|
|
+
|
|
|
+ if (!res) return Ok(JsonView(false, "操作失败"));
|
|
|
+
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "操作成功!"));
|
|
|
+ }
|
|
|
+ else return Ok(JsonView(false, "操作失败"));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 日付数据列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="_dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("DailypaymentTypeDataSave")]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> DailypaymentRange(DailypaymentTypeDataSaveDto _dto)
|
|
|
+ {
|
|
|
+ #region 参数验证
|
|
|
+ if (_dto.PortType < 1 || _dto.PortType > 3) return Ok(JsonView(false, msg: MsgTips.Port));
|
|
|
+
|
|
|
+ PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
+ #region 页面操作权限验证
|
|
|
+ //pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+
|
|
|
+ //if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限"));
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ if (_dto.PortType == 1 || _dto.PortType == 2 || _dto.PortType == 3) // web/Android/IOS
|
|
|
+ {
|
|
|
+ if (_dto.TypeIds.Count < 1) return Ok(JsonView(false, "请传入需要保存的TypeIds"));
|
|
|
+
|
|
|
+ var res = await RedisRepository.RedisFactory
|
|
|
+ .CreateRedisRepository()
|
|
|
+ .StringSetAsync(
|
|
|
+ key: "DailypaymentTypeData",
|
|
|
+ _dto.TypeIds,
|
|
|
+ timeout: null);
|
|
|
+
|
|
|
+ if (!res) return Ok(JsonView(false, "操作失败"));
|
|
|
+
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "操作成功!"));
|
|
|
+ }
|
|
|
+ else return Ok(JsonView(false, "操作失败"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
#endregion
|
|
|
}
|
|
|
}
|