From 3a0fef4ed5be4b2d3e9259fa0202fa42cb31c875 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期五, 21 二月 2025 16:56:43 +0800 Subject: [PATCH] 盘点功能,板料优化,PDA前端更新 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs | 51 ++++++++++++++++++++++++++++----------------------- 1 files changed, 28 insertions(+), 23 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" index 6000ca6..f86d61e 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" @@ -385,6 +385,10 @@ throw new Exception("鏃犲簱瀛�"); } } + tasks.ForEach(x => + { + x.TargetAddress = model.Line; + }); _unitOfWorkManage.BeginTran(); int id = BaseDal.AddData(tasks); @@ -433,15 +437,9 @@ Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseCode == WarehouseEnum.HA57.ToString()); - Dt_StockInfo stockInfo = new Dt_StockInfo() - { - PalletCode = model.CarrierCode, - PalletType = palletTypeInfo.PalletType, - WarehouseId = warehouse.WarehouseId, - StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() - }; - - Dt_StockInfoDetail_Hty stockInfoDetail_Hty = _stockRepository.StockInfoDetail_HtyRepository.QueryFirst(x => x.BatchNo == model.MaterialLot && x.MaterielCode == model.MaterialCode); + + Dt_StockInfo_Hty stockInfo_Hty = _stockRepository.StockInfo_HtyRepository.QueryData(x=>x.PalletCode== model.CarrierCode).OrderByDescending(x=>x.SourceId).First(); + Dt_StockInfoDetail_Hty stockInfoDetail_Hty = _stockRepository.StockInfoDetail_HtyRepository.QueryFirst(x => x.StockId==stockInfo_Hty.SourceId); Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail() { @@ -455,27 +453,34 @@ OutboundQuantity = 0, SerialNumber = stockInfoDetail_Hty?.SerialNumber ?? "0", StockQuantity = model.Quantity, - Status = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(), + Status = StockStatusEmun.MES閫�搴�.ObjToInt(), Unit = model.Unit }; - - Dt_Task task = new Dt_Task() + Dt_StockInfo stockInfo = new Dt_StockInfo() { - PalletCode = stockInfo.PalletCode, - CurrentAddress = "", - NextAddress = "", - PalletType = stockInfo.PalletType, - Roadway = "RGV01_BC", - SourceAddress = "RGV01_BC", - TargetAddress = "", - TaskStatus = TaskStatusEnum.New.ObjToInt(), - TaskType = TaskTypeEnum.MesMatReturn.ObjToInt(), - WarehouseId = warehouse.WarehouseId + PalletCode = model.CarrierCode, + PalletType = palletTypeInfo.PalletType, + WarehouseId = warehouse.WarehouseId, + StockStatus = StockStatusEmun.MES閫�搴�.ObjToInt(), + Details=new List<Dt_StockInfoDetail> { stockInfoDetail } }; + //Dt_Task task = new Dt_Task() + //{ + // PalletCode = stockInfo.PalletCode, + // CurrentAddress = "", + // NextAddress = "", + // PalletType = stockInfo.PalletType, + // Roadway = "RGV01_BC", + // SourceAddress = "RGV01_BC", + // TargetAddress = "", + // TaskStatus = TaskStatusEnum.New.ObjToInt(), + // TaskType = TaskTypeEnum.MesMatReturn.ObjToInt(), + // WarehouseId = warehouse.WarehouseId + //}; _unitOfWorkManage.BeginTran(); Db.InsertNav(stockInfo).Include(x => x.Details).ExecuteCommand(); - BaseDal.AddData(task); + //BaseDal.AddData(task); _unitOfWorkManage.CommitTran(); return MesResponseContent.Instance.OK(); -- Gitblit v1.9.3