admin
2024-09-20 8b7b39172ee548ff303dbd73816cb7c1071f7887
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
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using RiskControl.NewService.Entity;
using SqlSugar;
 
namespace RiskControl.NewService.Service
{
    public class RiskFactorService:BaseService<RateSubjectRiskFactor>
    {
        /// <summary>
        /// 获取主体性质风险系数相关类型
        /// </summary>
        /// <returns></returns>
        public Dictionary<string, string> GetRateRiskFactorType()
        {
            var dict = new Dictionary<string, string>()
            {
                {"ZYZF","中央政府"},
                {"SJZF","省级政府"},
                {"SHIJZF","市级政府"},
                {"QXJZF","区县级政府"},
                {"XJZF","乡级政府"},
                {"QTZF","其他政府相关"},
                {"CZJT","城镇集体"},
                {"XCJT","乡村集体"},
                {"ZGZRR","中国自然人"},
                {"GJZZ","国际组织相关"},
                {"WGZF","外国政府相关"},
                {"WGFR","外国法人"},
                {"WGZRR","外国自然人"},
            };
            return dict;
        }
 
        /// <summary>
        /// 获取主体性质风险系数相关列表
        /// </summary>
        /// <returns></returns>
        public async Task<List<RateSubjectRiskFactor>> GetRateRiskFactorList()
        {
            var res = await Db.Queryable<RateSubjectRiskFactor>().OrderBy(a => a.Time, OrderByType.Asc).ToListAsync();
            return res;
        }
 
        /// <summary>
        /// 获取主体性质风险系数所有时间及id(Drop)
        /// </summary>
        /// <returns></returns>
        public async Task<List<object>> GetAllTime()
        {
            var res = await Db.Queryable<RateSubjectRiskFactor>().OrderBy(a => a.Time, OrderByType.Desc)
            .Select(a => new RateSubjectRiskFactor() { Id = a.Id, Time = a.Time }).ToListAsync();
 
            var list = new List<object>();
            res.ForEach(a => list.Add(new { Id = a.Id, Time = a.Time }));
            return list;
        }
 
    }
}