| | |
| | | _supplyTaskService.AddData(supplyTasks); |
| | | _inventory_BatchServices.UpdateData(batchesUp); |
| | | _inventoryInfoService.UpdateData(inventoryInfosUp); |
| | | BaseDal.Db.CopyNew().InsertNav(entityOrder).Include(x => x.Details).ExecuteCommand(); |
| | | BaseDal.Db.InsertNav(entityOrder).Include(x => x.Details).ExecuteCommand(); |
| | | _unitOfWorkManage.CommitTran(); |
| | | #endregion |
| | | } |
| | |
| | | #region æ·»å åºåºä»»å¡ãä¿®æ¹åºåä¿¡æ¯ |
| | | Dt_InventoryInfo? inventoryInfo = dt_InventoryInfos.FirstOrDefault(x => x.WarehouseCode == WareCodeLK); |
| | | if (inventoryInfo == null) |
| | | throw new Exception($"æªæ¾å°ç©æç¼å·ã{detail.goods_no}ãç©ææ¹æ¬¡ã{detail.batch_num}ãå¨ç«åºä¸çåºåä¿¡æ¯ï¼æéæ°éã{orderDetailLK.Order_qty}ã请补货"); |
| | | throw new Exception($"åºåºåã{outorder.order_no}ã详æ
å卿£ä»¶,ç©æç¼å·ã{detail.goods_no}ãç©ææ¹æ¬¡ã{detail.batch_num}ãæéæ°éã{Convert.ToInt32(orderDetailLK.Order_qty)}ãè¯·äººå·¥è°æ¨è¡¥è´§å
¥ç«åº"); |
| | | inventoryInfo.AvailableQuantity -= orderDetailLK.Order_qty; |
| | | inventoryInfo.OutboundQuantity += orderDetailLK.Order_qty; |
| | | Dt_SupplyTask supplyTask = new Dt_SupplyTask() |
| | |
| | | _inventory_BatchServices.UpdateData(batchesUp); |
| | | _inventoryInfoService.UpdateData(inventoryInfosUp); |
| | | if (entityOrder.Details.Count > 0) |
| | | BaseDal.Db.CopyNew().InsertNav(entityOrder).Include(x => x.Details).ExecuteCommand(); |
| | | BaseDal.Db.InsertNav(entityOrder).Include(x => x.Details).ExecuteCommand(); |
| | | if (entityOrderLK.Details.Count > 0) |
| | | BaseDal.Db.CopyNew().InsertNav(entityOrderLK).Include(x => x.Details).ExecuteCommand(); |
| | | BaseDal.Db.InsertNav(entityOrderLK).Include(x => x.Details).ExecuteCommand(); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | try |
| | | { |
| | | // 1ï¸â£ æ¥æ¾æå®æ¹æ¬¡ä¸ç©æçåºåä¿¡æ¯ |
| | | var batchInfo = BaseDal.Db.CopyNew().Queryable<Dt_Inventory_Batch>() |
| | | .Where(x => x.BatchNo == batchNo && x.MaterielCode == goodsNo) |
| | | .First(); |
| | | var batchInfo = _inventory_BatchServices.Repository.QueryFirst(x => x.BatchNo == batchNo && x.MaterielCode == goodsNo); |
| | | |
| | | if (batchInfo == null) |
| | | return response.Error($"æªæ¾å°è¯¥ç©æ [{goodsNo}] æ¹æ¬¡ [{batchNo}] çåºåä¿¡æ¯"); |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent OutTaskFinish(Dt_SupplyTask supplyTask, Dt_DeliveryOrder deliveryOrder) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent OutTaskFinish(Dt_SupplyTask supplyTask) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_DeliveryOrder? cabinOrder = BaseDal.Db.CopyNew().Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == supplyTask.OrderNo && x.Warehouse_no == supplyTask.WarehouseCode).Includes(x => x.Details).First(); |
| | | Dt_DeliveryOrder? cabinOrder = BaseDal.Db.Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == supplyTask.OrderNo && x.Warehouse_no == supplyTask.WarehouseCode).Includes(x => x.Details).First(); |
| | | if (cabinOrder == null) return WebResponseContent.Instance.OK($"åºåºå已宿"); |
| | | |
| | | Dt_DeliveryOrderDetail? cabinOrderDetail = cabinOrder.Details.Where(x => x.Batch_num == supplyTask.BatchNo && x.Reservoirarea == supplyTask.WarehouseCode && x.Goods_no == supplyTask.MaterielCode).FirstOrDefault(); |
| | |
| | | //_deliveryOrderDetailServices.Repository.DeleteAndMoveIntoHty(cabinOrderDetail, OperateTypeEnum.èªå¨å®æ); |
| | | } |
| | | _deliveryOrderDetailServices.Repository.UpdateData(cabinOrderDetail); |
| | | var cabinOrder1 = BaseDal.Db.CopyNew().Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == cabinOrder.Out_no && x.Warehouse_no == supplyTask.WarehouseCode && x.Out_type != "20").Includes(x => x.Details).First(); |
| | | var cabinOrder1 = BaseDal.Db.Queryable<Dt_DeliveryOrder>().Where(x => x.Out_no == cabinOrder.Out_no && x.Warehouse_no == supplyTask.WarehouseCode && x.Out_type != "20").Includes(x => x.Details).First(); |
| | | if (!cabinOrder1.Details.Where(x => x.OotDetailStatus != "已宿").Any()) |
| | | cabinOrder.OutStatus = "已宿"; |
| | | Repository.UpdateData(cabinOrder); |