From 8bf3cddf92e5cb4ba5ff53b623a38fecf838e451 Mon Sep 17 00:00:00 2001 From: Lemon Date: Thu, 21 Sep 2023 09:03:19 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20=20=E5=85=85=E7=94=B5=E5=BA=A6?= =?UTF-8?q?=E6=95=B0=E8=BE=BE=E5=88=B010=E5=BA=A6=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=E6=89=8D=E7=BB=91=E5=AE=9A=E4=BC=98=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../netty/handler/TransactionRecordsRequestHandler.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/handler/TransactionRecordsRequestHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/handler/TransactionRecordsRequestHandler.java index cbbd9a2bb..3eac94636 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/handler/TransactionRecordsRequestHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/handler/TransactionRecordsRequestHandler.java @@ -35,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.io.UnsupportedEncodingException; +import java.math.BigDecimal; import java.util.Date; import java.util.Objects; @@ -655,8 +656,12 @@ public class TransactionRecordsRequestHandler extends AbstractHandler { // 给车辆绑定优惠券 try { - String bindResult = bindCoupon(orderBasicInfo); - log.info("绑定优惠券 订单信息:{}, result:{}", orderBasicInfo, bindResult); + BigDecimal totalElectricity = new BigDecimal(data.getTotalElectricity()); + if (totalElectricity.compareTo(BigDecimal.TEN) > 0 ) { + // 充电度数大于10度 + String bindResult = bindCoupon(orderBasicInfo); + log.info("绑定优惠券 订单信息:{}, result:{}", orderBasicInfo, bindResult); + } }catch (BusinessException e) { log.error("绑定优惠券 error, code:{}, msg:{}", e.getCode(), e.getMessage()); } catch (Exception e) {