´úÂë¹ÜÀí/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
@@ -74,6 +74,10 @@
                }
                if (bagInfoModel.BatchNo.Substring(0, 3).ToUpper() == "CPK")
                {
                    if (warehouse.WarehouseCode==WarehouseEnum.HA73.ToString())
                    {
                        return content.Error($"研发仓属性不能入平库");
                    }
                    WebResponseContent inProRespone = InPKProStock(bagInfoModel, proDetailsExists, warehouse);
                    if (!inProRespone.Status)
                    {
@@ -107,6 +111,7 @@
                            ERPOrder = child.ERPOrder,
                            SaleOrder = child.SaleOrder,
                            MoNumber = child.MoNumber,
                            IsFineWorks=item.IsFineWorks,
                        };
                        mesProInOrderDetails.Add(mesProInOrderDetail);
                    }
@@ -165,25 +170,29 @@
                    WarehouseId = warehouse.WarehouseId,
                    PalletType = proStockInfo.PalletType,
                    MaterielCode = proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).FirstOrDefault()?.ProductCode,
                    Quantity = (float)proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).Sum(x => x.StockPcsQty)
                    Quantity = (float)proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).Sum(x => x.StockPcsQty),
                    BatchNo = proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).FirstOrDefault()?.LotNumber,
                };
                _unitOfWorkManage.BeginTran();
                int taskId = BaseDal.AddData(newTask);
                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();
                //推送任务
@@ -435,7 +444,7 @@
            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,
@@ -663,6 +672,7 @@
                        throw new Exception("同步MES库存板出库失败,错误:" + responseContent.Message);
                    }
                    _unitOfWorkManage.CommitTran();
                    PushTasksToWCS(tasks);
                }
                return content.OK($"提供返库单接收成功,ReceiveDown:{model.ReceiveDown}");
            }