update 充电度数达到10度以上才绑定优惠券

This commit is contained in:
Lemon
2023-09-21 09:03:19 +08:00
parent 76d0d4bc9a
commit 8bf3cddf92

View File

@@ -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) {