mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
add 联联平台请求停止充电接口
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package com.jsowell.thirdparty.service;
|
||||
|
||||
import com.jsowell.pile.dto.QueryEquipmentDTO;
|
||||
import com.jsowell.pile.dto.QueryStartChargeDTO;
|
||||
import com.jsowell.thirdparty.domain.StationStatsInfo;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.thirdparty.vo.EquipmentAuthVO;
|
||||
import com.jsowell.thirdparty.vo.LianLianPageResponse;
|
||||
import com.jsowell.thirdparty.vo.QueryChargingStatusVO;
|
||||
import com.jsowell.thirdparty.vo.QueryStopChargeVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -54,4 +56,11 @@ public interface LianLianService {
|
||||
* @param startChargeSeq
|
||||
*/
|
||||
QueryChargingStatusVO query_equip_charge_status(String startChargeSeq);
|
||||
|
||||
/**
|
||||
* 请求停止充电
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
QueryStopChargeVO query_stop_charge(QueryStartChargeDTO dto);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.PageUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.netty.command.ykc.StopChargingCommand;
|
||||
import com.jsowell.netty.service.yunkuaichong.YKCPushCommandService;
|
||||
import com.jsowell.pile.domain.*;
|
||||
import com.jsowell.pile.dto.QueryEquipmentDTO;
|
||||
import com.jsowell.pile.dto.QueryStartChargeDTO;
|
||||
@@ -40,6 +42,7 @@ import com.jsowell.thirdparty.service.LianLianService;
|
||||
import com.jsowell.thirdparty.vo.EquipmentAuthVO;
|
||||
import com.jsowell.thirdparty.vo.LianLianPageResponse;
|
||||
import com.jsowell.thirdparty.vo.QueryChargingStatusVO;
|
||||
import com.jsowell.thirdparty.vo.QueryStopChargeVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -72,7 +75,7 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
private YKCPushCommandService ykcPushCommandService;
|
||||
|
||||
@Override
|
||||
public void pushMerchantInfo(Long merchantId) {
|
||||
@@ -421,11 +424,55 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 请求停止充电
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public QueryStopChargeVO query_stop_charge(QueryStartChargeDTO dto) {
|
||||
QueryStopChargeVO vo = new QueryStopChargeVO();
|
||||
|
||||
public void query_stop_charge(QueryStartChargeDTO dto) {
|
||||
String orderCode = dto.getStartChargeSeq();
|
||||
|
||||
// 根据订单号查询订单信息
|
||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
if (orderInfo == null) {
|
||||
throw new BusinessException("", "");
|
||||
}
|
||||
// 若状态为充电中,则发送停机指令
|
||||
if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderInfo.getOrderStatus())) {
|
||||
// 充电中
|
||||
StopChargingCommand command = StopChargingCommand.builder()
|
||||
.pileSn(orderInfo.getPileSn())
|
||||
.connectorCode(orderInfo.getConnectorCode())
|
||||
.build();
|
||||
ykcPushCommandService.pushStopChargingCommand(command);
|
||||
vo.setStartChargeSeq(orderCode);
|
||||
vo.setStartChargeSeqStat(3); // 停止中
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
// TODO 推送停止充电结果 notification_stop_charge_result
|
||||
|
||||
// TODO 推送充电订单信息 notification_charge_order_info
|
||||
|
||||
// TODO 推送订单对账结果信息 check_charge_orders
|
||||
|
||||
/**
|
||||
* TODO 请求打印充电小票
|
||||
*/
|
||||
public void query_print_parking_ticket() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// TODO 推送订单结算信息 notification_order_settlement_info
|
||||
|
||||
// TODO 查询订单结算信息 query_order_settlement_info
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取桩列表信息
|
||||
* @param pileStationInfo
|
||||
|
||||
38
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/vo/QueryStopChargeVO.java
vendored
Normal file
38
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/vo/QueryStopChargeVO.java
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.jsowell.thirdparty.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 请求停止充电
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/25 11:21
|
||||
*/
|
||||
@Data
|
||||
public class QueryStopChargeVO {
|
||||
|
||||
/**
|
||||
* 充电订单号
|
||||
*/
|
||||
private String StartChargeSeq;
|
||||
|
||||
/**
|
||||
* 充电订单状态 1、启动中 ;2、充电中;3、停止中;4、已结束;5、未知
|
||||
*/
|
||||
private int StartChargeSeqStat;
|
||||
|
||||
/**
|
||||
* 成功状态 0:成功; 1:失败
|
||||
*/
|
||||
private int SuccStat;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
* 0:无;
|
||||
* 1:此设备不存在;
|
||||
* 2:此设备离线:
|
||||
* 3:设备已停止充电;
|
||||
* 4~99:自定义
|
||||
*/
|
||||
private int FailReason;
|
||||
}
|
||||
Reference in New Issue
Block a user