wangxinhui
8 小时以前 67348f250a1b7970059698002949a5e0a5f3c52f
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
56
57
58
59
60
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core.Attributes;
using WIDESEA_Core;
using WIDESEA_DTO;
using WIDESEA_IBasicService;
using WIDESEA_ITaskInfoService;
using WIDESEA_TaskInfoService;
using WIDESEA_DTO.ERP;
using WIDESEA_DTO.MES;
using WIDESEA_Core.Helper;
using Autofac.Core;
using WIDESEA_DTO.Stock;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Common.LocationEnum;
using System.Collections.Generic;
using WIDESEA_Model.Models;
using SqlSugar;
using WIDESEA_IStockService;
using WIDESEA_Common.StockEnum;
using HslCommunication.WebSocket;
 
namespace WIDESEA_WMSServer.Controllers.LargeScreen
{
    [Route("api/Large")]
    [ApiController]
    public class LargeController : ControllerBase
    {
        private readonly ITaskService _taskService;
        private readonly ITask_HtyService _task_HtyService;
        private readonly IBasicService _basicService;
        private readonly WebSocketServer _webSocketServer;
        private readonly IProStockInfoDetailService _proStockInfoDetailService;
        private readonly IProStockInfoService _proStockInfoService;
 
        public LargeController( ITaskService taskService, ITask_HtyService task_HtyService, IBasicService basicService, IProStockInfoDetailService proStockInfoDetailService, IProStockInfoService proStockInfoService, WebSocketServer webSocketServer)
        {
            _taskService = taskService;
            _task_HtyService = task_HtyService;
            _basicService = basicService;
            _proStockInfoDetailService = proStockInfoDetailService;
            _proStockInfoService = proStockInfoService;
            _webSocketServer = webSocketServer;
        }
        /// <summary>
        /// 测试
        /// </summary>
        /// <returns></returns>
        [HttpPost, Route("PushInfoSocket"), AllowAnonymous]
        public WebResponseContent ProMonthTaskStatistics(string info)
        {
            WebSocketSession[] webSocketSession = _webSocketServer.OnlineSessions;
            if (webSocketSession != null)
            {
                _webSocketServer.SendClientPayload(webSocketSession[0], "同意");
            }
            return WebResponseContent.Instance.OK(_webSocketServer.OnlineSessions.Select(x=>x.Url).Serialize());
        }
    }
}