| | |
| | | input.RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); |
| | | var inputJson = input.ToDictionary(); |
| | | var x = await HttpsClient.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/TrayCellsStatus", inputJson); |
| | | if (x != null) |
| | | { |
| | | ResultTrayCellsStatus result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(x); |
| | | DtBoxingInfo boxingInfo = new DtBoxingInfo() |
| | | { |
| | | IsFull = true, |
| | | PalletCode = result.TrayBarcode, |
| | | }; |
| | | var details = new List<DtBoxingInfoDetail>(); |
| | | foreach (var item in result.SerialNos) |
| | | { |
| | | DtBoxingInfoDetail detail = new DtBoxingInfoDetail() |
| | | { |
| | | SerialNumber = item.SerialNo, |
| | | OrderNo = item.PositionNo.ToString(), |
| | | Status = item.SerialNoStatus, |
| | | Remark = result.TrayBarcodePropertys.ToJsonString(), |
| | | MaterielCode = result.BindCode, |
| | | }; |
| | | details.Add(detail); |
| | | } |
| | | boxingInfo.BoxingInfoDetails = details; |
| | | var abc = await _boxingInfoService.AddBoxingInfoAsync(boxingInfo); |
| | | if (abc.Status) |
| | | content.OK("组盘成功", result); |
| | | else |
| | | content.Error("组盘失败"); |
| | | } |
| | | //if (x != null) |
| | | //{ |
| | | // // 反序列化ResultTrayCellsStatus对象 |
| | | // ResultTrayCellsStatus result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(x); |
| | | |
| | | // // 创建DtBoxingInfo对象 |
| | | // DtBoxingInfo boxingInfo = new DtBoxingInfo |
| | | // { |
| | | // IsFull = true, |
| | | // PalletCode = result.TrayBarcode, |
| | | // }; |
| | | |
| | | // // 使用LINQ创建DtBoxingInfoDetail对象列表 |
| | | // var details = result.SerialNos.Select(item => new DtBoxingInfoDetail |
| | | // { |
| | | // SerialNumber = item.SerialNo, |
| | | // OrderNo = item.PositionNo.ToString(), |
| | | // Status = item.SerialNoStatus, |
| | | // Remark = result.TrayBarcodePropertys.ToJsonString(), |
| | | // MaterielCode = result.BindCode, |
| | | // }).ToList(); |
| | | |
| | | // // 赋值DtBoxingInfoDetails |
| | | // boxingInfo.BoxingInfoDetails = details; |
| | | // var abc = await _boxingInfoService.AddBoxingInfoAsync(boxingInfo); |
| | | // if (abc.Status) |
| | | // content.OK("组盘成功", result); |
| | | // else |
| | | // content.Error("组盘失败"); |
| | | //} |
| | | LogFactory.GetLog("整盘电芯属性获取").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("整盘电芯属性获取").Info(true, x); |
| | | } |