已删除1个文件
已修改7个文件
已添加5个文件
已重命名1个文件
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEAWCS_Core; |
| | |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | private readonly IRouterExtension _routerExtension; |
| | | private readonly WebSocketServer _webSocketServer; |
| | | |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension) : base(service) |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension, WebSocketServer webSocketServer) : base(service) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | _routerExtension = routerExtension; |
| | | _webSocketServer = webSocketServer; |
| | | } |
| | | |
| | | [HttpPost, Route("ReceiveTask"), AllowAnonymous] |
| | |
| | | { |
| | | return Service.SendSecureReplyToAgv(taskNum); |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("GetRouteEndPoint"), AllowAnonymous] |
| | | public WebResponseContent GetRouteEndPoint(string startPoint, int routeType) |
| | | { |
| | | return WebResponseContent.Instance.OK(data: _routerExtension.GetEndPoint(startPoint, routeType)); |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("WebSocketPushMessage"), AllowAnonymous] |
| | | public WebResponseContent WebSocketPushMessage(string message) |
| | | { |
| | | try |
| | | { |
| | | _webSocketServer.PublishAllClientPayload(message); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | |  |
| | | using HslCommunication.WebSocket; |
| | | using SqlSugar; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core.Seed; |
| | |
| | | { |
| | | private readonly ICacheService _cacheService; |
| | | private readonly DBContext _dbContext; |
| | | private readonly WebSocketServer _webSocketServer; |
| | | |
| | | public WarehouseHostedService(ICacheService cacheService, DBContext dbContext) |
| | | public WarehouseHostedService(ICacheService cacheService, DBContext dbContext, WebSocketServer webSocketServer) |
| | | { |
| | | _cacheService = cacheService; |
| | | _dbContext = dbContext; |
| | | _webSocketServer = webSocketServer; |
| | | } |
| | | |
| | | public Task StartAsync(CancellationToken cancellationToken) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using HslCommunication.WebSocket; |
| | | using WIDESEAWCS_Core.Helper; |
| | | |
| | | namespace WIDESEAWCS_Server.HostedService |
| | | { |
| | | public static class WebSocketSetup |
| | | { |
| | | public static void AddWebSocketSetup(this IServiceCollection services) |
| | | { |
| | | if (services == null) throw new ArgumentNullException(nameof(services)); |
| | | |
| | | if(AppSettings.Get("WebSocketEnable").ObjToBool()) |
| | | { |
| | | int port = AppSettings.Get("WebSocketPort").ObjToInt(); |
| | | if (port == 0) |
| | | { |
| | | port = 9296; |
| | | } |
| | | |
| | | services.AddSingleton(x => |
| | | { |
| | | WebSocketServer socketServer = new WebSocketServer(); |
| | | socketServer.ServerStart(port); |
| | | return socketServer; |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | builder.Services.AddHostedService<WarehouseHostedService>(); |
| | | builder.Services.AddHostedService<QuartzJobDataTableHostedService>(); |
| | | |
| | | builder.Services.AddWebSocketSetup(); |
| | | |
| | | builder.Services.AddAutoMapperSetup(); |
| | | |
| | | builder.Services.AddCorsSetup(); |
| | |
| | | app.UseAllServicesMiddle(builder.Services); |
| | | |
| | | app.UseSession(); |
| | | //if (app.Environment.IsDevelopment()) |
| | | if (app.Environment.IsProduction()) |
| | | { |
| | | //todo |
| | | app.UseSwaggerAuthorized(); |
| | | app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEAWCS_Server.index.html") ?? throw new Exception("æªæ¾å°WIDESEAWCS_Server.index.htmlæä»¶")); |
| | | |
| | | }//夿æ¯å¦éè¦æå¼swagger |
| | | |
| | | app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEAWCS_Server.index.html") ?? throw new Exception("æªæ¾å°WIDESEAWCS_Server.index.htmlæä»¶")); |
| | | |
| | | app.UseIpLimitMiddle(); |
| | | app.UseApiLogMiddleware(); |
| | | //todo |
| | |
| | | "WMSApiAddress": "http://127.0.0.1:9293", //"http://127.0.0.1:9283",æ£å¼ç¯å¢å°å |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 120, |
| | | "QuartzJobAutoStart": true |
| | | "QuartzJobAutoStart": true, |
| | | "WebSocketEnable": true, |
| | | "WebSocketPort": 9260 |
| | | } |
| | |
| | | let config = { |
| | | baseUrl: 'http://localhost:9293', |
| | | baseUrl: 'http://10.30.4.92:9293', |
| | | urls: [ |
| | | 'http://10.30.4.92:9283', |
| | | 'http://10.30.4.92:9283' |
| | |
| | | }, |
| | | snInput() { |
| | | this.$nextTick(() => { |
| | | if (this.warehouseId == 6 || this.warehouseId == 2) { |
| | | if (this.warehouseId == 6 || this.warehouseId == 2 || this.warehouseId == 3) { |
| | | if (this.sns.length > 0) { |
| | | this.sns = []; |
| | | } |
| | | } |
| | | if (this.materSn != "") { |
| | | this.focus = false; |
| | | var matSn = this.materSn; |
| | | setTimeout(() => { |
| | | if(this.materSn.split(',').length != 6){ |
| | | this.materSn = ""; |
| | | }, 10); |
| | | return; |
| | | } |
| | | var matSn = this.materSn; |
| | | //setTimeout(() => { |
| | | this.materSn = ""; |
| | | //}, 10); |
| | | this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => { |
| | | this.Testcheck = false; |
| | | if (res.status) { |
| | | this.sns.push(res.data.serialNumber); |
| | | if (this.warehouseId == 6 || this.warehouseId == 2) { |
| | | if (this.warehouseId == 6 || this.warehouseId == 2 || this.warehouseId == 3) { |
| | | if (this.matInfos.length > 0) { |
| | | this.matInfos = []; |
| | | } |
| | |
| | | innerAudioContext.src = src; // '../../static/success.mp3'; |
| | | innerAudioContext.play(); |
| | | }, |
| | | //è§£ç |
| | | releasebox() { |
| | | if (this.value.length == 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "请æ«ç ", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | var param; |
| | | var matInfo = this.value.split('|'); |
| | | if (matInfo.length == 7) { |
| | | param = { |
| | | MainData: { |
| | | "innerCode": this.value |
| | | } |
| | | } |
| | | } else { |
| | | param = { |
| | | MainData: { |
| | | "barcode": this.value |
| | | } |
| | | } |
| | | } |
| | | this.$u.post('/api/StockOperate/ReleaseAllBox', param).then(resdt => { |
| | | if (resdt.status) { |
| | | uni.$showMsg('è§£çæå!') |
| | | this.value = ""; |
| | | this.matInfo = []; |
| | | this.matTotals = []; |
| | | this.value2 = ""; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: resdt.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | releaseboxInput() { |
| | | this.$nextTick(() => { |
| | | if (this.value.length == 0) { |
| | | return; |
| | | } |
| | | var matInfo = this.value.split('|'); |
| | | this.matInfo = []; |
| | | if (matInfo.length == 7) { |
| | | this.$u.post('/api/StockOperate/GetStockInfoByInnerCode', { |
| | | MainData: { |
| | | "innerCode": this.value |
| | | } |
| | | }).then(res => { |
| | | if (res.status) { |
| | | this.matInfo = res.data.stockInfo; |
| | | this.matTotals = res.data.stockTotal; |
| | | this.value2 = res.data.barcode; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | this.$u.post('/api/StockOperate/GetStockInfoByBarcode', { |
| | | MainData: { |
| | | "barcode": this.value |
| | | } |
| | | }).then(res => { |
| | | if (res.status) { |
| | | this.matInfo = res.data.stockInfo; |
| | | this.matTotals = res.data.stockTotal; |
| | | this.value2 = res.data.barcode; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | updateFocus() { |
| | | debugger |
| | | this.$nextTick(() => { |