车辆相关配置
This commit is contained in:
parent
08d6256fd5
commit
a842dcb7c6
@ -18,7 +18,7 @@ public interface EbikeDispatchConfigurationService extends IService<EbikeDispatc
|
|||||||
*
|
*
|
||||||
* @return 配置项
|
* @return 配置项
|
||||||
*/
|
*/
|
||||||
EbikeDispatchConfiguration getConfigurationByOperationId();
|
EbikeDispatchConfiguration getConfigurationByOperationId(Long operationId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置项保存
|
* 配置项保存
|
||||||
|
|||||||
@ -12,10 +12,7 @@ import com.cdzy.operations.model.dto.EbikeUserBikeInfo;
|
|||||||
import com.cdzy.operations.model.dto.EbikeUserLockDto;
|
import com.cdzy.operations.model.dto.EbikeUserLockDto;
|
||||||
import com.cdzy.operations.model.entity.*;
|
import com.cdzy.operations.model.entity.*;
|
||||||
import com.cdzy.operations.model.vo.*;
|
import com.cdzy.operations.model.vo.*;
|
||||||
import com.cdzy.operations.service.EbikeBikeInfoService;
|
import com.cdzy.operations.service.*;
|
||||||
import com.cdzy.operations.service.EbikeEcuInfoService;
|
|
||||||
import com.cdzy.operations.service.EbikeInventoryRecordService;
|
|
||||||
import com.cdzy.operations.service.EbikeInventoryService;
|
|
||||||
import com.cdzy.operations.utils.RedisUtil;
|
import com.cdzy.operations.utils.RedisUtil;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
@ -35,6 +32,7 @@ import java.time.LocalTime;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static com.cdzy.operations.model.entity.table.EbikeBatteryInfoTableDef.EBIKE_BATTERY_INFO;
|
import static com.cdzy.operations.model.entity.table.EbikeBatteryInfoTableDef.EBIKE_BATTERY_INFO;
|
||||||
import static com.cdzy.operations.model.entity.table.EbikeBikeInfoTableDef.EBIKE_BIKE_INFO;
|
import static com.cdzy.operations.model.entity.table.EbikeBikeInfoTableDef.EBIKE_BIKE_INFO;
|
||||||
@ -96,6 +94,9 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
|||||||
@Resource
|
@Resource
|
||||||
private EbikeBikeOrderMapper orderMapper;
|
private EbikeBikeOrderMapper orderMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private EbikeDispatchConfigurationService dispatchConfigurationService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void bind(EbikeBikeBindVo bindVo) {
|
public void bind(EbikeBikeBindVo bindVo) {
|
||||||
@ -466,6 +467,10 @@ public class EbikeBikeInfoServiceImpl extends ServiceImpl<EbikeBikeInfoMapper, E
|
|||||||
|
|
||||||
ebikeEcuInfoService.lock(ebikeEcuInfo);
|
ebikeEcuInfoService.lock(ebikeEcuInfo);
|
||||||
|
|
||||||
|
EbikeDispatchConfiguration configuration = dispatchConfigurationService.getConfigurationByOperationId(info.getOperatorId());
|
||||||
|
|
||||||
|
redisUtil.expire(bikeCode, configuration.getDispatchDuration(), TimeUnit.HOURS);
|
||||||
|
|
||||||
this.mapper.update(info);
|
this.mapper.update(info);
|
||||||
|
|
||||||
return EbikeUserLockDto.builder()
|
return EbikeUserLockDto.builder()
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import static com.cdzy.operations.model.entity.table.EbikeDispatchConfigurationTableDef.EBIKE_DISPATCH_CONFIGURATION;
|
import static com.cdzy.operations.model.entity.table.EbikeDispatchConfigurationTableDef.EBIKE_DISPATCH_CONFIGURATION;
|
||||||
|
|
||||||
@ -24,9 +25,10 @@ import static com.cdzy.operations.model.entity.table.EbikeDispatchConfigurationT
|
|||||||
public class EbikeDispatchConfigurationServiceImpl extends ServiceImpl<EbikeDispatchConfigurationMapper, EbikeDispatchConfiguration> implements EbikeDispatchConfigurationService {
|
public class EbikeDispatchConfigurationServiceImpl extends ServiceImpl<EbikeDispatchConfigurationMapper, EbikeDispatchConfiguration> implements EbikeDispatchConfigurationService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EbikeDispatchConfiguration getConfigurationByOperationId() {
|
public EbikeDispatchConfiguration getConfigurationByOperationId(Long operationId) {
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||||
.select(EBIKE_DISPATCH_CONFIGURATION.ALL_COLUMNS);
|
.select(EBIKE_DISPATCH_CONFIGURATION.ALL_COLUMNS)
|
||||||
|
.and(EBIKE_DISPATCH_CONFIGURATION.OPERATOR_ID.eq(operationId, Objects.nonNull(operationId)));
|
||||||
return this.mapper.selectOneByQuery(queryWrapper);
|
return this.mapper.selectOneByQuery(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user