IGroupAppService.cs
3.81 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
using FoodLabeling.Application.Contracts.Dtos.Common;
using FoodLabeling.Application.Contracts.Dtos.Group;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace FoodLabeling.Application.Contracts.IServices;
/// <summary>
/// 组织(Group)管理接口(fl_group)
/// </summary>
public interface IGroupAppService : IApplicationService
{
/// <summary>
/// 组织分页列表(与导出使用相同筛选条件)
/// </summary>
/// <remarks>
/// 数据范围(按登录 Token):
/// 管理员可见全部 Region;其它角色仅可见其 <c>userlocation</c> 绑定门店对应的组织(<c>location.Partner</c> + <c>location.GroupName</c> 与 <c>fl_group</c> 匹配)。
/// </remarks>
/// <param name="input">分页与筛选;SkipCount 为页码(从 1 起)</param>
Task<PagedResultWithPageDto<GroupGetListOutputDto>> GetListAsync(GroupGetListInputVo input);
/// <summary>
/// 组织详情
/// </summary>
/// <param name="id">主键(Guid,与 <c>fl_group.Id</c> 一致;约定路由 <c>{id:guid}</c>,避免与 <c>export-pdf</c> 等路径冲突)</param>
Task<GroupGetOutputDto> GetAsync(Guid id);
/// <summary>
/// 新增组织
/// </summary>
/// <remarks>
/// <b>Company Admin</b>(RoleCode <c>CompanyAdmin</c> / RoleName <c>Company Admin</c>)在其绑定 Company 下新建 Region 时,
/// 后端会将该 Region 下已有门店(<c>location.Partner</c> + <c>location.GroupName</c> 与新建 Region 一致)追加写入当前账号的 <c>userlocation</c>,
/// 以便 auth-scope、门店列表等依赖门店绑定的能力立即识别新 Region。
/// </remarks>
Task<GroupGetOutputDto> CreateAsync(GroupCreateInputVo input);
/// <summary>
/// 编辑组织
/// </summary>
Task<GroupGetOutputDto> UpdateAsync(Guid id, GroupUpdateInputVo input);
/// <summary>
/// 删除组织(逻辑删除)
/// </summary>
Task DeleteAsync(Guid id);
/// <summary>
/// 按列表相同筛选条件全量导出组织(Region)为 PDF(不分页;与 <see cref="GetListAsync"/> 相同筛选与 Token 数据范围;单次最多 5000 条)
/// </summary>
/// <remarks>
/// 与 <see cref="GetListAsync"/> 使用同一套 <c>BuildGroupJoinedQueryAsync</c>(含 <c>ResolveGroupScopeAsync</c>),导出行集与列表一致。
/// </remarks>
/// <param name="input">Keyword、PartnerId、State、Sorting;分页字段忽略</param>
/// <returns>application/pdf</returns>
Task<IActionResult> ExportPdfAsync(GroupGetListInputVo input);
/// <summary>
/// JSON 在线批量导入 Region(逐行调用 <see cref="CreateAsync"/>,部分成功)
/// </summary>
/// <remarks>
/// 请求体为 JSON,每行字段与单条新增 <see cref="GroupCreateInputVo"/> 一致。
///
/// 示例请求:
/// ```json
/// {
/// "items": [
/// {
/// "groupName": "NC Region",
/// "partnerId": "PARTNER_ID",
/// "state": true
/// }
/// ]
/// }
/// ```
///
/// 参数说明:
/// - items: 待导入行数组;<c>index</c> 从 0 起;单次最多 <c>MaxImportRows</c> 条(默认 5000)
/// </remarks>
/// <param name="input">批量导入请求体</param>
/// <returns>成功数、失败数及失败明细(<c>index</c>、<c>groupName</c>、<c>message</c>)</returns>
/// <response code="200">全部或部分行处理完成,见返回体中的计数与 errors</response>
/// <response code="400">整单校验失败(如 items 为空、超过单次条数上限)</response>
/// <response code="500">服务器错误</response>
Task<GroupBatchImportOnlineResultDto> BatchImportOnlineAsync(GroupBatchImportOnlineInputVo input);
}