From f947d43adfe6a204b6afe920ce88a30d78015f1d Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期五, 28 二月 2025 10:44:44 +0800 Subject: [PATCH] 板料优化,成品流程,测试架... --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs | 39 +++++++++++++++++++++++++++------------ 1 files changed, 27 insertions(+), 12 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 af36c1b..e74b420 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" @@ -333,7 +333,16 @@ { try { - Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA57.ToString()); + string line = string.Empty; + if (!model.Line.Contains("SCUTL")) + { + line = WarehouseEnum.HA58.ToString(); + } + else + { + line = WarehouseEnum.HA57.ToString(); + } + Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == line); if (warehouse == null) { return MesResponseContent.Instance.Error($"浠撳簱鍩虹淇℃伅鏈厤缃�"); @@ -385,6 +394,10 @@ throw new Exception("鏃犲簱瀛�"); } } + tasks.ForEach(x => + { + x.TargetAddress = model.Line; + }); _unitOfWorkManage.BeginTran(); int id = BaseDal.AddData(tasks); @@ -431,17 +444,11 @@ return MesResponseContent.Instance.Error($"鏈瘑鍒鎵樼洏绫诲瀷锛岃纭鎵樼洏鍙�"); } - Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseCode == WarehouseEnum.HA57.ToString()); + Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == palletTypeInfo.WarehouseId); - Dt_StockInfo stockInfo = new Dt_StockInfo() - { - PalletCode = model.CarrierCode, - PalletType = palletTypeInfo.PalletType, - WarehouseId = warehouse.WarehouseId, - StockStatus = StockStatusEmun.MES閫�搴�.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,10 +462,18 @@ OutboundQuantity = 0, SerialNumber = stockInfoDetail_Hty?.SerialNumber ?? "0", StockQuantity = model.Quantity, - Status = StockStatusEmun.MES閫�搴�.ObjToInt(), + Status = model.Quantity <= 0.0 ? StockStatusEmun.MES绌烘墭閫�搴�.ObjToInt() : StockStatusEmun.MES閫�搴�.ObjToInt(), Unit = model.Unit }; - + Dt_StockInfo stockInfo = new Dt_StockInfo() + { + PalletCode = model.CarrierCode, + PalletType = palletTypeInfo.PalletType, + WarehouseId = warehouse.WarehouseId, + StockStatus = stockInfoDetail.StockQuantity<=0.0? StockStatusEmun.MES绌烘墭閫�搴�.ObjToInt():StockStatusEmun.MES閫�搴�.ObjToInt(), + Details = new List<Dt_StockInfoDetail> { stockInfoDetail }, + Remark= stockInfoDetail.StockQuantity <= 0.0 ? StockStatusEmun.MES绌烘墭閫�搴�.ToString() : StockStatusEmun.MES閫�搴�.ToString() + }; //Dt_Task task = new Dt_Task() //{ // PalletCode = stockInfo.PalletCode, -- Gitblit v1.9.3