From 189ef97da64b5e3156199320c28e897c19b06eb9 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期四, 16 一月 2025 17:20:19 +0800 Subject: [PATCH] 入库上报优化 --- /dev/null | 0 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/abd54a07-f45e-4ca1-84da-81eadaf42b49.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs | 33 ++++--- 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/16db4c6a-3f42-45b5-b9ef-df469de7deae.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/MaterielInfoDTO.cs | 68 +++++++--------- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 99 +++++++++++++----------- 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock | 0 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/StackerCraneJob_CSJ.cs | 3 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/MaterielInfoService.cs | 22 ++-- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/Root.cs | 4 + 10 files changed, 119 insertions(+), 110 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/06dccb41-87b3-48ce-b00c-0fc37ecc3657.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/06dccb41-87b3-48ce-b00c-0fc37ecc3657.vsidx" deleted file mode 100644 index 515e194..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/06dccb41-87b3-48ce-b00c-0fc37ecc3657.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/16db4c6a-3f42-45b5-b9ef-df469de7deae.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/16db4c6a-3f42-45b5-b9ef-df469de7deae.vsidx" new file mode 100644 index 0000000..5f8e948 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/16db4c6a-3f42-45b5-b9ef-df469de7deae.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/18a53365-4699-4a05-a22d-52202ffc28c5.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/18a53365-4699-4a05-a22d-52202ffc28c5.vsidx" deleted file mode 100644 index 3810953..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/18a53365-4699-4a05-a22d-52202ffc28c5.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" index 80714d4..e9a0996 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" @@ -113,8 +113,9 @@ CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; if (commonStackerCrane != null) { - if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) + if (e.TaskNum != 0) { + WriteDebug(commonStackerCrane.DeviceCode, $"璇诲彇鍒颁换鍔″畬鎴�,浠诲姟鍙�:{e.TaskNum}"); StackerCraneTaskCompleted(e.TaskNum, commonStackerCrane.DeviceCode); commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/abd54a07-f45e-4ca1-84da-81eadaf42b49.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/abd54a07-f45e-4ca1-84da-81eadaf42b49.vsidx" new file mode 100644 index 0000000..b31c7ef --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/abd54a07-f45e-4ca1-84da-81eadaf42b49.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fdd7913b-53cb-4968-b953-7b7a7fdaa3e3.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fdd7913b-53cb-4968-b953-7b7a7fdaa3e3.vsidx" deleted file mode 100644 index 2fd3192..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fdd7913b-53cb-4968-b953-7b7a7fdaa3e3.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" new file mode 100644 index 0000000..e69de29 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/MaterielInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/MaterielInfoService.cs" index e360f6f..df5f06c 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/MaterielInfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/MaterielInfoService.cs" @@ -81,7 +81,7 @@ try { Dt_Warehouse? warehouse = null; - if (model.ItemType == MaterielTypeEnum.RawMateriel.ObjToInt()) + if (model.ItemType.ObjToInt() == MaterielTypeEnum.RawMateriel.ObjToInt()) { warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == model.WaId); if (warehouse == null) @@ -89,7 +89,7 @@ return WebResponseContent.Instance.Error("鏈壘鍒颁粨搴撲俊鎭�"); } } - if (model.OperateType == 0) + if (model.OperateType.ObjToInt() == 0) { Dt_MaterielInfo materielInfo = new Dt_MaterielInfo() { @@ -100,11 +100,11 @@ MaterielModel = model.Model, MaterielName = model.Name, MaterielSize = model.Size, - MaterielSourceType = (MaterielSourceTypeEnum)model.ItemSourceType, + MaterielSourceType = (MaterielSourceTypeEnum)(model.ItemSourceType.ObjToInt()), MaterielSpec = warehouse == null ? "绌�" : model.StandType, - MaterielState = (EnableEnum)model.State, + MaterielState = (EnableEnum)(model.State.ObjToInt()), MaterielThickness = model.Thickness, - MaterielType = (MaterielTypeEnum)model.ItemType, + MaterielType = (MaterielTypeEnum)(model.ItemType.ObjToInt()), MaterielUnit = model.Unit == null ? "" : model.Unit, MaterielVersion = model.MaterialVersion, MaterielWide = model.Wide, @@ -112,7 +112,7 @@ }; BaseDal.AddData(materielInfo); } - else if (model.OperateType == 1) + else if (model.OperateType.ObjToInt() == 1) { Dt_MaterielInfo materielInfo = BaseDal.QueryFirst(x => x.MaterielCode == model.Code); if (materielInfo == null) @@ -127,18 +127,18 @@ materielInfo.MaterielModel = model.Model; materielInfo.MaterielName = model.Name; materielInfo.MaterielSize = model.Size; - materielInfo.MaterielSourceType = (MaterielSourceTypeEnum)model.ItemSourceType; + materielInfo.MaterielSourceType = (MaterielSourceTypeEnum)model.ItemSourceType.ObjToInt(); materielInfo.MaterielSpec = warehouse == null ? "" : model.StandType; - materielInfo.MaterielState = (EnableEnum)model.State; + materielInfo.MaterielState = (EnableEnum)model.State.ObjToInt(); materielInfo.MaterielThickness = model.Thickness; - materielInfo.MaterielType = (MaterielTypeEnum)model.ItemType; + materielInfo.MaterielType = (MaterielTypeEnum)model.ItemType.ObjToInt(); materielInfo.MaterielUnit = model.Unit == null ? "" : model.Unit; materielInfo.MaterielVersion = model.MaterialVersion; materielInfo.MaterielWide = model.Wide; materielInfo.WarehouseId = warehouse == null ? 0 : warehouse.WarehouseId; BaseDal.UpdateData(materielInfo); } - else if (model.OperateType == 2) + else if (model.OperateType.ObjToInt() == 2) { Dt_MaterielInfo materielInfo = BaseDal.QueryFirst(x => x.MaterielCode == model.Code); if (materielInfo == null) @@ -152,7 +152,7 @@ } catch (Exception ex) { - return WebResponseContent.Instance.Error(ex.Message); + return WebResponseContent.Instance.OK(ex.Message); } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/MaterielInfoDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/MaterielInfoDTO.cs" index dfdbccb..e06362c 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/MaterielInfoDTO.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/MaterielInfoDTO.cs" @@ -31,7 +31,7 @@ /// /// </summary> [PropertyValidate("", NotNullAndEmpty = true)] - public int ItemType { get; set; } + public string ItemType { get; set; } /// <summary> /// @@ -42,7 +42,7 @@ /// /// </summary> [PropertyValidate("", NotNullAndEmpty = true)] - public int ItemSourceType { get; set; } + public string ItemSourceType { get; set; } /// <summary> /// @@ -53,7 +53,6 @@ /// <summary> /// /// </summary> - [PropertyValidate("", NotNullAndEmpty = true)] public string MaterialVersion { get; set; } /// <summary> @@ -66,30 +65,28 @@ /// /// </summary> [PropertyValidate("", NotNullAndEmpty = true)] - public int Length { get; set; } + public float Length { get; set; } /// <summary> /// /// </summary> [PropertyValidate("", NotNullAndEmpty = true)] - public int Thickness { get; set; } + public float Thickness { get; set; } /// <summary> /// /// </summary> [PropertyValidate("", NotNullAndEmpty = true)] - public int Wide { get; set; } + public float Wide { get; set; } /// <summary> /// /// </summary> - [PropertyValidate("", NotNullAndEmpty = true)] public string Model { get; set; } /// <summary> /// /// </summary> - [PropertyValidate("", NotNullAndEmpty = true)] public string Color { get; set; } /// <summary> @@ -98,41 +95,36 @@ [PropertyValidate("", NotNullAndEmpty = true)] public string MaterialTG { get; set; } - ///// <summary> - ///// - ///// </summary> - //[PropertyValidate("", NotNullAndEmpty = true)] - //public string Spare1 { get; set; } + /// <summary> + /// + /// </summary> + public string Spare1 { get; set; } - ///// <summary> - ///// - ///// </summary> - //[PropertyValidate("", NotNullAndEmpty = true)] - //public string Spare2 { get; set; } + /// <summary> + /// + /// </summary> + public string Spare2 { get; set; } - ///// <summary> - ///// - ///// </summary> - //[PropertyValidate("", NotNullAndEmpty = true)] - //public string Spare3 { get; set; } + /// <summary> + /// + /// </summary> + public string Spare3 { get; set; } - ///// <summary> - ///// - ///// </summary> - //[PropertyValidate("", NotNullAndEmpty = true)] - //public string Spare4 { get; set; } + /// <summary> + /// + /// </summary> + public string Spare4 { get; set; } - ///// <summary> - ///// - ///// </summary> - //[PropertyValidate("", NotNullAndEmpty = true)] - //public string Spare5 { get; set; } + /// <summary> + /// + /// </summary> + public string Spare5 { get; set; } /// <summary> /// /// </summary> [PropertyValidate("", NotNullAndEmpty = true)] - public int State { get; set; } + public string State { get; set; } /// <summary> /// @@ -143,19 +135,19 @@ /// <summary> /// /// </summary> - [PropertyValidate("", NotNullAndEmpty = true)] - public int OperateType { get; set; } + [PropertyValidate("", NotNullAndEmpty = false)] + public string OperateType { get; set; } /// <summary> /// /// </summary> - [PropertyValidate("", NotNullAndEmpty = true)] + [PropertyValidate("", NotNullAndEmpty = false)] public string UserDef01 { get; set; } /// <summary> /// /// </summary> - [PropertyValidate("", NotNullAndEmpty = true)] + [PropertyValidate("", NotNullAndEmpty = false)] public string UserDef04 { get; set; } /// <summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/Root.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/Root.cs" index 6307243..ef0b7cf 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/Root.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/Root.cs" @@ -21,6 +21,10 @@ /// <summary> /// /// </summary> + public string Message { get; set; } + /// <summary> + /// + /// </summary> [PropertyValidate("鍐呭", NotNullAndEmpty = true)] public T Content { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" index b7ab61d..92e8817 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" @@ -752,28 +752,33 @@ { return WebResponseContent.Instance.Error($"鏈壘鍒板簱瀛樻槑缁嗕俊鎭�"); } - List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.QueryData(x => stockInfoDetails.Select(x => x.StockId).ToList().Contains(x.Id)); + //鑾峰彇璇ュ叆搴撳崟鎵�鏈夊簱瀛� + List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => stockInfoDetails.GroupBy(x => x.StockId).Select(x => x.Key).Contains(x.Id)).Includes(x => x.Details).ToList(); Dt_Warehouse warehouse = _warehouseService.Repository.QueryFirst(x => x.WarehouseId == inboundOrder.WarehouseId); if (warehouse == null) { return WebResponseContent.Instance.Error($"鏈壘鍒颁粨搴撲俊鎭�"); } List<ERPInboundDetailModel>? detailModels = new List<ERPInboundDetailModel>(); - foreach (var item in stockInfoDetails) + foreach (var stockInfo in stockInfos) { - ERPInboundDetailModel detailModel = new ERPInboundDetailModel() + foreach (var item in stockInfo.Details.GroupBy(x=>x.InboundOrderRowNo).Select(x=>x.Key)) { - ExpiryDate = item.EffectiveDate ?? "", - LocationCode = warehouse.WarehouseCode, - MaterialsCode = item.MaterielCode, - MfgDate = item.ProductionDate ?? "", - QtyCustoms = "0", - Quantity = item.StockQuantity.ToString(), - Rack = stockInfos.FirstOrDefault(x => x.Id == item.StockId).LocationCode, - ReceiptCode = inboundOrder.UpperOrderNo, - ReceiptSerNo = item.InboundOrderRowNo.ToString() - }; - detailModels.Add(detailModel); + Dt_StockInfoDetail? dt_StockInfoDetail = stockInfo.Details.Where(x => x.InboundOrderRowNo == item).FirstOrDefault(); + ERPInboundDetailModel detailModel = new ERPInboundDetailModel() + { + ExpiryDate = dt_StockInfoDetail?.EffectiveDate ?? "", + LocationCode = warehouse.WarehouseCode, + MaterialsCode = dt_StockInfoDetail.MaterielCode, + MfgDate = dt_StockInfoDetail.ProductionDate ?? "", + QtyCustoms = "0", + Quantity = stockInfo.Details.Where(x => x.InboundOrderRowNo == item).Sum(x => x.StockQuantity).ToString(), + Rack = stockInfo.LocationCode, + ReceiptCode = inboundOrder.UpperOrderNo, + ReceiptSerNo = item.ToString() + }; + detailModels.Add(detailModel); + } } ERPInboundModel model = new ERPInboundModel() { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" index 875c1e5..1edf744 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" @@ -198,15 +198,20 @@ stockInfo.LocationCode = locationInfo.LocationCode; - #region 绌虹鍏ュ簱/鎷i�夊洖搴� - if (task.TaskType == TaskTypeEnum.InEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.InPick.ObjToInt()) + #region 绌虹鍏ュ簱/鎷i�夊洖搴�/鐢熶骇閫�鏂� + if (task.TaskType == TaskTypeEnum.InEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.InPick.ObjToInt() || task.TaskType==TaskTypeEnum.ProductionReturn.ObjToInt()) { stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt(); task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); + stockInfo.Details.ForEach(x => + { + x.Status = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt(); + }); _unitOfWorkManage.BeginTran(); BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.浜哄伐瀹屾垚 : OperateTypeEnum.鑷姩瀹屾垚); _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); _stockRepository.StockInfoRepository.UpdateData(stockInfo); + _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.InStock, LocationChangeType.InboundCompleted); _unitOfWorkManage.CommitTran(); return WebResponseContent.Instance.OK(); @@ -214,51 +219,54 @@ #endregion Dt_InboundOrder? inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First(); - if (inboundOrder == null) - { - return WebResponseContent.Instance.Error($"瀵瑰簲鍏ュ簱鍗曚笉瀛樺湪"); - } - //鏌ヨ鍘熷畬鎴愮殑鍏ュ簱鏄庣粏鏁伴噺 - int overCount = inboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).ToList().Count; Dt_InboundOrderDetail? inboundOrderDetail = null; - if (stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt()) + //鏍囧噯鍏ュ簱娴佺▼鏌ユ壘鍏ュ簱鍗曟嵁 + if (inboundOrder != null && stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt()) { - inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.RowNo == stockInfo.Details.FirstOrDefault()?.InboundOrderRowNo); - foreach (var item in stockInfo.Details) + //鏌ヨ鍘熷畬鎴愮殑鍏ュ簱鏄庣粏鏁伴噺 + int overCount = inboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).ToList().Count; + if (stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt()) { - if (inboundOrderDetail == null) + inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.RowNo == stockInfo.Details.FirstOrDefault()?.InboundOrderRowNo); + foreach (var item in stockInfo.Details) { - continue; - } - ERPInboundDetailModel detailModel = new ERPInboundDetailModel() - { - ExpiryDate = item.EffectiveDate ?? "", - LocationCode = warehouse.WarehouseCode, - MaterialsCode = item.MaterielCode, - MfgDate = item.ProductionDate ?? "", - QtyCustoms = "0", - Quantity = item.StockQuantity.ToString(), - Rack = stockInfo.LocationCode, - ReceiptCode = inboundOrder.UpperOrderNo, - ReceiptSerNo = item.InboundOrderRowNo.ToString() - }; - inboundOrderDetail.OverInQuantity += item.StockQuantity; - if (inboundOrderDetail.OverInQuantity == inboundOrderDetail.OrderQuantity) - { - inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); - overCount += 1; - } - else if (inboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) - { - inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Inbounding.ObjToInt(); + if (inboundOrderDetail == null) + { + continue; + } + ERPInboundDetailModel detailModel = new ERPInboundDetailModel() + { + ExpiryDate = item.EffectiveDate ?? "", + LocationCode = warehouse.WarehouseCode, + MaterialsCode = item.MaterielCode, + MfgDate = item.ProductionDate ?? "", + QtyCustoms = "0", + Quantity = item.StockQuantity.ToString(), + Rack = stockInfo.LocationCode, + ReceiptCode = inboundOrder.UpperOrderNo, + ReceiptSerNo = item.InboundOrderRowNo.ToString() + }; + inboundOrderDetail.OverInQuantity += item.StockQuantity; + if (inboundOrderDetail.OverInQuantity == inboundOrderDetail.OrderQuantity) + { + inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); + overCount += 1; + } + else if (inboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) + { + inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Inbounding.ObjToInt(); + } } } + if (inboundOrder.Details.Count == overCount) + { + inboundOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt(); + } + if (inboundOrder.OrderStatus == InOrderStatusEnum.鏈紑濮�.ObjToInt()) + { + inboundOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱涓�.ObjToInt(); + } } - if (inboundOrder.Details.Count == overCount) - { - inboundOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt(); - } - if ((stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt() || stockInfo.StockStatus == StockStatusEmun.鎵嬪姩缁勭洏鍏ュ簱纭.ObjToInt()) && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) { foreach (var model in stockInfo.Details) @@ -266,7 +274,6 @@ TestSynStock(new TestToolSynInfo() { ToolCode = model.BatchNo, MaterialName = model.MaterielName, Life = int.TryParse(model.Remark, out int val) ? val : 1000 }); } } - //娴嬭瘯鏋跺叆搴撳簱瀛樼姸鎬� if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt() && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鍏ュ簱纭.ObjToInt()) { @@ -275,14 +282,13 @@ else { stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt(); - } stockInfo.Details.ForEach(x => { x.Status = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt(); }); //鏇存柊浠诲姟鐘舵�� - task.TaskStatus = (int)TaskStatusEnum.Finish; + task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); _unitOfWorkManage.BeginTran(); BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.浜哄伐瀹屾垚 : OperateTypeEnum.鑷姩瀹屾垚); _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); @@ -290,13 +296,14 @@ _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.InStock, LocationChangeType.InboundCompleted); _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, stockInfo.Details.Sum(x => x.StockQuantity), stockInfo.Details.Sum(x => x.StockQuantity), StockChangeTypeEnum.Inbound, taskNum); - _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); - if (inboundOrderDetail != null) + if (inboundOrder != null) { + _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail); } _unitOfWorkManage.CommitTran(); - if (inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt()) + //瀛樺湪鍏ュ簱鍗曞苟鐘舵�佷负瀹屾垚鐘舵�佹帹閫佽嚦ERP + if (inboundOrder != null && inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt()) _inboundOrderService.FeedbackInboundOrder(inboundOrder); return WebResponseContent.Instance.OK(); } -- Gitblit v1.9.3