using cylsg.Model.ECTEModel;
using ECTESTOA;
using EzCoreNet.Redis;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static SKIT.FlurlHttpClient.Wechat.Api.Models.ProductOfflineGetSameCityTemplateResponse.Types.Template.Types;
namespace cylsg.Application.CyOS
{
///
/// 川印通用信息获取
///
[Authorize]
[ApiDescriptionSettings("CYOA")]
public class CYOSSettingController : IDynamicApiController
{
private readonly ISqlSugarClient _client;
private readonly IOAServices _oAServices;
private readonly IEzCoreNetRedisService _eZCoreNetRedisService;
public CYOSSettingController(ISqlSugarClient client, IOAServices oAServices, IEzCoreNetRedisService netRedisService)
{
_client = client.AsTenant().GetConnection("ECTESTOADB");
_oAServices = oAServices;
_eZCoreNetRedisService = netRedisService;
}
///
/// 获取部门列表
///
///
[HttpGet]
public async Task> GetDepartLstt()
{
return await _client.Queryable().Where(x => x.Status == "启用" && x.FirmId == _oAServices.firmId).Select(x => new OaDepartment
{
Name = x.Name,
Keyid = x.Keyid,
Remark = x.Remark,
}).WithCache(60).ToListAsync();
}
///
/// 获取科目列表
///
///
[HttpGet]
[AllowAnonymous]
public async Task> getKeMuList()
{
return await _client.Queryable().Where(x => x.Status == true && x.FirmId == _oAServices.firmId && x.SubjectType == "贷").Select(x => new OaSubjectSet
{
SubjectName = x.SubjectName,
Keyid = x.Keyid,
Remark = x.Remark,
}).WithCache(60).ToListAsync();
}
///
/// 获取流水号
///
///
[HttpGet]
[AllowAnonymous]
public string GetShowID()
{
return _eZCoreNetRedisService.GetYYYMMddAnd4sn();
}
///
/// 获取客户列表
///
///
[HttpGet]
//[AllowAnonymous]
public async Task