增加租电订单生成
This commit is contained in:
@ -0,0 +1,27 @@
|
|||||||
|
package com.sczx.order.controller;
|
||||||
|
|
||||||
|
import com.sczx.order.common.Result;
|
||||||
|
import com.sczx.order.dto.RentCarOrderReq;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: 张黎
|
||||||
|
* @Date: 2025/07/25/16:42
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Api(value = "客户订单操作接口", tags = "客户订单操作接口")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/clientOrder")
|
||||||
|
public class ClientOrderController {
|
||||||
|
|
||||||
|
// @ApiOperation(value = "生成租车订单")
|
||||||
|
// @PostMapping("/confirmRentalCarOrder")
|
||||||
|
// public Result<List<RentBatteyRuleDTO>> confirmRentalCarOrder(@RequestBody RentCarOrderReq rentCarOrderReq){
|
||||||
|
// return Result.ok(carRentalService.queryRentBatteyRuleByCarRuleId(carRuleId));
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
95
src/main/java/com/sczx/order/dto/OrderMainDTO.java
Normal file
95
src/main/java/com/sczx/order/dto/OrderMainDTO.java
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
package com.sczx.order.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: 张黎
|
||||||
|
* @Date: 2025/07/25/17:18
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "订单dto", description = "租车订单信息")
|
||||||
|
public class OrderMainDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty("订单ID(主键)")
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单编号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单状态:下单未提车、租赁中、已结束-自动、已结束-手动")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属运营商ID")
|
||||||
|
private Long operatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属门店ID")
|
||||||
|
private Long storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("车辆ID")
|
||||||
|
private Long vehicleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户id")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户姓名")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户联系电话")
|
||||||
|
private String customerPhone;
|
||||||
|
|
||||||
|
@ApiModelProperty("租赁类型(时租/日租/按天数/以租代售)")
|
||||||
|
private String rentalType;
|
||||||
|
|
||||||
|
@ApiModelProperty("租赁天数(当类型为\"按天数\"时使用)")
|
||||||
|
private Integer rentalDays;
|
||||||
|
|
||||||
|
@ApiModelProperty("租车价格(元)")
|
||||||
|
private BigDecimal rentalPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty("押金价格(元)")
|
||||||
|
private BigDecimal depositPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty("逾期金额(元)")
|
||||||
|
private BigDecimal overdueFee;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否开通免押")
|
||||||
|
private Boolean isDepositFree;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否开通代扣")
|
||||||
|
private Boolean isAutoDeduct;
|
||||||
|
|
||||||
|
@ApiModelProperty("首次下单时间")
|
||||||
|
private LocalDateTime firstOrderTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("开始计费时间")
|
||||||
|
private LocalDateTime startRentTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("逾期天数")
|
||||||
|
private Integer overdueDays;
|
||||||
|
|
||||||
|
@ApiModelProperty("续租次数")
|
||||||
|
private Integer renewalTimes;
|
||||||
|
|
||||||
|
@ApiModelProperty("充电次数")
|
||||||
|
private Integer chargeTimes;
|
||||||
|
|
||||||
|
@ApiModelProperty("租车套餐id")
|
||||||
|
private Long rentCarRuleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("租电套餐id")
|
||||||
|
private Long rentBatteyRuleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
}
|
||||||
31
src/main/java/com/sczx/order/dto/RentCarOrderReq.java
Normal file
31
src/main/java/com/sczx/order/dto/RentCarOrderReq.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package com.sczx.order.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: 张黎
|
||||||
|
* @Date: 2025/07/25/16:58
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "租车订单请求参数")
|
||||||
|
public class RentCarOrderReq {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "运营商id")
|
||||||
|
private Long operatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "门店id")
|
||||||
|
private Long storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "客户id")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租车套餐id")
|
||||||
|
private Long rentCarRuleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租电套餐id")
|
||||||
|
private Long rentBatteyRuleId;
|
||||||
|
}
|
||||||
16
src/main/java/com/sczx/order/mapper/OrderMainMapper.java
Normal file
16
src/main/java/com/sczx/order/mapper/OrderMainMapper.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package com.sczx.order.mapper;
|
||||||
|
|
||||||
|
import com.sczx.order.po.OrderMainPO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 租车订单信息 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhangli
|
||||||
|
* @since 2025-07-25 17:16:50
|
||||||
|
*/
|
||||||
|
public interface OrderMainMapper extends BaseMapper<OrderMainPO> {
|
||||||
|
|
||||||
|
}
|
||||||
16
src/main/java/com/sczx/order/mapper/OrderSubMapper.java
Normal file
16
src/main/java/com/sczx/order/mapper/OrderSubMapper.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package com.sczx.order.mapper;
|
||||||
|
|
||||||
|
import com.sczx.order.po.OrderSubPO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 租车子订单信息 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhangli
|
||||||
|
* @since 2025-07-25 17:17:28
|
||||||
|
*/
|
||||||
|
public interface OrderSubMapper extends BaseMapper<OrderSubPO> {
|
||||||
|
|
||||||
|
}
|
||||||
110
src/main/java/com/sczx/order/po/OrderMainPO.java
Normal file
110
src/main/java/com/sczx/order/po/OrderMainPO.java
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
package com.sczx.order.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 租车订单信息
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhangli
|
||||||
|
* @since 2025-07-25 17:16:50
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("zc_order_main")
|
||||||
|
@ApiModel(value = "OrderMainPO对象", description = "租车订单信息")
|
||||||
|
public class OrderMainPO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单ID(主键)")
|
||||||
|
@TableId(value = "order_id", type = IdType.AUTO)
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单编号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单状态:下单未提车、租赁中、已结束-自动、已结束-手动")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属运营商ID")
|
||||||
|
private Long operatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属门店ID")
|
||||||
|
private Long storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("车辆ID")
|
||||||
|
private Long vehicleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户id")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户姓名")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户联系电话")
|
||||||
|
private String customerPhone;
|
||||||
|
|
||||||
|
@ApiModelProperty("租赁类型(时租/日租/按天数/以租代售)")
|
||||||
|
private String rentalType;
|
||||||
|
|
||||||
|
@ApiModelProperty("租赁天数(当类型为\"按天数\"时使用)")
|
||||||
|
private Integer rentalDays;
|
||||||
|
|
||||||
|
@ApiModelProperty("租车价格(元)")
|
||||||
|
private BigDecimal rentalPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty("押金价格(元)")
|
||||||
|
private BigDecimal depositPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty("逾期金额(元)")
|
||||||
|
private BigDecimal overdueFee;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否开通免押")
|
||||||
|
private Boolean isDepositFree;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否开通代扣")
|
||||||
|
private Boolean isAutoDeduct;
|
||||||
|
|
||||||
|
@ApiModelProperty("首次下单时间")
|
||||||
|
private LocalDateTime firstOrderTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("开始计费时间")
|
||||||
|
private LocalDateTime startRentTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("逾期天数")
|
||||||
|
private Integer overdueDays;
|
||||||
|
|
||||||
|
@ApiModelProperty("续租次数")
|
||||||
|
private Integer renewalTimes;
|
||||||
|
|
||||||
|
@ApiModelProperty("充电次数")
|
||||||
|
private Integer chargeTimes;
|
||||||
|
|
||||||
|
@ApiModelProperty("租车套餐id")
|
||||||
|
private Long rentCarRuleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("租电套餐id")
|
||||||
|
private Long rentBatteyRuleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
74
src/main/java/com/sczx/order/po/OrderSubPO.java
Normal file
74
src/main/java/com/sczx/order/po/OrderSubPO.java
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
package com.sczx.order.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 租车子订单信息
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhangli
|
||||||
|
* @since 2025-07-25 17:17:28
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("zc_order_sub")
|
||||||
|
@ApiModel(value = "OrderSubPO对象", description = "租车子订单信息")
|
||||||
|
public class OrderSubPO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("子订单ID(主键)")
|
||||||
|
@TableId(value = "suborder_id", type = IdType.AUTO)
|
||||||
|
private Long suborderId;
|
||||||
|
|
||||||
|
@ApiModelProperty("关联的订单ID(外键)")
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
@ApiModelProperty("子订单编号")
|
||||||
|
private String suborderNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("子订单类型(首租、续租、逾期、押金、租电等)")
|
||||||
|
private String suborderType;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ApiModelProperty("支付方式")
|
||||||
|
private String paymentMethod;
|
||||||
|
|
||||||
|
@ApiModelProperty("车架/电池编号")
|
||||||
|
private String vinBatteryNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单产生时间")
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
@ApiModelProperty("支付ID")
|
||||||
|
private String paymentId;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际支付时间")
|
||||||
|
private LocalDateTime paidAt;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
16
src/main/java/com/sczx/order/repository/OrderMainRepo.java
Normal file
16
src/main/java/com/sczx/order/repository/OrderMainRepo.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package com.sczx.order.repository;
|
||||||
|
|
||||||
|
import com.sczx.order.po.OrderMainPO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 租车订单信息 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhangli
|
||||||
|
* @since 2025-07-25 17:16:50
|
||||||
|
*/
|
||||||
|
public interface OrderMainRepo extends IService<OrderMainPO> {
|
||||||
|
|
||||||
|
}
|
||||||
16
src/main/java/com/sczx/order/repository/OrderSubRepo.java
Normal file
16
src/main/java/com/sczx/order/repository/OrderSubRepo.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package com.sczx.order.repository;
|
||||||
|
|
||||||
|
import com.sczx.order.po.OrderSubPO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 租车子订单信息 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhangli
|
||||||
|
* @since 2025-07-25 17:17:28
|
||||||
|
*/
|
||||||
|
public interface OrderSubRepo extends IService<OrderSubPO> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
package com.sczx.order.repository.impl;
|
||||||
|
|
||||||
|
import com.sczx.order.po.OrderMainPO;
|
||||||
|
import com.sczx.order.mapper.OrderMainMapper;
|
||||||
|
import com.sczx.order.repository.OrderMainRepo;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 租车订单信息 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhangli
|
||||||
|
* @since 2025-07-25 17:16:50
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OrderMainRepoImpl extends ServiceImpl<OrderMainMapper, OrderMainPO> implements OrderMainRepo {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
package com.sczx.order.repository.impl;
|
||||||
|
|
||||||
|
import com.sczx.order.po.OrderSubPO;
|
||||||
|
import com.sczx.order.mapper.OrderSubMapper;
|
||||||
|
import com.sczx.order.repository.OrderSubRepo;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 租车子订单信息 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhangli
|
||||||
|
* @since 2025-07-25 17:17:28
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OrderSubRepoImpl extends ServiceImpl<OrderSubMapper, OrderSubPO> implements OrderSubRepo {
|
||||||
|
|
||||||
|
}
|
||||||
5
src/main/resources/mapper/OrderMainMapper.xml
Normal file
5
src/main/resources/mapper/OrderMainMapper.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.sczx.order.mapper.OrderMainMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
5
src/main/resources/mapper/OrderSubMapper.xml
Normal file
5
src/main/resources/mapper/OrderSubMapper.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.sczx.order.mapper.OrderSubMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user