From 7f293ba7bf96688f40a75a7a530e5b299d64b42e Mon Sep 17 00:00:00 2001 From: hu177768073 <177768073@qq.com> Date: Wed, 18 Sep 2024 18:00:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bweb/controller/TestController.java | 24 +++++++++++++++++++ .../hfkj/device/sanmisen/PrinterTemplate.java | 12 +++++++--- .../hfkj/device/spyun/SpPrinterTemplate.java | 24 +++++++++---------- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/bweb/src/main/java/com/bweb/controller/TestController.java b/bweb/src/main/java/com/bweb/controller/TestController.java index d463d7e..caef57e 100644 --- a/bweb/src/main/java/com/bweb/controller/TestController.java +++ b/bweb/src/main/java/com/bweb/controller/TestController.java @@ -18,6 +18,7 @@ import com.hfkj.entity.BsGasOrder; import com.hfkj.entity.SecUser; import com.hfkj.model.GasClassGroupTaskDataCount; import com.hfkj.model.ResponseData; +import com.hfkj.service.BsDeviceService; import com.hfkj.service.gas.BsGasClassGroupTaskService; import com.hfkj.service.gas.BsGasOrderService; import com.hfkj.service.sec.SecUserLoginLogService; @@ -47,6 +48,9 @@ public class TestController { @Resource private SecUserLoginLogService secUserLoginLogService; + @Resource + private BsDeviceService deviceService; + @RequestMapping(value="gasSyncPayment",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "壳牌推送") @@ -75,6 +79,26 @@ public class TestController { } } + + @RequestMapping(value="printOrder",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "壳牌推送") + public ResponseData printOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { + try { + // 查询加油订单 + BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(orderNo); + if (gasOrder == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的加油的订单"); + } + deviceService.printGasOrder(gasOrder.getMerId(), gasOrder, true); + return ResponseMsgUtil.success(""); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + @Resource private MqttProviderConfig mqttProviderConfig; @Resource diff --git a/service/src/main/java/com/hfkj/device/sanmisen/PrinterTemplate.java b/service/src/main/java/com/hfkj/device/sanmisen/PrinterTemplate.java index 5663c33..0232127 100644 --- a/service/src/main/java/com/hfkj/device/sanmisen/PrinterTemplate.java +++ b/service/src/main/java/com/hfkj/device/sanmisen/PrinterTemplate.java @@ -236,18 +236,21 @@ public class PrinterTemplate { JSONObject gunNo = new JSONObject(); gunNo.put("cont", "油枪:" + gasOrder.getGasGunNo()+"号"); gunNo.put("type", "text"); + gunNo.put("size", "11"); contents.add(gunNo); // 油品 JSONObject oilNo = new JSONObject(); oilNo.put("cont", "油品:" + gasOrder.getGasOilNo()+"#"); oilNo.put("type", "text"); + oilNo.put("size", "11"); contents.add(oilNo); // 升数 JSONObject oilLiters = new JSONObject(); oilLiters.put("cont", "升数:" + gasOrder.getGasOilLiters()+"升"); oilLiters.put("type", "text"); + oilLiters.put("size", "11"); contents.add(oilLiters); // 升数描述 @@ -264,14 +267,16 @@ public class PrinterTemplate { // 加油金额 JSONObject refuelPrice = new JSONObject(); - refuelPrice.put("cont", "加油金额:" + gasOrder.getGasRefuelPrice()+"元"); + refuelPrice.put("cont", "加油金额:" + gasOrder.getGasRefuelPrice()); refuelPrice.put("type", "text"); + refuelPrice.put("size", "11"); contents.add(refuelPrice); // 优惠金额 JSONObject discountPrice = new JSONObject(); - discountPrice.put("cont", "优惠金额:" + gasOrder.getTotalDeductionPrice()+"元"); + discountPrice.put("cont", "优惠金额:" + gasOrder.getTotalDeductionPrice()); discountPrice.put("type", "text"); + discountPrice.put("size", "11"); contents.add(discountPrice); // 分割线 @@ -282,8 +287,9 @@ public class PrinterTemplate { // 实际支付 JSONObject actualPayment = new JSONObject(); - actualPayment.put("cont", "实际支付:" + gasOrder.getActualPayPrice()+"元"); + actualPayment.put("cont", "实际支付:" + gasOrder.getActualPayPrice()); actualPayment.put("type", "text"); + actualPayment.put("size", "11"); contents.add(actualPayment); /* // 加油金额标题 diff --git a/service/src/main/java/com/hfkj/device/spyun/SpPrinterTemplate.java b/service/src/main/java/com/hfkj/device/spyun/SpPrinterTemplate.java index 93af2f2..6fe95fe 100644 --- a/service/src/main/java/com/hfkj/device/spyun/SpPrinterTemplate.java +++ b/service/src/main/java/com/hfkj/device/spyun/SpPrinterTemplate.java @@ -81,15 +81,15 @@ public class SpPrinterTemplate { "支付时间:" + payTime + "
" + "电话:" + (StringUtils.isNotBlank(phone)?phone.substring(0, 3) + "****" + phone.substring(7):"") + "
" + "来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨加油")+ "
" + - "油枪:"+ gunNo + "号
" + - "油品:" + oilNo + "#
" + - "升数:" + oilLiters +"升
" + + "油枪:"+ gunNo + "号
" + + "油品:" + oilNo + "#
" + + "升数:" + oilLiters +"升
" + "实际加油升数以油站加油机为准!
" + "------------------------------
" + - "加油金额:"+ orderPrice + "元
" + - "优惠金额:" + discountPrice + "元
" + + "加油金额:"+ orderPrice + "
" + + "优惠金额:" + discountPrice + "
" + "------------------------------
" + - "实际支付:" + actualPayment +"元
" + + "实际支付:" + actualPayment +"
" + /* "加油金额
" + "¥" + orderPrice + "元
" +*/ "------------------------------
" + @@ -132,15 +132,15 @@ public class SpPrinterTemplate { "支付时间:" + payTime + "
" + "电话:" + (StringUtils.isNotBlank(phone)?phone.substring(0, 3) + "****" + phone.substring(7):"") + "
" + "来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨加油")+ "
" + - "油枪:"+ gunNo + "号
" + - "油品:" + oilNo + "#
" + - "升数:" + oilLiters +"升
" + + "油枪:"+ gunNo + "号
" + + "油品:" + oilNo + "#
" + + "升数:" + oilLiters +"升
" + "实际加油升数以油站加油机为准!
" + "------------------------------
" + - "加油金额:"+ orderPrice + "元
" + - "优惠金额:" + discountPrice + "元
" + + "加油金额:"+ orderPrice + "
" + + "优惠金额:" + discountPrice + "
" + "------------------------------
" + - "实际支付:" + actualPayment +"元
" + + "实际支付:" + actualPayment +"
" + /* "加油金额
" + "¥" + orderPrice + "元
" +*/ "------------------------------
" +