using AngleSharp.Common; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEA_Common; using WIDESEA_Common.MES.Request; using WIDESEA_Core; using WIDESEA_Core.Const; using WIDESEA_Core.Helper; using WIDESEAWCS_BasicInfoService; using WIDESEAWCS_Model.Models; namespace WIDESEA_StoragIntegrationServices { /// /// 车身绑定工单(焊装直通涂装) /// public partial class MESService { public WebResponseContent bindWorkOrder(string stationCode) { WebResponseContent content = new WebResponseContent(); try { var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_MESIPAddress); var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.MESIPAddress)?.ConfigValue; var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.bindWorkOrder)?.ConfigValue; if (wmsBase == null || ipAddress == null) { throw new InvalidOperationException("WMS IP 未配置"); } var wmsIpAddress = wmsBase + ipAddress; var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == stationCode); BindWorkOrder passPoint = new BindWorkOrder() { unionKey = Guid.NewGuid().ToString(), stationCode = stationInfo.stationChildCode, messageTime = DateTime.Now.ToString(), plantCode = "1022", pvi = "", workOrderNo = "", workOrderType = "", workshopCode = "" }; var MESrespon = HttpHelper.Post(wmsIpAddress, passPoint.ToJson()); return content; } catch (Exception ex) { return content.Error(ex.Message); } } } }