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);