lixiaojun
2022-11-23 b5c20e5143555a1bdd450a1e660216b90c93b6f1
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
68
69
70
71
72
73
74
75
using Microsoft.AspNetCore.Mvc;
using System.Net;
using System.Net.Http.Headers;
using Microsoft.Extensions.Hosting.Internal;
using Microsoft.AspNetCore.Http.Extensions;
using IStation.Untity;
using Furion.DynamicApiController;
using System.ComponentModel.DataAnnotations;
using Mapster;
using Microsoft.AspNetCore.Http;
 
namespace IStation.Application
{
    /// <summary>
    /// RepairForm
    /// </summary>
    [Route("Repair/RepairForm")]
    [ApiDescriptionSettings("Repair", Name = "维修工单", Order = 800)]
    public class RepairForm_Controller : IDynamicApiController 
    {
 
        private readonly IHttpContextAccessor _httpContextAccessor;
 
        /// <summary>
        /// 
        /// </summary>
        public RepairForm_Controller(IHttpContextAccessor httpContextAccessor) 
        {
            _httpContextAccessor = httpContextAccessor;
        }
 
        /// <summary>
        /// 通过 Kind 获取地图列表
        /// </summary>
        [Route("GetMapListByKind@V1.0")]
        [HttpGet]
        public List<RepairFormMapDto> GetMapListByKind
            (
                [Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
                long CorpID,
                [Required,DataValidation(AllowEmptyStrings =false)]
                string Kind
            )
        {
            var vmList = new List<RepairFormMapDto>();
            var requestList=new Service.RepairRequestForm().GetPendingByCorpID(CorpID);
            if (requestList != null && requestList.Count > 0)
            {
                foreach (var request in requestList)
                {
                    var vmRequest = new RepairFormMapDto(request,Kind);
                    vmList.Add(vmRequest);
                }
            }
            var taskList = new Service.RepairTaskForm().GetUnCheckedByCorpID(CorpID);
            if (taskList != null && taskList.Count > 0)
            {
                foreach (var task in taskList)
                {
                    var vmTask = new RepairFormMapDto(task, Kind);
                    vmList.Add(vmTask);
                }
            }
            return vmList;
        }
 
 
 
 
 
 
 
 
    }
}