mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
新增协议0x65预约充电启动结果上传
This commit is contained in:
@@ -106,6 +106,7 @@ weixin:
|
||||
sendMsg:
|
||||
startChargingTmpId: BGgZe98QHr0I1S1GrtGps0y3uhvURtQNkbMAzI2D8g8
|
||||
stopChargingTmpId: UyBPbADlZfsCj89rh_xvfR2ZP1iwtmPcMFA0sUOJwog
|
||||
startupResultTmpId: BGgZe98QHr0I1S1GrtGps-Av8-Y6WoD2Ny8DZWvdhoQ
|
||||
|
||||
#Sim卡信息
|
||||
xunzhong:
|
||||
|
||||
@@ -8,8 +8,11 @@ import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
import com.jsowell.netty.factory.YKCOperateFactory;
|
||||
import com.jsowell.pile.dto.ReservationChargingStartupResult;
|
||||
import com.jsowell.pile.service.PileBasicInfoService;
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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());
|
||||
|
||||
@Autowired
|
||||
private PileBasicInfoService pileBasicInfoService;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
YKCOperateFactory.register(type, this);
|
||||
@@ -76,6 +82,15 @@ public class ReservationChargingStartupResultHandler extends AbstractHandler{
|
||||
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);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -2,10 +2,7 @@ package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.pile.domain.PileBasicInfo;
|
||||
import com.jsowell.pile.dto.IndexQueryDTO;
|
||||
import com.jsowell.pile.dto.QueryPileDTO;
|
||||
import com.jsowell.pile.dto.ReplaceMerchantStationDTO;
|
||||
import com.jsowell.pile.dto.StartPersonPileDTO;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.thirdparty.ConnectorInfo;
|
||||
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
||||
import com.jsowell.pile.thirdparty.ZDLConnectorInfo;
|
||||
@@ -222,4 +219,6 @@ public interface PileBasicInfoService {
|
||||
List<ZDLConnectorInfo> getConnectorListForZDL(String pileSn);
|
||||
|
||||
String startPersonalPileCharging(StartPersonPileDTO dto);
|
||||
|
||||
void startupResult(ReservationChargingStartupResult chargingStartupResult);
|
||||
}
|
||||
|
||||
@@ -18,10 +18,7 @@ import com.jsowell.pile.domain.PileBasicInfo;
|
||||
import com.jsowell.pile.domain.PileConnectorInfo;
|
||||
import com.jsowell.pile.domain.PileModelInfo;
|
||||
import com.jsowell.pile.domain.PileSimInfo;
|
||||
import com.jsowell.pile.dto.IndexQueryDTO;
|
||||
import com.jsowell.pile.dto.QueryPileDTO;
|
||||
import com.jsowell.pile.dto.ReplaceMerchantStationDTO;
|
||||
import com.jsowell.pile.dto.StartPersonPileDTO;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.mapper.PileBasicInfoMapper;
|
||||
import com.jsowell.pile.service.*;
|
||||
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.PileConnectorDetailVO;
|
||||
import com.jsowell.pile.vo.web.*;
|
||||
import com.jsowell.wxpay.service.WxAppletRemoteService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
@@ -89,6 +87,9 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
@Autowired
|
||||
private PileReservationInfoService pileReservationInfoService;
|
||||
|
||||
@Autowired
|
||||
private WxAppletRemoteService wxAppletRemoteService;
|
||||
|
||||
/**
|
||||
* 查询设备管理
|
||||
*
|
||||
@@ -1211,4 +1212,13 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
String orderCode = orderLogic.startPersonalPileCharging(dto);
|
||||
return orderCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 预约充电启动结果
|
||||
*/
|
||||
@Override
|
||||
public void startupResult(ReservationChargingStartupResult chargingStartupResult) {
|
||||
// 小程序通知
|
||||
wxAppletRemoteService.reservationStartupResultSendMsg();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,19 +72,14 @@ public class WxAppletRemoteService {
|
||||
@Value("${weixin.sendMsg.stopChargingTmpId}")
|
||||
private String stopChargingTmpId;
|
||||
|
||||
@Value("${weixin.sendMsg.startupResultTmpId}")
|
||||
private String startupResultTmpId;
|
||||
/**
|
||||
* 获取accessToken
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getAccessToken() {
|
||||
// String appid = Constants.APP_ID;
|
||||
// String secret = Constants.APP_SECRET;
|
||||
|
||||
// 这里我是从配置文件中取得appid和appsecret
|
||||
// appid = properties.getAppId();
|
||||
// secret = properties.getAppSecret();
|
||||
|
||||
//查询token是否存在
|
||||
String redisKey = CacheConstants.ACCESS_TOKEN + appid;
|
||||
// 使用缓存先查询AccessToken是否存在
|
||||
@@ -236,7 +231,6 @@ public class WxAppletRemoteService {
|
||||
return uniAppSendMsg(msgInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 停止充电发送消息
|
||||
* @param dto
|
||||
@@ -281,7 +275,15 @@ public class WxAppletRemoteService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序发送消息方法
|
||||
* 预约充电结果小程序服务通知
|
||||
*/
|
||||
public Map<String, String> reservationStartupResultSendMsg() {
|
||||
AppletTemplateMessageSendDTO msgInfo = new AppletTemplateMessageSendDTO();
|
||||
return uniAppSendMsg(msgInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序发送消息方法/小程序通知/服务通知
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user