mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 修改充电桩别名
This commit is contained in:
@@ -12,6 +12,8 @@ import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.DelFlagEnum;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.*;
|
||||
import com.jsowell.pile.domain.PileBasicInfo;
|
||||
import com.jsowell.pile.domain.PileConnectorInfo;
|
||||
@@ -150,10 +152,23 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
||||
@Override
|
||||
public int updatePileBasicInfo(PileBasicInfo pileBasicInfo) {
|
||||
// pileBasicInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
Long stationId = pileBasicInfo.getStationId();
|
||||
// 清缓存
|
||||
cleanRedisCache(pileBasicInfo.getSn());
|
||||
pileBasicInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
redisCache.deleteObject(CacheConstants.GET_PILE_LIST_BY_STATION_ID + pileBasicInfo.getStationId());
|
||||
// 判断是否修改别名
|
||||
if (StringUtils.isNotBlank(pileBasicInfo.getName())) {
|
||||
// 先查询该别名在该站点下是否有用过
|
||||
PileBasicInfo info = new PileBasicInfo();
|
||||
info.setName(pileBasicInfo.getName());
|
||||
info.setStationId(stationId);
|
||||
List<PileBasicInfo> pileBasicInfos = selectPileBasicInfoList(info);
|
||||
if (CollectionUtils.isNotEmpty(pileBasicInfos)) {
|
||||
// 已有重复别名
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_THIS_NAME_HAS_BEEN_USED);
|
||||
}
|
||||
}
|
||||
redisCache.deleteObject(CacheConstants.GET_PILE_LIST_BY_STATION_ID + stationId);
|
||||
return pileBasicInfoMapper.updatePileBasicInfo(pileBasicInfo);
|
||||
}
|
||||
|
||||
@@ -709,11 +724,14 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
||||
List<PileConnectorInfoVO> connectorInfoVOList = pileConnectorInfoService.selectConnectorListByStationId(Long.parseLong(stationId));
|
||||
// 根据pileSn分组
|
||||
Map<String, List<PileConnectorInfoVO>> collect = connectorInfoVOList.stream().collect(Collectors.groupingBy(PileConnectorInfoVO::getPileSn));
|
||||
// 根据桩别名分组
|
||||
// Map<String, List<PileConnectorInfoVO>> collect = connectorInfoVOList.stream().collect(Collectors.groupingBy(PileConnectorInfoVO::getName));
|
||||
|
||||
for (Map.Entry<String, List<PileConnectorInfoVO>> entry : collect.entrySet()) {
|
||||
vo = new GroundLockInfoVO();
|
||||
lockInfoList = new ArrayList<>();
|
||||
String pileSn = entry.getKey();
|
||||
// String pileName = entry.getKey();
|
||||
List<PileConnectorInfoVO> list = entry.getValue();
|
||||
for (PileConnectorInfoVO pileConnectorInfoVO : list) {
|
||||
// 查地锁缓存状态,有缓存说明有地锁信息
|
||||
@@ -737,6 +755,7 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
||||
.build());
|
||||
}
|
||||
vo.setPileSn(pileSn);
|
||||
// vo.setName(pileName);
|
||||
vo.setLockInfos(lockInfoList);
|
||||
|
||||
resultList.add(vo);
|
||||
|
||||
@@ -23,6 +23,11 @@ public class GroundLockInfoVO {
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 桩别名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 地锁List
|
||||
*/
|
||||
|
||||
@@ -70,6 +70,11 @@ public class PileConnectorInfoVO {
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 充电桩别名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
* 1-直流接口 汽车桩+快充
|
||||
|
||||
@@ -23,6 +23,11 @@ public class PileDetailVO {
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 桩类型(1-运营桩;2-个人桩)
|
||||
*/
|
||||
private String businessType;
|
||||
|
||||
/**
|
||||
* 别名
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user