Commit 792a15c15a4cfa0e3ed7e2d71c49afc5802f8127
1 parent
b31159d8
feat: 新增按月份删除考勤汇总数据的接口
- 在LqAttendanceSummaryService中新增DeleteByMonth方法,支持根据年份和月份清空考勤汇总数据 - 添加相应的API注释,明确参数和返回信息 - 优化代码结构,确保功能的清晰性和可维护性
Showing
1 changed file
with
21 additions
and
1 deletions
netcore/src/Modularity/Extend/NCC.Extend/LqAttendanceSummaryService.cs
| ... | ... | @@ -325,6 +325,7 @@ namespace NCC.Extend |
| 325 | 325 | .WhereIF(input.Year.HasValue, a => a.Year == input.Year) |
| 326 | 326 | .WhereIF(input.Month.HasValue, a => a.Month == input.Month) |
| 327 | 327 | .WhereIF(input.EmployeeStatus.HasValue, a => a.EmployeeStatus == input.EmployeeStatus) |
| 328 | + | |
| 328 | 329 | .Select(a => new LqAttendanceSummaryListOutput |
| 329 | 330 | { |
| 330 | 331 | id = a.Id, |
| ... | ... | @@ -353,7 +354,26 @@ namespace NCC.Extend |
| 353 | 354 | #endregion |
| 354 | 355 | |
| 355 | 356 | #region 清空某一个月的数据 |
| 356 | - | |
| 357 | + /// <summary> | |
| 358 | + /// 清空某一个月的数据 | |
| 359 | + /// </summary> | |
| 360 | + /// <param name="year">年份</param> | |
| 361 | + /// <param name="month">月份</param> | |
| 362 | + /// <returns></returns> | |
| 363 | + [HttpDelete("DeleteByMonth/{year}/{month}")] | |
| 364 | + public async Task<dynamic> DeleteByMonth(string year, string month) | |
| 365 | + { | |
| 366 | + int yearInt = int.Parse(year); | |
| 367 | + int monthInt = int.Parse(month); | |
| 368 | + await _db.Deleteable<LqAttendanceSummaryEntity>().Where(p => p.Year == yearInt && p.Month == monthInt).ExecuteCommandAsync(); | |
| 369 | + return new | |
| 370 | + { | |
| 371 | + success = true, | |
| 372 | + message = "清空成功" | |
| 373 | + }; | |
| 374 | + } | |
| 357 | 375 | #endregion |
| 376 | + | |
| 377 | + | |
| 358 | 378 | } |
| 359 | 379 | } | ... | ... |