Ez is itt félig kész ...
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using WorkFlowCheck.BL.Services;
|
||||
using WorkFlowCheck.BL.Services.Interfaces;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
|
||||
namespace WorkFlowCheck.API.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class CheckListController : ControllerBase
|
||||
{
|
||||
private ICheckListService _checkListService;
|
||||
public CheckListController(ICheckListService checkListService)
|
||||
{
|
||||
_checkListService = checkListService;
|
||||
}
|
||||
|
||||
[HttpGet("GetCheckListHeader/{id}")]
|
||||
public async Task<ApiResponseDTO<CheckListHeaderDTO>> GetCheckListHeader()
|
||||
{
|
||||
var retVal = new ApiResponseDTO<List<CheckPointDTO>>()
|
||||
{
|
||||
IsSuccess = true,
|
||||
};
|
||||
var checkPointListDTO = await _checkListService.GetAllCheckPointAsync();
|
||||
|
||||
if (checkPointListDTO != null)
|
||||
{
|
||||
|
||||
retVal.IsSuccess = true;
|
||||
retVal.Data = checkPointListDTO;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
retVal.Errors.Add("No data!");
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpGet("GetAllEquipments")]
|
||||
public async Task<ApiResponseDTO<List<EquipmentDTO>>> GetAllEquipmentsAsync()
|
||||
{
|
||||
var retVal = new ApiResponseDTO<List<EquipmentDTO>>()
|
||||
{
|
||||
IsSuccess = true,
|
||||
};
|
||||
var equipmentListDTO = await _syncService.GetAllEquipmentAsync();
|
||||
|
||||
if (equipmentListDTO != null)
|
||||
{
|
||||
|
||||
retVal.IsSuccess = true;
|
||||
retVal.Data = equipmentListDTO;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
retVal.Errors.Add("No data!");
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpGet("GetAllLocations")]
|
||||
public async Task<ApiResponseDTO<List<LocationDTO>>> GetAllLocationsAsync()
|
||||
{
|
||||
var retVal = new ApiResponseDTO<List<LocationDTO>>()
|
||||
{
|
||||
IsSuccess = true,
|
||||
};
|
||||
var locationListDTO = await _syncService.GetAllLocationAsync();
|
||||
|
||||
if (locationListDTO != null)
|
||||
{
|
||||
|
||||
retVal.IsSuccess = true;
|
||||
retVal.Data = locationListDTO;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
retVal.Errors.Add("No data!");
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpGet("GetAllCheckListTemplateHeader")]
|
||||
public async Task<ApiResponseDTO<List<CheckListTemplateHeaderDTO>>> GetAllCheckListTemplateHeaderAsync()
|
||||
{
|
||||
var retVal = new ApiResponseDTO<List<CheckListTemplateHeaderDTO>>()
|
||||
{
|
||||
IsSuccess = true,
|
||||
};
|
||||
var response = await _syncService.GetAllCheckListTemplateAsync();
|
||||
|
||||
if (response != null)
|
||||
{
|
||||
|
||||
retVal.IsSuccess = true;
|
||||
retVal.Data = response;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
retVal.Errors.Add("No data!");
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.BL.Services
|
||||
{
|
||||
class CheckListService
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
|
||||
namespace WorkFlowCheck.BL.Services.Interfaces
|
||||
{
|
||||
public interface ICheckListService
|
||||
{
|
||||
Task<CheckListHeaderDTO> GetCheckListHeader(int Id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.Common.DTO
|
||||
{
|
||||
public class CheckListHeaderDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ShortName { get; set; } = null!;
|
||||
public string Description { get; set; } = null!;
|
||||
public string DocumentNumber { get; set; } = null!;
|
||||
public Guid GuidNumber { get; set; }
|
||||
public required ICollection<CheckListRowDTO> CheckListRowDTO { get; set; } = new List<CheckListRowDTO>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.Common.DTO
|
||||
{
|
||||
public class CheckListRowDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int CheckListHeaderId { get; set; }
|
||||
public int CheckListTemplateRowId { get; set; }
|
||||
public string Answer { get; set; } = null!;
|
||||
public byte[] Photo { get; set; } = null!;
|
||||
public Guid GuidNumber { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ namespace WorkFlowCheck.DL.Entities
|
||||
public string ShortName { get; set; } = null!;
|
||||
public string Description { get; set; } = null!;
|
||||
public string DocumentNumber { get; set; } = null!;
|
||||
public Guid GuidNumber { get; set; }
|
||||
public bool IsStorno { get; set; }
|
||||
public DateTime LastModAt { get; set; }
|
||||
public string LastModBy { get; set; } = null!;
|
||||
|
||||
@@ -7,15 +7,16 @@ using WorkFlowCheck.DL.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.DL.Entities
|
||||
{
|
||||
public class CheckListRow:ISoftDeletableEntity, IAuditableEntity
|
||||
public class CheckListRow : ISoftDeletableEntity, IAuditableEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int CheckListHeaderId { get; set; }
|
||||
public int Id { get; set; }
|
||||
public int CheckListHeaderId { get; set; }
|
||||
public virtual CheckListHeader CheckListHeader { get; set; } = null!;
|
||||
public int CheckListTemplateRowId { get; set; }
|
||||
public int CheckListTemplateRowId { get; set; }
|
||||
public virtual CheckListTemplateRow CheckListTemplateRow { get; set; } = null!;
|
||||
public string Answer { get; set; } = null!;
|
||||
public string Answer { get; set; } = null!;
|
||||
public byte[] Photo { get; set; } = null!;
|
||||
public Guid GuidNumber { get; set; }
|
||||
public DateTime LastModAt { get; set; }
|
||||
public string LastModBy { get; set; } = null!;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user