diff --git a/bweb/src/main/java/com/bweb/controller/TestController.java b/bweb/src/main/java/com/bweb/controller/TestController.java index caef57e..970788e 100644 --- a/bweb/src/main/java/com/bweb/controller/TestController.java +++ b/bweb/src/main/java/com/bweb/controller/TestController.java @@ -50,6 +50,34 @@ public class TestController { @Resource private BsDeviceService deviceService; + @Resource + private BsGasOrderService gasOrderService; + + @RequestMapping(value="testDevice",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "testDevice") + public ResponseData testDevice(@RequestParam(name = "deviceNo", required = true) String deviceNo) { + try { + BsGasOrder gasOrder = JSONObject.parseObject("{\"abnormal\":false,\"actualPayPrice\":452.83,\"agentId\":13,\"agentName\":\"胡某\",\"agentStaffId\":190,\"agentStaffName\":\"袁业务员\",\"channelType\":1,\"createTime\":1728460158000,\"deductionCouponPrice\":0.00,\"deductionOilPrice\":47.17,\"gasAgentSettlePrice\":452.83,\"gasClassGroupId\":26,\"gasClassGroupName\":\"中班\",\"gasClassGroupTaskId\":188,\"gasDiscount\":0.9684,\"gasGunNo\":\"1\",\"gasLitersPreferences\":0.80,\"gasOilLiters\":58.96,\"gasOilNo\":\"92\",\"gasOilSubsidy\":0.00,\"gasOilType\":1,\"gasPriceGun\":8.48,\"gasPriceOfficial\":8.48,\"gasPricePlatform\":7.68,\"gasPricePreferences\":7.68,\"gasPriceVip\":7.93,\"gasRefuelPrice\":500.00,\"gasServiceFeePrice\":0.00,\"gasServiceFeeRate\":0.00,\"gasSettlePrice\":467.57,\"id\":25691,\"merAddress\":\"四川省南充市顺庆区南充北站\",\"merId\":19,\"merName\":\"R的油站\",\"merNo\":\"10019\",\"orderChildNo\":\"4301992\",\"orderNo\":\"241009154917861199\",\"payChannelOrderNo\":\"83620241009737898443\",\"payIntegral\":0,\"paySerialNo\":\"4200002424202410091052109539\",\"payTime\":1728460168000,\"payType\":2,\"payablePrice\":452.83,\"receiptStatus\":0,\"refundRemarks\":\"\",\"refundTime\":1728460376000,\"status\":4,\"totalDeductionPrice\":47.17}",BsGasOrder.class); + + Map receiptMap = new HashMap<>(); + + JSONObject param = new JSONObject(); + param.put("id", System.currentTimeMillis()); + param.put("type", 5); + param.put("vType", 0); + param.put("vMessage", "嗨加油新订单,加油金额"+gasOrder.getGasRefuelPrice()+"元,请注意查收"); + param.put("contents", PrinterTemplate.oilReceipt(1, gasOrder , receiptMap, false)); + + mqttProviderConfig.publish(1, false, deviceNo+"/submsg", param.toJSONString()); + + return ResponseMsgUtil.success(param.toJSONString()); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } @RequestMapping(value="gasSyncPayment",method = RequestMethod.GET) @ResponseBody @@ -101,8 +129,6 @@ public class TestController { @Resource private MqttProviderConfig mqttProviderConfig; - @Resource - private BsGasOrderService gasOrderService; @Resource private BsGasClassGroupTaskService gasClassGroupTaskService;