mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
Merge branch 'dev-zza' into dev
# Conflicts: # jsowell-admin/src/main/java/com/jsowell/service/OrderService.java
This commit is contained in:
@@ -3,12 +3,12 @@ package com.jsowell.api.thirdparty;
|
||||
import com.jsowell.common.annotation.Anonymous;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.thirdparty.platform.dto.BatteryChargeReportDTO;
|
||||
import com.jsowell.thirdparty.platform.service.impl.BatteryChargeReportService;
|
||||
import com.jsowell.thirdparty.platform.service.impl.ChargeAlgorithmService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 算法应用Controller
|
||||
@@ -24,12 +24,20 @@ public class ChargeAlgorithmController extends BaseController {
|
||||
@Autowired
|
||||
private ChargeAlgorithmService chargeAlgorithmService;
|
||||
|
||||
@GetMapping("/pushOrderInfo/{orderCode}")
|
||||
public RestApiResponse<?> pushOrderInfo(@PathVariable("orderCode") String orderCode) {
|
||||
@Autowired
|
||||
private BatteryChargeReportService batteryChargeReportService;
|
||||
|
||||
@PostMapping("/pushOrderInfo")
|
||||
public RestApiResponse<?> pushOrderInfo(@RequestBody BatteryChargeReportDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
String result = chargeAlgorithmService.pushOrderInfo(orderCode);
|
||||
response = new RestApiResponse<>(result);
|
||||
// String result = chargeAlgorithmService.pushOrderInfo(orderCode);
|
||||
String taskId = batteryChargeReportService.getTaskIdByOrderCode(dto.getOrderCode());
|
||||
String url = "";
|
||||
if (StringUtils.isNotBlank(taskId)) {
|
||||
url = batteryChargeReportService.getUrlByTaskId(taskId, dto.getReportType());
|
||||
}
|
||||
response = new RestApiResponse<>(url);
|
||||
}catch (Exception e) {
|
||||
logger.error("算法应用推送订单信息 error, ", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
|
||||
@@ -151,6 +151,9 @@ public class OrderService {
|
||||
@Autowired
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
@Autowired
|
||||
private IOrderInsuranceInfoService orderInsuranceInfoService;
|
||||
|
||||
// 引入线程池
|
||||
private ThreadPoolTaskExecutor executor = SpringUtils.getBean("threadPoolTaskExecutor");
|
||||
|
||||
@@ -1221,10 +1224,18 @@ public class OrderService {
|
||||
}
|
||||
}, executor);
|
||||
|
||||
// 初始化充电金额
|
||||
BigDecimal chargeAmount = amount;
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
BigDecimal insuranceAmount = orderBasicInfo.getInsuranceAmount();
|
||||
if (insuranceAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
// 如果用户支付了保险金额,则充电金额需将保险金额减去
|
||||
chargeAmount = amount.subtract(insuranceAmount).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
// 支付订单成功
|
||||
PayOrderSuccessCallbackDTO callbackDTO = PayOrderSuccessCallbackDTO.builder()
|
||||
.orderCode(orderCode)
|
||||
.payAmount(amount)
|
||||
.payAmount(chargeAmount) // amount
|
||||
// .payMode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())
|
||||
.payMode(payModel)
|
||||
.acquirer(AcquirerEnum.ADAPAY.getValue())
|
||||
|
||||
@@ -249,13 +249,19 @@ parking:
|
||||
orgId: BTTEST01
|
||||
|
||||
# 充电算法平台配置
|
||||
chargeAlgorithm:
|
||||
url: http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json
|
||||
clientId: e488bac5f70b496fa2d82065089e5f81
|
||||
chargeAlgorithm2pdf:
|
||||
url: https://wx.btiger.net/jeecg-boot
|
||||
getTaskIdUrl: /api/docking/api/evaluate
|
||||
getPdfLinkUrl: /api/docking/report/pdf/
|
||||
#chargeAlgorithm:
|
||||
# url: http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json
|
||||
# clientId: e488bac5f70b496fa2d82065089e5f81
|
||||
#chargeAlgorithm2pdf:
|
||||
# url: https://wx.btiger.net/jeecg-boot
|
||||
# getTaskIdUrl: /api/docking/api/evaluate
|
||||
# getPdfLinkUrl: /api/docking/report/pdf/
|
||||
# token: MTc0NzcyMjgwMzg0NC1xNmFucG96cHR4aQ==
|
||||
|
||||
batteryChargeReport:
|
||||
webDomainPrefix: https://wx.btiger.net/jeecg-boot
|
||||
getTaskIdApi: /api/docking/api/evaluate
|
||||
apiPrefix: /api/docking/report/
|
||||
token: MTc0NzcyMjgwMzg0NC1xNmFucG96cHR4aQ==
|
||||
|
||||
# dubbo配置
|
||||
|
||||
@@ -244,13 +244,19 @@ parking:
|
||||
orgId: DCWYPROD20250210
|
||||
|
||||
# 充电算法平台配置
|
||||
chargeAlgorithm:
|
||||
url: http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json
|
||||
clientId: e488bac5f70b496fa2d82065089e5f81
|
||||
chargeAlgorithm2pdf:
|
||||
url: https://wx.btiger.net/jeecg-boot
|
||||
getTaskIdUrl: /api/docking/api/evaluate
|
||||
getPdfLinkUrl: /api/docking/report/pdf/
|
||||
#chargeAlgorithm:
|
||||
# url: http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json
|
||||
# clientId: e488bac5f70b496fa2d82065089e5f81
|
||||
#chargeAlgorithm2pdf:
|
||||
# url: https://wx.btiger.net/jeecg-boot
|
||||
# getTaskIdUrl: /api/docking/api/evaluate
|
||||
# getPdfLinkUrl: /api/docking/report/pdf/
|
||||
# token: MTc0NzcyMjgwMzg0NC1xNmFucG96cHR4aQ==
|
||||
|
||||
batteryChargeReport:
|
||||
webDomainPrefix: https://wx.btiger.net/jeecg-boot
|
||||
getTaskIdApi: /api/docking/api/evaluate
|
||||
apiPrefix: /api/docking/report/
|
||||
token: MTc0NzcyMjgwMzg0NC1xNmFucG96cHR4aQ==
|
||||
|
||||
# dubbo配置
|
||||
|
||||
@@ -249,13 +249,19 @@ parking:
|
||||
orgId: BTTEST01
|
||||
|
||||
# 充电算法平台配置
|
||||
chargeAlgorithm:
|
||||
url: http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json
|
||||
clientId: e488bac5f70b496fa2d82065089e5f81
|
||||
chargeAlgorithm2pdf:
|
||||
url: https://wx.btiger.net/jeecg-boot
|
||||
getTaskIdUrl: /api/docking/api/evaluate
|
||||
getPdfLinkUrl: /api/docking/report/pdf/
|
||||
#chargeAlgorithm:
|
||||
# url: http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json
|
||||
# clientId: e488bac5f70b496fa2d82065089e5f81
|
||||
#chargeAlgorithm2pdf:
|
||||
# url: https://wx.btiger.net/jeecg-boot
|
||||
# getTaskIdUrl: /api/docking/api/evaluate
|
||||
# getPdfLinkUrl: /api/docking/report/pdf/
|
||||
# token: MTc0NzcyMjgwMzg0NC1xNmFucG96cHR4aQ==
|
||||
|
||||
batteryChargeReport:
|
||||
webDomainPrefix: https://wx.btiger.net/jeecg-boot
|
||||
getTaskIdApi: /api/docking/api/evaluate
|
||||
apiPrefix: /api/docking/report/
|
||||
token: MTc0NzcyMjgwMzg0NC1xNmFucG96cHR4aQ==
|
||||
|
||||
# dubbo配置
|
||||
|
||||
@@ -247,9 +247,15 @@ parking:
|
||||
orgId: BTTEST01
|
||||
|
||||
# 充电算法平台配置
|
||||
chargeAlgorithm:
|
||||
url: http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json
|
||||
clientId: e488bac5f70b496fa2d82065089e5f81
|
||||
#chargeAlgorithm:
|
||||
# url: http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json
|
||||
# clientId: e488bac5f70b496fa2d82065089e5f81
|
||||
|
||||
batteryChargeReport:
|
||||
webDomainPrefix: https://wx.btiger.net/jeecg-boot
|
||||
getTaskIdApi: /api/docking/api/evaluate
|
||||
apiPrefix: /api/docking/report/
|
||||
token: MTc0NzcyMjgwMzg0NC1xNmFucG96cHR4aQ==
|
||||
|
||||
# dubbo配置
|
||||
dubbo:
|
||||
|
||||
@@ -144,12 +144,18 @@ wulian:
|
||||
WuLianSimRenew: api.v2.order.renew
|
||||
|
||||
# 充电算法平台配置
|
||||
chargeAlgorithm:
|
||||
url: http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json
|
||||
clientId: e488bac5f70b496fa2d82065089e5f81
|
||||
chargeAlgorithm2pdf:
|
||||
getTaskIdUrl: /api/docking/api/evaluate
|
||||
getPdfLinkUrl: /api/docking/report/pdf/
|
||||
#chargeAlgorithm:
|
||||
# url: http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json
|
||||
# clientId: e488bac5f70b496fa2d82065089e5f81
|
||||
#chargeAlgorithm2pdf:
|
||||
# getTaskIdUrl: /api/docking/api/evaluate
|
||||
# getPdfLinkUrl: /api/docking/report/pdf/
|
||||
# token: MTc0NzcyMjgwMzg0NC1xNmFucG96cHR4aQ==
|
||||
|
||||
batteryChargeReport:
|
||||
webDomainPrefix: https://wx.btiger.net/jeecg-boot
|
||||
getTaskIdApi: /api/docking/api/evaluate
|
||||
apiPrefix: /api/docking/report/
|
||||
token: MTc0NzcyMjgwMzg0NC1xNmFucG96cHR4aQ==
|
||||
|
||||
# sms4j
|
||||
|
||||
@@ -539,10 +539,10 @@ public class PaymentTestController {
|
||||
*/
|
||||
@Test
|
||||
public void createPaymentReverseRequestTest() {
|
||||
String paymentId = "002212025040208183810753300530720288768";
|
||||
BigDecimal refundAmount = new BigDecimal("33.55");
|
||||
String memberId = "61212331";
|
||||
String orderCode = "C25747230823";
|
||||
String paymentId = "002212025091910192610814936868000780288";
|
||||
BigDecimal refundAmount = new BigDecimal("0.02");
|
||||
String memberId = "65622699";
|
||||
String orderCode = "C48996543963";
|
||||
|
||||
// 延迟分账未确认调撤销调撤销接口退款
|
||||
PaymentReverseOperation operation = new PaymentReverseOperation();
|
||||
|
||||
@@ -86,6 +86,7 @@ import com.jsowell.thirdparty.parking.common.bean.QcyunParkCouponDTO;
|
||||
import com.jsowell.thirdparty.parking.service.LTYTService;
|
||||
import com.jsowell.thirdparty.parking.service.QcyunsService;
|
||||
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
||||
import com.jsowell.thirdparty.platform.service.impl.BatteryChargeReportService;
|
||||
import com.jsowell.thirdparty.platform.util.Cryptos;
|
||||
import com.jsowell.thirdparty.platform.util.Encodes;
|
||||
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
||||
@@ -292,6 +293,9 @@ public class SpringBootTestController {
|
||||
@Autowired
|
||||
private OrderSplitRecordService orderSplitRecordService;
|
||||
|
||||
@Autowired
|
||||
private BatteryChargeReportService batteryChargeReportService;
|
||||
|
||||
@Qualifier("zhongDianLianPlatformServiceImpl")
|
||||
private ThirdPartyPlatformService platformLogic;
|
||||
|
||||
@@ -305,6 +309,21 @@ public class SpringBootTestController {
|
||||
|
||||
private final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(10, JsowellThreadFactory.forName("test-thread-factory"));
|
||||
|
||||
@Test
|
||||
public void testBatteryReport() throws InterruptedException {
|
||||
String orderCode = "C25787997784";
|
||||
String taskId = batteryChargeReportService.getTaskIdByOrderCode(orderCode);
|
||||
|
||||
|
||||
// String taskId = "f46d86c5fc9942c3a4806aa97120d279";
|
||||
String url = batteryChargeReportService.getUrlByTaskId(taskId, Constants.TWO);
|
||||
if (StringUtils.isBlank(url)) {
|
||||
Thread.sleep(2000);
|
||||
url = batteryChargeReportService.getUrlByTaskId(taskId, Constants.TWO);
|
||||
}
|
||||
System.out.println(url);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testThread() {
|
||||
threadFactory.newThread(() -> System.out.println("testThread:"+ Thread.currentThread().getName()));
|
||||
|
||||
Reference in New Issue
Block a user