diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs index cedcd0e0..05be114d 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs @@ -526,7 +526,16 @@ namespace Tnb.ProductionMgr Log.Information($"签收载具信息{JsonConvert.SerializeObject(carryCodes)}"); foreach (var item in carryCodes) { - + PrdMaterialReceiptD existD = await db.Queryable() + .LeftJoin((x, y) => x.material_receipt_id == y.id) + .Where((x, y) => x.carry_id == carry.id && y.mo_task_id == moTask.id && x.is_all_feeding == 0) + .Select((x,y)=>x) + .FirstAsync(); + if (existD != null) + { + throw new Exception($"{moTask.mo_task_code}任务单存在未投完的签收物料,物料签收子表id{existD.id}"); + } + insertDList.Add(new PrdMaterialReceiptD { material_receipt_id = prdMaterialReceiptH.id, diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index c8b6aecb..fa1adb3a 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -4029,7 +4029,7 @@ namespace Tnb.ProductionMgr batch = $"{organizeEntity.EnCode.Substring(organizeEntity.EnCode.Length - 2, 2)}{DateTime.Now.ToString("yyMMdd")}"; } - string code = $"(01){basMaterial.di ?? ""}*(11){DateTime.Now.ToString("yyMMdd")}*(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}*(10){batch}#{basMaterial.material_specification}*{batch}*{DateTime.Now.ToString("yyyyMMdd")}*{DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyyyMMdd")}*{basMaterial.container_no}"; + string code = $"(01){basMaterial.di ?? ""}*(11){DateTime.Now.ToString("yyMMdd")}*(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}*(10){batch}#{basMaterial.material_specification}*{batch}*{DateTime.Now.ToString("yyyyMMdd")}*{DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyyyMMdd")}*{basMaterial.material_standard}"; return code; } } diff --git a/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs b/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs index e9f95742..2300da77 100644 --- a/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs @@ -125,6 +125,24 @@ namespace Tnb.ProductionMgr // Log.Information($"{device},{eqpDaq3.label_name}称重完成返回结果:{responseresult}"); // } // } + string equipStatus = await _redisData.GetHash(device, "1 启动2停止 3手动4急停"); + Log.Information($"换箱机状态:{equipStatus}"); + if (equipStatus != "1") + { + if (equipStatus.Trim() == "2") + { + throw Oops.Bah("换箱机状态为停止"); + } + if (equipStatus.Trim() == "3") + { + throw Oops.Bah("换箱机状态为手动"); + } + if (equipStatus.Trim() == "4") + { + throw Oops.Bah("换箱机状态为急停"); + } + } + return result; }