mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
预约充电
This commit is contained in:
@@ -32,6 +32,11 @@ public class PileReservedInfo {
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 充电桩枪口编号
|
||||
*/
|
||||
private String pileConnectorCode;
|
||||
|
||||
/**
|
||||
* 状态(0-未生效;1-生效)
|
||||
*/
|
||||
|
||||
@@ -20,6 +20,11 @@ public class CreateReservedDTO {
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 充电桩枪口编号
|
||||
*/
|
||||
private String pileConnectorCode;
|
||||
|
||||
/**
|
||||
* 预约开始时间
|
||||
*/
|
||||
|
||||
@@ -116,6 +116,16 @@ public interface PileBasicInfoService {
|
||||
*/
|
||||
List<PileDetailVO> selectPileListByStationIds(List<Long> stationIdList);
|
||||
|
||||
/**
|
||||
* 首次插枪
|
||||
*/
|
||||
public void firstPlugInCharger(String pileConnectorCode);
|
||||
|
||||
/**
|
||||
* 首次拔枪
|
||||
*/
|
||||
public void firstUnplugCharger(String pileConnectorCode);
|
||||
|
||||
/**
|
||||
* 通过桩编号查询站点id
|
||||
* @param sn 桩编号
|
||||
|
||||
@@ -32,9 +32,24 @@ public interface PileReservedInfoService {
|
||||
|
||||
List<PileReservedInfo> getReservationsByMemberIdAndPileSn(String memberId, String pileSn);
|
||||
|
||||
/**
|
||||
* 启动预约
|
||||
* @param dto
|
||||
*/
|
||||
void activateReserved(PileReservedDTO dto);
|
||||
|
||||
/**
|
||||
* 关闭预约
|
||||
* @param dto
|
||||
*/
|
||||
void deactivateReserved(PileReservedDTO dto);
|
||||
|
||||
/**
|
||||
* 根据充电枪口编号发送预约指令
|
||||
* @param pileConnectorCode
|
||||
*/
|
||||
void pushReservedByPileConnectorCode(String pileConnectorCode);
|
||||
|
||||
void cancelOneTimeReservation(String pileConnectorCode);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,18 +82,15 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
@Autowired
|
||||
private SimCardService simCardService;
|
||||
|
||||
@Autowired
|
||||
private PileSimInfoMapper pileSimInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private PileMerchantInfoMapper pileMerchantInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Value("${baseurl.prefix}")
|
||||
private String BASE_URL_PREFIX;
|
||||
|
||||
@Autowired
|
||||
private PileReservedInfoService pileReservedInfoService;
|
||||
|
||||
/**
|
||||
* 查询设备管理
|
||||
*
|
||||
@@ -460,6 +457,28 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
return pileInfoVOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 首次插枪
|
||||
*
|
||||
* @param pileConnectorCode
|
||||
*/
|
||||
@Override
|
||||
public void firstPlugInCharger(String pileConnectorCode) {
|
||||
// 下发预约指令
|
||||
pileReservedInfoService.pushReservedByPileConnectorCode(pileConnectorCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 首次拔枪
|
||||
*
|
||||
* @param pileConnectorCode
|
||||
*/
|
||||
@Override
|
||||
public void firstUnplugCharger(String pileConnectorCode) {
|
||||
// 关闭仅执行一次的预约
|
||||
pileReservedInfoService.cancelOneTimeReservation(pileConnectorCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* 用于登陆协议,心跳包协议,上传实时数据协议 更新状态的方法
|
||||
@@ -476,10 +495,10 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
* 7.上传实时数据,枪状态传0x03充电,设置为【3-占用(充电中)】
|
||||
*/
|
||||
@Override
|
||||
public void updateStatus(String frameType, String pileSn, String connectorCode, String status, String putGunType) {
|
||||
public void updateStatus(String frameType, String pileSn, String connectorCode, String status, String isChargerPluggedIn) {
|
||||
// 清缓存
|
||||
cleanRedisCache(pileSn);
|
||||
// log.info("updateStatus传参:帧类型:{}, 桩编号:{}, 枪口号:{}, 状态:{}, 插拔枪:{}", "0x" + frameType, pileSn, connectorCode, status, putGunType);
|
||||
// log.info("updateStatus传参:帧类型:{}, 桩编号:{}, 枪口号:{}, 状态:{}, 插拔枪:{}", "0x" + frameType, pileSn, connectorCode, status, isChargerPluggedIn);
|
||||
/*
|
||||
0x01 登陆认证
|
||||
登陆成功,把充电桩和枪口的状态都更新为【在线】
|
||||
@@ -522,7 +541,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
*/
|
||||
if (StringUtils.equals(frameType, BytesUtil.bcd2Str(YKCFrameTypeCode.UPLOAD_REAL_TIME_MONITOR_DATA_CODE.getBytes()))
|
||||
|| StringUtils.equals(frameType, BytesUtil.bcd2Str(YKCFrameTypeCode.UPLOAD_REAL_TIME_MONITOR_DATA_OLD_VERSION_CODE.getBytes()))) {
|
||||
// log.info("上传实时数据中的修改状态逻辑 桩号:{}, 枪号:{}, 枪状态{}, 是否插枪:{}", pileSn, connectorCode, status, putGunType);
|
||||
// log.info("上传实时数据中的修改状态逻辑 桩号:{}, 枪号:{}, 枪状态{}, 是否插枪:{}", pileSn, connectorCode, status, isChargerPluggedIn);
|
||||
/**
|
||||
* 更新枪状态
|
||||
* connectorStatus 桩传过来的枪口状态: 0x00:离线 0x01:故障 0x02:空闲 0x03:充电
|
||||
@@ -535,7 +554,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
statusDataBase = PileConnectorDataBaseStatusEnum.FAULT.getValue();
|
||||
} else if (StringUtils.equals(status, PileConnectorStatusEnum.FREE.getValue())) { // 空闲
|
||||
//是否插枪 0x00:否 0x01:是
|
||||
if (StringUtils.equals(putGunType, Constants.ZERO_ONE)) {
|
||||
if (StringUtils.equals(isChargerPluggedIn, Constants.ZERO_ONE)) {
|
||||
// 空闲并插枪 设置为【占用(未充电)】
|
||||
statusDataBase = PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue();
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.jsowell.pile.service.impl;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.dto.PileReservedDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -11,7 +10,6 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.sql.Time;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.mapper.PileReservedInfoMapper;
|
||||
@@ -118,7 +116,6 @@ public class PileReservedInfoServiceImpl implements PileReservedInfoService {
|
||||
pileReservedInfoMapper.updateByPrimaryKeySelective(pileReservedInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验时间是否重叠
|
||||
* @param memberId
|
||||
@@ -154,5 +151,14 @@ public class PileReservedInfoServiceImpl implements PileReservedInfoService {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_UPDATE_RESERVED_STATUS_REFUSED);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据充电枪口编号发送指令
|
||||
* @param pileConnectorCode
|
||||
*/
|
||||
@Override
|
||||
public void pushReservedByPileConnectorCode(String pileConnectorCode) {
|
||||
// 根据充电枪口编号查询正在生效中的预约
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user