| | |
| | | _proInStatisticsService.SaveStatic(bagInfoModel); |
| | | if (!responseContent.Status) |
| | | { |
| | | mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt(); |
| | | mesProInOrder.Remark = responseContent.Message; |
| | | //mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt(); |
| | | //mesProInOrder.Remark = responseContent.Message; |
| | | throw new Exception(responseContent.Message); |
| | | } |
| | | else |
| | | { |
| | |
| | | }; |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand(); |
| | | //涓婁紶ERP |
| | | WebResponseContent responseContent = _inboundOrderService.FeedbackProIn(mesProInOrder); |
| | | if (!responseContent.Status) |
| | | { |
| | | mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt(); |
| | | mesProInOrder.Remark = responseContent.Message; |
| | | //mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt(); |
| | | //mesProInOrder.Remark = responseContent.Message; |
| | | return WebResponseContent.Instance.Error($"{responseContent.Message}"); |
| | | } |
| | | else |
| | | { |
| | | mesProInOrder.UpErpStatus = WhetherEnum.True.ObjToInt(); |
| | | } |
| | | Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand(); |
| | | Db.InsertNav(mesProInOrder).Include(x => x.Details).ExecuteCommand(); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK("鎺ユ敹鎴愬姛"); |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WMS鍚屾鎴愬搧鍑哄簱鑷矼ES澶栧寘瑁呮満 |
| | | /// </summary> |
| | | public WebResponseContent ShipmentOrderMESSync(MesShipmentOrderSync model) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.AnhuaitcShipmentOrderSync.ToString()); |
| | | MESRoot<MesShipmentOrderSync> root = new MESRoot<MesShipmentOrderSync>() |
| | | { |
| | | From = "WMS", |
| | | DateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Content = model |
| | | }; |
| | | 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); |
| | | } |
| | | else |
| | | { |
| | | content.Error(mesResponseContent.StrMsg); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// MES鎴愬搧杩斿伐鎻愬簱 |
| | | /// </summary> |