using cylsg.Model.ECTEModel;
using ECTESTOA;
using EzCoreNet.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace cylsg.Application.CyOS
{
///
/// 川印通用信息获取
///
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< List> 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(3600).ToListAsync();
}
///
/// 获取科目列表
///
///
[HttpGet]
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(3600).ToListAsync();
}
///
/// 获取流水号
///
///
[HttpGet]
public string GetShowID()
{
return _eZCoreNetRedisService.GetYYYMMddAnd4sn();
}
}
}