运营区特殊计费配置参数定义
This commit is contained in:
parent
2e8afcdbb2
commit
e5fbb2325f
@ -8,8 +8,10 @@ import com.cdzy.operations.model.entity.EbikeDefaultBillingConfiguration;
|
||||
import com.cdzy.operations.model.entity.EbikeRegion;
|
||||
import com.cdzy.operations.model.vo.EbikeDefaultBillingConfigurationVo;
|
||||
import com.cdzy.operations.model.vo.EbikeRegionVo;
|
||||
import com.cdzy.operations.model.vo.EbikeSpecialBillingConfigurationVo;
|
||||
import com.cdzy.operations.service.EbikeDefaultBillingConfigurationService;
|
||||
import com.cdzy.operations.service.EbikeRegionService;
|
||||
import com.cdzy.operations.service.EbikeSpecialBillingConfigurationService;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.update.UpdateChain;
|
||||
@ -40,6 +42,9 @@ public class EbikeRegionController {
|
||||
@Resource
|
||||
private EbikeDefaultBillingConfigurationService defaultConfigurationService;
|
||||
|
||||
@Resource
|
||||
private EbikeSpecialBillingConfigurationService specialBillingConfigurationService;
|
||||
|
||||
/**
|
||||
* 添加运营区域。
|
||||
*
|
||||
@ -174,4 +179,31 @@ public class EbikeRegionController {
|
||||
EbikeDefaultBillingConfiguration configuration = defaultConfigurationService.getOne(queryWrapper);
|
||||
return JsonResult.success(configuration);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存运营区默认计费规则。
|
||||
*
|
||||
* @param configurationVo 配置信息
|
||||
* @return 分页对象
|
||||
*/
|
||||
@PostMapping("specialConfiguration")
|
||||
public JsonResult<?> specialConfiguration(@Validated @RequestBody EbikeSpecialBillingConfigurationVo configurationVo) {
|
||||
specialBillingConfigurationService.specialConfiguration(configurationVo);
|
||||
return JsonResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运营区默认计费规则。
|
||||
*
|
||||
* @param regionId 区域ID
|
||||
* @return 分页对象
|
||||
*/
|
||||
@GetMapping("getspecialConfiguration")
|
||||
public JsonResult<?> getspecialConfiguration(@RequestParam Long regionId) {
|
||||
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||
.where(EBIKE_DEFAULT_BILLING_CONFIGURATION.REGION_ID.eq(regionId));
|
||||
EbikeDefaultBillingConfiguration configuration = defaultConfigurationService.getOne(queryWrapper);
|
||||
return JsonResult.success(configuration);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cdzy.operations.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cdzy.operations.model.entity.EbiekSpecialDay;
|
||||
|
||||
/**
|
||||
* 高峰日计费配置表 映射层。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
public interface EbiekSpecialDayMapper extends BaseMapper<EbiekSpecialDay> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cdzy.operations.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cdzy.operations.model.entity.EbiekSpecialTime;
|
||||
|
||||
/**
|
||||
* 映射层。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
public interface EbiekSpecialTimeMapper extends BaseMapper<EbiekSpecialTime> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cdzy.operations.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cdzy.operations.model.entity.EbikeSpecialBillingConfiguration;
|
||||
|
||||
/**
|
||||
* 映射层。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
public interface EbikeSpecialBillingConfigurationMapper extends BaseMapper<EbikeSpecialBillingConfiguration> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.cdzy.operations.model.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 高峰日计费配置表 实体类。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("ebiek_special_day")
|
||||
public class EbiekSpecialDay implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private Long specialDayId;
|
||||
|
||||
/**
|
||||
* 区域ID
|
||||
*/
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 周几
|
||||
*/
|
||||
private Integer specialDayNum;
|
||||
|
||||
/**
|
||||
* 起步费用(元)
|
||||
*/
|
||||
private BigDecimal baseFee;
|
||||
|
||||
/**
|
||||
* 时长费用(元)
|
||||
*/
|
||||
private BigDecimal durationFee;
|
||||
|
||||
/**
|
||||
* 起步时长(分钟
|
||||
*/
|
||||
private Integer baseDurationMinutes;
|
||||
|
||||
/**
|
||||
* 时长(分钟)
|
||||
*/
|
||||
private Integer chargeDurationMinutes;
|
||||
|
||||
/**
|
||||
* 记录创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
private Long createdBy;
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package com.cdzy.operations.model.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 实体类。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("ebiek_special_time")
|
||||
public class EbiekSpecialTime implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private Long specialTimeId;
|
||||
|
||||
/**
|
||||
* 区域ID
|
||||
*/
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalTime endTime;
|
||||
|
||||
/**
|
||||
* 起步费用(元)
|
||||
*/
|
||||
private BigDecimal baseFee;
|
||||
|
||||
/**
|
||||
* 时长费用(元)
|
||||
*/
|
||||
private BigDecimal durationFee;
|
||||
|
||||
/**
|
||||
* 起步时长(分钟
|
||||
*/
|
||||
private Integer baseDurationMinutes;
|
||||
|
||||
/**
|
||||
* 时长(分钟)
|
||||
*/
|
||||
private Integer chargeDurationMinutes;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
private Long createdBy;
|
||||
|
||||
}
|
||||
@ -30,7 +30,7 @@ public class EbikeDefaultBillingConfiguration implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private Long defaultEbikeDefaultBillingConfigurationId;
|
||||
private Long defaultBillingConfigurationId;
|
||||
|
||||
/**
|
||||
* 区域ID - 关联运营区域的唯一标识
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
package com.cdzy.operations.model.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 实体类。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("ebike_special_billing_configuration")
|
||||
public class EbikeSpecialBillingConfiguration implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 高峰日ID
|
||||
*/
|
||||
@Id
|
||||
private Long specialDayId;
|
||||
|
||||
/**
|
||||
* 运营商ID
|
||||
*/
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 1-关闭 2-高峰时段 3-高峰日
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
private Timestamp createdAt;
|
||||
|
||||
private Long createdBy;
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.cdzy.operations.model.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 高峰日计费配置表 实体类。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EbiekSpecialDayVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 周几
|
||||
*/
|
||||
private Integer specialDayNum;
|
||||
|
||||
/**
|
||||
* 起步费用(元)
|
||||
*/
|
||||
private BigDecimal baseFee;
|
||||
|
||||
/**
|
||||
* 时长费用(元)
|
||||
*/
|
||||
private BigDecimal durationFee;
|
||||
|
||||
/**
|
||||
* 起步时长(分钟
|
||||
*/
|
||||
private Integer baseDurationMinutes;
|
||||
|
||||
/**
|
||||
* 时长(分钟)
|
||||
*/
|
||||
private Integer chargeDurationMinutes;
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.cdzy.operations.model.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 实体类。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EbiekSpecialTimeVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalTime endTime;
|
||||
|
||||
/**
|
||||
* 起步费用(元)
|
||||
*/
|
||||
private BigDecimal baseFee;
|
||||
|
||||
/**
|
||||
* 时长费用(元)
|
||||
*/
|
||||
private BigDecimal durationFee;
|
||||
|
||||
/**
|
||||
* 起步时长(分钟
|
||||
*/
|
||||
private Integer baseDurationMinutes;
|
||||
|
||||
/**
|
||||
* 时长(分钟)
|
||||
*/
|
||||
private Integer chargeDurationMinutes;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.cdzy.operations.model.vo;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实体类。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EbikeSpecialBillingConfigurationVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 区域ID
|
||||
*/
|
||||
@NotNull(message = "区域ID不能为空")
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 1-关闭 2-高峰时段 3-高峰日
|
||||
*/
|
||||
@NotNull(message = "配置类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 高峰日配置
|
||||
*/
|
||||
private List<EbiekSpecialDayVo> dayConfigs;
|
||||
|
||||
/**
|
||||
* 高峰时段配置
|
||||
*/
|
||||
private List<EbiekSpecialTimeVo> timeConfigs;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.cdzy.operations.service;
|
||||
|
||||
import com.cdzy.operations.model.vo.EbikeSpecialBillingConfigurationVo;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.cdzy.operations.model.entity.EbikeSpecialBillingConfiguration;
|
||||
|
||||
/**
|
||||
* 服务层。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
public interface EbikeSpecialBillingConfigurationService extends IService<EbikeSpecialBillingConfiguration> {
|
||||
|
||||
/**
|
||||
* 保存特殊时间计费配置
|
||||
* @param configurationVo 配置信息
|
||||
*/
|
||||
void specialConfiguration(EbikeSpecialBillingConfigurationVo configurationVo);
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.cdzy.operations.service.impl;
|
||||
|
||||
import com.cdzy.operations.mapper.EbiekSpecialDayMapper;
|
||||
import com.cdzy.operations.mapper.EbiekSpecialTimeMapper;
|
||||
import com.cdzy.operations.model.vo.EbikeSpecialBillingConfigurationVo;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.cdzy.operations.model.entity.EbikeSpecialBillingConfiguration;
|
||||
import com.cdzy.operations.mapper.EbikeSpecialBillingConfigurationMapper;
|
||||
import com.cdzy.operations.service.EbikeSpecialBillingConfigurationService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 服务层实现。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-24
|
||||
*/
|
||||
@Service
|
||||
public class EbikeSpecialBillingConfigurationServiceImpl extends ServiceImpl<EbikeSpecialBillingConfigurationMapper, EbikeSpecialBillingConfiguration> implements EbikeSpecialBillingConfigurationService{
|
||||
|
||||
|
||||
@Resource
|
||||
EbiekSpecialDayMapper dayMapper;
|
||||
|
||||
@Resource
|
||||
EbiekSpecialTimeMapper timeMapper;
|
||||
|
||||
@Override
|
||||
public void specialConfiguration(EbikeSpecialBillingConfigurationVo configurationVo) {
|
||||
|
||||
}
|
||||
}
|
||||
@ -12,7 +12,7 @@ class EbikeStaffApplicationTests {
|
||||
private static final String mapperPath="D:/ebike_plus/ebike-operations/resources/mapper";
|
||||
private static final String packageName ="com.cdzy.operations";
|
||||
private static final String[] tables= new String[]{
|
||||
"ebike_default_billing_configuration"
|
||||
"ebiek_special_time","ebiek_special_day"
|
||||
};
|
||||
|
||||
@Test
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user