mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
新增 甬城泊车相关接口、controller
This commit is contained in:
@@ -50,10 +50,10 @@ public class YCBCController extends BaseController {
|
||||
try {
|
||||
Map<String, String> map = ycbcService.generateToken(dto);
|
||||
logger.info("甬城泊车平台请求令牌 result:{}", JSONObject.toJSONString(map));
|
||||
return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig"));
|
||||
return CommonResult.YCBCSuccess(0, "请求令牌成功!", map.get("Data"), map.get("Sig"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
logger.error("甬城泊车平台 请求令牌接口 异常");
|
||||
return CommonResult.failed("获取token发生异常");
|
||||
return CommonResult.YCBCFailed("获取token发生异常");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,13 +72,13 @@ public class YCBCController extends BaseController {
|
||||
String token = request.getHeader("Authorization");
|
||||
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||
// 校验失败
|
||||
return CommonResult.failed("令牌校验错误");
|
||||
return CommonResult.YCBCFailed("令牌校验错误");
|
||||
}
|
||||
// 校验签名
|
||||
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||
if (resultMap == null) {
|
||||
// 签名错误
|
||||
return CommonResult.failed("签名校验错误");
|
||||
return CommonResult.YCBCFailed("签名校验错误");
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
@@ -92,12 +92,12 @@ public class YCBCController extends BaseController {
|
||||
queryStationInfoDTO.setOperatorId(dto.getOperatorID());
|
||||
Map<String, String> map = ycbcService.queryStationsInfo(queryStationInfoDTO);
|
||||
|
||||
return CommonResult.success(0, "查询充电站信息成功!", map.get("Data"), map.get("Sig"));
|
||||
return CommonResult.YCBCSuccess(0, "查询充电站信息成功!", map.get("Data"), map.get("Sig"));
|
||||
} catch (Exception e) {
|
||||
logger.info("甬城泊车平台查询充电站信息 error:", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return CommonResult.failed("查询充电站信息发生异常");
|
||||
return CommonResult.YCBCFailed("查询充电站信息发生异常");
|
||||
}
|
||||
|
||||
|
||||
@@ -115,13 +115,13 @@ public class YCBCController extends BaseController {
|
||||
String token = request.getHeader("Authorization");
|
||||
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||
// 校验失败
|
||||
return CommonResult.failed("令牌校验错误");
|
||||
return CommonResult.YCBCFailed("令牌校验错误");
|
||||
}
|
||||
// 校验签名
|
||||
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||
if (resultMap == null) {
|
||||
// 签名错误
|
||||
return CommonResult.failed("签名校验错误");
|
||||
return CommonResult.YCBCFailed("签名校验错误");
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
@@ -135,12 +135,12 @@ public class YCBCController extends BaseController {
|
||||
queryStationInfoDTO.setOperatorId(dto.getOperatorID());
|
||||
Map<String, String> map = ycbcService.queryStationStatus(queryStationInfoDTO);
|
||||
|
||||
return CommonResult.success(0, "查询充电站状态信息成功!", map.get("Data"), map.get("Sig"));
|
||||
return CommonResult.YCBCSuccess(0, "查询充电站状态信息成功!", map.get("Data"), map.get("Sig"));
|
||||
} catch (Exception e) {
|
||||
logger.info("甬城泊车平台查询充电站状态信息 error:", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return CommonResult.failed("查询充电站状态信息发生异常");
|
||||
return CommonResult.YCBCFailed("查询充电站状态信息发生异常");
|
||||
}
|
||||
|
||||
|
||||
@@ -210,13 +210,13 @@ public class YCBCController extends BaseController {
|
||||
String token = request.getHeader("Authorization");
|
||||
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||
// 校验失败
|
||||
return CommonResult.failed("令牌校验错误");
|
||||
return CommonResult.YCBCFailed("令牌校验错误");
|
||||
}
|
||||
// 校验签名
|
||||
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||
if (resultMap == null) {
|
||||
// 签名错误
|
||||
return CommonResult.failed("签名校验错误");
|
||||
return CommonResult.YCBCFailed("签名校验错误");
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
@@ -230,12 +230,12 @@ public class YCBCController extends BaseController {
|
||||
queryEquipmentDTO.setOperatorID(dto.getOperatorID());
|
||||
Map<String, String> map = ycbcService.queryEquipAuth(queryEquipmentDTO);
|
||||
|
||||
return CommonResult.success(0, "请求设备认证成功!", map.get("Data"), map.get("Sig"));
|
||||
return CommonResult.YCBCSuccess(0, "请求设备认证成功!", map.get("Data"), map.get("Sig"));
|
||||
} catch (Exception e) {
|
||||
logger.info("甬城泊车平台请求设备认证 error:", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return CommonResult.failed("请求设备认证发生异常");
|
||||
return CommonResult.YCBCFailed("请求设备认证发生异常");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -252,13 +252,13 @@ public class YCBCController extends BaseController {
|
||||
String token = request.getHeader("Authorization");
|
||||
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||
// 校验失败
|
||||
return CommonResult.failed("令牌校验错误");
|
||||
return CommonResult.YCBCFailed("令牌校验错误");
|
||||
}
|
||||
// 校验签名
|
||||
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||
if (resultMap == null) {
|
||||
// 签名错误
|
||||
return CommonResult.failed("签名校验错误");
|
||||
return CommonResult.YCBCFailed("签名校验错误");
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
@@ -272,11 +272,11 @@ public class YCBCController extends BaseController {
|
||||
queryStartChargeDTO.setOperatorId(dto.getOperatorID());
|
||||
Map<String, String> map = ycbcService.queryStartCharge(queryStartChargeDTO);
|
||||
|
||||
return CommonResult.success(0, "请求启动充电成功!", map.get("Data"), map.get("Sig"));
|
||||
return CommonResult.YCBCSuccess(0, "请求启动充电成功!", map.get("Data"), map.get("Sig"));
|
||||
} catch (Exception e) {
|
||||
logger.error("甬城泊车平台请求启动充电 error", e);
|
||||
}
|
||||
return CommonResult.failed("请求启动充电发生异常");
|
||||
return CommonResult.YCBCFailed("请求启动充电发生异常");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -293,13 +293,13 @@ public class YCBCController extends BaseController {
|
||||
String token = request.getHeader("Authorization");
|
||||
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||
// 校验失败
|
||||
return CommonResult.failed("令牌校验错误");
|
||||
return CommonResult.YCBCFailed("令牌校验错误");
|
||||
}
|
||||
// 校验签名
|
||||
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||
if (resultMap == null) {
|
||||
// 签名错误
|
||||
return CommonResult.failed("签名校验错误");
|
||||
return CommonResult.YCBCFailed("签名校验错误");
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
@@ -313,11 +313,11 @@ public class YCBCController extends BaseController {
|
||||
queryEquipChargeStatusDTO.setOperatorID(dto.getOperatorID());
|
||||
Map<String, String> map = ycbcService.queryEquipChargeStatus(queryEquipChargeStatusDTO);
|
||||
|
||||
return CommonResult.success(0, "查询充电状态成功!", map.get("Data"), map.get("Sig"));
|
||||
return CommonResult.YCBCSuccess(0, "查询充电状态成功!", map.get("Data"), map.get("Sig"));
|
||||
} catch (Exception e) {
|
||||
logger.error("甬城泊车平台查询充电状态 error", e);
|
||||
}
|
||||
return CommonResult.failed("甬城泊车平台查询充电状态发生异常");
|
||||
return CommonResult.YCBCFailed("甬城泊车平台查询充电状态发生异常");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -358,13 +358,13 @@ public class YCBCController extends BaseController {
|
||||
String token = request.getHeader("Authorization");
|
||||
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||
// 校验失败
|
||||
return CommonResult.failed("令牌校验错误");
|
||||
return CommonResult.YCBCFailed("令牌校验错误");
|
||||
}
|
||||
// 校验签名
|
||||
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||
if (resultMap == null) {
|
||||
// 签名错误
|
||||
return CommonResult.failed("签名校验错误");
|
||||
return CommonResult.YCBCFailed("签名校验错误");
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
String dataString = resultMap.get("Data");
|
||||
@@ -378,11 +378,11 @@ public class YCBCController extends BaseController {
|
||||
queryStartChargeDTO.setOperatorId(dto.getOperatorID());
|
||||
Map<String, String> map = ycbcService.queryStopCharge(queryStartChargeDTO);
|
||||
|
||||
return CommonResult.success(0, "请求停止充电成功!", map.get("Data"), map.get("Sig"));
|
||||
return CommonResult.YCBCSuccess(0, "请求停止充电成功!", map.get("Data"), map.get("Sig"));
|
||||
} catch (Exception e) {
|
||||
logger.error("甬城泊车平台请求停止充电 error", e);
|
||||
}
|
||||
return CommonResult.failed("甬城泊车平台请求停止充电发生异常");
|
||||
return CommonResult.YCBCFailed("甬城泊车平台请求停止充电发生异常");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.jsowell.pile.vo.web.PileStationVO;
|
||||
import com.jsowell.service.PileService;
|
||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||
import com.jsowell.thirdparty.nanrui.service.NRService;
|
||||
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
|
||||
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -66,6 +67,9 @@ public class PileStationInfoController extends BaseController {
|
||||
@Autowired
|
||||
private NRService nrService;
|
||||
|
||||
@Autowired
|
||||
private YCBCService ycbcService;
|
||||
|
||||
@Autowired
|
||||
private IThirdPartyStationRelationService thirdPartyStationRelationService;
|
||||
|
||||
@@ -299,6 +303,10 @@ public class PileStationInfoController extends BaseController {
|
||||
// 江苏省平台
|
||||
result = nrService.pushStationInfo(dto);
|
||||
}
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), dto.getThirdPartyType())) {
|
||||
// 甬城泊车平台
|
||||
result = ycbcService.pushStationInfo(dto);
|
||||
}
|
||||
response = new RestApiResponse<>(result);
|
||||
}catch (BusinessException e) {
|
||||
logger.error("推送第三方平台充电站信息 error",e);
|
||||
|
||||
Reference in New Issue
Block a user