helongyang
2025-07-07 b7796f5e4d6594976ea948905af769eca863f27c
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs
@@ -172,17 +172,17 @@
                newTask.TaskId = taskId;
                Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand();
                //上传ERP
                WebResponseContent responseContent = _inboundOrderService.FeedbackProIn(mesProInOrder);
                //WebResponseContent responseContent = _inboundOrderService.FeedbackProIn(mesProInOrder);
                _proInStatisticsService.SaveStatic(bagInfoModel);
                if (!responseContent.Status)
                {
                    mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt();
                    mesProInOrder.Remark = responseContent.Message;
                }
                else
                {
                //if (!responseContent.Status)
                //{
                //    mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt();
                //    mesProInOrder.Remark = responseContent.Message;
                //}
                //else
                //{
                    mesProInOrder.UpErpStatus = WhetherEnum.True.ObjToInt();
                }
                //}
                Db.InsertNav(mesProInOrder).Include(x => x.Details).ExecuteCommand();
                _unitOfWorkManage.CommitTran();
                //推送任务
@@ -282,17 +282,17 @@
            
            _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;
            }
            else
            {
            ////上传ERP
            //WebResponseContent responseContent = _inboundOrderService.FeedbackProIn(mesProInOrder);
            //if (!responseContent.Status)
            //{
            //    mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt();
            //    mesProInOrder.Remark = responseContent.Message;
            //}
            //else
            //{
                mesProInOrder.UpErpStatus = WhetherEnum.True.ObjToInt();
            }
            //}
            Db.InsertNav(mesProInOrder).Include(x => x.Details).ExecuteCommand();
            _unitOfWorkManage.CommitTran();
            return WebResponseContent.Instance.OK("接收成功");
@@ -481,7 +481,44 @@
            }
            return content;
        }
        /// <summary>
        /// WMS同步成品出库至MES外包装机
        /// </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>