mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-21 15:49:47 +08:00
update 常畅充平台充电记录相关接口,只需通过他们平台启动的充电记录
This commit is contained in:
@@ -59,6 +59,8 @@ import java.time.format.DateTimeFormatter;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
import static com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||||
@@ -469,6 +471,13 @@ public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String notificationStartChargeResult(String orderCode) {
|
public String notificationStartChargeResult(String orderCode) {
|
||||||
|
//判断是否是常畅充平台的订单
|
||||||
|
Boolean flag = isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.CHANG_ZHOU_PLATFORM.getOperatorId());
|
||||||
|
if (!flag){
|
||||||
|
//表示不是常畅充平台的订单
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// 根据订单号查询订单信息
|
// 根据订单号查询订单信息
|
||||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
if (orderInfo == null) {
|
if (orderInfo == null) {
|
||||||
@@ -582,6 +591,13 @@ public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String notificationEquipChargeStatus(String orderCode) {
|
public String notificationEquipChargeStatus(String orderCode) {
|
||||||
|
//判断是否是常畅充平台的订单
|
||||||
|
Boolean flag = isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.CHANG_ZHOU_PLATFORM.getOperatorId());
|
||||||
|
if (!flag){
|
||||||
|
//表示不是常畅充平台的订单
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// 根据订单号查询订单信息
|
// 根据订单号查询订单信息
|
||||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode());
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode());
|
||||||
@@ -684,6 +700,13 @@ public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String notificationStopChargeResult(String orderCode) {
|
public String notificationStopChargeResult(String orderCode) {
|
||||||
|
//判断是否是常畅充平台的订单
|
||||||
|
Boolean flag = isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.CHANG_ZHOU_PLATFORM.getOperatorId());
|
||||||
|
if (!flag){
|
||||||
|
//表示不是常畅充平台的订单
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// 根据订单号查询订单信息
|
// 根据订单号查询订单信息
|
||||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
if (orderInfo == null) {
|
if (orderInfo == null) {
|
||||||
@@ -752,6 +775,13 @@ public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String notificationChargeOrderInfo(String orderCode, ThirdPartySecretInfoVO thirdPartySecretInfoVO) {
|
public String notificationChargeOrderInfo(String orderCode, ThirdPartySecretInfoVO thirdPartySecretInfoVO) {
|
||||||
|
//判断是否是常畅充平台的订单
|
||||||
|
Boolean flag = isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.CHANG_ZHOU_PLATFORM.getOperatorId());
|
||||||
|
if (!flag){
|
||||||
|
//表示不是常畅充平台的订单
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||||
|
|
||||||
@@ -808,6 +838,13 @@ public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String notificationPayOrderInfo(String orderCode){
|
public String notificationPayOrderInfo(String orderCode){
|
||||||
|
//判断是否是常畅充平台的订单
|
||||||
|
Boolean flag = isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.CHANG_ZHOU_PLATFORM.getOperatorId());
|
||||||
|
if (!flag){
|
||||||
|
//表示不是常畅充平台的订单
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
//获取订单信息
|
//获取订单信息
|
||||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
if (orderBasicInfo == null) {
|
if (orderBasicInfo == null) {
|
||||||
|
|||||||
@@ -116,4 +116,17 @@ public class ThirdPartyPlatformUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过截取订单号前9位,来判断是否需要推送充电记录到指定的第三方平台
|
||||||
|
* 例: 2025-08-05 ,常畅充平台只需要通过他们平台启动的充电记录
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Boolean isNeedPushToThirdPartyPlatform(String orderCode,String operatorId) {
|
||||||
|
String operatorIdPrefix = StringUtils.substring(orderCode , 0 , 9);
|
||||||
|
return operatorIdPrefix.equals(operatorId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user