移动系统liao
2025-01-22 20c735f3df81e9e0a8946c71344fe62ddcee9d87
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
using cylsg.Model.ECTEModel;
using ECTESTOA;
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;
        public CYOSSettingController( ISqlSugarClient client,IOAServices oAServices )
        {
            _client = client.AsTenant().GetConnection("ECTESTOADB");
            _oAServices = oAServices;
        }
 
        /// <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();
        }
 
    }
}