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;
}
///
/// 查询公司Item数据
///
/// 租户id
///
public async Task 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 result = new PageResult();
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);
}
}
}