From 7c3e39e10461e95c1199d803ebc855309fb81b74 Mon Sep 17 00:00:00 2001 From: zhou keda <1315948824@qq.com> Date: Wed, 19 Jun 2024 15:43:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=B4=E6=A0=87=E5=96=B7=E7=A0=81=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.ProductionMgr/PrdMoTaskService.cs | 66 ++++++++++++------- .../Consts/WmsWareHouseConst.cs | 10 ++- 2 files changed, 51 insertions(+), 25 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 3ba7560e..23f77a4f 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -1404,33 +1404,38 @@ namespace Tnb.ProductionMgr PrdMo prdMo = await db.Queryable().SingleAsync(x => x.id == item.mo_id); if (prdMo.mo_type == DictConst.PrdMoTypeBZ) { - if (await _db.Queryable().Where(x => - x.mo_task_code == item.mo_task_code && x.status == "0" && x.is_label == null && x.is_mark==0).AnyAsync()) - { - await _db.Updateable() - .SetColumns(x => x.is_label == 0) - .Where(x => x.mo_task_code == item.mo_task_code && x.status == "0" && x.is_label == null && - x.is_mark == 0) - .ExecuteCommandAsync(); - } - else - { - PrdOutPackMarkLabel prdOutPackMarkLabel = new PrdOutPackMarkLabel() - { - is_mark = null, - is_label = 0, - mo_task_code = item.mo_task_code, - material_code = item.material_code, - create_time = DateTime.Now, - }; - - await _db.Insertable(prdOutPackMarkLabel).ExecuteCommandAsync(); - } + // if (await _db.Queryable().Where(x => + // x.mo_task_code == item.mo_task_code && x.status == "0" && x.is_label == null && x.is_mark==0).AnyAsync()) + // { + // await _db.Updateable() + // .SetColumns(x => x.is_label == 0) + // .Where(x => x.mo_task_code == item.mo_task_code && x.status == "0" && x.is_label == null && + // x.is_mark == 0) + // .ExecuteCommandAsync(); + // } + // else + // { + // PrdOutPackMarkLabel prdOutPackMarkLabel = new PrdOutPackMarkLabel() + // { + // is_mark = null, + // is_label = 0, + // mo_task_code = item.mo_task_code, + // material_code = item.material_code, + // create_time = DateTime.Now, + // }; + // + // await _db.Insertable(prdOutPackMarkLabel).ExecuteCommandAsync(); + // } + + OrganizeEntity organizeEntity = await _db.Queryable().SingleAsync(x => x.Id == item.workline_id); + string batch = $"{organizeEntity.EnCode.Substring(organizeEntity.EnCode.Length - 2, 2)}{DateTime.Now.ToString("yyMMdd")}"; PrdMoTask parent = await _db.Queryable().SingleAsync(x => x.id == item.parent_id); BasMaterial basMaterial = await _db.Queryable().SingleAsync(x=>x.id==parent.material_id); - - string code = $"(01){basMaterial.di ?? ""}(11){DateTime.Now.ToString("yyMMdd")}(17){DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyMMdd")}(10){parent.batch??""}#{basMaterial.material_specification}*{DateTime.Now.ToString("yyyyMMdd")}*{DateTime.Now.AddMonths(basMaterial.quality_guarantee_period ?? 0).ToString("yyyyMMdd")}*{basMaterial.container_no}"; + BasMbom basMbom = await _db.Queryable().SingleAsync(x => x.id == item.bom_id); + + //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.container_no}"; Dictionary dicCommand1 = new(StringComparer.OrdinalIgnoreCase) { ["DevName"] = "外包装箱码垛线", @@ -1445,8 +1450,21 @@ namespace Tnb.ProductionMgr ["TagName"] = "WBZX_pm_cs", ["Value"] = code, }; + Dictionary workLineDic = new Dictionary() + { + [WmsWareHouseConst.XUELUGUAN1XIAN] = "WBZX_x1_dy_quantity", + [WmsWareHouseConst.XUELUGUAN2XIAN] = "WBZX_x2_dy_quantity", + }; + Dictionary dicCommand3 = new(StringComparer.OrdinalIgnoreCase) + { + ["DevName"] = "外包装箱码垛线", + ["token"] = _eleCtlCfg.token, + ["TagName"] = workLineDic[item.workline_id], + ["Value"] = basMbom.full_qty.ToString(), + }; await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand1); await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand2); + await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand3); } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs index d7873af8..5d6ea04c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs @@ -371,7 +371,15 @@ /// public const string LIAOXIANGID = "26037262680357"; - + /// + /// 血路管自动生产线1线 + /// + public const string XUELUGUAN1XIAN = "30019971917589"; + + /// + /// 血路管自动生产线2线 + /// + public const string XUELUGUAN2XIAN = "25966313322789"; } }