移动系统liao
2025-01-24 f4a0b32daa9e021227707bcfb70b67738bd1b000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
{
    /// <summary>
    /// 川印通用信息获取
    /// </summary>
    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;
        }
 
        /// <summary>
        /// 获取部门列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task< List<OaDepartment>> GetDepartLstt()
        {
            return await _client.Queryable<OaDepartment>().Where(x=>x.Status== "启用"&&x.FirmId== _oAServices.firmId).Select(x=>new OaDepartment
            {
                  Name=x.Name,
                    Keyid=x.Keyid,
                     Remark=x.Remark,
            }).WithCache(3600).ToListAsync();
        }
        /// <summary>
        /// 获取科目列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<List<OaSubjectSet>> getKeMuList()
        {
            return await _client.Queryable<OaSubjectSet>().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();
        }
        /// <summary>
        /// 获取流水号
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public  string GetShowID()
        {
          return   _eZCoreNetRedisService.GetYYYMMddAnd4sn();
        }
    }
}