From 82c880b684c41c0063a6604c7316b668120e1827 Mon Sep 17 00:00:00 2001 From: rui_li <877258667@qq.com> Date: Wed, 12 Aug 2026 14:01:37 +0800 Subject: [PATCH] =?UTF-8?q?QC=20=E6=A0=87=E7=AD=BE=E5=8D=B0=E5=BA=A6?= =?UTF-8?q?=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- external/print/print_qc_label.js | 464 +++--------------- external/print/print_qc_zero_label.js | 4 +- .../service/impl/PrintLabelServiceImpl.java | 152 ++---- 3 files changed, 95 insertions(+), 525 deletions(-) diff --git a/external/print/print_qc_label.js b/external/print/print_qc_label.js index 95d0b1c..4b438b1 100644 --- a/external/print/print_qc_label.js +++ b/external/print/print_qc_label.js @@ -30,25 +30,10 @@ function initPrintSetting(clodoplisence) { //总调用打印的方法 function printQcRollLabel(printRow, printerData){ - let labelFlag = printRow.labelFlag; //初始化打印 initPrintSetting(printerData.clodopLicense); - switch (labelFlag) { - case "A": - printPageA(printRow, printerData); - break; - case "B": - printPageB(printRow, printerData); - break; - case "C": - printPageC(printRow, printerData); - break; - case "D": - printPageD(printRow, printerData); - break; - default: - break; - } + //调用打印的方法 + printIndiaQcPage(printRow); //区分各种打印的模式 let printerSeq = printerData.printerSeq; if (printerSeq >= 0){ @@ -61,441 +46,110 @@ function printQcRollLabel(printRow, printerData){ } } -function printPageA(printRow, printerInfo){ - LODOP.NewPage(); - LODOP.SET_PRINT_PAGESIZE(2,800,1125,""); - LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE",1); - LODOP.ADD_PRINT_TEXT(7,7,220,20,"LUXSANTECH"); - LODOP.SET_PRINT_STYLEA(0,"FontSize",16); - LODOP.ADD_PRINT_LINE(28,7,29,167,0,1); - LODOP.ADD_PRINT_TEXT(31,7,160,20,"Vendor: CCL-SZ"); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_LINE(48,7,49,167,0,1); - LODOP.ADD_PRINT_TEXT(53,7,190,20,"P/N:"+printRow.customerPartNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",8); - LODOP.ADD_PRINT_LINE(68,7,69,167,0,1); - LODOP.ADD_PRINT_TEXT(71,7,160,20,"APN: "+printRow.pgppn); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_LINE(88,7,89,167,0,1); - LODOP.ADD_PRINT_TEXT(93,7,190,20,"DESC:"+printRow.partDesc); - LODOP.SET_PRINT_STYLEA(0,"FontSize",8); - LODOP.ADD_PRINT_LINE(108,7,109,167,0,1); - LODOP.ADD_PRINT_TEXT(111,7,160,20,"DateCode:"+printRow.dateCode); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_LINE(128,7,129,167,0,1); - LODOP.ADD_PRINT_TEXT(134,7,160,20,"QTY: "+printRow.standardRollQty+" Rev:"+printRow.revNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_LINE(152,7,153,167,0,1); - LODOP.ADD_PRINT_TEXT(152,7,160,20,"Stage: "+printRow.stage); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_TEXT(169,7,160,20,printRow.partNo ); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_TEXT(186,7,160,20,printRow.finalRollNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_TEXT(203,7,160,20,printRow.rollDate2); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_TEXT(220,7,84,20,printRow.username); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_BARCODE(154,104,69,69,"QRCode", printRow.pgppn); - LODOP.ADD_PRINT_TEXT(222,78,88,20,printRow.pgppn); - LODOP.SET_PRINT_STYLEA(0,"FontSize",8); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.ADD_PRINT_IMAGE(243,87,70,25,""); - LODOP.SET_PRINT_STYLEA(0,"Stretch",1); - LODOP.ADD_PRINT_BARCODE(266,7,100,25,"128A",printRow.lineBarcodeTime); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(243,6,71,20,"Config "+printRow.config); - - LODOP.ADD_PRINT_TEXT(7,178,160,20,"LUXSANTECH"); - LODOP.SET_PRINT_STYLEA(0,"FontSize",16); - LODOP.ADD_PRINT_LINE(28,178,29,338,0,1); - LODOP.ADD_PRINT_TEXT(31,178,160,20,"Vendor: CCL-SZ"); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_LINE(48,178,49,338,0,1); - LODOP.ADD_PRINT_TEXT(53,178,190,20,"P/N:"+printRow.customerPartNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",8); - LODOP.ADD_PRINT_LINE(68,178,69,338,0,1); - LODOP.ADD_PRINT_TEXT(71,178,160,20,"APN: "+printRow.pgppn); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_LINE(88,178,89,338,0,1); - LODOP.ADD_PRINT_TEXT(93,178,190,20,"DESC:"+printRow.partDesc); - LODOP.SET_PRINT_STYLEA(0,"FontSize",8); - LODOP.ADD_PRINT_LINE(108,178,109,338,0,1); - LODOP.ADD_PRINT_TEXT(111,178,160,20,"DateCode:"+printRow.dateCode); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_LINE(128,178,129,338,0,1); - LODOP.ADD_PRINT_TEXT(134,178,160,20,"QTY: "+printRow.standardRollQty+" Rev:"+printRow.revNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_LINE(152,178,153,338,0,1); - LODOP.ADD_PRINT_TEXT(152,178,160,20,"Stage: "+printRow.stage); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_TEXT(169,178,160,20,printRow.partNo ); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_TEXT(186,178,160,20,printRow.finalRollNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_TEXT(203,178,160,20,printRow.rollDate2); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_TEXT(220,178,84,20,printRow.username); - LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - LODOP.ADD_PRINT_BARCODE(154,275,69,69,"QRCode",printRow.pgppn); - LODOP.ADD_PRINT_TEXT(222,249,88,20,printRow.pgppn); - LODOP.SET_PRINT_STYLEA(0,"FontSize",8); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.ADD_PRINT_IMAGE(243,258,70,25,""); - LODOP.SET_PRINT_STYLEA(0,"Stretch",1); - LODOP.ADD_PRINT_BARCODE(266,178,100,25,"128A",printRow.lineBarcodeTime); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(243,177,71,20,"Config "+printRow.config); - - LODOP.ADD_PRINT_BARCODE(4,348,110,80,"QRCode",printRow.finalRollNo); - LODOP.ADD_PRINT_TEXT(73,309,100,15,printRow.finalRollNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.ADD_PRINT_TEXT(88,372,35,15,"新"); - LODOP.SET_PRINT_STYLEA(0,"FontSize",12); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(114,304,100,15,printRow.qty); - LODOP.SET_PRINT_STYLEA(0,"FontSize",8); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - - LODOP.ADD_PRINT_TEXT(135,304,100,15,printRow.status); - LODOP.SET_PRINT_STYLEA(0,"FontSize",11); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - -} - -function printPageB(printRow){ +function printIndiaQcPage(printRow, printerData){ LODOP.NewPage(); LODOP.SET_PRINT_PAGESIZE(2,800,975,""); - LODOP.ADD_PRINT_TEXT(3,3,135,15,"(P)HH P/N:"+printRow.customerPartNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(12,3,135,20,"128A",printRow.customerPartNo); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(33,3,135,15,"(Q)QTY:"+printRow.standardRollQty); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(42,3,65,20,"128A",printRow.standardRollQty); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(62,3,135,15,"(M)Mfr P/N:"+printRow.partNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(71,3,65,20,"128A",printRow.partNo); + LODOP.ADD_PRINT_TEXT(3,3,135,15,"P/N:"+printRow.customerPartNo); + LODOP.SET_PRINT_STYLEA(0,"FontSize",7); + LODOP.ADD_PRINT_BARCODE(16,3,135,20,"128A",printRow.customerPartNo); LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(93,3,135,15,"(D)Date Code:"+printRow.rollDate2); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(102,5,135,20,"128A",printRow.rollDate2); + LODOP.ADD_PRINT_TEXT(37,3,135,15,"QTY:"+printRow.standardRollQty); + LODOP.SET_PRINT_STYLEA(0,"FontSize",7); + LODOP.ADD_PRINT_BARCODE(50,3,65,20,"128A",printRow.standardRollQty); LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(123,5,135,20,"(W)Week Code:"+printRow.dateCode); + LODOP.ADD_PRINT_TEXT(71,3,135,15,"Mfr P/N:"+printRow.partNo); LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(132,5,96,20,"128A",printRow.dateCode); + LODOP.ADD_PRINT_BARCODE(84,3,65,20,"128A",printRow.partNo); LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(153,5,135,15,"(L)Lot NO:"+printRow.finalRollNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(162,5,135,20,"128A",printRow.finalRollNo); + LODOP.ADD_PRINT_TEXT(105,3,135,15,"Date Code:"+printRow.dateCode); + LODOP.SET_PRINT_STYLEA(0,"FontSize",7); + LODOP.ADD_PRINT_BARCODE(118,3,135,20,"128A",printRow.dateCode); LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(183,5,75,15,"Rev:"+printRow.revNo); + LODOP.ADD_PRINT_TEXT(139,3,135,15,"Lot NO:"+printRow.finalRollNo); LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(192,5,69,20,"128A",printRow.revNo); + LODOP.ADD_PRINT_BARCODE(152,3,130,20,"128A",printRow.finalRollNo); LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(213,5,135,15,"PKG ID:"+printRow.pkcId); + LODOP.ADD_PRINT_TEXT(173,3,135,15,"PKG ID:"+printRow.pkcId); LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(222,5,135,20,"128A",printRow.pkcId); + LODOP.ADD_PRINT_BARCODE(186,5,135,20,"128A",printRow.pkcId); LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); //二维码以及下面的部分 - LODOP.ADD_PRINT_BARCODE(243,5,74,74,"QRCode",printRow.customerPartNo+","+printRow.standardRollQty+","+printRow.partNo +","+printRow.rollDate2+","+printRow.dateCode+","+printRow.finalRollNo+","+printRow.revNo+","+printRow.pkcId); - LODOP.ADD_PRINT_TEXT(261,50,30,20,"HF"); - LODOP.SET_PRINT_STYLEA(0,"FontSize",12); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(286,50,117,15,printRow.username); + LODOP.ADD_PRINT_BARCODE(208,3,105,105,"QRCode",printRow.customerPartNo+","+printRow.standardRollQty+","+printRow.partNo +","+printRow.dateCode+","+printRow.finalRollNo+","+printRow.pkcId); + + LODOP.ADD_PRINT_TEXT(280,3,80,15,printRow.username); LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.ADD_PRINT_IMAGE(241,43,55,20,""); + + LODOP.ADD_PRINT_TEXT(208,82,75,20,"Rev:"+printRow.revNo); + LODOP.SET_PRINT_STYLEA(0,"FontSize",10); + + LODOP.ADD_PRINT_IMAGE(225,75,55,20,""); LODOP.SET_PRINT_STYLEA(0,"Stretch",1); - LODOP.ADD_PRINT_TEXT(276,50,117,15,"机种:"+printRow.resource); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); + LODOP.SET_PRINT_STYLEA(0,"ScalX",0.75); + LODOP.SET_PRINT_STYLEA(0,"ScalY",0.75); + LODOP.ADD_PRINT_TEXT(258,80,30,20,"HF"); + LODOP.SET_PRINT_STYLEA(0,"FontSize",10); + //第二部分的标签 - LODOP.ADD_PRINT_TEXT(3,130,188,21,"(P)HH P/N:"+printRow.customerPartNo); - LODOP.ADD_PRINT_BARCODE(18,130,156,15,"128A",printRow.customerPartNo); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(33,130,186,21,"(Q)QTY:"+printRow.standardRollQty); - LODOP.ADD_PRINT_BARCODE(47,130,65,15,"128A",printRow.standardRollQty); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(62,130,189,20,"(M)Mfr P/N:"+printRow.partNo ); - LODOP.ADD_PRINT_BARCODE(76,130,161,15,"128A",printRow.partNo ); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(93,130,190,20,"(D)Date Code:"+printRow.rollDate2); - LODOP.ADD_PRINT_BARCODE(108,130,132,15,"128A",printRow.rollDate2); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(123,130,136,20,"(W)Week Code:"+printRow.dateCode); - LODOP.ADD_PRINT_BARCODE(138,130,96,15,"128A",printRow.dateCode); + LODOP.ADD_PRINT_TEXT(3,130,188,21,"P/N:"+printRow.customerPartNo); + LODOP.SET_PRINT_STYLEA(0,"FontSize",7); + LODOP.ADD_PRINT_BARCODE(16,130,156,15,"128A",printRow.customerPartNo); LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(153,130,192,20,"(L)Lot NO:"+printRow.finalRollNo); - LODOP.ADD_PRINT_BARCODE(167,130,161,16,"128A",printRow.finalRollNo); + LODOP.ADD_PRINT_TEXT(37,130,186,21,"QTY:"+printRow.standardRollQty); + LODOP.SET_PRINT_STYLEA(0,"FontSize",7); + LODOP.ADD_PRINT_BARCODE(50,130,65,15,"128A",printRow.standardRollQty); LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(183,130,75,20,"Rev:"+printRow.revNo); - LODOP.ADD_PRINT_BARCODE(197,130,69,15,"128A",printRow.revNo); + LODOP.ADD_PRINT_TEXT(71,130,189,20,"Mfr P/N:"+printRow.partNo); + LODOP.ADD_PRINT_BARCODE(84,130,161,15,"128A",printRow.partNo); LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(211,130,192,20,"PKG ID:"+printRow.pkcId); - LODOP.ADD_PRINT_BARCODE(226,130,168,15,"128A",printRow.pkcId); + LODOP.ADD_PRINT_TEXT(105,125,190,20,"Date Code:"+printRow.dateCode); + LODOP.ADD_PRINT_BARCODE(118,125,132,15,"128A",printRow.dateCode); LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - - LODOP.ADD_PRINT_BARCODE(241,141,105,76,"QRCode",printRow.customerPartNo+","+printRow.standardRollQty+","+printRow.partNo +","+printRow.rollDate2+","+printRow.dateCode+","+printRow.finalRollNo+","+printRow.revNo+","+printRow.pkcId); - - LODOP.ADD_PRINT_TEXT(261,205,30,20,"HF"); - LODOP.SET_PRINT_STYLEA(0,"FontSize",12); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - - LODOP.ADD_PRINT_TEXT(286,205,117,15,printRow.username); + + LODOP.ADD_PRINT_TEXT(139,130,185,15,"Lot NO:"+printRow.finalRollNo); LODOP.SET_PRINT_STYLEA(0,"FontSize",7); + LODOP.ADD_PRINT_BARCODE(152,130,185,20,"128A",printRow.finalRollNo); + LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_IMAGE(241,198,55,20,""); - LODOP.SET_PRINT_STYLEA(0,"Stretch",1); - - LODOP.ADD_PRINT_TEXT(276,205,117,15,"机种:"+printRow.resource); + LODOP.ADD_PRINT_TEXT(173,130,192,20,"PKG ID:"+printRow.pkcId); LODOP.SET_PRINT_STYLEA(0,"FontSize",7); + LODOP.ADD_PRINT_BARCODE(186,130,168,15,"128A",printRow.pkcId); + LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - //第二部分右侧的部分 - LODOP.ADD_PRINT_BARCODE(4,300,110,80,"QRCode",printRow.finalRollNo); - LODOP.ADD_PRINT_TEXT(73,261,100,15,printRow.finalRollNo); + LODOP.ADD_PRINT_BARCODE(208,141,105,105,"QRCode",printRow.customerPartNo+","+printRow.standardRollQty+","+printRow.partNo +","+printRow.dateCode+","+printRow.finalRollNo+","+printRow.pkcId); + + LODOP.ADD_PRINT_TEXT(280,141,117,15,printRow.username); LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.ADD_PRINT_TEXT(88,280,80,15,printRow.productStyle); - LODOP.SET_PRINT_STYLEA(0,"FontSize",12); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(114,261,100,15, printRow.qty); - LODOP.SET_PRINT_STYLEA(0,"FontSize",8); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.ADD_PRINT_TEXT(135,261,100,15,printRow.status); - LODOP.SET_PRINT_STYLEA(0,"FontSize",11); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); + LODOP.ADD_PRINT_TEXT(208,220,75,20,"Rev:"+printRow.revNo); + LODOP.SET_PRINT_STYLEA(0,"FontSize",10); -} + LODOP.ADD_PRINT_IMAGE(225,220,55,20,""); + LODOP.SET_PRINT_STYLEA(0,"Stretch",1); -function printPageD(printRow){ - LODOP.NewPage(); - LODOP.SET_PRINT_PAGESIZE(2,800,975,""); + LODOP.ADD_PRINT_TEXT(258,220,30,20,"HF"); + LODOP.SET_PRINT_STYLEA(0,"FontSize",10); - //第二部分的标签 - LODOP.ADD_PRINT_TEXT(3,130,188,21,"(P)HH P/N:"+printRow.customerPartNo); - LODOP.ADD_PRINT_BARCODE(18,130,156,15,"128A",printRow.customerPartNo); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(33,130,186,21,"(Q)QTY:"+printRow.standardRollQty); - LODOP.ADD_PRINT_BARCODE(47,130,65,15,"128A",printRow.standardRollQty); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(62,130,189,20,"(M)Mfr P/N:"+printRow.partNo ); - LODOP.ADD_PRINT_BARCODE(76,130,161,15,"128A",printRow.partNo ); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(93,130,190,20,"(D)Date Code:"+printRow.rollDate2); - LODOP.ADD_PRINT_BARCODE(108,130,132,15,"128A",printRow.rollDate2); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(123,130,136,20,"(W)Week Code:"+printRow.dateCode); - LODOP.ADD_PRINT_BARCODE(138,130,96,15,"128A",printRow.dateCode); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(153,130,192,20,"(L)Lot NO:"+printRow.finalRollNo); - LODOP.ADD_PRINT_BARCODE(167,130,161,16,"128A",printRow.finalRollNo); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(183,130,75,20,"Rev:"+printRow.revNo); - LODOP.ADD_PRINT_BARCODE(197,130,69,15,"128A",printRow.revNo); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(211,130,192,20,"PKG ID:"+printRow.pkcId); - LODOP.ADD_PRINT_BARCODE(226,130,168,15,"128A",printRow.pkcId); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - - LODOP.ADD_PRINT_BARCODE(241,141,105,76,"QRCode",printRow.customerPartNo+","+printRow.standardRollQty+","+printRow.partNo +","+printRow.rollDate2+","+printRow.dateCode+","+printRow.finalRollNo+","+printRow.revNo+","+printRow.pkcId); - - LODOP.ADD_PRINT_TEXT(261,205,30,20,"HF"); - LODOP.SET_PRINT_STYLEA(0,"FontSize",12); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - - LODOP.ADD_PRINT_TEXT(286,205,117,15,printRow.username); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - - LODOP.ADD_PRINT_IMAGE(241,198,55,20,""); - LODOP.SET_PRINT_STYLEA(0,"Stretch",1); - - LODOP.ADD_PRINT_TEXT(276,205,117,15,"机种:"+printRow.resource); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); //第二部分右侧的部分 LODOP.ADD_PRINT_BARCODE(4,300,110,80,"QRCode",printRow.finalRollNo); LODOP.ADD_PRINT_TEXT(73,261,100,15,printRow.finalRollNo); LODOP.SET_PRINT_STYLEA(0,"FontSize",7); LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.ADD_PRINT_TEXT(88,280,80,15,printRow.productStyle); - LODOP.SET_PRINT_STYLEA(0,"FontSize",12); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(114,261,100,15, printRow.qty); - LODOP.SET_PRINT_STYLEA(0,"FontSize",8); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.ADD_PRINT_TEXT(135,261,100,15,printRow.status); + LODOP.ADD_PRINT_TEXT(105,260,100,25,printRow.status); LODOP.SET_PRINT_STYLEA(0,"FontSize",11); LODOP.SET_PRINT_STYLEA(0,"Alignment",3); LODOP.SET_PRINT_STYLEA(0,"Bold",1); -} - -function printPageC(printRow){ - LODOP.NewPage(); - LODOP.SET_PRINT_PAGESIZE(1,800,975,""); - - LODOP.ADD_PRINT_TEXT(3,5,200,10,"Project:"+printRow.project); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - - LODOP.ADD_PRINT_TEXT(11,5,133,10,"Config:"+printRow.config); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - - LODOP.ADD_PRINT_TEXT(19,5,240,15,"OEMPN+VC:"+printRow.oempn); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(28,5,240,13,"128A",printRow.oempn); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(40,5,200,10,"TRACE ID:"+printRow.traceId); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(49,5,200,13,"128A",printRow.traceId); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(61,5,94,15,"Qty:"+printRow.standardRollQty); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(70,5,81,13,"128A",printRow.standardRollQty); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(82,5,180,15,"ID NO:"+printRow.pkcId); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(91,4,180,13,"128A",printRow.pkcId); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - - LODOP.ADD_PRINT_TEXT(103,5,163,10,printRow.partNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - //第一部分 中间的标签 - LODOP.ADD_PRINT_TEXT(65,110,88,15,"RoHS+HF"); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(79,120,53,15,"CCL"); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(97,115,91,15,printRow.username); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - //第一部分最右侧的标签 - LODOP.ADD_PRINT_TEXT(3,100,148,15,"Stage:"+printRow.stage); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(35,230,40,15,"Rev.:"+printRow.revNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",6); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(45,245,40,12,"128A",printRow.revNo); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_BARCODE(60,225,79,79,"QRCode",printRow.newQrCode); - LODOP.SET_PRINT_STYLEA(0, "ScalX", 0.75); - LODOP.SET_PRINT_STYLEA(0, "ScalY", 0.75); - - //第二部分的代码 - LODOP.ADD_PRINT_TEXT(127,5,200,16,"Project:"+printRow.project); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - - LODOP.ADD_PRINT_TEXT(127,100,148,15,"Stage:"+printRow.stage); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - - LODOP.ADD_PRINT_TEXT(136,5,133,16,"Config:"+printRow.config); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(165,135,155,15,"Rev.:"+printRow.revNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Alignment",3); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - - LODOP.ADD_PRINT_TEXT(147,5,240,15,"OEMPN+VC:"+printRow.oempn); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(157,5,240,20,"128A",printRow.oempn); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(178,5,200,15,"TRACE ID:"+printRow.traceId); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(190,5,200,20,"128A",printRow.traceId); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_BARCODE(190,245,50,20,"128A",printRow.revNo); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(211,5,94,15,"Qty:"+printRow.standardRollQty); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(223,5,81,20,"128A",printRow.standardRollQty); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_TEXT(243,5,180,15,"ID NO:"+printRow.pkcId); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(255,4,180,20,"128A",printRow.pkcId); - LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0); - LODOP.ADD_PRINT_BARCODE(214,218,110,79,"QRCode",printRow.newQrCode); - LODOP.ADD_PRINT_TEXT(217,135,88,15,"RoHS+HF"); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(231,151,53,15,"CCL"); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(275,5,163,15,printRow.partNo ); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(275,120,91,15,printRow.username); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_BARCODE(302,10,110,80,"QRCode",printRow.finalRollNo); - LODOP.ADD_PRINT_TEXT(313,89,100,15,printRow.finalRollNo); - LODOP.SET_PRINT_STYLEA(0,"FontSize",7); - LODOP.ADD_PRINT_TEXT(313,180,80,15,printRow.productStyle); - LODOP.SET_PRINT_STYLEA(0,"FontSize",12); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.ADD_PRINT_TEXT(329,89,100,15,printRow.qty); - LODOP.SET_PRINT_STYLEA(0,"FontSize",8); - - LODOP.ADD_PRINT_TEXT(346,89,100,15,printRow.status); - LODOP.SET_PRINT_STYLEA(0,"FontSize",11); - LODOP.SET_PRINT_STYLEA(0,"Bold",1); - LODOP.SET_PRINT_STYLEA(1,"AngleOfPageInside",180); -} +} \ No newline at end of file diff --git a/external/print/print_qc_zero_label.js b/external/print/print_qc_zero_label.js index c765b68..adc564d 100644 --- a/external/print/print_qc_zero_label.js +++ b/external/print/print_qc_zero_label.js @@ -65,13 +65,13 @@ function printZeroPageA(printRow, printerInfo){ LODOP.NewPage(); LODOP.SET_PRINT_PAGESIZE(2,800,1125,""); LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE",1); - LODOP.ADD_PRINT_TEXT(7,7,220,20,"LUXSANTECH"); + LODOP.ADD_PRINT_TEXT(7,7,220,20,"PEGAGLOBE"); LODOP.SET_PRINT_STYLEA(0,"FontSize",16); LODOP.ADD_PRINT_LINE(28,7,29,167,0,1); LODOP.ADD_PRINT_TEXT(31,7,160,20,"Vendor: CCL-SZ"); LODOP.SET_PRINT_STYLEA(0,"FontSize",10); LODOP.ADD_PRINT_LINE(48,7,49,167,0,1); - LODOP.ADD_PRINT_TEXT(53,7,190,20,"P/N:"+printRow.customerPartNo); + LODOP.ADD_PRINT_TEXT(53,7,190,20,"Pega P/N:"+printRow.customerPartNo); LODOP.SET_PRINT_STYLEA(0,"FontSize",8); LODOP.ADD_PRINT_LINE(68,7,69,167,0,1); LODOP.ADD_PRINT_TEXT(71,7,160,20,"APN: "+printRow.pgppn); diff --git a/src/main/java/com/ccl/tt/service/impl/PrintLabelServiceImpl.java b/src/main/java/com/ccl/tt/service/impl/PrintLabelServiceImpl.java index 44e6e29..dd7be96 100644 --- a/src/main/java/com/ccl/tt/service/impl/PrintLabelServiceImpl.java +++ b/src/main/java/com/ccl/tt/service/impl/PrintLabelServiceImpl.java @@ -105,7 +105,6 @@ public class PrintLabelServiceImpl implements PrintLabelService { String resource = ""; PartData part = new PartData(); String customerPartNoAll = ""; - String labelFlag = ""; if (StringUtils.isNotEmpty(orderNo)){ String status = fr.getStatus(); cacheMap.put("status", status); @@ -145,30 +144,10 @@ public class PrintLabelServiceImpl implements PrintLabelService { throw new RuntimeException("Material Apn not maintained."); } cacheMap.put("apn", apn); - labelFlag = part.getLabelType(); - if(labelFlag == null){ - throw new RuntimeException("Material LabelFlag not maintained."); - } - cacheMap.put("labelFlag", labelFlag); resource = part.getCustomerDrawing(); - String project = resource.split("\\|")[0]; - cacheMap.put("project", project); stage = part.getStage(); cacheMap.put("stage", stage); - String dateStr = DateUtils.getStringDate(order.getFirstRollTime() != null ? order.getFirstRollTime() : new Date(), "yyyyMMdd").substring(2, 8); customerPartNoAll = customerPartNo+','+ revNo+','+ resource; - traceID = order.getOrderNo().replace("-",""); - if(traceID.length() > 12){ - traceID=traceID.substring(0, 12); - }else { - StringBuilder sb = new StringBuilder(traceID); - while (sb.length() < 12) { - sb.append("0"); - } - traceID = sb.toString(); - } - traceID = traceID+"-"+dateStr; - cacheMap.put("traceId", traceID); cacheMap.put("pgppn", apn); cacheMap.put("resource", resource); } @@ -181,32 +160,6 @@ public class PrintLabelServiceImpl implements PrintLabelService { if (fr.getFinalRollNo().indexOf("-Q") > 0){ type = "QC Roll"; } - cacheMap.put("type", type); - //处理qrCreator - if (type.length() > 0) { - if (fr.getJobId().startsWith("ROLLOP_")){ - String code = fr.getJobId().substring(7,9); - User creator = userRepo.findByUsername(fr.getCreatedBy()); - String qrCreator = creator.getDisplay(); - if ("10".equals(code)){ - qrCreator = "Indigo - " + qrCreator; - } - if ("15".equals(code)){ - qrCreator = "Themal - " + qrCreator; - } - if ("20".equals(code)){ - qrCreator = "ABG - " + qrCreator; - } - if ("30".equals(code)){ - qrCreator = "AOI - " + qrCreator; - } - if ("40".equals(code)){ - qrCreator = "Scanning - " + qrCreator; - } - cacheMap.put("qcCreator", qrCreator); - } - } - //获取年和周 Calendar calendar = Calendar.getInstance(); //改成首开卷日期 @@ -233,85 +186,48 @@ public class PrintLabelServiceImpl implements PrintLabelService { dateCode = strYears.substring(2)+""+weeks; } - cacheMap.put("dateCode", dateCode); + Date usedDate = order.getFirstRollTime()!=null?order.getFirstRollTime():fr.getCreatedDate(); + + cacheMap.put("dateCode", DateUtils.getStringDate(usedDate, "yyyyMMdd")); cacheMap.put("username", username); cacheMap.put("finalRollNo", finalRollNo); cacheMap.put("lineBarcodeTime", DateUtils.getStringDate(fr.getCreatedDate(), "yyyyMMdd")); - String dateCode2 = ""; + String weekCode = ""; if(weeks < 10) { - dateCode2 = strYears.substring(2)+"W0"+weeks; + weekCode = strYears.substring(2)+"W0"+weeks; }else { - dateCode2 = strYears.substring(2)+"W"+weeks; + weekCode = strYears.substring(2)+"W"+weeks; } - StringBuilder newQrCode = new StringBuilder(); - String pkcId=""; - if("B".equals(labelFlag) || "D".equals(labelFlag)) { - //五位流水号 - List params = new ArrayList<>(); - params.add("1"); - params.add("rollLabelBC"); - params.add(dateCode2); - params.add(5); - List> getSerialNo = procedureDao.getProcedureData("getSerialNo", params); - int seqNoNum = Integer.parseInt(getSerialNo.get(0).get("serial_no").toString(),10); - String seqNo34 = convertToBase34(seqNoNum); - int stringLength=seqNo34.length(); - String stringAdd=""; - for (int i = 0; i <4-stringLength ; i++) { - stringAdd=stringAdd+"0"; - } - String seqNo= stringAdd+seqNo34; - pkcId = "B00CCL" + dateCode2 +"T"+ seqNo; - - newQrCode.append(order.getCustomerPartNo()) - .append(",") - .append(standardRollQty) - .append(",") - .append(order.getPartNo()) - .append(",") - .append(DateUtils.getStringDate(order.getFirstRollTime() != null ? order.getFirstRollTime() : fr.getCreatedDate(), "yyyyMMdd")) - .append(",") - .append(fr.getFinalRollNo()) - .append(",") - .append(pkcId); - } - if("C".equals(labelFlag)){ - if(customerPartNoAll.split(",")[0].length()<2){ - throw new RuntimeException("CustomerPartNoAll field format is incorrect"); - } - DateFormat yy = new SimpleDateFormat("yy"); - String year = yy.format(new Date()); - DateFormat MM = new SimpleDateFormat("MM"); - String month = MM.format(new Date()); - DateFormat df = new SimpleDateFormat("dd"); - String date = df.format(new Date()); - pkcId = "M"+part.getCustomerPartNo().substring(part.getCustomerPartNo().length()-5); - pkcId = pkcId + year + month + date; - //五位流水号 - List params = new ArrayList<>(); - params.add("1"); - params.add("ICT_QC_Print"); - params.add(pkcId); - params.add(5); - List> getSerialNo = procedureDao.getProcedureData("getSerialNo", params); - int seqNoNum = Integer.parseInt(getSerialNo.get(0).get("serial_no").toString(),10); - - if ("".equals(part.getCustomerPartNo()) || part.getCustomerPartNo().length() < 5) { - throw new RuntimeException("Customer part number maintenance error"); - } - pkcId = pkcId + "8" + String.format("%05d", seqNoNum); - newQrCode.append(oempn) - .append("|") - .append(traceID) - .append("|") - .append(part.getPackageQty()) - .append("|") - .append(pkcId) - .append("|") - .append("CCL"); + StringBuilder qrCode = new StringBuilder(); + //五位流水号 + List params = new ArrayList<>(); + params.add("1"); + params.add("rollLabelBC"); + params.add(weekCode); + params.add(5); + List> getSerialNo = procedureDao.getProcedureData("getSerialNo", params); + int seqNoNum = Integer.parseInt(getSerialNo.get(0).get("serial_no").toString(), 10); + String seqNo34 = convertToBase34(seqNoNum); + int stringLength = seqNo34.length(); + String stringAdd=""; + for (int i = 0; i < 4 - stringLength; i++) { + stringAdd = stringAdd + "0"; } + String seqNo= stringAdd + seqNo34; + String pkcId = "B00CCL" + weekCode +"T"+ seqNo; + StringBuilder newQrCode = new StringBuilder(); + newQrCode.append(order.getCustomerPartNo()) + .append(",") + .append(standardRollQty) + .append(",") + .append(order.getPartNo()) + .append(",") + .append(dateCode) + .append(",") + .append(fr.getFinalRollNo()) + .append(",") + .append(pkcId); cacheMap.put("pkcId", pkcId); - cacheMap.put("dateCode2", dateCode2); cacheMap.put("newQrCode", newQrCode.toString()); cacheMap.put("rollDate", DateUtils.getStringDate(order.getFirstRollTime()!=null?order.getFirstRollTime():fr.getCreatedDate(), "yyyyMMdd")); cacheMap.put("rollDate2", DateUtils.getStringDate(order.getFirstRollTime()!=null?order.getFirstRollTime():fr.getCreatedDate(), "yyyy-MM-dd"));