From eb983fef76ab8a07749aa4309be95acd88433e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E6=96=87=E8=B4=A2?= Date: Mon, 19 May 2025 20:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=BB=88=E7=AB=AF=E5=8F=B7?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ReceiptPrintController.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/dpkj/modules/autoReplyPrint/controller/ReceiptPrintController.java b/src/main/java/com/dpkj/modules/autoReplyPrint/controller/ReceiptPrintController.java index d21d49c..3a3a334 100644 --- a/src/main/java/com/dpkj/modules/autoReplyPrint/controller/ReceiptPrintController.java +++ b/src/main/java/com/dpkj/modules/autoReplyPrint/controller/ReceiptPrintController.java @@ -13,16 +13,19 @@ import com.dpkj.modules.autoReplyPrint.utils.FolderUtils; import com.dpkj.modules.autoReplyPrint.vo.PrinterStatus; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import org.thymeleaf.util.StringUtils; + +import javax.annotation.Resource; import java.io.File; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.text.SimpleDateFormat; import java.util.Date; -import javax.annotation.Resource; - /** * 小票打印机控制层 * @@ -59,10 +62,10 @@ public class ReceiptPrintController { JSONObject data = JSONObject.parseObject(URLDecoder.decode(request.getTemplateFillData(), "UTF-8")); - // 强行设置终端号 - data.put("terminalNumber", printerConfig.getTerminalNumber()); + // 强行设置终端号 不需要固定,前端自己穿 +// data.put("terminalNumber", printerConfig.getTerminalNumber()); - // 强行设置终端号和打印时间 + // 强行设置打印时间 SimpleDateFormat sdf = new SimpleDateFormat(printerConfig.getTimeType()); String formattedDate = sdf.format( new Date()); data.put("printTime", formattedDate);