mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-16 15:58:41 +08:00
update 更新桩清缓存
This commit is contained in:
@@ -116,8 +116,8 @@ public class PileRemoteService {
|
|||||||
PileStationVO pileStationVO = pileStationInfoService.getStationInfoByPileSn(pileSn);
|
PileStationVO pileStationVO = pileStationInfoService.getStationInfoByPileSn(pileSn);
|
||||||
if (StringUtils.isNotBlank(pileStationVO.getQrcodePrefix())) {
|
if (StringUtils.isNotBlank(pileStationVO.getQrcodePrefix())) {
|
||||||
command.setQrcodePrefix(pileStationVO.getQrcodePrefix());
|
command.setQrcodePrefix(pileStationVO.getQrcodePrefix());
|
||||||
ykcPushCommandService.pushIssueQRCodeCommand(command);
|
|
||||||
}
|
}
|
||||||
|
ykcPushCommandService.pushIssueQRCodeCommand(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,13 +14,25 @@ import com.jsowell.common.util.Cp56Time2a.Cp56Time2aUtil;
|
|||||||
import com.jsowell.common.util.DateUtils;
|
import com.jsowell.common.util.DateUtils;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.common.util.YKCUtils;
|
import com.jsowell.common.util.YKCUtils;
|
||||||
import com.jsowell.netty.command.ykc.*;
|
import com.jsowell.netty.command.ykc.GetRealTimeMonitorDataCommand;
|
||||||
|
import com.jsowell.netty.command.ykc.IssueQRCodeCommand;
|
||||||
|
import com.jsowell.netty.command.ykc.PileSettingCommand;
|
||||||
|
import com.jsowell.netty.command.ykc.ProofreadTimeCommand;
|
||||||
|
import com.jsowell.netty.command.ykc.PublishPileBillingTemplateCommand;
|
||||||
|
import com.jsowell.netty.command.ykc.QueryWorkParamsCommand;
|
||||||
|
import com.jsowell.netty.command.ykc.RebootCommand;
|
||||||
|
import com.jsowell.netty.command.ykc.StartChargingCommand;
|
||||||
|
import com.jsowell.netty.command.ykc.StopChargingCommand;
|
||||||
|
import com.jsowell.netty.command.ykc.UpdateFirmwareCommand;
|
||||||
import com.jsowell.netty.service.yunkuaichong.YKCPushCommandService;
|
import com.jsowell.netty.service.yunkuaichong.YKCPushCommandService;
|
||||||
import com.jsowell.pile.domain.PileBasicInfo;
|
import com.jsowell.pile.service.IPileBasicInfoService;
|
||||||
import com.jsowell.pile.service.*;
|
import com.jsowell.pile.service.IPileBillingTemplateService;
|
||||||
|
import com.jsowell.pile.service.IPileConnectorInfoService;
|
||||||
|
import com.jsowell.pile.service.IPileModelInfoService;
|
||||||
|
import com.jsowell.pile.service.IPileMsgRecordService;
|
||||||
|
import com.jsowell.pile.service.IPileStationInfoService;
|
||||||
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
||||||
import com.jsowell.pile.vo.web.PileModelInfoVO;
|
import com.jsowell.pile.vo.web.PileModelInfoVO;
|
||||||
import com.jsowell.pile.vo.web.PileStationVO;
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
|
|||||||
@@ -94,6 +94,16 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
return pileBasicInfoMapper.selectPileBasicInfoById(id);
|
return pileBasicInfoMapper.selectPileBasicInfoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除缓存
|
||||||
|
* @param pileSn
|
||||||
|
*/
|
||||||
|
private void cleanRedisCache(String pileSn) {
|
||||||
|
List<String> keys = Lists.newArrayList();
|
||||||
|
keys.add(CacheConstants.SELECT_PILE_BASIC_INFO_BY_SN + pileSn);
|
||||||
|
redisCache.deleteObject(keys);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PileBasicInfo selectPileBasicInfoBySN(String pileSn) {
|
public PileBasicInfo selectPileBasicInfoBySN(String pileSn) {
|
||||||
// 加缓存
|
// 加缓存
|
||||||
@@ -143,8 +153,7 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
public int updatePileBasicInfo(PileBasicInfo pileBasicInfo) {
|
public int updatePileBasicInfo(PileBasicInfo pileBasicInfo) {
|
||||||
// pileBasicInfo.setUpdateBy(SecurityUtils.getUsername());
|
// pileBasicInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||||
// 清缓存
|
// 清缓存
|
||||||
String redisKey = CacheConstants.SELECT_PILE_BASIC_INFO_BY_SN + pileBasicInfo.getSn();
|
cleanRedisCache(pileBasicInfo.getSn());
|
||||||
redisCache.deleteObject(redisKey);
|
|
||||||
pileBasicInfo.setUpdateTime(DateUtils.getNowDate());
|
pileBasicInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
return pileBasicInfoMapper.updatePileBasicInfo(pileBasicInfo);
|
return pileBasicInfoMapper.updatePileBasicInfo(pileBasicInfo);
|
||||||
}
|
}
|
||||||
@@ -262,6 +271,7 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int replaceMerchantStationByPileIds(ReplaceMerchantStationDTO dto) {
|
public int replaceMerchantStationByPileIds(ReplaceMerchantStationDTO dto) {
|
||||||
|
|
||||||
dto.setUpdateBy(SecurityUtils.getUsername());
|
dto.setUpdateBy(SecurityUtils.getUsername());
|
||||||
dto.setUpdateTime(DateUtils.getNowDate());
|
dto.setUpdateTime(DateUtils.getNowDate());
|
||||||
int num = pileBasicInfoMapper.replaceMerchantStationByPileIds(dto);
|
int num = pileBasicInfoMapper.replaceMerchantStationByPileIds(dto);
|
||||||
@@ -271,6 +281,8 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
pileConnectorInfoService.deletePileConnectorInfoByPileSnList(dto.getPileSnList());
|
pileConnectorInfoService.deletePileConnectorInfoByPileSnList(dto.getPileSnList());
|
||||||
List<PileConnectorInfo> connectorInfoList = Lists.newArrayList();
|
List<PileConnectorInfo> connectorInfoList = Lists.newArrayList();
|
||||||
for (String pileSn : dto.getPileSnList()) {
|
for (String pileSn : dto.getPileSnList()) {
|
||||||
|
// 清缓存
|
||||||
|
cleanRedisCache(pileSn);
|
||||||
for (int i = 1; i < dto.getConnectorNum() + 1; i++) {
|
for (int i = 1; i < dto.getConnectorNum() + 1; i++) {
|
||||||
// 组装pile_connector_info表数据
|
// 组装pile_connector_info表数据
|
||||||
PileConnectorInfo connectorInfo = new PileConnectorInfo();
|
PileConnectorInfo connectorInfo = new PileConnectorInfo();
|
||||||
@@ -358,38 +370,6 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
return pileInfoVOS;
|
return pileInfoVOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过桩sn号查询站点id
|
|
||||||
*
|
|
||||||
* @param sn 桩sn号
|
|
||||||
* @return 站点id
|
|
||||||
*/
|
|
||||||
// @Override
|
|
||||||
// public String selectStationIdBySn(String sn) {
|
|
||||||
// return pileBasicInfoMapper.selectStationIdBySn(sn);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* uniApp通过桩号查询桩详情
|
|
||||||
*
|
|
||||||
* @param pileSn 桩号
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
// @Override
|
|
||||||
// public PileDetailVO uniAppGetPileDetailByPileSn(String pileSn) {
|
|
||||||
// PileDetailVO pileDetailVO = pileBasicInfoMapper.uniAppGetPileDetailByPileSn(pileSn);
|
|
||||||
// // 查询计费模板
|
|
||||||
// BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
|
|
||||||
// if (Objects.nonNull(billingTemplateVO)) {
|
|
||||||
// pileDetailVO.setBillingTemplate(billingTemplateVO);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// // 查询枪口相关信息
|
|
||||||
// List<ConnectorVO> connectorList = new ArrayList<>();
|
|
||||||
//
|
|
||||||
// return pileDetailVO;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改状态
|
* 修改状态
|
||||||
* 用于登陆协议,心跳包协议,上传实时数据协议 更新状态的方法
|
* 用于登陆协议,心跳包协议,上传实时数据协议 更新状态的方法
|
||||||
@@ -407,6 +387,8 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@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 putGunType) {
|
||||||
|
// 清缓存
|
||||||
|
cleanRedisCache(pileSn);
|
||||||
// log.info("updateStatus传参:帧类型:{}, 桩编号:{}, 枪口号:{}, 状态:{}, 插拔枪:{}", "0x" + frameType, pileSn, connectorCode, status, putGunType);
|
// log.info("updateStatus传参:帧类型:{}, 桩编号:{}, 枪口号:{}, 状态:{}, 插拔枪:{}", "0x" + frameType, pileSn, connectorCode, status, putGunType);
|
||||||
/*
|
/*
|
||||||
0x01 登陆认证
|
0x01 登陆认证
|
||||||
@@ -530,6 +512,8 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updatePileSimInfo(String pileSn, String iccid) {
|
public void updatePileSimInfo(String pileSn, String iccid) {
|
||||||
|
// 清缓存
|
||||||
|
cleanRedisCache(pileSn);
|
||||||
PileBasicInfo basicInfo = selectPileBasicInfoBySN(pileSn);
|
PileBasicInfo basicInfo = selectPileBasicInfoBySN(pileSn);
|
||||||
if (basicInfo == null) {
|
if (basicInfo == null) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user