| | |
| | | |
| | | namespace WIDESEA_SquareCabinServices |
| | | { |
| | | public class DeliveryOrderServices : ServiceBase<Dt_DeliveryOrder, IRepository<Dt_DeliveryOrder>>, IDeliveryOrderServices |
| | | public partial class DeliveryOrderServices : ServiceBase<Dt_DeliveryOrder, IRepository<Dt_DeliveryOrder>>, IDeliveryOrderServices |
| | | { |
| | | static string SearchDate = ""; |
| | | private readonly IBasicService _basicService; |
| | |
| | | private readonly IInventoryInfoService _inventoryInfoService; |
| | | private readonly IDeliveryOrderDetailServices _deliveryOrderDetailServices; |
| | | private readonly ISupplyTaskService _supplyTaskService; |
| | | private readonly ICabinOrderServices _cabinOrderServices; |
| | | public IRepository<Dt_DeliveryOrder> Repository => BaseDal; |
| | | public DeliveryOrderServices(IRepository<Dt_DeliveryOrder> BaseDal, IBasicService basicService, IUnitOfWorkManage unitOfWorkManage, IInventory_BatchServices inventory_BatchServices, IInventoryInfoService inventoryInfoService, IDeliveryOrderDetailServices deliveryOrderDetailServices, ISupplyTaskService supplyTaskService) : base(BaseDal) |
| | | public DeliveryOrderServices(IRepository<Dt_DeliveryOrder> BaseDal, IBasicService basicService, IUnitOfWorkManage unitOfWorkManage, IInventory_BatchServices inventory_BatchServices, IInventoryInfoService inventoryInfoService, IDeliveryOrderDetailServices deliveryOrderDetailServices, ISupplyTaskService supplyTaskService, ICabinOrderServices cabinOrderServices) : base(BaseDal) |
| | | { |
| | | _basicService = basicService; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _supplyTaskService = supplyTaskService; |
| | | _inventory_BatchServices = inventory_BatchServices; |
| | | _inventoryInfoService = inventoryInfoService; |
| | | _cabinOrderServices = cabinOrderServices; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | return q.OrderBy(i => i.InDate).ToList(); |
| | | }; |
| | | |
| | | // 4ï¸â£åé
æ£ä»¶ï¼ä¼å
ç«åº Status=1ï¼ |
| | | // 4ï¸â£åé
æ£ä»¶ï¼ä¼å
ç«åº Status=0ï¼ |
| | | decimal remainingPartial = partialQty; |
| | | if (remainingPartial > 0) |
| | | { |
| | |
| | | }; |
| | | entityOrder.Details.Add(detail); |
| | | |
| | | inv.OutboundQuantity += (float)use; |
| | | inv.OutboundQuantity += use; |
| | | BaseDal.Db.Updateable(inv).ExecuteCommand(); |
| | | |
| | | remainingPartial -= use; |
| | |
| | | }; |
| | | entityOrder.Details.Add(detail); |
| | | |
| | | inv.OutboundQuantity += (float)use; |
| | | inv.OutboundQuantity += use; |
| | | BaseDal.Db.Updateable(inv).ExecuteCommand(); |
| | | |
| | | remainingPartial -= use; |
| | |
| | | }; |
| | | entityOrder.Details.Add(detail); |
| | | |
| | | inv.OutboundQuantity += (float)useQty; |
| | | inv.OutboundQuantity += useQty; |
| | | BaseDal.Db.Updateable(inv).ExecuteCommand(); |
| | | |
| | | remainingFullBoxes -= useBoxes; |
| | |
| | | }; |
| | | entityOrder.Details.Add(detail); |
| | | |
| | | inv.OutboundQuantity += (float)useQty; |
| | | inv.OutboundQuantity += useQty; |
| | | BaseDal.Db.Updateable(inv).ExecuteCommand(); |
| | | |
| | | remainingFullBoxes -= useBoxes; |
| | |
| | | decimal orderQty = (decimal)item.order_qty; |
| | | |
| | | // 2ï¸â£ æ¥ç©æåºç¡ä¿¡æ¯ï¼è·åç®±è§ï¼ |
| | | var medication = BaseDal.Db.Queryable<Dt_MedicineGoods>() |
| | | .Where(m => m.Goods_no == item.goods_no) |
| | | var medication = BaseDal.Db.Queryable<Dt_MaterielInfo>() |
| | | .Where(m => m.MaterielCode == item.goods_no) |
| | | .First(); |
| | | //å¦æç©æä¿¡æ¯ä¸åå¨ï¼è·³è¿æ´ä¸ªå
¥åºå |
| | | if (medication == null) |
| | |
| | | string materialCode = "YY";//é»è®¤å¼ |
| | | //è·åå½å订åç第ä¸ä¸ªæç»é¡¹ |
| | | var firstDetail = order.Details.FirstOrDefault(); |
| | | if (firstDetail?.MedicineGoods != null && !string.IsNullOrEmpty(firstDetail.MedicineGoods.MaterialCode)) |
| | | if (firstDetail?.MedicineGoods != null && !string.IsNullOrEmpty(firstDetail.MedicineGoods.MaterielErpType)) |
| | | { |
| | | //妿æ¡ä»¶æ»¡è¶³ï¼å°ç©æä»£ç 设置为第ä¸ä¸ªæç»é¡¹å¯¹åºçè¯åç©æä»£ç |
| | | materialCode = firstDetail.MedicineGoods.MaterialCode; |
| | | materialCode = firstDetail.MedicineGoods.MaterielErpType; |
| | | } |
| | | // 3. ç»è£
DTO |
| | | var ediDto = new TowcsDto.ToediOutInfo |
| | |
| | | { |
| | | batchNo = d.Batch_num, |
| | | productCode = d.Goods_no, |
| | | productName = d.MedicineGoods?.Goods_spm, |
| | | productSpecifications = d.MedicineGoods?.Model, |
| | | productName = d.MedicineGoods?.MaterielName, |
| | | productSpecifications = d.MedicineGoods?.MaterielModel, |
| | | quantity = (int)d.Order_qty, |
| | | //stocktakingDetails = order.Out_type == "3" |
| | | // ? new List<ToOutediInStock> |
| | |
| | | MaterielCode = inventoryInfo.MaterielCode, |
| | | MaterielSpec = inventoryInfo.MaterielSpec, |
| | | TaskType = TaskTypeEnum.OutInventory.ObjToInt(), |
| | | TaskStatus = SupplyStatusEnum.CheckFinish.ObjToInt(), |
| | | CreateDate = DateTime.Now, |
| | | Creater = App.User.UserName, |
| | | LocationCode = LocationCode, |
| | |
| | | MaterielName = inventoryInfo.MaterielName, |
| | | MaterielCode = inventoryInfo.MaterielCode, |
| | | MaterielSpec = inventoryInfo.MaterielSpec, |
| | | TaskStatus = SupplyStatusEnum.OutFinish.ObjToInt(), |
| | | TaskType = TaskTypeEnum.OutPick.ObjToInt(), |
| | | CreateDate = DateTime.Now, |
| | | Creater = App.User.UserName, |