dengjunjie
2025-04-13 2950220f98f891a64cc452478e2a2ae61b82a8cd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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)
            });
        }
    }
}