| | |
| | | /// MESæåå
¥åºåæ¥æ¶ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public MesResponseContent BagInfoSync(MesBagInfoModel bagInfoModel) |
| | | public MesResponseContent BagInfoSync(MesBagInfoModel bagInfoModel, string formSign = "") |
| | | { |
| | | MesResponseContent content = new MesResponseContent(); |
| | | try |
| | |
| | | } |
| | | 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) |
| | | { |
| | |
| | | ERPOrder = child.ERPOrder, |
| | | SaleOrder = child.SaleOrder, |
| | | MoNumber = child.MoNumber, |
| | | IsFineWorks=item.IsFineWorks, |
| | | }; |
| | | mesProInOrderDetails.Add(mesProInOrderDetail); |
| | | } |
| | |
| | | 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(); |
| | | //æ¨éä»»å¡ |
| | |
| | | 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, |