添加订单表
This commit is contained in:
parent
1766bef7ca
commit
b55dee0c88
@ -0,0 +1,89 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.combo;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.combo.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.combo.ComboDO;
|
||||
import cn.iocoder.yudao.module.system.service.combo.ComboService;
|
||||
|
||||
@Tag(name = "管理后台 - 会员套餐")
|
||||
@RestController
|
||||
@RequestMapping("/system/combo")
|
||||
@Validated
|
||||
public class ComboController {
|
||||
|
||||
@Resource
|
||||
private ComboService comboService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员套餐")
|
||||
public CommonResult<Long> createCombo(@Valid @RequestBody ComboSaveReqVO createReqVO) {
|
||||
return success(comboService.createCombo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员套餐")
|
||||
public CommonResult<Boolean> updateCombo(@Valid @RequestBody ComboSaveReqVO updateReqVO) {
|
||||
comboService.updateCombo(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员套餐")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteCombo(@RequestParam("id") Long id) {
|
||||
comboService.deleteCombo(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员套餐")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<ComboRespVO> getCombo(@RequestParam("id") Long id) {
|
||||
ComboDO combo = comboService.getCombo(id);
|
||||
return success(BeanUtils.toBean(combo, ComboRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员套餐分页")
|
||||
public CommonResult<PageResult<ComboRespVO>> getComboPage(@Valid ComboPageReqVO pageReqVO) {
|
||||
PageResult<ComboDO> pageResult = comboService.getComboPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ComboRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员套餐 Excel")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportComboExcel(@Valid ComboPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ComboDO> list = comboService.getComboPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "会员套餐.xls", "数据", ComboRespVO.class,
|
||||
BeanUtils.toBean(list, ComboRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.combo.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员套餐分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ComboPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "机构ID", example = "14944")
|
||||
private Long orgid;
|
||||
|
||||
@Schema(description = "套餐名称", example = "赵六")
|
||||
private String comboname;
|
||||
|
||||
@Schema(description = "套餐价格", example = "17602")
|
||||
private String price;
|
||||
|
||||
@Schema(description = "套餐有效期(天)")
|
||||
private Integer period;
|
||||
|
||||
@Schema(description = "状态(0禁用 1启用)", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "套餐描述", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] updatetime;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.combo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员套餐 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ComboRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11669")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "机构ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14944")
|
||||
@ExcelProperty("机构ID")
|
||||
private Long orgid;
|
||||
|
||||
@Schema(description = "套餐名称", example = "赵六")
|
||||
@ExcelProperty("套餐名称")
|
||||
private String comboname;
|
||||
|
||||
@Schema(description = "套餐价格", example = "17602")
|
||||
@ExcelProperty("套餐价格")
|
||||
private String price;
|
||||
|
||||
@Schema(description = "套餐有效期(天)")
|
||||
@ExcelProperty("套餐有效期(天)")
|
||||
private Integer period;
|
||||
|
||||
@Schema(description = "状态(0禁用 1启用)", example = "2")
|
||||
@ExcelProperty("状态(0禁用 1启用)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "套餐描述", example = "你猜")
|
||||
@ExcelProperty("套餐描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.combo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员套餐新增/修改 Request VO")
|
||||
@Data
|
||||
public class ComboSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11669")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "机构ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14944")
|
||||
@NotNull(message = "机构ID不能为空")
|
||||
private Long orgid;
|
||||
|
||||
@Schema(description = "套餐名称", example = "赵六")
|
||||
private String comboname;
|
||||
|
||||
@Schema(description = "套餐价格", example = "17602")
|
||||
private String price;
|
||||
|
||||
@Schema(description = "套餐有效期(天)")
|
||||
private Integer period;
|
||||
|
||||
@Schema(description = "状态(0禁用 1启用)", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "套餐描述", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.order;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.order.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.order.OrderDO;
|
||||
import cn.iocoder.yudao.module.system.service.order.OrderService;
|
||||
|
||||
@Tag(name = "管理后台 - 会员订单")
|
||||
@RestController
|
||||
@RequestMapping("/system/order")
|
||||
@Validated
|
||||
public class OrderController {
|
||||
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员订单")
|
||||
public CommonResult<Long> createOrder(@Valid @RequestBody OrderSaveReqVO createReqVO) {
|
||||
return success(orderService.createOrder(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员订单")
|
||||
public CommonResult<Boolean> updateOrder(@Valid @RequestBody OrderSaveReqVO updateReqVO) {
|
||||
orderService.updateOrder(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员订单")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteOrder(@RequestParam("id") Long id) {
|
||||
orderService.deleteOrder(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员订单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<OrderRespVO> getOrder(@RequestParam("id") Long id) {
|
||||
OrderDO order = orderService.getOrder(id);
|
||||
return success(BeanUtils.toBean(order, OrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员订单分页")
|
||||
public CommonResult<PageResult<OrderRespVO>> getOrderPage(@Valid OrderPageReqVO pageReqVO) {
|
||||
PageResult<OrderDO> pageResult = orderService.getOrderPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, OrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员订单 Excel")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportOrderExcel(@Valid OrderPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OrderDO> list = orderService.getOrderPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "会员订单.xls", "数据", OrderRespVO.class,
|
||||
BeanUtils.toBean(list, OrderRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.order.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员订单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OrderPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "组织机构ID", example = "14513")
|
||||
private Long orgid;
|
||||
|
||||
@Schema(description = "用户ID", example = "11032")
|
||||
private Long userid;
|
||||
|
||||
@Schema(description = "套餐ID", example = "6734")
|
||||
private Long comboid;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
private String orderno;
|
||||
|
||||
@Schema(description = "原价", example = "243")
|
||||
private String originalprice;
|
||||
|
||||
@Schema(description = "实付金额", example = "24874")
|
||||
private String actualprice;
|
||||
|
||||
@Schema(description = "订单状态(0待支付 1已支付 2已取消 3已退款)", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "支付方式(1微信 2支付宝 3银行卡)", example = "1")
|
||||
private Integer paytype;
|
||||
|
||||
@Schema(description = "支付时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] paytime;
|
||||
|
||||
@Schema(description = "会员开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] vipstarttime;
|
||||
|
||||
@Schema(description = "会员结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] vipendtime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] updatetime;
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.order.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员订单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OrderRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28873")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "组织机构ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14513")
|
||||
@ExcelProperty("组织机构ID")
|
||||
private Long orgid;
|
||||
|
||||
@Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11032")
|
||||
@ExcelProperty("用户ID")
|
||||
private Long userid;
|
||||
|
||||
@Schema(description = "套餐ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6734")
|
||||
@ExcelProperty("套餐ID")
|
||||
private Long comboid;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
@ExcelProperty("订单编号")
|
||||
private String orderno;
|
||||
|
||||
@Schema(description = "原价", example = "243")
|
||||
@ExcelProperty("原价")
|
||||
private String originalprice;
|
||||
|
||||
@Schema(description = "实付金额", example = "24874")
|
||||
@ExcelProperty("实付金额")
|
||||
private String actualprice;
|
||||
|
||||
@Schema(description = "订单状态(0待支付 1已支付 2已取消 3已退款)", example = "1")
|
||||
@ExcelProperty("订单状态(0待支付 1已支付 2已取消 3已退款)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "支付方式(1微信 2支付宝 3银行卡)", example = "1")
|
||||
@ExcelProperty("支付方式(1微信 2支付宝 3银行卡)")
|
||||
private Integer paytype;
|
||||
|
||||
@Schema(description = "支付时间")
|
||||
@ExcelProperty("支付时间")
|
||||
private LocalDateTime paytime;
|
||||
|
||||
@Schema(description = "会员开始时间")
|
||||
@ExcelProperty("会员开始时间")
|
||||
private LocalDateTime vipstarttime;
|
||||
|
||||
@Schema(description = "会员结束时间")
|
||||
@ExcelProperty("会员结束时间")
|
||||
private LocalDateTime vipendtime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.order.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员订单新增/修改 Request VO")
|
||||
@Data
|
||||
public class OrderSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28873")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "组织机构ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14513")
|
||||
@NotNull(message = "组织机构ID不能为空")
|
||||
private Long orgid;
|
||||
|
||||
@Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11032")
|
||||
@NotNull(message = "用户ID不能为空")
|
||||
private Long userid;
|
||||
|
||||
@Schema(description = "套餐ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6734")
|
||||
@NotNull(message = "套餐ID不能为空")
|
||||
private Long comboid;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
private String orderno;
|
||||
|
||||
@Schema(description = "原价", example = "243")
|
||||
private String originalprice;
|
||||
|
||||
@Schema(description = "实付金额", example = "24874")
|
||||
private String actualprice;
|
||||
|
||||
@Schema(description = "订单状态(0待支付 1已支付 2已取消 3已退款)", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "支付方式(1微信 2支付宝 3银行卡)", example = "1")
|
||||
private Integer paytype;
|
||||
|
||||
@Schema(description = "支付时间")
|
||||
private LocalDateTime paytime;
|
||||
|
||||
@Schema(description = "会员开始时间")
|
||||
private LocalDateTime vipstarttime;
|
||||
|
||||
@Schema(description = "会员结束时间")
|
||||
private LocalDateTime vipendtime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.combo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 会员套餐 DO
|
||||
*
|
||||
* @author 全智安
|
||||
*/
|
||||
@TableName("tb_combo")
|
||||
@KeySequence("tb_combo_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ComboDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 机构ID
|
||||
*/
|
||||
@TableField("orgid")
|
||||
private Long orgid;
|
||||
/**
|
||||
* 套餐名称
|
||||
*/
|
||||
@TableField("comboname")
|
||||
private String comboname;
|
||||
/**
|
||||
* 套餐价格
|
||||
*/
|
||||
@TableField("price")
|
||||
private String price;
|
||||
/**
|
||||
* 套餐有效期(天)
|
||||
*/
|
||||
@TableField("period")
|
||||
private Integer period;
|
||||
/**
|
||||
* 状态(0禁用 1启用)
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
/**
|
||||
* 套餐描述
|
||||
*/
|
||||
@TableField("description")
|
||||
private String description;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("createtime")
|
||||
private LocalDateTime createtime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("updatetime")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.order;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 会员订单 DO
|
||||
*
|
||||
* @author 全智安
|
||||
*/
|
||||
@TableName("tb_order")
|
||||
@KeySequence("tb_order_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 组织机构ID
|
||||
*/
|
||||
@TableField("orgid")
|
||||
private Long orgid;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@TableField("userid")
|
||||
private Long userid;
|
||||
/**
|
||||
* 套餐ID
|
||||
*/
|
||||
@TableField("comboid")
|
||||
private Long comboid;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@TableField("orderno")
|
||||
private String orderno;
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
@TableField("originalprice")
|
||||
private String originalprice;
|
||||
/**
|
||||
* 实付金额
|
||||
*/
|
||||
@TableField("actualprice")
|
||||
private String actualprice;
|
||||
/**
|
||||
* 订单状态(0待支付 1已支付 2已取消 3已退款)
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
/**
|
||||
* 支付方式(1微信 2支付宝 3银行卡)
|
||||
*/
|
||||
@TableField("paytype")
|
||||
private Integer paytype;
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@TableField("paytime")
|
||||
private LocalDateTime paytime;
|
||||
/**
|
||||
* 会员开始时间
|
||||
*/
|
||||
@TableField("vipstarttime")
|
||||
private LocalDateTime vipstarttime;
|
||||
/**
|
||||
* 会员结束时间
|
||||
*/
|
||||
@TableField("vipendtime")
|
||||
private LocalDateTime vipendtime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("createtime")
|
||||
private LocalDateTime createtime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("updatetime")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.combo;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.combo.ComboDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.combo.vo.*;
|
||||
|
||||
/**
|
||||
* 会员套餐 Mapper
|
||||
*
|
||||
* @author 全智安
|
||||
*/
|
||||
@Mapper
|
||||
public interface ComboMapper extends BaseMapperX<ComboDO> {
|
||||
|
||||
default PageResult<ComboDO> selectPage(ComboPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ComboDO>()
|
||||
.eqIfPresent(ComboDO::getOrgid, reqVO.getOrgid())
|
||||
.likeIfPresent(ComboDO::getComboname, reqVO.getComboname())
|
||||
.eqIfPresent(ComboDO::getPrice, reqVO.getPrice())
|
||||
.eqIfPresent(ComboDO::getPeriod, reqVO.getPeriod())
|
||||
.eqIfPresent(ComboDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ComboDO::getDescription, reqVO.getDescription())
|
||||
.betweenIfPresent(ComboDO::getCreatetime, reqVO.getCreatetime())
|
||||
.betweenIfPresent(ComboDO::getUpdatetime, reqVO.getUpdatetime())
|
||||
.orderByDesc(ComboDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.order;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.order.OrderDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.order.vo.*;
|
||||
|
||||
/**
|
||||
* 会员订单 Mapper
|
||||
*
|
||||
* @author 全智安
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
|
||||
default PageResult<OrderDO> selectPage(OrderPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OrderDO>()
|
||||
.eqIfPresent(OrderDO::getOrgid, reqVO.getOrgid())
|
||||
.eqIfPresent(OrderDO::getUserid, reqVO.getUserid())
|
||||
.eqIfPresent(OrderDO::getComboid, reqVO.getComboid())
|
||||
.eqIfPresent(OrderDO::getOrderno, reqVO.getOrderno())
|
||||
.eqIfPresent(OrderDO::getOriginalprice, reqVO.getOriginalprice())
|
||||
.eqIfPresent(OrderDO::getActualprice, reqVO.getActualprice())
|
||||
.eqIfPresent(OrderDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(OrderDO::getPaytype, reqVO.getPaytype())
|
||||
.betweenIfPresent(OrderDO::getPaytime, reqVO.getPaytime())
|
||||
.betweenIfPresent(OrderDO::getVipstarttime, reqVO.getVipstarttime())
|
||||
.betweenIfPresent(OrderDO::getVipendtime, reqVO.getVipendtime())
|
||||
.betweenIfPresent(OrderDO::getCreatetime, reqVO.getCreatetime())
|
||||
.betweenIfPresent(OrderDO::getUpdatetime, reqVO.getUpdatetime())
|
||||
.orderByDesc(OrderDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.system.service.combo;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.combo.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.combo.ComboDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 会员套餐 Service 接口
|
||||
*
|
||||
* @author 全智安
|
||||
*/
|
||||
public interface ComboService {
|
||||
|
||||
/**
|
||||
* 创建会员套餐
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createCombo(@Valid ComboSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新会员套餐
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateCombo(@Valid ComboSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除会员套餐
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteCombo(Long id);
|
||||
|
||||
/**
|
||||
* 获得会员套餐
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 会员套餐
|
||||
*/
|
||||
ComboDO getCombo(Long id);
|
||||
|
||||
/**
|
||||
* 获得会员套餐分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 会员套餐分页
|
||||
*/
|
||||
PageResult<ComboDO> getComboPage(ComboPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.system.service.combo;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.combo.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.combo.ComboDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.combo.ComboMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 会员套餐 Service 实现类
|
||||
*
|
||||
* @author 全智安
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ComboServiceImpl implements ComboService {
|
||||
|
||||
@Resource
|
||||
private ComboMapper comboMapper;
|
||||
|
||||
@Override
|
||||
public Long createCombo(ComboSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ComboDO combo = BeanUtils.toBean(createReqVO, ComboDO.class);
|
||||
comboMapper.insert(combo);
|
||||
// 返回
|
||||
return combo.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCombo(ComboSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateComboExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ComboDO updateObj = BeanUtils.toBean(updateReqVO, ComboDO.class);
|
||||
comboMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCombo(Long id) {
|
||||
// 校验存在
|
||||
validateComboExists(id);
|
||||
// 删除
|
||||
comboMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateComboExists(Long id) {
|
||||
if (comboMapper.selectById(id) == null) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComboDO getCombo(Long id) {
|
||||
return comboMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ComboDO> getComboPage(ComboPageReqVO pageReqVO) {
|
||||
return comboMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.system.service.order;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.order.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.order.OrderDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 会员订单 Service 接口
|
||||
*
|
||||
* @author 全智安
|
||||
*/
|
||||
public interface OrderService {
|
||||
|
||||
/**
|
||||
* 创建会员订单
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createOrder(@Valid OrderSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新会员订单
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateOrder(@Valid OrderSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除会员订单
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteOrder(Long id);
|
||||
|
||||
/**
|
||||
* 获得会员订单
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 会员订单
|
||||
*/
|
||||
OrderDO getOrder(Long id);
|
||||
|
||||
/**
|
||||
* 获得会员订单分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 会员订单分页
|
||||
*/
|
||||
PageResult<OrderDO> getOrderPage(OrderPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.system.service.order;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.order.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.order.OrderDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.order.OrderMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 会员订单 Service 实现类
|
||||
*
|
||||
* @author 全智安
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OrderServiceImpl implements OrderService {
|
||||
|
||||
@Resource
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@Override
|
||||
public Long createOrder(OrderSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
OrderDO order = BeanUtils.toBean(createReqVO, OrderDO.class);
|
||||
orderMapper.insert(order);
|
||||
// 返回
|
||||
return order.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOrder(OrderSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateOrderExists(updateReqVO.getId());
|
||||
// 更新
|
||||
OrderDO updateObj = BeanUtils.toBean(updateReqVO, OrderDO.class);
|
||||
orderMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOrder(Long id) {
|
||||
// 校验存在
|
||||
validateOrderExists(id);
|
||||
// 删除
|
||||
orderMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateOrderExists(Long id) {
|
||||
if (orderMapper.selectById(id) == null) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderDO getOrder(Long id) {
|
||||
return orderMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrderDO> getOrderPage(OrderPageReqVO pageReqVO) {
|
||||
return orderMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?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="cn.iocoder.yudao.module.system.dal.mysql.combo.ComboMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?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="cn.iocoder.yudao.module.system.dal.mysql.order.OrderMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -286,6 +286,8 @@ yudao:
|
||||
- tb_devicedata # 忽略设备数据表
|
||||
- tb_ecgdata # 忽略ECG设备数据类型表
|
||||
- tb_doctornotice # 忽略医生通知表
|
||||
- tb_combo # 忽略套餐表
|
||||
- tb_order # 忽略订单表
|
||||
ignore-caches:
|
||||
- user_role_ids
|
||||
- permission_menu_ids
|
||||
|
Loading…
Reference in New Issue
Block a user