mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
个人桩停止充电
This commit is contained in:
@@ -4,8 +4,10 @@ import com.alibaba.fastjson2.JSON;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.DelFlagEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
@@ -57,6 +59,9 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
||||
@Autowired
|
||||
private PileMemberRelationService pileMemberRelationService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return pileReservationInfoMapper.deleteByPrimaryKey(id);
|
||||
@@ -431,6 +436,7 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
||||
public void personPileStopCharging(PersonPileStopChargingDTO dto) {
|
||||
String pileConnectorCode = dto.getPileConnectorCode();
|
||||
String pileSn = StringUtils.substring(pileConnectorCode, 0, pileConnectorCode.length() - 2);
|
||||
String connectorCode = StringUtils.substring(pileConnectorCode, pileConnectorCode.length() - 2, pileConnectorCode.length());
|
||||
// 查询个人桩信息
|
||||
List<PileMemberRelation> pileMemberRelations = pileMemberRelationService.selectPileMemberRelationByPileSn(pileSn);
|
||||
Map<String, List<String>> listMap = pileMemberRelations.stream()
|
||||
@@ -451,7 +457,11 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
||||
}
|
||||
|
||||
if (stopFlag) {
|
||||
log.info("发送停止指令");
|
||||
String pileIsChargingKey = CacheConstants.PILE_IS_CHARGING + pileSn + connectorCode;
|
||||
String redisResult = redisCache.getCacheObject(pileIsChargingKey);
|
||||
// 发送停止充电指令
|
||||
log.info("发送停止指令, pileSn:{}, connectorCode:{}, transactionCode:{}", pileSn, connectorCode, redisResult);
|
||||
pileRemoteService.remoteStopCharging(pileSn, connectorCode, redisResult);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user