ISalaryCalculationService.cs
4.45 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using LqSalaryCalculationService.Models;
namespace LqSalaryCalculationService.Services
{
/// <summary>
/// 工资核算服务接口
/// </summary>
public interface ISalaryCalculationService
{
/// <summary>
/// 初始化用户信息到工资表
/// </summary>
/// <param name="calculationMonth">计算月份 (格式: yyyy-MM)</param>
/// <returns>初始化结果</returns>
Task<UserInfoInitResult> InitializeUserInfoAsync(string calculationMonth);
/// <summary>
/// 执行工资核算
/// </summary>
/// <param name="calculationMonth">计算月份 (格式: yyyy-MM)</param>
/// <returns>核算结果</returns>
Task<SalaryCalculationResult> CalculateSalaryAsync(string calculationMonth);
/// <summary>
/// 获取员工业绩数据
/// </summary>
/// <param name="calculationMonth">计算月份</param>
/// <returns>员工业绩列表</returns>
Task<List<EmployeePerformance>> GetEmployeePerformanceAsync(string calculationMonth);
/// <summary>
/// 计算健康师工资
/// </summary>
/// <param name="performance">业绩数据</param>
/// <returns>工资计算结果</returns>
Task<EmployeeSalary> CalculateHealthWorkerSalaryAsync(EmployeePerformance performance);
/// <summary>
/// 计算金三角提成
/// </summary>
/// <param name="teamPerformance">团队业绩</param>
/// <param name="memberCount">团队成员数</param>
/// <returns>提成比例</returns>
decimal CalculateTeamCommissionRate(decimal teamPerformance, int memberCount);
/// <summary>
/// 计算门店管理员工资
/// </summary>
/// <param name="performance">业绩数据</param>
/// <returns>工资计算结果</returns>
Task<EmployeeSalary> CalculateManagerSalaryAsync(EmployeePerformance performance);
/// <summary>
/// 导出工资报表
/// </summary>
/// <param name="salaries">工资列表</param>
/// <param name="outputPath">输出路径</param>
/// <returns>导出文件路径</returns>
Task<string> ExportSalaryReportAsync(List<EmployeeSalary> salaries, string outputPath);
/// <summary>
/// 发送邮件通知
/// </summary>
/// <param name="result">核算结果</param>
/// <returns>发送结果</returns>
Task<bool> SendEmailNotificationAsync(SalaryCalculationResult result);
}
/// <summary>
/// 员工业绩数据模型
/// </summary>
public class EmployeePerformance
{
public string EmployeeId { get; set; } = string.Empty;
public string EmployeeName { get; set; } = string.Empty;
public string StoreId { get; set; } = string.Empty;
public string StoreName { get; set; } = string.Empty;
public string Position { get; set; } = string.Empty;
public string PositionCategory { get; set; } = string.Empty;
public decimal TotalPerformance { get; set; }
public decimal ConsumptionPerformance { get; set; }
public int ProjectCount { get; set; }
public int CustomerCount { get; set; }
public decimal TeamPerformance { get; set; }
public bool IsNewStore { get; set; }
public decimal StoreLifeLine { get; set; }
public string TeamId { get; set; } = string.Empty;
public int TeamMemberCount { get; set; }
}
/// <summary>
/// 工资核算结果
/// </summary>
public class SalaryCalculationResult
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
public List<EmployeeSalary> Salaries { get; set; } = new List<EmployeeSalary>();
public string OutputFilePath { get; set; } = string.Empty;
public DateTime CalculationTime { get; set; } = DateTime.Now;
public string CalculationMonth { get; set; } = string.Empty;
}
/// <summary>
/// 用户信息初始化结果
/// </summary>
public class UserInfoInitResult
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
public int UserCount { get; set; }
public DateTime InitTime { get; set; } = DateTime.Now;
public string CalculationMonth { get; set; } = string.Empty;
}
}