1
wangxinhui
2025-06-10 3443d00c1c23f84d8559e802a27eb9ba7ff0858a
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs
@@ -77,7 +77,7 @@
                      (x.EnableStatus == (int)EnableStatusEnum.Normal || x.EnableStatus == (int)EnableStatusEnum.OnlyOut));
                    if (locationInfo == null)
                    {
                        return responseContent.Error($"测试架货位。。。。。。。。。:{stockInfo.LocationCode}出库条件不满足");
                        return responseContent.Error($"测试架货位:{stockInfo.LocationCode}出库条件不满足");
                    }
                    //生成测试架出库任务 é”å®šåº“å­˜ æ›´æ”¹è´§ä½çŠ¶æ€
                    Dt_Task taskOut = new()
@@ -1424,6 +1424,46 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// èŽ·å–MES阻焊批次信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public WebResponseContent GetZHMesMaterialLot(string materialLot)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMS_MES_GetProductByLot.ToString());
                object obj = new { LotNo = materialLot };
                MESRoot<object> root = new MESRoot<object>()
                {
                    From = "WMS",
                    DateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    Content = obj
                };
                JsonSerializerSettings settings = new JsonSerializerSettings
                {
                    ContractResolver = new CamelCasePropertyNamesContractResolver()
                };
                string request = JsonConvert.SerializeObject(root, settings);
                string response = HttpMesHelper.Post(apiInfo.ApiAddress, request);
                MesResponseContent mesResponseContent = response.DeserializeObject<MesResponseContent>();
                //调用接口
                if (mesResponseContent.BSucc == true)
                {
                    content.OK(mesResponseContent.StrMsg, mesResponseContent.Content);
                }
                else
                {
                    content.Error(mesResponseContent.StrMsg);
                }
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}