mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
改名
This commit is contained in:
@@ -108,10 +108,10 @@ public interface PileConnectorInfoMapper {
|
||||
/**
|
||||
* 根据枪口号 修改枪口状态
|
||||
*
|
||||
* @param connectorCode 枪口号
|
||||
* @param pileConnectorCode 枪口号
|
||||
* @param connectorStatus 状态
|
||||
*/
|
||||
int updateConnectorStatus(@Param("connectorCode") String connectorCode, @Param("connectorStatus") String connectorStatus);
|
||||
int updateConnectorStatus(@Param("pileConnectorCode") String pileConnectorCode, @Param("connectorStatus") String connectorStatus);
|
||||
|
||||
/**
|
||||
* 根据桩编号修改枪口状态
|
||||
|
||||
@@ -470,23 +470,23 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService {
|
||||
* 修改枪口状态
|
||||
* 所有修改枪口状态的都要使用这个方法,和数据库交互只有这一个口子
|
||||
*
|
||||
* @param connectorCode 枪口号 桩编号+枪口号
|
||||
* @param pileConnectorCode 枪口编号 桩编号+枪口号
|
||||
* @param status 状态 0:离网 (默认);1:空闲;2:占用(未充电);3:占用(充电中);4:占用(预约锁定) ;255:故障
|
||||
*/
|
||||
@Override
|
||||
public int updateConnectorStatus(String connectorCode, String status) {
|
||||
public int updateConnectorStatus(String pileConnectorCode, String status) {
|
||||
int num = 0;
|
||||
if (StringUtils.isBlank(connectorCode) || StringUtils.isBlank(status)) {
|
||||
if (StringUtils.isBlank(pileConnectorCode) || StringUtils.isBlank(status)) {
|
||||
return num;
|
||||
}
|
||||
String redisKey = CacheConstants.PILE_CONNECTOR_STATUS_KEY + connectorCode;
|
||||
String redisKey = CacheConstants.PILE_CONNECTOR_STATUS_KEY + pileConnectorCode;
|
||||
String redisStatus = redisCache.getCacheObject(redisKey);
|
||||
// log.info("修改充电桩枪口状态 缓存状态:{}, 传来的状态:{}", redisStatus, status);
|
||||
if (!StringUtils.equals(redisStatus, status)) {
|
||||
log.info("更新枪口状态 枪口号:{}, 缓存状态:{}, 状态值:{}, 状态:{}", connectorCode, redisStatus, status, PileConnectorDataBaseStatusEnum.getStatusDescription(status));
|
||||
String pileSn = connectorCode.substring(0, connectorCode.length() - 2);
|
||||
log.info("更新枪口状态 枪口编号:{}, 缓存状态:{}, 状态值:{}, 状态:{}", pileConnectorCode, redisStatus, status, PileConnectorDataBaseStatusEnum.getStatusDescription(status));
|
||||
String pileSn = pileConnectorCode.substring(0, pileConnectorCode.length() - 2);
|
||||
// 只修改一个枪口的状态
|
||||
num = pileConnectorInfoMapper.updateConnectorStatus(connectorCode, status);
|
||||
num = pileConnectorInfoMapper.updateConnectorStatus(pileConnectorCode, status);
|
||||
deleteRedisByPileSn(pileSn);
|
||||
redisCache.setCacheObject(redisKey, status);
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
<update id="updateConnectorStatus">
|
||||
update pile_connector_info
|
||||
set status = #{connectorStatus,jdbcType=VARCHAR}
|
||||
where pile_connector_code = #{connectorCode,jdbcType=VARCHAR}
|
||||
where pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
|
||||
</update>
|
||||
|
||||
<update id="updateConnectorStatusByPileSn">
|
||||
|
||||
Reference in New Issue
Block a user