陈勇
2 天以前 6b74e1dcf5642c8f56975471e27780d695953989
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/pushWorkOrderInfo.cs
@@ -22,19 +22,35 @@
{
    public partial class MESService
    {
        /// <summary>
        /// MES推送涂装工单
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        public WebResponseContent pushWorkOrderInfo(object json)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                if (string.IsNullOrEmpty(json.ToString())) throw new Exception("请求参数为空");
                var result = JsonConvert.DeserializeObject<pushWorkOrderInfo>(json.ToString());
                Console.WriteLine(json);
                var result = JsonConvert.DeserializeObject<List<pushWorkOrderInfo>>(json.ToString());
                var paintingOrderInfos = new List<Dt_PaintingOrderInfo>();
                foreach (var item in result.list)
                foreach (var item in result)
                {
                    //var paintingInfo = _paintingOrderInfoRepository.QueryFirst(x => x.workOrderNo == item.workOrderNo && x.workOrderType == item.workOrderType);
                    //if (null != paintingInfo)
                    //{
                    //    paintingInfo.pvi = item.pvi;
                    //    paintingInfo.carBodyCharacteristic = item.carBodyCharacteristic;
                    //    paintingInfo.twoToneCharacteristic = item.twoToneCharacteristic;
                    //    paintingInfo.pbMaterial = item.pbMaterial;
                    //    _paintingOrderInfoRepository.UpdateData(paintingInfo);
                    //}
                    //else
                    //{
                    Dt_PaintingOrderInfo paintingOrderInfo = new Dt_PaintingOrderInfo()
                    {
                        biwMaterial = item.biwMaterial,
@@ -56,10 +72,10 @@
                        workOrderType = item.workOrderType,
                        workshopCode = item.workshopCode,
                    };
                    paintingOrderInfos.Add(paintingOrderInfo);
                }
                _paintingOrderInfoRepository.AddData(paintingOrderInfos);
                //}
                LogFactory.GetLog("涂装工单信息").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("涂装工单信息").Info(true, result.ToJsonString());
@@ -68,7 +84,7 @@
            catch (Exception ex)
            {
                LogFactory.GetLog("涂装工单信息").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("涂装工单信息").Info(true, ex.Message);
                LogFactory.GetLog("涂装工单信息").Info(true, $"涂装工单接收异常:{ex.Message}");
                return content.Error(ex.Message);
            }
        }