freenum_box_label

This commit is contained in:
qianhao.xu 2025-04-11 15:55:55 +08:00
parent 14ebf1f1bf
commit bda417c52c
2 changed files with 14 additions and 9 deletions

View File

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