wangxinhui
2 天以前 617cd40beff6019043597796f92eeddd5fe41a5b
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs
@@ -30,7 +30,7 @@
        /// MES成品入库单接收
        /// </summary>
        /// <returns></returns>
        public MesResponseContent BagInfoSync(MesBagInfoModel bagInfoModel)
        public MesResponseContent BagInfoSync(MesBagInfoModel bagInfoModel, string formSign = "")
        {
            MesResponseContent content = new MesResponseContent();
            try
@@ -111,6 +111,7 @@
                            ERPOrder = child.ERPOrder,
                            SaleOrder = child.SaleOrder,
                            MoNumber = child.MoNumber,
                            IsFineWorks=item.IsFineWorks,
                        };
                        mesProInOrderDetails.Add(mesProInOrderDetail);
                    }
@@ -177,18 +178,21 @@
                newTask.TaskId = taskId;
                Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand();
                //上传ERP
                WebResponseContent responseContent = _inboundOrderService.FeedbackProIn(mesProInOrder);
                if (string.IsNullOrEmpty(formSign))
                {
                    WebResponseContent responseContent = _inboundOrderService.FeedbackProIn(mesProInOrder);
                    if (!responseContent.Status)
                    {
                        //mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt();
                        //mesProInOrder.Remark = responseContent.Message;
                        throw new Exception(responseContent.Message);
                    }
                    else
                    {
                        mesProInOrder.UpErpStatus = WhetherEnum.True.ObjToInt();
                    }
                }
                _proInStatisticsService.SaveStatic(bagInfoModel);
                if (!responseContent.Status)
                {
                    //mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt();
                    //mesProInOrder.Remark = responseContent.Message;
                    throw new Exception(responseContent.Message);
                }
                else
                {
                    mesProInOrder.UpErpStatus = WhetherEnum.True.ObjToInt();
                }
                Db.InsertNav(mesProInOrder).Include(x => x.Details).ExecuteCommand();
                _unitOfWorkManage.CommitTran();
                //推送任务
@@ -409,7 +413,7 @@
        /// <summary>
        /// MES成品出库单同步数据处理
        /// </summary>
        public MesShipmentOrderSync MesOutSync(Dt_OutProStockInfo outProStockInfo, Dt_ProOutOrderDetail proOutOrderDetail,List<Dt_ProStockInfoDetail> proStockInfoDetails)
        public MesShipmentOrderSync MesOutSync(Dt_OutProStockInfo outProStockInfo, Dt_ProOutOrderDetail proOutOrderDetail,List<Dt_ProStockInfoDetail> proStockInfoDetails,Dt_Task task=null)
        {
            List<MesShipOrderDetail> mesShipOrderDetails = new List<MesShipOrderDetail>();
            //获取出库单
@@ -437,10 +441,20 @@
                    } 
                }
            };
            if (task!=null)
            {
                orderDetail.WorkCenter = task.TargetAddress switch
                {
                    "5236" => "SPCK_OUTER-001",
                    "5243" => "SPCK_OUTER-002",
                    "5250" => "SPCK_OUTER-003",
                    _ => "SPCK_OUTER-001",
                };
            }
            mesShipOrderDetails.Add(orderDetail);
            MesShipmentOrderSync shipmentOrderSync = new MesShipmentOrderSync()
            {
                ShipmentOrder = proOutOrder.ProOutOrderNo+"-"+ outProStockInfo.TaskNum,
                ShipmentOrder = proOutOrder.ProOutOrderNo,
                PlantShipDate = proOutOrder.PlantShipDate.ToString("yyyy-MM-dd HH:mm:ss"),
                Customer = proOutOrderDetail.EndCustomer,
                FactoryCode = proOutOrderDetail.FactoryCode,