mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-10 13:00:02 +08:00
Merge branch 'dev-new-rabbitmq' into dev
This commit is contained in:
@@ -5,7 +5,7 @@ import com.jsowell.common.annotation.Anonymous;
|
|||||||
import com.jsowell.common.core.controller.BaseController;
|
import com.jsowell.common.core.controller.BaseController;
|
||||||
import com.jsowell.common.response.RestApiResponse;
|
import com.jsowell.common.response.RestApiResponse;
|
||||||
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
|
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
|
||||||
import com.jsowell.thirdparty.ruanjie.service.RJService;
|
import com.jsowell.thirdparty.parking.service.RJService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ import com.jsowell.thirdparty.common.NotificationDTO;
|
|||||||
import com.jsowell.thirdparty.common.NotificationService;
|
import com.jsowell.thirdparty.common.NotificationService;
|
||||||
import com.jsowell.thirdparty.huawei.HuaWeiService;
|
import com.jsowell.thirdparty.huawei.HuaWeiService;
|
||||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||||
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
|
import com.jsowell.thirdparty.parking.service.LTYTService;
|
||||||
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
||||||
import com.jsowell.thirdparty.platform.util.Cryptos;
|
import com.jsowell.thirdparty.platform.util.Cryptos;
|
||||||
import com.jsowell.thirdparty.platform.util.Encodes;
|
import com.jsowell.thirdparty.platform.util.Encodes;
|
||||||
|
|||||||
@@ -661,36 +661,7 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler {
|
|||||||
log.error("结算订单发生异常 orderCode:{}", orderBasicInfo.getOrderCode(), e);
|
log.error("结算订单发生异常 orderCode:{}", orderBasicInfo.getOrderCode(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 异步绑定第三方平台优惠券
|
|
||||||
OrderBasicInfo finalOrderBasicInfo = orderBasicInfo;
|
OrderBasicInfo finalOrderBasicInfo = orderBasicInfo;
|
||||||
String redisKey = CacheConstants.CAR_BIND_COUPON_BY_ORDER_CODE + orderBasicInfo.getOrderCode();
|
|
||||||
Object cacheObject = redisCache.getCacheObject(redisKey);
|
|
||||||
if (cacheObject == null) {
|
|
||||||
CompletableFuture.runAsync(() -> {
|
|
||||||
try {
|
|
||||||
String bindResult = commonService.bindCoupon(finalOrderBasicInfo);
|
|
||||||
log.info("绑定优惠券 订单信息:{}, result:{}", finalOrderBasicInfo, bindResult);
|
|
||||||
// 删除绑定优惠券缓存
|
|
||||||
redisCache.deleteObject(redisKey);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("绑定优惠券 error,", e);
|
|
||||||
}
|
|
||||||
}, executor);
|
|
||||||
}
|
|
||||||
|
|
||||||
// // 给车辆绑定优惠券
|
|
||||||
// try {
|
|
||||||
// // 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) {
|
|
||||||
// log.error("绑定优惠券 error,", e);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 异步推送第三方平台订单信息
|
// 异步推送第三方平台订单信息
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
@@ -698,7 +669,6 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler {
|
|||||||
commonService.commonPushOrderInfo(finalOrderBasicInfo);
|
commonService.commonPushOrderInfo(finalOrderBasicInfo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("推送第三方平台订单信息error, ", e);
|
log.error("推送第三方平台订单信息error, ", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}, executor);
|
}, executor);
|
||||||
|
|
||||||
@@ -708,7 +678,6 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler {
|
|||||||
commonService.commonPushOrderInfoV2(finalOrderBasicInfo);
|
commonService.commonPushOrderInfoV2(finalOrderBasicInfo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("推送第三方平台订单信息error, ", e);
|
log.error("推送第三方平台订单信息error, ", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}, executor);
|
}, executor);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -322,28 +322,28 @@ public class UploadRealTimeMonitorHandler extends AbstractYkcHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 判断该订单是否需要下发优惠券
|
// 判断该订单是否需要下发优惠券
|
||||||
String redisKey = CacheConstants.CAR_BIND_COUPON_BY_ORDER_CODE + orderInfo.getOrderCode();
|
// String redisKey = CacheConstants.CAR_BIND_COUPON_BY_ORDER_CODE + orderInfo.getOrderCode();
|
||||||
Object cacheObject = redisCache.getCacheObject(redisKey);
|
// Object cacheObject = redisCache.getCacheObject(redisKey);
|
||||||
if (cacheObject == null && sumChargingTime >= 10) {
|
// if (cacheObject == null && sumChargingTime >= 10) {
|
||||||
// 异步绑定优惠券并设置缓存
|
// // 异步绑定优惠券并设置缓存
|
||||||
CompletableFuture.runAsync(() -> {
|
// CompletableFuture.runAsync(() -> {
|
||||||
try {
|
// try {
|
||||||
commonService.bindCoupon(orderInfo);
|
// commonService.bindCoupon(orderInfo);
|
||||||
redisCache.setCacheObject(redisKey, Boolean.TRUE, 24, TimeUnit.HOURS);
|
// redisCache.setCacheObject(redisKey, Boolean.TRUE, 24, TimeUnit.HOURS);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
log.error("异步绑定车辆优惠券 error,", e);
|
// log.error("异步绑定车辆优惠券 error,", e);
|
||||||
}
|
// }
|
||||||
}, executor);
|
// }, executor);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 异步绑定优惠券
|
// 异步绑定优惠券
|
||||||
// CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
// try {
|
try {
|
||||||
// commonService.bindParkingCoupon(realTimeMonitorData, orderInfo);
|
commonService.bindParkingCoupon(realTimeMonitorData, orderInfo);
|
||||||
// } catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// log.error("异步绑定车辆停车优惠券error", e);
|
log.error("异步绑定车辆停车优惠券error", e);
|
||||||
// }
|
}
|
||||||
// }, executor);
|
}, executor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 充电时保存实时数据到redis
|
// 充电时保存实时数据到redis
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ import com.jsowell.pile.vo.web.ChargeParkingDiscountVO;
|
|||||||
import com.jsowell.pile.vo.web.PileStationVO;
|
import com.jsowell.pile.vo.web.PileStationVO;
|
||||||
import com.jsowell.thirdparty.huawei.HuaweiServiceV2;
|
import com.jsowell.thirdparty.huawei.HuaweiServiceV2;
|
||||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||||
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
|
import com.jsowell.thirdparty.parking.service.LTYTService;
|
||||||
import com.jsowell.thirdparty.nanrui.service.NRService;
|
import com.jsowell.thirdparty.nanrui.service.NRService;
|
||||||
import com.jsowell.thirdparty.platform.service.impl.DianXingPlatformServiceImpl;
|
import com.jsowell.thirdparty.platform.service.impl.DianXingPlatformServiceImpl;
|
||||||
import com.jsowell.thirdparty.platform.service.impl.HaiNanPlatformServiceImpl;
|
import com.jsowell.thirdparty.platform.service.impl.HaiNanPlatformServiceImpl;
|
||||||
import com.jsowell.thirdparty.platform.service.impl.NingXiaPlatformServiceImpl;
|
import com.jsowell.thirdparty.platform.service.impl.NingXiaPlatformServiceImpl;
|
||||||
import com.jsowell.thirdparty.platform.service.impl.QingHaiPlatformServiceImpl;
|
import com.jsowell.thirdparty.platform.service.impl.QingHaiPlatformServiceImpl;
|
||||||
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
|
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
|
||||||
import com.jsowell.thirdparty.ruanjie.service.RJService;
|
import com.jsowell.thirdparty.parking.service.RJService;
|
||||||
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
||||||
import com.jsowell.thirdparty.xindiantu.service.XDTService;
|
import com.jsowell.thirdparty.xindiantu.service.XDTService;
|
||||||
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
|
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.lutongyunting.common;
|
package com.jsowell.thirdparty.parking.common;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.lutongyunting.common;
|
package com.jsowell.thirdparty.parking.common;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.lutongyunting.service;
|
package com.jsowell.thirdparty.parking.service;
|
||||||
|
|
||||||
import com.jsowell.pile.dto.lutongyunting.BindCouponDTO;
|
import com.jsowell.pile.dto.lutongyunting.BindCouponDTO;
|
||||||
import com.jsowell.pile.dto.lutongyunting.GetTokenDTO;
|
import com.jsowell.pile.dto.lutongyunting.GetTokenDTO;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.ruanjie.service;
|
package com.jsowell.thirdparty.parking.service;
|
||||||
|
|
||||||
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
|
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jsowell.thirdparty.lutongyunting.service.impl;
|
package com.jsowell.thirdparty.parking.service.impl;
|
||||||
|
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
@@ -14,8 +14,7 @@ import com.jsowell.pile.domain.OrderBasicInfo;
|
|||||||
import com.jsowell.pile.dto.lutongyunting.BindCouponDTO;
|
import com.jsowell.pile.dto.lutongyunting.BindCouponDTO;
|
||||||
import com.jsowell.pile.dto.lutongyunting.GetTokenDTO;
|
import com.jsowell.pile.dto.lutongyunting.GetTokenDTO;
|
||||||
import com.jsowell.pile.service.CarCouponRecordService;
|
import com.jsowell.pile.service.CarCouponRecordService;
|
||||||
import com.jsowell.thirdparty.lutongyunting.common.LTYTCommonParams;
|
import com.jsowell.thirdparty.parking.service.LTYTService;
|
||||||
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.jsowell.thirdparty.ruanjie.service.impl;
|
package com.jsowell.thirdparty.parking.service.impl;
|
||||||
|
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.jsowell.common.util.sign.MD5Util;
|
import com.jsowell.common.util.sign.MD5Util;
|
||||||
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
|
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
|
||||||
import com.jsowell.thirdparty.lutongyunting.service.impl.LTYTServiceImpl;
|
import com.jsowell.thirdparty.parking.service.impl.LTYTServiceImpl;
|
||||||
import com.jsowell.thirdparty.ruanjie.service.RJService;
|
import com.jsowell.thirdparty.parking.service.RJService;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
Reference in New Issue
Block a user