mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-01 08:30:05 +08:00
新增 绑定停车平台接口
This commit is contained in:
@@ -9,6 +9,8 @@ import com.jsowell.common.core.domain.entity.SysUser;
|
||||
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
||||
import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.DistanceUtils;
|
||||
import com.jsowell.common.util.SecurityUtils;
|
||||
@@ -16,8 +18,11 @@ import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.ip.AddressUtils;
|
||||
import com.jsowell.pile.domain.PileBasicInfo;
|
||||
import com.jsowell.pile.domain.PileStationInfo;
|
||||
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
|
||||
import com.jsowell.pile.domain.ThirdpartyParkingConfig;
|
||||
import com.jsowell.pile.dto.FastCreateStationDTO;
|
||||
import com.jsowell.pile.dto.QueryStationDTO;
|
||||
import com.jsowell.pile.dto.lutongyunting.BindParkingPlatformDTO;
|
||||
import com.jsowell.pile.mapper.PileStationInfoMapper;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||
@@ -73,6 +78,8 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
||||
@Autowired
|
||||
private SysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private IThirdPartyParkingConfigService parkingConfigService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -486,5 +493,25 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
||||
return pileStationInfoMapper.getIdsByDeptId(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定停车系统平台
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public int bindParkingPlatform(BindParkingPlatformDTO dto) {
|
||||
String parkingId = dto.getParkingId();
|
||||
String stationId = dto.getStationId();
|
||||
// 先根据停车系统平台查询一下是否有数据
|
||||
ThirdpartyParkingConfig basicInfo = parkingConfigService.selectByPrimaryKey(Integer.parseInt(parkingId));
|
||||
if (basicInfo == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_QUERY_PARKING_INFO_IS_NULL);
|
||||
}
|
||||
// 先删除缓存
|
||||
String redisKey = CacheConstants.SELECT_PILE_STATION_INFO_BY_ID + stationId;
|
||||
redisCache.deleteObject(redisKey);
|
||||
// 再将站点信息表中绑定上parkingId
|
||||
return pileStationInfoMapper.updateParkingPlatform(parkingId, stationId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.jsowell.pile.domain.ThirdpartyParkingConfig;
|
||||
import com.jsowell.pile.mapper.ThirdpartyParkingConfigMapper;
|
||||
import com.jsowell.pile.service.IThirdPartyParkingConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/8/25 13:43
|
||||
*/
|
||||
@Service
|
||||
public class ThirdPartyParkingConfigServiceImpl implements IThirdPartyParkingConfigService {
|
||||
|
||||
@Autowired
|
||||
private ThirdpartyParkingConfigMapper thirdpartyParkingConfigMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return thirdpartyParkingConfigMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(ThirdpartyParkingConfig record) {
|
||||
return thirdpartyParkingConfigMapper.insert(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSelective(ThirdpartyParkingConfig record) {
|
||||
return thirdpartyParkingConfigMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThirdpartyParkingConfig selectByPrimaryKey(Integer id) {
|
||||
return thirdpartyParkingConfigMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKeySelective(ThirdpartyParkingConfig record) {
|
||||
return thirdpartyParkingConfigMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKey(ThirdpartyParkingConfig record) {
|
||||
return thirdpartyParkingConfigMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user