Merge branch 'dev-new-rabbitmq' into dev

This commit is contained in:
Guoqs
2025-02-10 14:34:26 +08:00
11 changed files with 33 additions and 65 deletions

View File

@@ -5,7 +5,7 @@ import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.response.RestApiResponse;
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.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

View File

@@ -77,7 +77,7 @@ import com.jsowell.thirdparty.common.NotificationDTO;
import com.jsowell.thirdparty.common.NotificationService;
import com.jsowell.thirdparty.huawei.HuaWeiService;
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.util.Cryptos;
import com.jsowell.thirdparty.platform.util.Encodes;

View File

@@ -661,36 +661,7 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler {
log.error("结算订单发生异常 orderCode:{}", orderBasicInfo.getOrderCode(), e);
}
// 异步绑定第三方平台优惠券
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(() -> {
@@ -698,7 +669,6 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler {
commonService.commonPushOrderInfo(finalOrderBasicInfo);
} catch (Exception e) {
log.error("推送第三方平台订单信息error, ", e);
e.printStackTrace();
}
}, executor);
@@ -708,7 +678,6 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler {
commonService.commonPushOrderInfoV2(finalOrderBasicInfo);
} catch (Exception e) {
log.error("推送第三方平台订单信息error, ", e);
e.printStackTrace();
}
}, executor);
} else {

View File

@@ -322,28 +322,28 @@ public class UploadRealTimeMonitorHandler extends AbstractYkcHandler {
}
// 判断该订单是否需要下发优惠券
String redisKey = CacheConstants.CAR_BIND_COUPON_BY_ORDER_CODE + orderInfo.getOrderCode();
Object cacheObject = redisCache.getCacheObject(redisKey);
if (cacheObject == null && sumChargingTime >= 10) {
// 异步绑定优惠券并设置缓存
CompletableFuture.runAsync(() -> {
try {
commonService.bindCoupon(orderInfo);
redisCache.setCacheObject(redisKey, Boolean.TRUE, 24, TimeUnit.HOURS);
} catch (Exception e) {
log.error("异步绑定车辆优惠券 error,", e);
}
}, executor);
}
// String redisKey = CacheConstants.CAR_BIND_COUPON_BY_ORDER_CODE + orderInfo.getOrderCode();
// Object cacheObject = redisCache.getCacheObject(redisKey);
// if (cacheObject == null && sumChargingTime >= 10) {
// // 异步绑定优惠券并设置缓存
// CompletableFuture.runAsync(() -> {
// try {
// commonService.bindCoupon(orderInfo);
// redisCache.setCacheObject(redisKey, Boolean.TRUE, 24, TimeUnit.HOURS);
// } catch (Exception e) {
// log.error("异步绑定车辆优惠券 error,", e);
// }
// }, executor);
// }
// 异步绑定优惠券
// CompletableFuture.runAsync(() -> {
// try {
// commonService.bindParkingCoupon(realTimeMonitorData, orderInfo);
// } catch (Exception e) {
// log.error("异步绑定车辆停车优惠券error", e);
// }
// }, executor);
CompletableFuture.runAsync(() -> {
try {
commonService.bindParkingCoupon(realTimeMonitorData, orderInfo);
} catch (Exception e) {
log.error("异步绑定车辆停车优惠券error", e);
}
}, executor);
}
// 充电时保存实时数据到redis

View File

@@ -34,14 +34,14 @@ import com.jsowell.pile.vo.web.ChargeParkingDiscountVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.thirdparty.huawei.HuaweiServiceV2;
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.platform.service.impl.DianXingPlatformServiceImpl;
import com.jsowell.thirdparty.platform.service.impl.HaiNanPlatformServiceImpl;
import com.jsowell.thirdparty.platform.service.impl.NingXiaPlatformServiceImpl;
import com.jsowell.thirdparty.platform.service.impl.QingHaiPlatformServiceImpl;
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.xindiantu.service.XDTService;
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.lutongyunting.common;
package com.jsowell.thirdparty.parking.common;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.lutongyunting.common;
package com.jsowell.thirdparty.parking.common;
import lombok.Data;

View File

@@ -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.GetTokenDTO;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.ruanjie.service;
package com.jsowell.thirdparty.parking.service;
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;

View File

@@ -1,4 +1,4 @@
package com.jsowell.thirdparty.lutongyunting.service.impl;
package com.jsowell.thirdparty.parking.service.impl;
import cn.hutool.http.HttpUtil;
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.GetTokenDTO;
import com.jsowell.pile.service.CarCouponRecordService;
import com.jsowell.thirdparty.lutongyunting.common.LTYTCommonParams;
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
import com.jsowell.thirdparty.parking.service.LTYTService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -1,12 +1,12 @@
package com.jsowell.thirdparty.ruanjie.service.impl;
package com.jsowell.thirdparty.parking.service.impl;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.jsowell.common.util.sign.MD5Util;
import com.jsowell.pile.dto.ruanjie.UseCouponDTO;
import com.jsowell.thirdparty.lutongyunting.service.impl.LTYTServiceImpl;
import com.jsowell.thirdparty.ruanjie.service.RJService;
import com.jsowell.thirdparty.parking.service.impl.LTYTServiceImpl;
import com.jsowell.thirdparty.parking.service.RJService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;