JRT打印预览实现

JRT客户端部分已经实现了打印、导出Excel部分,之前没实现打印预览部分,因为要自己写打印预览界面,所以留到最后做,经过两晚的努力,实现了打印预览。

效果:
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

打印预览界面代码

package Monitor.Print;import javafx.application.Platform;
import javafx.embed.swing.SwingFXUtils;
import javafx.geometry.Insets;
import javafx.geometry.Orientation;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextField;
import javafx.scene.image.ImageView;
import javafx.scene.layout.*;
import javafx.scene.text.Text;
import javafx.stage.Modality;
import javafx.stage.Stage;
import Monitor.Print.PrintProtocol;import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;import javafx.scene.image.Image;/*** 实现打印预览的弹窗和逻辑*/
public class PrintPreview {/*** 舞台*/private Stage curStage = null;/*** 操作打印协议的对象*/private PrintProtocol printProtocol = null;/*** 当前所在页*/TextField txtCurPage = new TextField();/*** 放预览图片*/FlowPane bottom = new FlowPane(500, 1);/*** 打印预览构造函数** @param oper*/public PrintPreview(PrintProtocol oper) {printProtocol = oper;// 创建新的Stage对象,设置标题和尺寸curStage = new Stage();curStage.setTitle("打印预览-由JRT计划提供");curStage.setWidth(1366);curStage.setHeight(768);SplitPane splitPane = new SplitPane();splitPane.setOrientation(Orientation.VERTICAL);// 打印当前页Button btnPrintCur = new Button("打印当前页");btnPrintCur.setStyle("-fx-background-color: #6abfef;");btnPrintCur.setOnMouseClicked(e -> {try {String curPage = txtCurPage.getText();List<Integer> pages = new ArrayList<>();pages.add(Integer.valueOf(curPage) - 1);oper.SetPrintPage(pages);oper.PrintOnece();} catch (Exception ex) {Alert alert = new Alert(Alert.AlertType.INFORMATION);alert.setTitle("提示");alert.setContentText(ex.getMessage());alert.showAndWait();}});btnPrintCur.setPrefHeight(26);// 打印全部Button btnPrintAll = new Button("打印全部");btnPrintAll.setStyle("-fx-background-color: #6abfef;");btnPrintAll.setOnMouseClicked(e -> {try {List<Integer> pages = new ArrayList<>();for (int i = 0; i < oper.AllPageNum; i++) {pages.add(i);}oper.SetPrintPage(pages);oper.PrintOnece();Hide();} catch (Exception ex) {Alert alert = new Alert(Alert.AlertType.INFORMATION);alert.setTitle("提示");alert.setContentText(ex.getMessage());alert.showAndWait();}});btnPrintAll.setPrefHeight(26);// 打印奇数页Button btnPrintOdd = new Button("打印奇数页");btnPrintOdd.setStyle("-fx-background-color: #6abfef;");btnPrintOdd.setOnMouseClicked(e -> {try {List<Integer> pages = new ArrayList<>();for (int i = 0; i < oper.AllPageNum; i++) {if (i % 2 == 0) {pages.add(i);}}oper.SetPrintPage(pages);oper.PrintOnece();Hide();} catch (Exception ex) {Alert alert = new Alert(Alert.AlertType.INFORMATION);alert.setTitle("提示");alert.setContentText(ex.getMessage());alert.showAndWait();}});btnPrintOdd.setPrefHeight(26);// 打印偶数页Button btnPrintEven = new Button("打印偶数页");btnPrintEven.setStyle("-fx-background-color: #6abfef;");btnPrintEven.setOnMouseClicked(e -> {try {List<Integer> pages = new ArrayList<>();for (int i = 0; i < oper.AllPageNum; i++) {if (i % 2 == 1) {pages.add(i);}}oper.SetPrintPage(pages);oper.PrintOnece();Hide();} catch (Exception ex) {Alert alert = new Alert(Alert.AlertType.INFORMATION);alert.setTitle("提示");alert.setContentText(ex.getMessage());alert.showAndWait();}});btnPrintEven.setPrefHeight(26);// 打印偶数页逆序Button btnPrintEvenRevert = new Button("打印偶逆序");btnPrintEvenRevert.setStyle("-fx-background-color: #6abfef;");btnPrintEvenRevert.setOnMouseClicked(e -> {try {List<Integer> pages = new ArrayList<>();for (int i = oper.AllPageNum - 1; i >= 0; i--) {if (i % 2 == 1) {pages.add(i);}}oper.SetPrintPage(pages);oper.PrintOnece();Hide();} catch (Exception ex) {Alert alert = new Alert(Alert.AlertType.INFORMATION);alert.setTitle("提示");alert.setContentText(ex.getMessage());alert.showAndWait();}});btnPrintEvenRevert.setPrefHeight(26);//打印开始页TextField txtStart = new TextField();txtStart.setPrefWidth(60);txtStart.setPrefHeight(26);//分割字符Label lab = new Label("-");//打印结束页TextField txtEnd = new TextField();txtEnd.setPrefWidth(60);txtEnd.setPrefHeight(26);// 范围打印Button btnPrintRange = new Button("范围打印");btnPrintRange.setStyle("-fx-background-color: #6abfef;");btnPrintRange.setOnMouseClicked(e -> {try {String start = txtStart.getText();String end = txtEnd.getText();int startInt = Integer.valueOf(start) - 1;int endInt = Integer.valueOf(end) - 1;List<Integer> pages = new ArrayList<>();for (int i = 0; i < oper.AllPageNum; i++) {if (i >= startInt && i <= endInt) {pages.add(i);}}oper.SetPrintPage(pages);oper.PrintOnece();Hide();} catch (Exception ex) {Alert alert = new Alert(Alert.AlertType.INFORMATION);alert.setTitle("提示");alert.setContentText(ex.getMessage());alert.showAndWait();}});btnPrintRange.setPrefHeight(26);// 打印设置Button btnPrintSetting = new Button("打印设置");btnPrintSetting.setStyle("-fx-background-color: #449be2;");btnPrintSetting.setOnMouseClicked(e -> {oper.job.printDialog();});btnPrintSetting.setPrefHeight(26);//当前页txtCurPage.setPrefWidth(30);txtCurPage.setText("1");txtCurPage.setPrefHeight(26);//所有页Label labAllPage = new Label("/" + oper.AllPageNum);labAllPage.setPrefHeight(26);// 上一页Button btnPrev = new Button("上一页");btnPrev.setStyle("-fx-background-color: #39c6c8;");btnPrev.setOnMouseClicked(e -> {try {String curPage = txtCurPage.getText();int curPageInt = Integer.valueOf(curPage);curPageInt--;if (curPageInt < 1 || curPageInt > oper.AllPageNum) {return;}txtCurPage.setText(curPageInt + "");BufferedImage img = new BufferedImage(867, 1169, BufferedImage.TYPE_INT_ARGB);Graphics g = img.getGraphics();g.setColor(Color.WHITE);g.fillRect(0, 0, img.getWidth(), img.getHeight());oper.PrintHandeler.DrawOnePage(g, curPageInt - 1);Image image = SwingFXUtils.toFXImage(img, null);ImageView onePage = new ImageView(image);bottom.getChildren().clear();bottom.getChildren().add(onePage);} catch (Exception ex) {Alert alert = new Alert(Alert.AlertType.INFORMATION);alert.setTitle("提示");alert.setContentText(ex.getMessage());alert.showAndWait();}});btnPrev.setPrefHeight(26);// 下一页Button btnNext = new Button("下一页");btnNext.setStyle("-fx-background-color: #39c6c8;");btnNext.setOnMouseClicked(e -> {try {String curPage = txtCurPage.getText();int curPageInt = Integer.valueOf(curPage);curPageInt++;if (curPageInt < 1 || curPageInt > oper.AllPageNum) {return;}txtCurPage.setText(curPageInt + "");BufferedImage img = new BufferedImage(867, 1169, BufferedImage.TYPE_INT_ARGB);Graphics g = img.getGraphics();g.setColor(Color.WHITE);g.fillRect(0, 0, img.getWidth(), img.getHeight());oper.PrintHandeler.DrawOnePage(g, curPageInt - 1);Image image = SwingFXUtils.toFXImage(img, null);ImageView onePage = new ImageView(image);bottom.getChildren().clear();bottom.getChildren().add(onePage);} catch (Exception ex) {Alert alert = new Alert(Alert.AlertType.INFORMATION);alert.setTitle("提示");alert.setContentText(ex.getMessage());alert.showAndWait();}});btnNext.setPrefHeight(26);HBox top = new HBox(20, btnPrintCur, btnPrintAll, btnPrintOdd, btnPrintEven, btnPrintEvenRevert, txtStart, lab, txtEnd, btnPrintRange, btnPrintSetting, txtCurPage, labAllPage, btnPrev, btnNext);top.setPadding(new Insets(5, 5, 5, 15));top.setPrefHeight(40);top.setMaxHeight(40);bottom.setAlignment(Pos.CENTER);bottom.setPadding(new Insets(10, 10, 10, 15));// 创建一个ScrollPaneScrollPane scrollPane = new ScrollPane();// 设置滚动条的可见性为自动//scrollPane.setScrollbarsVisible(true);scrollPane.setContent(bottom);//画每页的图if (oper.AllPageNum > 0) {for (int i = 0; i < oper.AllPageNum; i++) {try {BufferedImage img = new BufferedImage(867, 1169, BufferedImage.TYPE_INT_ARGB);Graphics g = img.getGraphics();g.setColor(Color.WHITE);g.fillRect(0, 0, img.getWidth(), img.getHeight());oper.PrintHandeler.DrawOnePage(g, i);Image image = SwingFXUtils.toFXImage(img, null);ImageView onePage = new ImageView(image);Label labSP = new Label("---第" + (i + 1) + "页---");bottom.getChildren().add(labSP);bottom.getChildren().add(onePage);} catch (Exception ex) {// 弹出一个信息对话框Alert alert = new Alert(Alert.AlertType.INFORMATION);alert.setTitle("提示");alert.setHeaderText(null);alert.setContentText(ex.getMessage());}}}//bottom.setBackground(new Background(new BackgroundFill(Color.WHITE, new CornerRadii(10), new Insets(10))));splitPane.getItems().addAll(top, scrollPane);Scene scene = new Scene(splitPane);splitPane.setStyle("-fx-background-color: #FAFAFA;");curStage.setOnCloseRequest(event -> {try {} catch (Exception ex) {}});curStage.setScene(scene);curStage.setMaximized(true);curStage.setAlwaysOnTop(true);}/*** 隐藏*/private void Hide() {Platform.runLater(() -> {curStage.hide();});}/*** 展示*/public void Show() {curStage.showAndWait();}
}

打印控制类调整

package Monitor.Print;import JRTPrintDraw.DrawConvert;
import JRTPrintDraw.DrawElement;
import JRTPrintDraw.JRTPrintDrawProtocol;
import JRTPrintDraw.JsonDealUtil;
import JRTPrintDraw.WebService.Parameters;
import Monitor.Print.PrintPreview;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import javafx.application.Platform;
import javafx.scene.control.Alert;import javax.print.DocFlavor;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.standard.Media;
import javax.print.attribute.standard.MediaSizeName;
import javax.print.attribute.standard.MediaTray;
import java.awt.*;
import java.awt.print.*;
import java.util.ArrayList;
import java.util.List;public class PrintProtocol implements Printable {/*** 纸张名称*/private String PageName;/*** 打印句柄*/public JRTPrintDrawProtocol PrintHandeler = null;/*** 所有页数*/public int AllPageNum = 0;/*** 通俗理解就是书、文档*/private Book book = new Book();/*** 获取打印服务对象*/PrinterJob job = PrinterJob.getPrinterJob();/*** 设置成竖打*/PageFormat pf = new PageFormat();/*** 得到打印机** @param printerName* @return*/public static PrintService GetPrinter(String printerName) {DocFlavor psInFormat = DocFlavor.INPUT_STREAM.AUTOSENSE;HashPrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();PrintService printService[] = PrintServiceLookup.lookupPrintServices(psInFormat, pras);PrintService myPrinter = null;//遍历所有打印机如果没有选择打印机或找不到该打印机则调用默认打印机for (PrintService printService2 : printService) {String svcName = printService2.toString();if (svcName.contains(printerName)) {myPrinter = printService2;break;}}if (myPrinter == null) {myPrinter = PrintServiceLookup.lookupDefaultPrintService();return myPrinter;}return myPrinter;}/*** 按打印元素绘制协议实现打印** @param rowids        数据主键* @param userCode      用户* @param paramList     参数* @param connectString 连接串* @param printFlag     打印标识* @param className     调用类名* @param funcName      方法名称*/public PrintProtocol(String rowids, String userCode, String paramList, String connectString, String printFlag, String className, String funcName) throws Exception {try {Parameters para = new Parameters();para.P0 = rowids;para.P1 = userCode;para.P2 = paramList;para.P3 = rowids;String json = JRTPrintDraw.WebService.WebGetData.GetData(connectString, className, funcName, para, null);List<DrawElement> elementList = JsonDealUtil.Json2List(json, DrawElement.class);PrintHandeler = new JRTPrintDrawProtocol();AllPageNum = PrintHandeler.JRTPrintDrawInit(elementList);// 设置打印类job.setPageable(book);pf.setOrientation(PageFormat.PORTRAIT);boolean hasSetPaper = false;//控制打印机的数据if (elementList.get(0).PrintType.contains("PRINTER")) {DrawElement dr = elementList.get(0);//打印机名称String tPrinterName = elementList.get(0).PrintFlag;//选择打印机if (tPrinterName != null && !tPrinterName.isEmpty()) {PrintService printService = GetPrinter(tPrinterName);job.setPrintService(printService);}//设置打印机其他参数if (dr.PrintType.equals("PRINTER")) {//设置打印机宽度int PrinterWidth = DrawConvert.ToInt32(dr.PrintWidth);//设置打印机高度int PrinterHeight = DrawConvert.ToInt32(dr.PrintHeight);PrintHandeler.WriteLog("PRINTER得到纸张宽高:" + PrinterWidth + " " + PrinterHeight);//页面名称PageName = dr.DataField;//停靠String ReportLayout = dr.PrintAlignment;PrintHandeler.WriteLog("PRINTER得打印机名称:" + tPrinterName);//指定打印机送纸来源int iPaperSource = DrawConvert.ToInt32(dr.PrintFont);if (ReportLayout == "Landscape") {pf.setOrientation(PageFormat.LANDSCAPE);PrintHandeler.WriteLog("PRINTER旋转纸张:Landscape");}//宽高大于0就控制if (PrinterWidth > 0 && PrinterHeight > 0) {//通过Paper设置页面的空白边距和可打印区域。必须与实际打印纸张大小相符。Paper paper = new Paper();// 设置纸张大小为 A4 大小(210 mm × 297 mm)int width = PrinterWidth;int height = PrinterHeight;//旋转if (ReportLayout == "Landscape") {int tmp = width;width = height;height = tmp;}double margin = 0;paper.setSize(width, height);paper.setImageableArea(margin, margin, width - 2 * margin, height - 2 * margin);pf.setPaper(paper);hasSetPaper = true;}}}if (hasSetPaper == false) {Paper paper = new Paper();// 设置纸张大小为 A4 大小(210 mm × 297 mm)int width = 794;int height = 1123;double margin = 0;paper.setSize(width, height);paper.setImageableArea(margin, margin, width - 2 * margin, height - 2 * margin);pf.setPaper(paper);}book.append(this, pf, AllPageNum);if (printFlag.contains("PrintPreview")) {Platform.runLater(() -> {try {PrintPreview frmPreview = new PrintPreview(this);frmPreview.Show();} catch (Exception ee) {Alert alert = new Alert(Alert.AlertType.INFORMATION);alert.setTitle("提示");alert.setContentText(ee.getMessage());alert.showAndWait();}});} else {job.print();}} catch (PrinterException e) {e.printStackTrace();}}/*** 设置打印页数** @param pages*/public void SetPrintPage(List<Integer> pages) {PrintHandeler.SetPrintPage(pages);book.append(this, pf, pages.size());}/*** 执行一次打印*/public void PrintOnece() throws Exception {job.print();//恢复页List<Integer> pages = new ArrayList<>();for (int i = 0; i < AllPageNum; i++) {pages.add(i);}SetPrintPage(pages);}/*** 打印画图** @param graphics* @param pageFormat* @param pageIndex* @return* @throws PrinterException*/@Overridepublic int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {// 转换成Graphics2D 拿到画笔Graphics2D g2 = (Graphics2D) graphics;if (PrintHandeler != null) {try {int drawOneRet = PrintHandeler.DrawOnePage(g2, pageIndex);return drawOneRet;} catch (Exception ex) {if (ex.getCause() != null) {PrintHandeler.WriteLog(ex.getCause().getMessage());} else {PrintHandeler.WriteLog(ex.getMessage());}ex.printStackTrace();return 1;}}return 1;}
}

之前做打印设计时候就考虑到后面做预览和在线打印预览要共用绘图,就把打印和绘图分离彻底了
在这里插入图片描述
从所有页里提取打印页,这是比老的设计合理的部分,因为合理设计,极大的简化了打印和打印预览的实现逻辑。
在这里插入图片描述

打印业务代码

import JRT.Core.Dto.OutParam;
import JRT.Core.Dto.PrintElement;
import JRT.Core.Util.PrintDrawProtocol;
import JRTBLLBase.BaseHttpHandlerNoSession;
import JRTBLLBase.Helper;import java.awt.*;
import java.util.ArrayList;
import java.util.List;/*** 输出符合打印元素绘制协议的打印元素数据,来供打印执行层打印*/
public class PrintBarCodeTest extends BaseHttpHandlerNoSession {/*** 按传入的RowID输出符合打印元素绘制协议的数据来实现打印控制* @param RowID 业务主键* @param P1* @param P2* @param P3* @param P4* @param P5* @param P6* @param P7* @param P8* @param P9* @param P10* @param P11* @param P12* @param P13* @param Session* @param Output* @return*/public String GetData(String RowID, String P1, String P2, String P3, String P4, String P5, String P6, String P7, String P8, String P9, String P10, String P11, String P12, String P13, OutParam Session, OutParam Output) throws  Exception{List<PrintElement> retList=new ArrayList<>();//画一个文本retList.add(PrintDrawProtocol.DrawLabel(20,20,"zhanglianzhu","宋体",12,"", null,"","0"));//画一个条码retList.add(PrintDrawProtocol.DrawBarCode(20,50,"0947809",true,5,30,"","宋体",12,"",null,"","0"));//换一根横线retList.add(PrintDrawProtocol.DrawLine(20,70,70,70,1,"",""));//换一根竖线retList.add(PrintDrawProtocol.DrawLine(50,10,50,470,1,"",""));//绘制一个条码retList.add(PrintDrawProtocol.DrawQRCode(20,90,"jbase",90,90));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(20,210,"jbase打印支持","宋体",12,"",null,"","0"));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(20,230,"20231118 22:49","宋体",12,"",null,"","0"));//画一个点retList.add(PrintDrawProtocol.DrawPoint(20,270,10,10,"o",""));retList.add(PrintDrawProtocol.DrawPoint(100,270,10,10,"[]",""));retList.add(PrintDrawProtocol.DrawPoint(200,270,10,10,"<>",""));//画多边形List<Point> pointList=new ArrayList<>();Point p1=new Point();p1.x=10;p1.y=300;pointList.add(p1);Point p2=new Point();p2.x=100;p2.y=310;pointList.add(p2);Point p3=new Point();p3.x=50;p3.y=360;pointList.add(p3);retList.add(PrintDrawProtocol.DrawPoly(pointList,""));//画复选框retList.add(PrintDrawProtocol.DrawCheckBox(10,400,true,30,30));//画单选框retList.add(PrintDrawProtocol.DrawRadio(60,400,true,30,30));//画复选框retList.add(PrintDrawProtocol.DrawCheckBox(110,400,false,30,30));//画单选框retList.add(PrintDrawProtocol.DrawRadio(160,400,false,30,30));//换页retList.add(PrintDrawProtocol.ChangePage());//画一个文本retList.add(PrintDrawProtocol.DrawLabel(10,10,"这是打印的第二页","宋体",12,"", null,"","0"));//画一个条码retList.add(PrintDrawProtocol.DrawBarCode(10,50,"0947809",true,5,30,"","宋体",12,"",null,"","0"));//换一根横线retList.add(PrintDrawProtocol.DrawLine(10,70,70,70,1,"",""));//换一根竖线retList.add(PrintDrawProtocol.DrawLine(50,10,50,470,1,"",""));//绘制一个条码retList.add(PrintDrawProtocol.DrawQRCode(10,90,"jbase",90,90));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10,210,"jbase打印支持","宋体",12,"",null,"","0"));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10,230,"20231119","宋体",12,"",null,"","0"));//换页retList.add(PrintDrawProtocol.ChangePage());//画一个文本retList.add(PrintDrawProtocol.DrawLabel(10,10,"这是打印的第三页","宋体",12,"", null,"","0"));//画一个条码retList.add(PrintDrawProtocol.DrawBarCode(10,50,"0947809",true,5,30,"","宋体",12,"",null,"","0"));//换一根横线retList.add(PrintDrawProtocol.DrawLine(10,70,70,70,1,"",""));//换一根竖线retList.add(PrintDrawProtocol.DrawLine(50,10,50,470,1,"",""));//绘制一个条码retList.add(PrintDrawProtocol.DrawQRCode(10,90,"jbase",90,90));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10,210,"jbase打印支持","宋体",12,"",null,"","0"));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10,230,"20231119","宋体",12,"",null,"","0"));//换页retList.add(PrintDrawProtocol.ChangePage());//画一个文本retList.add(PrintDrawProtocol.DrawLabel(10,10,"这是打印的第四页","宋体",12,"", null,"","0"));//画一个条码retList.add(PrintDrawProtocol.DrawBarCode(10,50,"0947809",true,5,30,"","宋体",12,"",null,"","0"));//换一根横线retList.add(PrintDrawProtocol.DrawLine(10,70,70,70,1,"",""));//换一根竖线retList.add(PrintDrawProtocol.DrawLine(50,10,50,470,1,"",""));//绘制一个条码retList.add(PrintDrawProtocol.DrawQRCode(10,90,"jbase",90,90));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10,210,"jbase打印支持","宋体",12,"",null,"","0"));//绘制一个条码retList.add(PrintDrawProtocol.DrawLabel(10,230,"20231206","宋体",12,"",null,"","0"));//先包一个打印元素绘制协议数据生成的工具类来解决元素约束问题,工具类实现了调用工具类得到标签,条码,文本等return Helper.Object2Json(retList);}
}

到此,JRT的设计目标全部实现,开始我还计划JRTWeb部分到过年左右完成的,JRTClient部分3-5年内实现,速度大大超出预期,也正好借着火候一鼓作气把全部实现了。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/202445.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

海鹰数据 shopee :为Shopee卖家提供的数据分析工具

在如今的电商时代&#xff0c;拥有准确的市场数据和深入的竞争分析是每个卖家成功的关键。为了帮助Shopee卖家更好地了解市场趋势、优化商品策略并提高运营效果&#xff0c;海鹰数据&#xff08;Haiying Data&#xff09;应运而生。作为一个专注于Shopee平台的数据分析工具&…

【日常总结】树莓派导致的公司无法上网 - 广播风暴

一、场景 二、问题 三、分析原因 四、解决方案 方案一&#xff1a;更换树莓派后ping路由器恢复正常 方案二&#xff1a;配置交换机 交换机广播风暴配置 也可以通过PPS来限速 查看配置 一、场景 宽带&#xff1a;公司3条500M光纤-联通 路由器&#xff1a;锐捷 在线用户…

VMware vSphere Web Services SDK 6.5编程指南(译文)

VMware vSphere Web Services SDK 6.5编程指南(译文) 本文档根据VMware vSphere 6.5 Documentation Center进行翻译整理&#xff0c;总共八章共110页。 先申明该译文文档非免费&#xff0c;有需要的可以联系(私信或微信)译者&#xff0c;文章尾部留也有联系方式。 目录 … ……

SAP MM中的科目分配类别是什么,如何配置

一、概述 这篇文章将概述 SAP MM 中的科目分配类别的基本概念以及如何在系统中配置它。我将在SAP配置中逐步解释配置。在此之前要理解采购的两种模式&#xff0c;库存物料采购和消耗型物料采购之间的区别。 1.1、库存采购 库存采购的物料&#xff0c;在收货后做库存管理&…

java WebSocket带参数处理使用

1、webSocket实现代码 Component public class WebSocketStompConfig {//这个bean的注册,用于扫描带有ServerEndpoint的注解成为websocket// ,如果你使用外置的tomcat就不需要该配置文件Beanpublic ServerEndpointExporter serverEndpointExporter() {return new ServerEndpoi…

NDIS协议驱动开发指南

文章目录 NDIS协议驱动开发指南1. 技术概览2. NDIS协议驱动2.1 BindAdapterHandlerEx2.2 SendNetBufferListsCompleteHandler2.3 ReceiveNetBufferListsHandler2.4 ProtocolNetPnpEvent 3. NET_BUFFER_LIST4. ndisprot实例5. 总结 NDIS协议驱动开发指南 我们知道&#xff0c;在…

【Proteus】绘制简单的电路图

参考书籍&#xff1a;微机原理与接口技术——基于8086和Proteus仿真&#xff08;第3版&#xff09;&#xff08;作者&#xff1a;顾晖等&#xff09;&#xff0c;p111 1.放置元件 以8086为例&#xff1a; 确保处于元件模式&#xff0c;点击对应的按钮&#xff1a; 在元件库中…

PyQt6 QGroupBox分组框控件

​锋哥原创的PyQt6视频教程&#xff1a; 2024版 PyQt6 Python桌面开发 视频教程(无废话版) 玩命更新中~_哔哩哔哩_bilibili2024版 PyQt6 Python桌面开发 视频教程(无废话版) 玩命更新中~共计37条视频&#xff0c;包括&#xff1a;2024版 PyQt6 Python桌面开发 视频教程(无废话…

Python自动化测试selenium核心技术处理弹框

页面上的弹框一般有三种&#xff1a; &#xff08;1&#xff09;alert&#xff1a;用来提示 &#xff08;2&#xff09;confirm&#xff1a;用来确认 &#xff08;2&#xff09;prompt&#xff1a;输入内容 示例网站&#xff1a;Sahi Tests 示例场景&#xff1a;打开Sahi T…

深入了解 CPU 的型号、代际架构与微架构!

CPU 在整个计算机硬件中、技术体系中都算是最最重要的东西了。在 10 月 16 号的时候&#xff0c;Intel 正式发布了第 14 代的酷睿处理器。但很多同学看不懂这种发布会上发布的各种 CPU 参数。 今天借着这个时机&#xff0c;从 CPU 硬件相关的技术细节切入&#xff0c;来深入地…

基于SSM的物资物流系统

末尾获取源码 开发语言&#xff1a;Java Java开发工具&#xff1a;JDK1.8 后端框架&#xff1a;SSM 前端&#xff1a;Vue 数据库&#xff1a;MySQL5.7和Navicat管理工具结合 服务器&#xff1a;Tomcat8.5 开发软件&#xff1a;IDEA / Eclipse 是否Maven项目&#xff1a;是 目录…

Distilling the Knowledge in a Neural Network(2015.5)(d补)

文章目录 Abstract1 Introduction2 Distillation2.1 Matching logits is a special case of distillation Results 论文链接 Abstract 提高几乎所有机器学习算法性能的一种非常简单的方法是在相同的数据上训练许多不同的模型&#xff0c;然后对它们的预测进行平均[3]。不幸的是…

C++之类和对象(下)

目录 初始化列表 static成员 C11对于非静态成员变量初始化 友元 友元函数 友元类 总结 初始化列表 我们知道&#xff0c;在学习构造函数时&#xff0c;我们知道对象的成员变量的初始化我们是在构造函数函数体内进行初始化的&#xff0c;还有没有其它初始化成员变量的方…

【Linux】telnet命令使用

telnet命令 telnet命令用于使用telnet协议与另一台主机进行通信。如果在没有主机参数的情况下调用telnet&#xff0c;它将进入命令模式&#xff0c;由其提示&#xff08;telnet>&#xff09;指示。在这种模式下&#xff0c;它接受并执行下面列出的命令。如果使用参数调用它…

数字化时代的保镖:实人认证API在身份验证中的角色

前言 随着数字化时代的迅猛发展&#xff0c;个人信息的安全性和隐私保护成为了当今社会中备受关注的话题。在这个背景下&#xff0c;实人认证API崭露头角&#xff0c;成为数字领域中的一项重要技术&#xff0c;为身份验证提供了全新的保障机制。本文将探讨实人认证API在身份验…

本地启动tomcat,打印的日志中中文乱码

修改配置文件 /conf/logging.properties 修改配置项 java.util.logging.ConsoleHandler.encoding 从UTF-8改成GBK

力扣226:翻转二叉树

力扣226&#xff1a;翻转二叉树 给你一棵二叉树的根节点 root &#xff0c;翻转这棵二叉树&#xff0c;并返回其根节点。 示例 1&#xff1a; 输入&#xff1a;root [4,2,7,1,3,6,9] 输出&#xff1a;[4,7,2,9,6,3,1] 示例 2&#xff1a; 输入&#xff1a;root [2,1,3]…

git submodule 用法

子仓库启蒙 在根目录执行&#xff1a; git submodule add gitgitee.com:liaosp/dcat-admin-basic-interface.git想要子模块指定的分支&#xff1a; git submodule add -b dev <仓库地址> <子模块路径>这样相当于在根目录上添加了 .gitmodules 信息&#xff0c;相…

如何制定开发计划

如何制定开发计划&#xff0c;很多开发主管跟项目经理在评估开发计划时喜欢把开发叫起来一块评估&#xff0c;结果会发现&#xff0c;三天时间能做好的功能&#xff0c;底下人&#xff08;特别是一些老油条&#xff09;总是会各种理由做不完要五天&#xff0c;其实这是人之常情…

CTF 6

信息收集 话不多说&#xff0c;nmap进行信息收集&#xff01; 存活主机探测 服务版本探测 端口探测 漏洞脚本探测 UDP端口探测 渗透测试 先看看网站的首页&#xff0c;发现了几个用户&#xff1a; 直接先保存下来吧&#xff0c;以防后面会用到。 SQL注入 看到一个read mor…