Compare commits
No commits in common. "f580956f19090434dc7e388268d7262d3d82d759ecc5267ae94735120ea2e494" and "0a3de7088c5d64fc0360581d96d7738fac52914d5d30932b92a797fb27676eac" have entirely different histories.
f580956f19
...
0a3de7088c
@ -0,0 +1,14 @@
|
|||||||
|
package com.cdzy.operations.mapper;
|
||||||
|
|
||||||
|
import com.cdzy.operations.model.entity.EbikeBikeConfiguration;
|
||||||
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆相关配置 映射层
|
||||||
|
*
|
||||||
|
* @author yanglei
|
||||||
|
* @since 2025-12-03 16:21
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface EbikeBikeConfigurationMapper extends BaseMapper<EbikeBikeConfiguration> {
|
||||||
|
}
|
||||||
@ -1,14 +0,0 @@
|
|||||||
package com.cdzy.operations.mapper;
|
|
||||||
|
|
||||||
import com.cdzy.operations.model.entity.EbikeDispatchConfiguration;
|
|
||||||
import com.mybatisflex.core.BaseMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆调度配置 映射层
|
|
||||||
*
|
|
||||||
* @author yanglei
|
|
||||||
* @since 2025-12-03 16:21
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface EbikeDispatchConfigurationMapper extends BaseMapper<EbikeDispatchConfiguration> {
|
|
||||||
}
|
|
||||||
@ -15,12 +15,7 @@ import lombok.NoArgsConstructor;
|
|||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class EbikeDispatchConfigurationDto {
|
public class EbikeBikeConfigurationDto {
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键id
|
|
||||||
*/
|
|
||||||
private Long configurationId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运营商id
|
* 运营商id
|
||||||
@ -31,12 +26,12 @@ public class EbikeDispatchConfigurationDto {
|
|||||||
/**
|
/**
|
||||||
* 配置项时长
|
* 配置项时长
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "车辆多长时间无单生成调度工单不能为空")
|
@NotNull(message = "配置项时长不能为空")
|
||||||
private Integer dispatchDuration;
|
private Integer configurationDuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置项描述
|
* 配置项描述
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "调度完成后多长时间内骑行是有效的不能为空")
|
@NotBlank(message = "配置项描述不能为空")
|
||||||
private Integer rideDuration;
|
private String configurationDescription;
|
||||||
}
|
}
|
||||||
@ -23,8 +23,8 @@ import java.time.LocalDateTime;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Table("ebike_dispatch_configuration")
|
@Table("ebike_bike_configuration")
|
||||||
public class EbikeDispatchConfiguration implements Serializable {
|
public class EbikeBikeConfiguration implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -33,7 +33,7 @@ public class EbikeDispatchConfiguration implements Serializable {
|
|||||||
* 操作主键id
|
* 操作主键id
|
||||||
*/
|
*/
|
||||||
@Id
|
@Id
|
||||||
private Long configurationId;
|
private Long batteryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运营商id
|
* 运营商id
|
||||||
@ -41,14 +41,14 @@ public class EbikeDispatchConfiguration implements Serializable {
|
|||||||
private Long operatorId;
|
private Long operatorId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆多长时间无单生成调度工单
|
* 配置项时长
|
||||||
*/
|
*/
|
||||||
private Integer dispatchDuration;
|
private Integer configurationDuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调度完成后多长时间内骑行是有效的
|
* 配置项描述
|
||||||
*/
|
*/
|
||||||
private Integer rideDuration;
|
private String configurationDescription;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
@ -1,9 +1,11 @@
|
|||||||
package com.cdzy.operations.service;
|
package com.cdzy.operations.service;
|
||||||
|
|
||||||
import com.cdzy.operations.model.dto.EbikeDispatchConfigurationDto;
|
import com.cdzy.operations.model.dto.EbikeBikeConfigurationDto;
|
||||||
import com.cdzy.operations.model.entity.EbikeDispatchConfiguration;
|
import com.cdzy.operations.model.entity.EbikeBikeConfiguration;
|
||||||
import com.mybatisflex.core.service.IService;
|
import com.mybatisflex.core.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆相关配置 服务层
|
* 车辆相关配置 服务层
|
||||||
*
|
*
|
||||||
@ -11,19 +13,19 @@ import com.mybatisflex.core.service.IService;
|
|||||||
* @since 2025-12-03 16:22
|
* @since 2025-12-03 16:22
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface EbikeDispatchConfigurationService extends IService<EbikeDispatchConfiguration> {
|
public interface EbikeBikeConfigurationService extends IService<EbikeBikeConfiguration> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据运营商id获取配置项(sql会自动拼接运营商id)
|
* 根据运营商id获取配置项(sql会自动拼接运营商id)
|
||||||
*
|
*
|
||||||
* @return 配置项
|
* @return 配置项
|
||||||
*/
|
*/
|
||||||
EbikeDispatchConfiguration getConfigurationByOperationId();
|
List<EbikeBikeConfiguration> getConfigurationByOperationId();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置项保存
|
* 配置项保存
|
||||||
*
|
*
|
||||||
* @param configurationDto 配置项参数
|
* @param configurationDto 配置项参数
|
||||||
*/
|
*/
|
||||||
void saveOrUpdateConfiguration(EbikeDispatchConfigurationDto configurationDto);
|
void saveConfiguration(EbikeBikeConfigurationDto configurationDto);
|
||||||
}
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.cdzy.operations.service.impl;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
|
import com.cdzy.operations.mapper.EbikeBikeConfigurationMapper;
|
||||||
|
import com.cdzy.operations.model.dto.EbikeBikeConfigurationDto;
|
||||||
|
import com.cdzy.operations.model.entity.EbikeBikeConfiguration;
|
||||||
|
import com.cdzy.operations.service.EbikeBikeConfigurationService;
|
||||||
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.cdzy.operations.model.entity.table.EbikeBikeConfigurationTableDef.EBIKE_BIKE_CONFIGURATION;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆相关配置 实现类
|
||||||
|
*
|
||||||
|
* @author yanglei
|
||||||
|
* @since 2025-12-03 16:22
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EbikeBikeConfigurationServiceImpl extends ServiceImpl<EbikeBikeConfigurationMapper, EbikeBikeConfiguration> implements EbikeBikeConfigurationService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EbikeBikeConfiguration> getConfigurationByOperationId() {
|
||||||
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||||
|
.select(EBIKE_BIKE_CONFIGURATION.ALL_COLUMNS);
|
||||||
|
return this.mapper.selectListByQuery(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveConfiguration(EbikeBikeConfigurationDto configurationDto) {
|
||||||
|
EbikeBikeConfiguration configuration = EbikeBikeConfiguration.builder()
|
||||||
|
.operatorId(configurationDto.getOperatorId())
|
||||||
|
.configurationDuration(configurationDto.getConfigurationDuration())
|
||||||
|
.configurationDescription(configurationDto.getConfigurationDescription())
|
||||||
|
.createdBy(StpUtil.getLoginIdAsLong())
|
||||||
|
.build();
|
||||||
|
this.mapper.insert(configuration);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,53 +0,0 @@
|
|||||||
package com.cdzy.operations.service.impl;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
|
||||||
import com.cdzy.operations.mapper.EbikeDispatchConfigurationMapper;
|
|
||||||
import com.cdzy.operations.model.dto.EbikeDispatchConfigurationDto;
|
|
||||||
import com.cdzy.operations.model.entity.EbikeDispatchConfiguration;
|
|
||||||
import com.cdzy.operations.service.EbikeDispatchConfigurationService;
|
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
|
||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static com.cdzy.operations.model.entity.table.EbikeDispatchConfigurationTableDef.EBIKE_DISPATCH_CONFIGURATION;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆相关配置 实现类
|
|
||||||
*
|
|
||||||
* @author yanglei
|
|
||||||
* @since 2025-12-03 16:22
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class EbikeDispatchConfigurationServiceImpl extends ServiceImpl<EbikeDispatchConfigurationMapper, EbikeDispatchConfiguration> implements EbikeDispatchConfigurationService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public EbikeDispatchConfiguration getConfigurationByOperationId() {
|
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
||||||
.select(EBIKE_DISPATCH_CONFIGURATION.ALL_COLUMNS);
|
|
||||||
return this.mapper.selectOneByQuery(queryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void saveOrUpdateConfiguration(EbikeDispatchConfigurationDto configurationDto) {
|
|
||||||
if (configurationDto.getConfigurationId() != null) {
|
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
|
||||||
.where(EBIKE_DISPATCH_CONFIGURATION.CONFIGURATION_ID.eq(configurationDto.getConfigurationId()));
|
|
||||||
EbikeDispatchConfiguration ebikeDispatchConfiguration = this.mapper.selectOneByQuery(queryWrapper);
|
|
||||||
ebikeDispatchConfiguration.setDispatchDuration(configurationDto.getDispatchDuration());
|
|
||||||
ebikeDispatchConfiguration.setRideDuration(configurationDto.getRideDuration());
|
|
||||||
ebikeDispatchConfiguration.setUpdatedBy(StpUtil.getLoginIdAsLong());
|
|
||||||
this.mapper.update(ebikeDispatchConfiguration);
|
|
||||||
} else {
|
|
||||||
EbikeDispatchConfiguration configuration = EbikeDispatchConfiguration.builder()
|
|
||||||
.operatorId(configurationDto.getOperatorId())
|
|
||||||
.dispatchDuration(configurationDto.getDispatchDuration())
|
|
||||||
.rideDuration(configurationDto.getRideDuration())
|
|
||||||
.createdBy(StpUtil.getLoginIdAsLong())
|
|
||||||
.build();
|
|
||||||
this.mapper.insert(configuration);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user