mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-14 02:58:09 +08:00
新增 甬城泊车controller
This commit is contained in:
@@ -442,6 +442,12 @@ public class LianLianController extends BaseController {
|
|||||||
// return response;
|
// return response;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求停止充电
|
||||||
|
* @param request
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@PostMapping("/v1/query_stop_charge")
|
@PostMapping("/v1/query_stop_charge")
|
||||||
public CommonResult<?> query_stop_charge(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
public CommonResult<?> query_stop_charge(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||||
logger.info("联联平台请求停止充电 params :{}", JSONObject.toJSONString(dto));
|
logger.info("联联平台请求停止充电 params :{}", JSONObject.toJSONString(dto));
|
||||||
|
|||||||
@@ -3,16 +3,24 @@ package com.jsowell.thirdparty.yongchengboche;
|
|||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.jsowell.common.annotation.Anonymous;
|
import com.jsowell.common.annotation.Anonymous;
|
||||||
import com.jsowell.common.core.controller.BaseController;
|
import com.jsowell.common.core.controller.BaseController;
|
||||||
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
|
import com.jsowell.common.exception.BusinessException;
|
||||||
|
import com.jsowell.common.response.RestApiResponse;
|
||||||
|
import com.jsowell.common.util.JWTUtils;
|
||||||
|
import com.jsowell.common.util.StringUtils;
|
||||||
|
import com.jsowell.pile.dto.*;
|
||||||
import com.jsowell.thirdparty.lianlian.common.CommonResult;
|
import com.jsowell.thirdparty.lianlian.common.CommonResult;
|
||||||
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
||||||
|
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||||
|
import com.jsowell.thirdparty.lianlian.util.Cryptos;
|
||||||
|
import com.jsowell.thirdparty.lianlian.util.Encodes;
|
||||||
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
|
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
|
||||||
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.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,9 +37,12 @@ public class YCBCController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private YCBCService ycbcService;
|
private YCBCService ycbcService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LianLianService lianLianService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取token接口
|
* 获取token接口
|
||||||
* http://localhost:8080/zdl/v1/query_token
|
* http://localhost:8080/ycbc/v1/query_token
|
||||||
*/
|
*/
|
||||||
@PostMapping("/v1/query_token")
|
@PostMapping("/v1/query_token")
|
||||||
public CommonResult<?> queryToken(@RequestBody CommonParamsDTO dto) {
|
public CommonResult<?> queryToken(@RequestBody CommonParamsDTO dto) {
|
||||||
@@ -47,5 +58,380 @@ public class YCBCController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 甬城泊车平台查询充电站信息
|
||||||
|
* http://localhost:8080/ycbc/query_stations_info
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/v1/query_stations_info")
|
||||||
|
public CommonResult<?> query_stations_info(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||||
|
logger.info("甬城泊车平台查询充电站信息 params:{}", JSONObject.toJSONString(dto));
|
||||||
|
try {
|
||||||
|
// 校验令牌
|
||||||
|
String token = request.getHeader("Authorization");
|
||||||
|
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||||
|
// 校验失败
|
||||||
|
return CommonResult.failed("令牌校验错误");
|
||||||
|
}
|
||||||
|
// 校验签名
|
||||||
|
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||||
|
if (resultMap == null) {
|
||||||
|
// 签名错误
|
||||||
|
return CommonResult.failed("签名校验错误");
|
||||||
|
}
|
||||||
|
String operatorSecret = resultMap.get("OperatorSecret");
|
||||||
|
String dataString = resultMap.get("Data");
|
||||||
|
String dataSecret = resultMap.get("DataSecret");
|
||||||
|
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||||
|
// 解密data
|
||||||
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||||
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||||
|
// 转换成相应对象
|
||||||
|
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||||
|
queryStationInfoDTO.setOperatorId(dto.getOperatorID());
|
||||||
|
Map<String, String> map = ycbcService.queryStationsInfo(queryStationInfoDTO);
|
||||||
|
|
||||||
|
return CommonResult.success(0, "查询充电站信息成功!", map.get("Data"), map.get("Sig"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.info("甬城泊车平台查询充电站信息 error:", e);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return CommonResult.failed("查询充电站信息发生异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 甬城泊车平台查询充电站状态信息
|
||||||
|
* http://localhost:8080/ycbc/query_station_status
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/v1/query_station_status")
|
||||||
|
public CommonResult<?> query_station_status(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||||
|
logger.info("甬城泊车平台查询充电站状态信息 params:{}", JSONObject.toJSONString(dto));
|
||||||
|
try {
|
||||||
|
// 校验令牌
|
||||||
|
String token = request.getHeader("Authorization");
|
||||||
|
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||||
|
// 校验失败
|
||||||
|
return CommonResult.failed("令牌校验错误");
|
||||||
|
}
|
||||||
|
// 校验签名
|
||||||
|
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||||
|
if (resultMap == null) {
|
||||||
|
// 签名错误
|
||||||
|
return CommonResult.failed("签名校验错误");
|
||||||
|
}
|
||||||
|
String operatorSecret = resultMap.get("OperatorSecret");
|
||||||
|
String dataString = resultMap.get("Data");
|
||||||
|
String dataSecret = resultMap.get("DataSecret");
|
||||||
|
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||||
|
// 解密data
|
||||||
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||||
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||||
|
// 转换成相应对象
|
||||||
|
QueryStationInfoDTO queryStationInfoDTO = JSONObject.parseObject(dataStr, QueryStationInfoDTO.class);
|
||||||
|
queryStationInfoDTO.setOperatorId(dto.getOperatorID());
|
||||||
|
Map<String, String> map = ycbcService.queryStationStatus(queryStationInfoDTO);
|
||||||
|
|
||||||
|
return CommonResult.success(0, "查询充电站状态信息成功!", map.get("Data"), map.get("Sig"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.info("甬城泊车平台查询充电站状态信息 error:", e);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return CommonResult.failed("查询充电站状态信息发生异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 甬城泊车平台设备状态变化推送
|
||||||
|
* http://localhost:8080/ycbc/pushStationStatus
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/pushStationStatus")
|
||||||
|
public RestApiResponse<?> pushStationStatus(@RequestBody PushInfoParamDTO dto) {
|
||||||
|
logger.info("甬城泊车平台设备状态变化推送 params:{}", JSONObject.toJSONString(dto));
|
||||||
|
RestApiResponse<?> response = null;
|
||||||
|
try {
|
||||||
|
if (StringUtils.isBlank(String.valueOf(dto.getPileConnectorCode())) ||
|
||||||
|
StringUtils.isBlank(String.valueOf(dto.getStatus()))) {
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||||
|
}
|
||||||
|
String result = ycbcService.notificationStationStatus(dto.getPileConnectorCode(), dto.getStatus());
|
||||||
|
response = new RestApiResponse<>(result);
|
||||||
|
}catch (BusinessException e) {
|
||||||
|
logger.error("甬城泊车平台设备状态变化推送 error",e);
|
||||||
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
|
}catch (Exception e) {
|
||||||
|
logger.error("甬城泊车平台设备状态变化推送 error", e);
|
||||||
|
response = new RestApiResponse<>(e);
|
||||||
|
}
|
||||||
|
logger.info("甬城泊车平台设备状态变化推送 result:{}", response);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 甬城泊车推送启动充电结果
|
||||||
|
* http://localhost:8080/ycbc/pushStartChargeResult
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/pushStartChargeResult/{orderCode}")
|
||||||
|
public RestApiResponse<?> pushStartChargeResult(@PathVariable("orderCode") String orderCode) {
|
||||||
|
logger.info("甬城泊车平台推送启动充电结果 params:{}", orderCode);
|
||||||
|
RestApiResponse<?> response = null;
|
||||||
|
try {
|
||||||
|
String result = ycbcService.pushStartChargeResult(orderCode);
|
||||||
|
response = new RestApiResponse<>(result);
|
||||||
|
}catch (BusinessException e) {
|
||||||
|
logger.error("甬城泊车平台推送启动充电结果 error",e);
|
||||||
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
|
}catch (Exception e) {
|
||||||
|
logger.error("甬城泊车平台推送启动充电结果 error", e);
|
||||||
|
response = new RestApiResponse<>(e);
|
||||||
|
}
|
||||||
|
logger.info("甬城泊车平台推送启动充电结果 result:{}", response);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求设备认证
|
||||||
|
* @param request
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/v1/query_equip_auth")
|
||||||
|
public CommonResult<?> query_equip_auth(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||||
|
logger.info("甬城泊车平台请求设备认证 param:{}", JSONObject.toJSONString(dto));
|
||||||
|
try {
|
||||||
|
// 校验令牌
|
||||||
|
String token = request.getHeader("Authorization");
|
||||||
|
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||||
|
// 校验失败
|
||||||
|
return CommonResult.failed("令牌校验错误");
|
||||||
|
}
|
||||||
|
// 校验签名
|
||||||
|
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||||
|
if (resultMap == null) {
|
||||||
|
// 签名错误
|
||||||
|
return CommonResult.failed("签名校验错误");
|
||||||
|
}
|
||||||
|
String operatorSecret = resultMap.get("OperatorSecret");
|
||||||
|
String dataString = resultMap.get("Data");
|
||||||
|
String dataSecret = resultMap.get("DataSecret");
|
||||||
|
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||||
|
// 解密data
|
||||||
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||||
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||||
|
// 转换成相应对象
|
||||||
|
QueryEquipmentDTO queryEquipmentDTO = JSONObject.parseObject(dataStr, QueryEquipmentDTO.class);
|
||||||
|
queryEquipmentDTO.setOperatorID(dto.getOperatorID());
|
||||||
|
Map<String, String> map = ycbcService.queryEquipAuth(queryEquipmentDTO);
|
||||||
|
|
||||||
|
return CommonResult.success(0, "请求设备认证成功!", map.get("Data"), map.get("Sig"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.info("甬城泊车平台请求设备认证 error:", e);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return CommonResult.failed("请求设备认证发生异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求启动充电
|
||||||
|
* @param request
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/v1/query_start_charge")
|
||||||
|
public CommonResult<?> query_start_charge(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||||
|
logger.info("甬城泊车平台请求启动充电 params :{}", JSONObject.toJSONString(dto));
|
||||||
|
try {
|
||||||
|
// 校验令牌
|
||||||
|
String token = request.getHeader("Authorization");
|
||||||
|
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||||
|
// 校验失败
|
||||||
|
return CommonResult.failed("令牌校验错误");
|
||||||
|
}
|
||||||
|
// 校验签名
|
||||||
|
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||||
|
if (resultMap == null) {
|
||||||
|
// 签名错误
|
||||||
|
return CommonResult.failed("签名校验错误");
|
||||||
|
}
|
||||||
|
String operatorSecret = resultMap.get("OperatorSecret");
|
||||||
|
String dataString = resultMap.get("Data");
|
||||||
|
String dataSecret = resultMap.get("DataSecret");
|
||||||
|
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||||
|
// 解密data
|
||||||
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||||
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||||
|
// 转换成相应对象
|
||||||
|
QueryStartChargeDTO queryStartChargeDTO = JSONObject.parseObject(dataStr, QueryStartChargeDTO.class);
|
||||||
|
queryStartChargeDTO.setOperatorId(dto.getOperatorID());
|
||||||
|
Map<String, String> map = ycbcService.queryStartCharge(queryStartChargeDTO);
|
||||||
|
|
||||||
|
return CommonResult.success(0, "请求启动充电成功!", map.get("Data"), map.get("Sig"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("甬城泊车平台请求启动充电 error", e);
|
||||||
|
}
|
||||||
|
return CommonResult.failed("请求启动充电发生异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询充电状态
|
||||||
|
* http://localhost:8080/LianLian/query_equip_charge_status/{startChargeSeq}
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/v1/query_equip_charge_status")
|
||||||
|
public CommonResult<?> query_equip_charge_status(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||||
|
logger.info("甬城泊车平台查询充电状态 params :{}", JSONObject.toJSONString(dto));
|
||||||
|
try {
|
||||||
|
// 校验令牌
|
||||||
|
String token = request.getHeader("Authorization");
|
||||||
|
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||||
|
// 校验失败
|
||||||
|
return CommonResult.failed("令牌校验错误");
|
||||||
|
}
|
||||||
|
// 校验签名
|
||||||
|
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||||
|
if (resultMap == null) {
|
||||||
|
// 签名错误
|
||||||
|
return CommonResult.failed("签名校验错误");
|
||||||
|
}
|
||||||
|
String operatorSecret = resultMap.get("OperatorSecret");
|
||||||
|
String dataString = resultMap.get("Data");
|
||||||
|
String dataSecret = resultMap.get("DataSecret");
|
||||||
|
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||||
|
// 解密data
|
||||||
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||||
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||||
|
// 转换成相应对象
|
||||||
|
QueryEquipChargeStatusDTO queryEquipChargeStatusDTO = JSONObject.parseObject(dataStr, QueryEquipChargeStatusDTO.class);
|
||||||
|
queryEquipChargeStatusDTO.setOperatorID(dto.getOperatorID());
|
||||||
|
Map<String, String> map = ycbcService.queryEquipChargeStatus(queryEquipChargeStatusDTO);
|
||||||
|
|
||||||
|
return CommonResult.success(0, "查询充电状态成功!", map.get("Data"), map.get("Sig"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("甬城泊车平台查询充电状态 error", e);
|
||||||
|
}
|
||||||
|
return CommonResult.failed("甬城泊车平台查询充电状态发生异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 甬城泊车推送充电状态
|
||||||
|
* http://localhost:8080/ycbc/pushStartChargeResult
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/pushChargeStatus/{orderCode}")
|
||||||
|
public RestApiResponse<?> pushChargeStatus(@PathVariable("orderCode") String orderCode) {
|
||||||
|
logger.info("甬城泊车平台推送充电状态 params:{}", orderCode);
|
||||||
|
RestApiResponse<?> response = null;
|
||||||
|
try {
|
||||||
|
String result = ycbcService.pushChargeStatus(orderCode);
|
||||||
|
response = new RestApiResponse<>(result);
|
||||||
|
}catch (BusinessException e) {
|
||||||
|
logger.error("甬城泊车平台推送充电状态 error",e);
|
||||||
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
|
}catch (Exception e) {
|
||||||
|
logger.error("甬城泊车平台推送充电状态 error", e);
|
||||||
|
response = new RestApiResponse<>(e);
|
||||||
|
}
|
||||||
|
logger.info("甬城泊车平台推送充电状态 result:{}", response);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求停止充电
|
||||||
|
* @param request
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/v1/query_stop_charge")
|
||||||
|
public CommonResult<?> query_stop_charge(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||||
|
logger.info("甬城泊车平台请求停止充电 params :{}", JSONObject.toJSONString(dto));
|
||||||
|
try {
|
||||||
|
// 校验令牌
|
||||||
|
String token = request.getHeader("Authorization");
|
||||||
|
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||||
|
// 校验失败
|
||||||
|
return CommonResult.failed("令牌校验错误");
|
||||||
|
}
|
||||||
|
// 校验签名
|
||||||
|
Map<String, String> resultMap = lianLianService.checkoutSign(dto);
|
||||||
|
if (resultMap == null) {
|
||||||
|
// 签名错误
|
||||||
|
return CommonResult.failed("签名校验错误");
|
||||||
|
}
|
||||||
|
String operatorSecret = resultMap.get("OperatorSecret");
|
||||||
|
String dataString = resultMap.get("Data");
|
||||||
|
String dataSecret = resultMap.get("DataSecret");
|
||||||
|
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||||
|
// 解密data
|
||||||
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||||
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||||
|
// 转换成相应对象
|
||||||
|
QueryStartChargeDTO queryStartChargeDTO = JSONObject.parseObject(dataStr, QueryStartChargeDTO.class);
|
||||||
|
queryStartChargeDTO.setOperatorId(dto.getOperatorID());
|
||||||
|
Map<String, String> map = ycbcService.queryStopCharge(queryStartChargeDTO);
|
||||||
|
|
||||||
|
return CommonResult.success(0, "请求停止充电成功!", map.get("Data"), map.get("Sig"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("甬城泊车平台请求停止充电 error", e);
|
||||||
|
}
|
||||||
|
return CommonResult.failed("甬城泊车平台请求停止充电发生异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 甬城泊车推送停止充电结果
|
||||||
|
* http://localhost:8080/ycbc/pushStartChargeResult
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/pushStopChargeResult/{orderCode}")
|
||||||
|
public RestApiResponse<?> pushStopChargeResult(@PathVariable("orderCode") String orderCode) {
|
||||||
|
logger.info("甬城泊车平台推送停止充电结果 params:{}", orderCode);
|
||||||
|
RestApiResponse<?> response = null;
|
||||||
|
try {
|
||||||
|
String result = ycbcService.pushStopChargeResult(orderCode);
|
||||||
|
response = new RestApiResponse<>(result);
|
||||||
|
}catch (BusinessException e) {
|
||||||
|
logger.error("甬城泊车平台推送停止充电结果 error",e);
|
||||||
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
|
}catch (Exception e) {
|
||||||
|
logger.error("甬城泊车平台推送停止充电结果 error", e);
|
||||||
|
response = new RestApiResponse<>(e);
|
||||||
|
}
|
||||||
|
logger.info("甬城泊车平台推送停止充电结果 result:{}", response);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 甬城泊车推送充电订单信息
|
||||||
|
* http://localhost:8080/ycbc/pushChargeOrderInfo
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/pushChargeOrderInfo/{orderCode}")
|
||||||
|
public RestApiResponse<?> pushChargeOrderInfo(@PathVariable("orderCode") String orderCode) {
|
||||||
|
logger.info("甬城泊车平台推送充电订单信息 params:{}", orderCode);
|
||||||
|
RestApiResponse<?> response = null;
|
||||||
|
try {
|
||||||
|
String result = ycbcService.pushChargeOrderInfo(orderCode);
|
||||||
|
response = new RestApiResponse<>(result);
|
||||||
|
}catch (BusinessException e) {
|
||||||
|
logger.error("甬城泊车平台推送充电订单信息 error",e);
|
||||||
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
|
}catch (Exception e) {
|
||||||
|
logger.error("甬城泊车平台推送充电订单信息 error", e);
|
||||||
|
response = new RestApiResponse<>(e);
|
||||||
|
}
|
||||||
|
logger.info("甬城泊车平台推送充电订单信息 result:{}", response);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user