using Microsoft.AspNetCore.Mvc;
|
using System.Net;
|
using System.Net.Http.Headers;
|
using Microsoft.Extensions.Hosting.Internal;
|
using Microsoft.AspNetCore.Http.Extensions;
|
using IStation.Untity;
|
using Furion.DynamicApiController;
|
using System.ComponentModel.DataAnnotations;
|
using Mapster;
|
using Microsoft.AspNetCore.Http;
|
|
namespace IStation.Application
|
{
|
/// <summary>
|
/// RepairForm
|
/// </summary>
|
[Route("Repair/RepairForm")]
|
[ApiDescriptionSettings("Repair", Name = "维修工单", Order = 800)]
|
public class RepairForm_Controller : IDynamicApiController
|
{
|
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
|
/// <summary>
|
///
|
/// </summary>
|
public RepairForm_Controller(IHttpContextAccessor httpContextAccessor)
|
{
|
_httpContextAccessor = httpContextAccessor;
|
}
|
|
/// <summary>
|
/// 通过 Kind 获取地图列表
|
/// </summary>
|
[Route("GetMapListByKind@V1.0")]
|
[HttpGet]
|
public List<RepairFormMapDto> GetMapListByKind
|
(
|
[Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
|
long CorpID,
|
[Required,DataValidation(AllowEmptyStrings =false)]
|
string Kind
|
)
|
{
|
var vmList = new List<RepairFormMapDto>();
|
var requestList=new Service.RepairRequestForm().GetPendingByCorpID(CorpID);
|
if (requestList != null && requestList.Count > 0)
|
{
|
foreach (var request in requestList)
|
{
|
var vmRequest = new RepairFormMapDto(request,Kind);
|
vmList.Add(vmRequest);
|
}
|
}
|
var taskList = new Service.RepairTaskForm().GetUnCheckedByCorpID(CorpID);
|
if (taskList != null && taskList.Count > 0)
|
{
|
foreach (var task in taskList)
|
{
|
var vmTask = new RepairFormMapDto(task, Kind);
|
vmList.Add(vmTask);
|
}
|
}
|
return vmList;
|
}
|
|
|
|
|
|
|
|
|
}
|
}
|