ningshuxia
2022-11-22 4efe844d9bcc03435cbbeb1aedbda5bf6ebf5912
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
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;
 
 
namespace IStation.Application
{
    /// <summary>
    /// ProductModifyRecord
    /// </summary>
    [Route("Product/ProductModifyRecord/Logic")]
    [ApiDescriptionSettings("Product", Name = "设备变更记录(业务)", Order = 589)]
    public class ProductModifyRecord_LogicController : IDynamicApiController
    {
        private Service.ProductModifyRecord _service = new Service.ProductModifyRecord();
 
        /// <summary>
        /// 通过 ProductID 获取内容列表
        /// </summary>
        [Route("GetContentByProductID@V1.0")]
        [HttpGet]
        public List<ProductModifyRecordContentLogicDto> GetContentByProductID([Required][FromQuery] ProductIDUnderCorpInput input)
        {
            var list = _service.GetByProductID(input.CorpID, input.ProductID);
            if (list == null || list.Count < 1)
                return default;
            var serviceFile = new Service.AttachmentFile();
            var vmList = list.Select(x=>new ProductModifyRecordContentLogicDto(x,
                ()=>serviceFile.GetCountByAttachTypeAndAttachID(x.CorpID,IStation.ObjectType.ProductModifyRecord,x.ID))).ToList();
            return vmList;
        }
 
        /// <summary>
        /// 通过 ProductID 获取列表
        /// </summary>
        [Route("GetByProductID@V1.0")]
        [HttpGet]
        public List<ProductModifyRecordLogicDto> GetByProductID([Required][FromQuery] ProductIDUnderCorpInput input)
        {
            var list = _service.GetByProductID(input.CorpID, input.ProductID);
            if (list == null || list.Count < 1)
                return default;
            var serviceFile = new Service.AttachmentFile();
            var serviceUser = new Service.User();
            var vmList = list.Select(x => new ProductModifyRecordLogicDto(x,
                () => serviceFile.GetCountByAttachTypeAndAttachID(x.CorpID, IStation.ObjectType.ProductModifyRecord, x.ID),
                (id)=>serviceUser.GetByID(id)?.RealName)).ToList();
            return vmList;
        }
        
 
        
 
       
 
       
 
 
 
 
 
 
    }
}