liaoxujun@qq.com
2023-09-01 82f8cf8f853252cd24bc150fc84a7ac8e3427148
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
using DocumentServiceAPI.Application.System.Services;
using DocumentServiceAPI.Application.UserAndLogin.Services;
using DocumentServiceAPI.Model;
using DocumentServiceAPI.Utility;
 
namespace DocumentServiceAPI.Application.System
{
    public class OrganizationPageSearch: PageBaseSearch
    {
 
    }
 
    public class OrganizationAppService : IDynamicApiController
    {
        private readonly OrganizationService _businessService;
        private readonly UserService _userServer;
 
        public OrganizationAppService(OrganizationService businessService, UserService userService)
        {
            _businessService = businessService;
            _userServer = userService;
        }
 
        /// <summary>
        /// 查询公司Item数据
        /// </summary>
        /// <param name="code">租户id</param>
        /// <returns></returns>
        public async Task<IActionResult> GetOrgItemList(int code)
        {
            var data = await _userServer.GetUserUnitList(code);
            return new JsonResult(data);
        }
 
        public IActionResult GetInfo()
        {
            var person = _businessService.GetList();
            return new JsonResult(person);
        }
 
        public IActionResult PostInfoPage(OrganizationPageSearch page)
        {
            PageModel pg = new PageModel();
            pg.PageSize = page.PageSize;
            pg.PageIndex = page.PageIndex;
 
            PageResult<Document_TenderUnit> result = new PageResult<Document_TenderUnit>();
            result.Items = _businessService.GetPageListAsync(c => c.UnitId > 0, pg).Result;
            result.TotalCount = pg.TotalCount;
 
            return new JsonResult(result);
        }
 
        public IActionResult PostAddTest(Document_TenderUnit info)
        {
            var person = _businessService.InsertAsync(info);
            return new JsonResult(person.Result);
        }
 
        public IActionResult PostEdtTest(Document_TenderUnit info)
        {
           
            var person = _businessService.UpdateAsync(info);
            return new JsonResult(person.Result);
        }
 
        public IActionResult PostDelTest(int id)
        {
            var person = _businessService.DeleteByIdAsync(id);
            return new JsonResult(person.Result);
        }
    }
}