新增协议0x65预约充电启动结果上传

This commit is contained in:
Guoqs
2024-07-25 13:42:16 +08:00
parent b2aff8a25a
commit 180645ffb2
6 changed files with 86 additions and 17 deletions

View File

@@ -106,6 +106,7 @@ weixin:
sendMsg: sendMsg:
startChargingTmpId: BGgZe98QHr0I1S1GrtGps0y3uhvURtQNkbMAzI2D8g8 startChargingTmpId: BGgZe98QHr0I1S1GrtGps0y3uhvURtQNkbMAzI2D8g8
stopChargingTmpId: UyBPbADlZfsCj89rh_xvfR2ZP1iwtmPcMFA0sUOJwog stopChargingTmpId: UyBPbADlZfsCj89rh_xvfR2ZP1iwtmPcMFA0sUOJwog
startupResultTmpId: BGgZe98QHr0I1S1GrtGps-Av8-Y6WoD2Ny8DZWvdhoQ
#Sim卡信息 #Sim卡信息
xunzhong: xunzhong:

View File

@@ -8,8 +8,11 @@ import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
import com.jsowell.common.util.BytesUtil; import com.jsowell.common.util.BytesUtil;
import com.jsowell.common.util.YKCUtils; import com.jsowell.common.util.YKCUtils;
import com.jsowell.netty.factory.YKCOperateFactory; import com.jsowell.netty.factory.YKCOperateFactory;
import com.jsowell.pile.dto.ReservationChargingStartupResult;
import com.jsowell.pile.service.PileBasicInfoService;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
@@ -21,6 +24,9 @@ public class ReservationChargingStartupResultHandler extends AbstractHandler{
private final String type = YKCUtils.frameType2Str(YKCFrameTypeCode.RESERVATION_CHARGING_STARTUP_RESULT_CODE.getBytes()); private final String type = YKCUtils.frameType2Str(YKCFrameTypeCode.RESERVATION_CHARGING_STARTUP_RESULT_CODE.getBytes());
@Autowired
private PileBasicInfoService pileBasicInfoService;
@Override @Override
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
YKCOperateFactory.register(type, this); YKCOperateFactory.register(type, this);
@@ -76,6 +82,15 @@ public class ReservationChargingStartupResultHandler extends AbstractHandler{
transactionCode, pileSn, connectorCode, vinCode, startupResult, failReason); transactionCode, pileSn, connectorCode, vinCode, startupResult, failReason);
ReservationChargingStartupResult chargingStartupResult = ReservationChargingStartupResult.builder()
.transactionCode(transactionCode)
.pileSn(pileSn)
.connectorCode(connectorCode)
.vinCode(vinCode)
.startupResult(startupResult)
.failReason(failReason)
.build();
pileBasicInfoService.startupResult(chargingStartupResult);
/* /*

View File

@@ -0,0 +1,42 @@
package com.jsowell.pile.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ReservationChargingStartupResult {
/**
* 交易流水号
*/
private String transactionCode;
/**
* 桩编号
*/
private String pileSn;
/**
* 枪口号
*/
private String connectorCode;
/**
* vin
*/
private String vinCode;
/**
* 启动结果
*/
private String startupResult;
/**
* 失败原因
*/
private String failReason;
}

View File

@@ -2,10 +2,7 @@ package com.jsowell.pile.service;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData; import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.domain.PileBasicInfo;
import com.jsowell.pile.dto.IndexQueryDTO; import com.jsowell.pile.dto.*;
import com.jsowell.pile.dto.QueryPileDTO;
import com.jsowell.pile.dto.ReplaceMerchantStationDTO;
import com.jsowell.pile.dto.StartPersonPileDTO;
import com.jsowell.pile.thirdparty.ConnectorInfo; import com.jsowell.pile.thirdparty.ConnectorInfo;
import com.jsowell.pile.thirdparty.EquipmentInfo; import com.jsowell.pile.thirdparty.EquipmentInfo;
import com.jsowell.pile.thirdparty.ZDLConnectorInfo; import com.jsowell.pile.thirdparty.ZDLConnectorInfo;
@@ -222,4 +219,6 @@ public interface PileBasicInfoService {
List<ZDLConnectorInfo> getConnectorListForZDL(String pileSn); List<ZDLConnectorInfo> getConnectorListForZDL(String pileSn);
String startPersonalPileCharging(StartPersonPileDTO dto); String startPersonalPileCharging(StartPersonPileDTO dto);
void startupResult(ReservationChargingStartupResult chargingStartupResult);
} }

View File

@@ -18,10 +18,7 @@ import com.jsowell.pile.domain.PileBasicInfo;
import com.jsowell.pile.domain.PileConnectorInfo; import com.jsowell.pile.domain.PileConnectorInfo;
import com.jsowell.pile.domain.PileModelInfo; import com.jsowell.pile.domain.PileModelInfo;
import com.jsowell.pile.domain.PileSimInfo; import com.jsowell.pile.domain.PileSimInfo;
import com.jsowell.pile.dto.IndexQueryDTO; import com.jsowell.pile.dto.*;
import com.jsowell.pile.dto.QueryPileDTO;
import com.jsowell.pile.dto.ReplaceMerchantStationDTO;
import com.jsowell.pile.dto.StartPersonPileDTO;
import com.jsowell.pile.mapper.PileBasicInfoMapper; import com.jsowell.pile.mapper.PileBasicInfoMapper;
import com.jsowell.pile.service.*; import com.jsowell.pile.service.*;
import com.jsowell.pile.service.programlogic.AbstractProgramLogic; import com.jsowell.pile.service.programlogic.AbstractProgramLogic;
@@ -37,6 +34,7 @@ import com.jsowell.pile.vo.uniapp.customer.GroundLockInfoVO;
import com.jsowell.pile.vo.uniapp.customer.PersonalPileInfoVO; import com.jsowell.pile.vo.uniapp.customer.PersonalPileInfoVO;
import com.jsowell.pile.vo.uniapp.customer.PileConnectorDetailVO; import com.jsowell.pile.vo.uniapp.customer.PileConnectorDetailVO;
import com.jsowell.pile.vo.web.*; import com.jsowell.pile.vo.web.*;
import com.jsowell.wxpay.service.WxAppletRemoteService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
@@ -89,6 +87,9 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
@Autowired @Autowired
private PileReservationInfoService pileReservationInfoService; private PileReservationInfoService pileReservationInfoService;
@Autowired
private WxAppletRemoteService wxAppletRemoteService;
/** /**
* 查询设备管理 * 查询设备管理
* *
@@ -1211,4 +1212,13 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
String orderCode = orderLogic.startPersonalPileCharging(dto); String orderCode = orderLogic.startPersonalPileCharging(dto);
return orderCode; return orderCode;
} }
/**
* 预约充电启动结果
*/
@Override
public void startupResult(ReservationChargingStartupResult chargingStartupResult) {
// 小程序通知
wxAppletRemoteService.reservationStartupResultSendMsg();
}
} }

View File

@@ -72,19 +72,14 @@ public class WxAppletRemoteService {
@Value("${weixin.sendMsg.stopChargingTmpId}") @Value("${weixin.sendMsg.stopChargingTmpId}")
private String stopChargingTmpId; private String stopChargingTmpId;
@Value("${weixin.sendMsg.startupResultTmpId}")
private String startupResultTmpId;
/** /**
* 获取accessToken * 获取accessToken
* *
* @return * @return
*/ */
public String getAccessToken() { public String getAccessToken() {
// String appid = Constants.APP_ID;
// String secret = Constants.APP_SECRET;
// 这里我是从配置文件中取得appid和appsecret
// appid = properties.getAppId();
// secret = properties.getAppSecret();
//查询token是否存在 //查询token是否存在
String redisKey = CacheConstants.ACCESS_TOKEN + appid; String redisKey = CacheConstants.ACCESS_TOKEN + appid;
// 使用缓存先查询AccessToken是否存在 // 使用缓存先查询AccessToken是否存在
@@ -236,7 +231,6 @@ public class WxAppletRemoteService {
return uniAppSendMsg(msgInfo); return uniAppSendMsg(msgInfo);
} }
/** /**
* 停止充电发送消息 * 停止充电发送消息
* @param dto * @param dto
@@ -281,7 +275,15 @@ public class WxAppletRemoteService {
} }
/** /**
* 小程序发送消息方法 * 预约充电结果小程序服务通知
*/
public Map<String, String> reservationStartupResultSendMsg() {
AppletTemplateMessageSendDTO msgInfo = new AppletTemplateMessageSendDTO();
return uniAppSendMsg(msgInfo);
}
/**
* 小程序发送消息方法/小程序通知/服务通知
* @param dto * @param dto
* @return * @return
*/ */