mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-05 02:20:12 +08:00
add 联联平台推送充电状态接口
This commit is contained in:
@@ -186,7 +186,13 @@ public class SpringBootTestController {
|
|||||||
// lianLianService.pushOrderInfo("C27680791529");
|
// lianLianService.pushOrderInfo("C27680791529");
|
||||||
|
|
||||||
// 推送启动充电结果
|
// 推送启动充电结果
|
||||||
lianLianService.pushStartChargeResult("C27680791529");
|
// lianLianService.pushStartChargeResult("C27680791529");
|
||||||
|
|
||||||
|
// 推送充电状态
|
||||||
|
lianLianService.pushChargeStatus("C27680791529");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ public class OrderDetail extends BaseEntity {
|
|||||||
this.totalServiceAmount = totalServiceAmount;
|
this.totalServiceAmount = totalServiceAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getTotalServiceAnount() {
|
public BigDecimal getTotalServiceAmount() {
|
||||||
return totalServiceAmount;
|
return totalServiceAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,7 +344,7 @@ public class OrderDetail extends BaseEntity {
|
|||||||
.append("totalUsedElectricity", getTotalUsedElectricity())
|
.append("totalUsedElectricity", getTotalUsedElectricity())
|
||||||
.append("totalOrderAmount", getTotalOrderAmount())
|
.append("totalOrderAmount", getTotalOrderAmount())
|
||||||
.append("totalElectricityAmount", getTotalElectricityAmount())
|
.append("totalElectricityAmount", getTotalElectricityAmount())
|
||||||
.append("totalServiceAnount", getTotalServiceAnount())
|
.append("totalServiceAnount", getTotalServiceAmount())
|
||||||
.append("sharpUsedElectricity", getSharpUsedElectricity())
|
.append("sharpUsedElectricity", getSharpUsedElectricity())
|
||||||
.append("sharpElectricityPrice", getSharpElectricityPrice())
|
.append("sharpElectricityPrice", getSharpElectricityPrice())
|
||||||
.append("sharpServicePrice", getSharpServicePrice())
|
.append("sharpServicePrice", getSharpServicePrice())
|
||||||
|
|||||||
@@ -100,4 +100,11 @@ public interface LianLianService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String pushStartChargeResult(String orderCode);
|
String pushStartChargeResult(String orderCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送充电状态
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String pushChargeStatus(String orderCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,6 +237,13 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
return pageResponse;
|
return pageResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备接口状态查询
|
||||||
|
* 此接口用于批量查询设备实时状态
|
||||||
|
*
|
||||||
|
* @param StationIDs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public LianLianPageResponse query_station_status(List<String> StationIDs) {
|
public LianLianPageResponse query_station_status(List<String> StationIDs) {
|
||||||
List<StationStatusInfo> StationStatusInfos = new ArrayList<>();
|
List<StationStatusInfo> StationStatusInfos = new ArrayList<>();
|
||||||
@@ -494,7 +501,7 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
if (orderInfo == null) {
|
if (orderInfo == null) {
|
||||||
throw new BusinessException("", "");
|
throw new BusinessException("", "");
|
||||||
}
|
}
|
||||||
// OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode());
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode());
|
||||||
List<RealTimeMonitorData> realTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
|
List<RealTimeMonitorData> realTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
|
||||||
RealTimeMonitorData data = realTimeData.get(0);
|
RealTimeMonitorData data = realTimeData.get(0);
|
||||||
String orderStatus = orderInfo.getOrderStatus();
|
String orderStatus = orderInfo.getOrderStatus();
|
||||||
@@ -520,8 +527,8 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
.StartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) // 开始时间
|
.StartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) // 开始时间
|
||||||
.EndTime(DateUtils.getTime()) // 本次采样时间
|
.EndTime(DateUtils.getTime()) // 本次采样时间
|
||||||
.TotalPower(new BigDecimal(data.getChargingDegree())) // 累计充电量
|
.TotalPower(new BigDecimal(data.getChargingDegree())) // 累计充电量
|
||||||
// .ElecMoney(new BigDecimal()) // 累计电费
|
.ElecMoney(orderDetail.getTotalElectricityAmount()) // 累计电费
|
||||||
// .SeviceMoney(new BigDecimal()) // 累计服务费
|
.SeviceMoney(orderDetail.getTotalServiceAmount()) // 累计服务费
|
||||||
.TotalMoney(new BigDecimal(data.getChargingAmount())) // 已充金额
|
.TotalMoney(new BigDecimal(data.getChargingAmount())) // 已充金额
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
@@ -802,6 +809,29 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送充电状态(仅桩充电时调)
|
||||||
|
* @param orderCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String pushChargeStatus(String orderCode) {
|
||||||
|
// 调用 查询充电状态方法
|
||||||
|
QueryChargingStatusVO vo = query_equip_charge_status(orderCode);
|
||||||
|
// 获取令牌
|
||||||
|
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
||||||
|
if (StringUtils.isBlank(token)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String url = TEST_URL + "notification_equip_charge_status";
|
||||||
|
// 调用联联平台接口
|
||||||
|
String jsonString = JSONObject.toJSONString(vo);
|
||||||
|
|
||||||
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// private ChargeDetail setChargeDetail(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) {
|
// private ChargeDetail setChargeDetail(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) {
|
||||||
// ChargeDetail detail = new ChargeDetail();
|
// ChargeDetail detail = new ChargeDetail();
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user