From 296b4aec849d45a075b6068cb121dd0c117d3818 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期六, 04 一月 2025 17:59:18 +0800 Subject: [PATCH] WMS添加物料码信息打印 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs | 48 ++++++++++++++++++++++++++++++++++++------------ 1 files changed, 36 insertions(+), 12 deletions(-) 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 6b37125..2979f71 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" @@ -25,6 +25,7 @@ using WIDESEA_DTO.Basic; using WIDESEA_DTO.ERP; using WIDESEA_DTO.Inbound; +using WIDESEA_DTO.MES; using WIDESEA_External.ERPService; using WIDESEA_External.Model; using WIDESEA_IBasicRepository; @@ -35,6 +36,7 @@ using WIDESEA_IStockRepository; using WIDESEA_IStockService; using WIDESEA_ITaskInfoRepository; +using WIDESEA_ITaskInfoService; using WIDESEA_Model.Models; using WIDESEA_StockRepository; @@ -270,7 +272,7 @@ { return WebResponseContent.Instance.Error($"鏈壘鍒拌浠撳簱淇℃伅"); } - + Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == orderNo && x.WarehouseId == warehouse.WarehouseId).Includes(x => x.Details).First(); if (inboundOrder == null) { @@ -344,6 +346,14 @@ if (warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) { stockInfo.Remark = Initiallife.ToString(); + if (palletCode.Substring(0, 1) == "6") + { + stockInfo.PalletType = PalletTypeEnum.MediumPallet.ObjToInt(); + } + else + { + stockInfo.PalletType = PalletTypeEnum.LargestPallet.ObjToInt(); + } } List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); @@ -406,6 +416,14 @@ _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup); _unitOfWorkManage.CommitTran(); + //if (warehouse.WarehouseCode==WarehouseEnum.HA153.ToString()) + //{ + // //鍚屾娴嬭瘯鏋朵俊鎭� + // foreach (var model in models) + // { + // _taskService.TestSynStock(new TestToolSynInfo() { ToolCode = model.LotNo, Life = Initiallife }); + // } + //} content.OK(); } catch (Exception ex) @@ -467,6 +485,14 @@ if (warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) { stockInfo.Remark = Initiallife.ToString(); + if (palletCode.Substring(0, 1) == "6") + { + stockInfo.PalletType = PalletTypeEnum.MediumPallet.ObjToInt(); + } + else + { + stockInfo.PalletType = PalletTypeEnum.LargestPallet.ObjToInt(); + } } List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); @@ -510,6 +536,11 @@ } _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup); _unitOfWorkManage.CommitTran(); + //鍚屾娴嬭瘯鏋朵俊鎭� + //foreach (var model in models) + //{ + // _taskService.TestSynStock(new TestToolSynInfo() { ToolCode = model.LotNo, Life = Initiallife }); + //} content.OK(); } catch (Exception ex) @@ -557,16 +588,8 @@ Way = 1, Details = detailModels }; - string response = _invokeERPService.InvokeInboundOrderApi(model); - ErpRequestContent? requestContent = JsonConvert.DeserializeObject<ErpRequestContent>(response); - if (requestContent == null) - { - return WebResponseContent.Instance.Error(); - } - if (requestContent.res == 0) - { - return WebResponseContent.Instance.Error(requestContent.Data); - } + //鎺ㄩ�丒RP 娴嬭瘯娉ㄩ噴 + _invokeERPService.InvokeInboundOrderApi(model); return WebResponseContent.Instance.OK(); } catch (Exception ex) @@ -649,7 +672,8 @@ Way = 1, Details = detailModels }; - string response = _invokeERPService.InvokeInboundOrderApi(model); + //娴嬭瘯娉ㄩ噴 + _invokeERPService.InvokeInboundOrderApi(model); return WebResponseContent.Instance.OK(); } catch (Exception ex) -- Gitblit v1.9.3