diff --git a/linesider_screen_bankend/linesider_screen_bankend/Controller/OnlyPrintBoxLabelController.cs b/linesider_screen_bankend/linesider_screen_bankend/Controller/OnlyPrintBoxLabelController.cs index 955b557..c1d7704 100644 --- a/linesider_screen_bankend/linesider_screen_bankend/Controller/OnlyPrintBoxLabelController.cs +++ b/linesider_screen_bankend/linesider_screen_bankend/Controller/OnlyPrintBoxLabelController.cs @@ -49,10 +49,13 @@ namespace linesider_screen_bankend.Controller var queryParams = HttpContext.Request.QueryString; // 获取特定参数 string workorder = queryParams["workorder"]; - int LabelNum = int.Parse(queryParams["label_num"]); - // 获取特定参数 - string model = queryParams["model"]; - string direction = queryParams["direction"]; + //订单号 + string orderNumber = queryParams["orderNumber"]; + //箱子容量 + int boxCapacity = int.Parse(queryParams["boxCapacity"]); + //自由标签数量 + int LabelNum = int.Parse(queryParams["LabelNum"]); + try { @@ -66,17 +69,19 @@ namespace linesider_screen_bankend.Controller await this.HttpContext.SendApiFailAsync(500, "工单不在数据库"); return; } + + string QRcode = workorderInfo.Specification + "/" + DateTime.Now.ToString("yyyyMMdd") + workorderInfo.GroupCode + "//"; // 使用 using 语句确保资源正确释放 using (var bartender = new BartenderPrintHelper()) { var variables = new Dictionary { - { "partnumber", workorderInfo.Specification }, - { "model", model }, - { "direction", direction }, - { "productdate", DateTime.Now.ToString("yyyy/MM/dd") }, - {"workorder",workorderInfo.Workorder+"|"+workorderInfo.Specification+"|"+model+"|"+direction } + { "salesOrderNo", orderNumber}, + { "productionName", workorderInfo.ProductionName }, + { "productionCode", workorderInfo.ProductionCode }, + { "packageNum", boxCapacity.ToString() }, + {"packageLabelCode",QRcode } }; // 打印标签 diff --git a/linesider_screen_bankend/linesider_screen_bankend/Resources/tiguanPackageLabel.btw b/linesider_screen_bankend/linesider_screen_bankend/Resources/tiguanPackageLabel.btw index cbc4652..5c166f9 100644 Binary files a/linesider_screen_bankend/linesider_screen_bankend/Resources/tiguanPackageLabel.btw and b/linesider_screen_bankend/linesider_screen_bankend/Resources/tiguanPackageLabel.btw differ