using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Mvc;
|
using SqlSugar;
|
using SqlSugar.Extensions;
|
using WIDESEA_Common.TaskEnum;
|
using WIDESEA_Core;
|
using WIDESEA_Core.Enums;
|
using WIDESEA_IBasicService;
|
using WIDESEA_IInboundRepository;
|
using WIDESEA_ITaskInfoRepository;
|
using WIDESEA_Model.Models;
|
using WIDESEAWCS_DTO.WCSInfo;
|
|
namespace WIDESEA_WMSServer.Controllers
|
{
|
[Route("api/LargeScreen")]
|
[ApiController, AllowAnonymous]
|
public class LargeScreenController : Controller
|
{
|
private readonly ILocationInfoService _locationInfoService;
|
private readonly ITaskRepository _taskRepository;
|
private readonly ITask_HtyRepository _taskHtyRepository;
|
private readonly IInboundOrderDetailRepository _inboundOrderDetailRepository;
|
public LargeScreenController(ILocationInfoService locationInfoService, ITaskRepository taskRepository, ITask_HtyRepository taskHtyRepository, IInboundOrderDetailRepository inboundOrderDetailRepository)
|
{
|
_locationInfoService = locationInfoService;
|
_taskRepository = taskRepository;
|
_taskHtyRepository = taskHtyRepository;
|
_inboundOrderDetailRepository = inboundOrderDetailRepository;
|
}
|
|
[HttpPost, Route("GetLocationInfo")]
|
public WebResponseContent GetLocationInfo([FromBody] SaveModel model)
|
{
|
return _locationInfoService.GetLocationInfo(model);
|
}
|
|
[HttpPost, Route("GetTask")]
|
public WebResponseContent GetTask([FromBody] SaveModel model)
|
{
|
List<Dt_Task_Hty> task_Hties = _taskHtyRepository.QueryData(x => x.TaskType == TaskInboundTypeEnum.Inbound.ObjToInt()).ToList();
|
var task_htys = task_Hties.Where(x => x.InsertTime.Date == DateTime.Now.Date).ToList();
|
var tasks = _taskRepository.QueryData(x => x.TaskType == TaskInboundTypeEnum.Inbound.ObjToInt()).ToList();
|
List<Dt_InboundOrderDetail> inboundOrderDetails = _inboundOrderDetailRepository.QueryData(x => x.OrderDetailStatus <= OrderDetailStatusEnum.GroupAndInbound.ObjToInt()).ToList();
|
return WebResponseContent.Instance.OK(data: new
|
{
|
task_Htiesqty = task_Hties.Count,
|
task_htysqty = task_htys.Count,
|
tasksqty = tasks.Count,
|
inboundOrderDetailsqty = inboundOrderDetails.Sum(x => x.OrderQuantity - x.OverInQuantity)
|
});
|
}
|
}
|
}
|