feat: add unit filtering and improve unit info handling in charge cycles
- Add optional UnitId parameter to CostCyclsList method for filtering cycles by specific unit - Replace UnitIds/UnitNames lists with structured UnitInfoDto containing Id and Name - Clean unit names by removing "GUID#" prefix when present - Update CostCycleDto to use UnitInfoDto list instead of separate Id and Name lists - Fix unit assignment logic in Add and Edit methods to use new DTO structure
This commit is contained in:
@@ -41,11 +41,12 @@ namespace Complex.EndPoint.Controllers
|
||||
/// <param name="EndDate"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ResultDto<List<CostCycleDto>> CostCyclsList([FromForm] Guid ComplexId, [FromForm] DateTime? StartDate = null, [FromForm] DateTime? EndDate = null)
|
||||
public ResultDto<List<CostCycleDto>> CostCyclsList([FromForm] Guid ComplexId, [FromForm] DateTime? StartDate = null, [FromForm] DateTime? EndDate = null, [FromForm] Guid? UnitId = null)
|
||||
{
|
||||
return _costCycleService.CostCyclsList(ComplexId,
|
||||
!StartDate.HasValue ? null : DateOnly.FromDateTime(StartDate.Value),
|
||||
!EndDate.HasValue ? null : DateOnly.FromDateTime(EndDate.Value));
|
||||
!EndDate.HasValue ? null : DateOnly.FromDateTime(EndDate.Value),
|
||||
UnitId: UnitId);
|
||||
}
|
||||
/// <summary>
|
||||
/// بدهی یک واحد
|
||||
|
||||
Reference in New Issue
Block a user