From 3814711ec4a3b57ddd152cf79938485e152059da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Tue, 27 Jan 2026 13:22:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(cms):=20=E6=B7=BB=E5=8A=A0=E7=BD=91?= =?UTF-8?q?=E7=AB=99=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建 CmsOrder 实体类,包含订单基本信息、支付信息、物流信息等完整字段 - 实现 CmsOrderController 控制器,提供增删改查及批量操作接口 - 开发 CmsOrderMapper 数据访问层,集成 MyBatis-Plus 基础功能 - 配置 CmsOrderMapper.xml XML 映射文件,实现关联查询 SQL 语句 - 定义 CmsOrderParam 查询参数类,支持多条件动态查询 - 构建 CmsOrderService 业务接口及其实现类,封装订单业务逻辑 - 集成 Swagger 文档注解,提供 API 接口文档支持 - 添加权限控制注解,确保接口安全性 - 实现分页查询、列表查询、单条查询等多种数据获取方式 --- .../cms/controller/CmsOrderController.java | 121 ++++++++ .../com/gxwebsoft/cms/entity/CmsOrder.java | 266 ++++++++++++++++ .../gxwebsoft/cms/mapper/CmsOrderMapper.java | 37 +++ .../cms/mapper/xml/CmsOrderMapper.xml | 258 ++++++++++++++++ .../gxwebsoft/cms/param/CmsOrderParam.java | 284 ++++++++++++++++++ .../cms/service/CmsOrderService.java | 42 +++ .../cms/service/impl/CmsOrderServiceImpl.java | 47 +++ 7 files changed, 1055 insertions(+) create mode 100644 src/main/java/com/gxwebsoft/cms/controller/CmsOrderController.java create mode 100644 src/main/java/com/gxwebsoft/cms/entity/CmsOrder.java create mode 100644 src/main/java/com/gxwebsoft/cms/mapper/CmsOrderMapper.java create mode 100644 src/main/java/com/gxwebsoft/cms/mapper/xml/CmsOrderMapper.xml create mode 100644 src/main/java/com/gxwebsoft/cms/param/CmsOrderParam.java create mode 100644 src/main/java/com/gxwebsoft/cms/service/CmsOrderService.java create mode 100644 src/main/java/com/gxwebsoft/cms/service/impl/CmsOrderServiceImpl.java diff --git a/src/main/java/com/gxwebsoft/cms/controller/CmsOrderController.java b/src/main/java/com/gxwebsoft/cms/controller/CmsOrderController.java new file mode 100644 index 0000000..406fa4f --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/CmsOrderController.java @@ -0,0 +1,121 @@ +package com.gxwebsoft.cms.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.cms.service.CmsOrderService; +import com.gxwebsoft.cms.entity.CmsOrder; +import com.gxwebsoft.cms.param.CmsOrderParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 网站订单控制器 + * + * @author 科技小王子 + * @since 2026-01-27 13:03:25 + */ +@Tag(name = "网站订单管理") +@RestController +@RequestMapping("/api/cms/cms-order") +public class CmsOrderController extends BaseController { + @Resource + private CmsOrderService cmsOrderService; + + @PreAuthorize("hasAuthority('cms:cmsOrder:list')") + @Operation(summary = "分页查询网站订单") + @GetMapping("/page") + public ApiResult> page(CmsOrderParam param) { + // 使用关联查询 + return success(cmsOrderService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('cms:cmsOrder:list')") + @Operation(summary = "查询全部网站订单") + @GetMapping() + public ApiResult> list(CmsOrderParam param) { + // 使用关联查询 + return success(cmsOrderService.listRel(param)); + } + + @PreAuthorize("hasAuthority('cms:cmsOrder:list')") + @Operation(summary = "根据id查询网站订单") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(cmsOrderService.getByIdRel(id)); + } + + @Operation(summary = "添加网站订单") + @PostMapping() + public ApiResult save(@RequestBody CmsOrder cmsOrder) { + if (cmsOrderService.save(cmsOrder)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('cms:cmsOrder:update')") + @OperationLog + @Operation(summary = "修改网站订单") + @PutMapping() + public ApiResult update(@RequestBody CmsOrder cmsOrder) { + if (cmsOrderService.updateById(cmsOrder)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('cms:cmsOrder:remove')") + @OperationLog + @Operation(summary = "删除网站订单") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (cmsOrderService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('cms:cmsOrder:save')") + @OperationLog + @Operation(summary = "批量添加网站订单") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (cmsOrderService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('cms:cmsOrder:update')") + @OperationLog + @Operation(summary = "批量修改网站订单") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(cmsOrderService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('cms:cmsOrder:remove')") + @OperationLog + @Operation(summary = "批量删除网站订单") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (cmsOrderService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/CmsOrder.java b/src/main/java/com/gxwebsoft/cms/entity/CmsOrder.java new file mode 100644 index 0000000..8869d1e --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/CmsOrder.java @@ -0,0 +1,266 @@ +package com.gxwebsoft.cms.entity; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 网站订单 + * + * @author 科技小王子 + * @since 2026-01-27 13:03:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "CmsOrder对象", description = "网站订单") +public class CmsOrder implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "订单类型,0售前咨询 1售后服务 2意见反馈") + private Integer type; + + @Schema(description = "订单标题") + private String title; + + @Schema(description = "公司/团队名称") + private String company; + + @Schema(description = "订单内容") + private String content; + + @Schema(description = "订单编号") + private String orderNo; + + @Schema(description = "快递/自提") + private Integer deliveryType; + + @Schema(description = "下单渠道,0网站 1微信小程序 2其他") + private Integer channel; + + @Schema(description = "微信支付交易号号") + private String transactionId; + + @Schema(description = "微信退款订单号") + private String refundOrder; + + @Schema(description = "商户ID") + private Integer merchantId; + + @Schema(description = "商户名称") + private String merchantName; + + @Schema(description = "商户编号") + private String merchantCode; + + @Schema(description = "使用的优惠券id") + private Integer couponId; + + @Schema(description = "使用的会员卡id") + private String cardId; + + @Schema(description = "关联管理员id") + private Integer adminId; + + @Schema(description = "核销管理员id") + private Integer confirmId; + + @Schema(description = "IC卡号") + private String icCard; + + @Schema(description = "真实姓名") + private String realName; + + @Schema(description = "关联收货地址") + private Integer addressId; + + @Schema(description = "收货地址") + private String address; + + private String addressLat; + + private String addressLng; + + @Schema(description = "自提店铺id") + private Integer selfTakeMerchantId; + + @Schema(description = "自提店铺") + private String selfTakeMerchantName; + + @Schema(description = "配送开始时间") + private String sendStartTime; + + @Schema(description = "配送结束时间") + private String sendEndTime; + + @Schema(description = "发货店铺id") + private Integer expressMerchantId; + + @Schema(description = "发货店铺") + private String expressMerchantName; + + @Schema(description = "订单总额") + private BigDecimal totalPrice; + + @Schema(description = "减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格") + private BigDecimal reducePrice; + + @Schema(description = "实际付款") + private BigDecimal payPrice; + + @Schema(description = "用于统计") + private BigDecimal price; + + @Schema(description = "价钱,用于积分赠送") + private BigDecimal money; + + @Schema(description = "取消时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime cancelTime; + + @Schema(description = "取消原因") + private String cancelReason; + + @Schema(description = "退款金额") + private BigDecimal refundMoney; + + @Schema(description = "教练价格") + private BigDecimal coachPrice; + + @Schema(description = "购买数量") + private Integer totalNum; + + @Schema(description = "教练id") + private Integer coachId; + + @Schema(description = "商品ID") + private Integer formId; + + @Schema(description = "支付的用户id") + private Integer payUserId; + + @Schema(description = "0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付") + private Integer payType; + + @Schema(description = "微信支付子类型:JSAPI小程序支付,NATIVE扫码支付") + private String wechatPayType; + + @Schema(description = "0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付") + private Integer friendPayType; + + @Schema(description = "0未付款,1已付款") + private Integer payStatus; + + @Schema(description = "0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款") + private Integer orderStatus; + + @Schema(description = "发货状态(10未发货 20已发货 30部分发货)") + private Integer deliveryStatus; + + @Schema(description = "无需发货备注") + private String deliveryNote; + + @Schema(description = "发货时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime deliveryTime; + + @Schema(description = "评价状态(0未评价 1已评价)") + private Integer evaluateStatus; + + @Schema(description = "评价时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime evaluateTime; + + @Schema(description = "优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡") + private Integer couponType; + + @Schema(description = "优惠说明") + private String couponDesc; + + @Schema(description = "二维码地址,保存订单号,支付成功后才生成") + private String qrcode; + + @Schema(description = "vip月卡年卡、ic月卡年卡回退次数") + private Integer returnNum; + + @Schema(description = "vip充值回退金额") + private BigDecimal returnMoney; + + @Schema(description = "预约详情开始时间数组") + private String startTime; + + @Schema(description = "是否已开具发票:0未开发票,1已开发票,2不能开具发票") + private Integer isInvoice; + + @Schema(description = "发票流水号") + private String invoiceNo; + + @Schema(description = "商家留言") + private String merchantRemarks; + + @Schema(description = "支付时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime payTime; + + @Schema(description = "退款时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime refundTime; + + @Schema(description = "申请退款时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime refundApplyTime; + + @Schema(description = "过期时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime expirationTime; + + @Schema(description = "自提码") + private String selfTakeCode; + + @Schema(description = "是否已收到赠品") + private Boolean hasTakeGift; + + @Schema(description = "对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单") + private Integer checkBill; + + @Schema(description = "订单是否已结算(0未结算 1已结算)") + private Integer isSettled; + + @Schema(description = "系统版本号 0当前版本 value=其他版本") + private Integer version; + + @Schema(description = "用户id") + private Integer userId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/CmsOrderMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/CmsOrderMapper.java new file mode 100644 index 0000000..021fb93 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/CmsOrderMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.cms.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.cms.entity.CmsOrder; +import com.gxwebsoft.cms.param.CmsOrderParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 网站订单Mapper + * + * @author 科技小王子 + * @since 2026-01-27 13:03:24 + */ +public interface CmsOrderMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CmsOrderParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CmsOrderParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsOrderMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsOrderMapper.xml new file mode 100644 index 0000000..384388b --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsOrderMapper.xml @@ -0,0 +1,258 @@ + + + + + + + SELECT a.* + FROM cms_order a + + + AND a.id = #{param.id} + + + AND a.type = #{param.type} + + + AND a.title LIKE CONCAT('%', #{param.title}, '%') + + + AND a.company LIKE CONCAT('%', #{param.company}, '%') + + + AND a.content LIKE CONCAT('%', #{param.content}, '%') + + + AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%') + + + AND a.delivery_type = #{param.deliveryType} + + + AND a.channel = #{param.channel} + + + AND a.transaction_id LIKE CONCAT('%', #{param.transactionId}, '%') + + + AND a.refund_order LIKE CONCAT('%', #{param.refundOrder}, '%') + + + AND a.merchant_id = #{param.merchantId} + + + AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%') + + + AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%') + + + AND a.coupon_id = #{param.couponId} + + + AND a.card_id LIKE CONCAT('%', #{param.cardId}, '%') + + + AND a.admin_id = #{param.adminId} + + + AND a.confirm_id = #{param.confirmId} + + + AND a.ic_card LIKE CONCAT('%', #{param.icCard}, '%') + + + AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') + + + AND a.address_id = #{param.addressId} + + + AND a.address LIKE CONCAT('%', #{param.address}, '%') + + + AND a.address_lat LIKE CONCAT('%', #{param.addressLat}, '%') + + + AND a.address_lng LIKE CONCAT('%', #{param.addressLng}, '%') + + + AND a.self_take_merchant_id = #{param.selfTakeMerchantId} + + + AND a.self_take_merchant_name LIKE CONCAT('%', #{param.selfTakeMerchantName}, '%') + + + AND a.send_start_time LIKE CONCAT('%', #{param.sendStartTime}, '%') + + + AND a.send_end_time LIKE CONCAT('%', #{param.sendEndTime}, '%') + + + AND a.express_merchant_id = #{param.expressMerchantId} + + + AND a.express_merchant_name LIKE CONCAT('%', #{param.expressMerchantName}, '%') + + + AND a.total_price = #{param.totalPrice} + + + AND a.reduce_price = #{param.reducePrice} + + + AND a.pay_price = #{param.payPrice} + + + AND a.price = #{param.price} + + + AND a.money = #{param.money} + + + AND a.cancel_time LIKE CONCAT('%', #{param.cancelTime}, '%') + + + AND a.cancel_reason LIKE CONCAT('%', #{param.cancelReason}, '%') + + + AND a.refund_money = #{param.refundMoney} + + + AND a.coach_price = #{param.coachPrice} + + + AND a.total_num = #{param.totalNum} + + + AND a.coach_id = #{param.coachId} + + + AND a.form_id = #{param.formId} + + + AND a.pay_user_id = #{param.payUserId} + + + AND a.pay_type = #{param.payType} + + + AND a.wechat_pay_type LIKE CONCAT('%', #{param.wechatPayType}, '%') + + + AND a.friend_pay_type = #{param.friendPayType} + + + AND a.pay_status = #{param.payStatus} + + + AND a.order_status = #{param.orderStatus} + + + AND a.delivery_status = #{param.deliveryStatus} + + + AND a.delivery_note LIKE CONCAT('%', #{param.deliveryNote}, '%') + + + AND a.delivery_time LIKE CONCAT('%', #{param.deliveryTime}, '%') + + + AND a.evaluate_status = #{param.evaluateStatus} + + + AND a.evaluate_time LIKE CONCAT('%', #{param.evaluateTime}, '%') + + + AND a.coupon_type = #{param.couponType} + + + AND a.coupon_desc LIKE CONCAT('%', #{param.couponDesc}, '%') + + + AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%') + + + AND a.return_num = #{param.returnNum} + + + AND a.return_money = #{param.returnMoney} + + + AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') + + + AND a.is_invoice = #{param.isInvoice} + + + AND a.invoice_no LIKE CONCAT('%', #{param.invoiceNo}, '%') + + + AND a.merchant_remarks LIKE CONCAT('%', #{param.merchantRemarks}, '%') + + + AND a.pay_time LIKE CONCAT('%', #{param.payTime}, '%') + + + AND a.refund_time LIKE CONCAT('%', #{param.refundTime}, '%') + + + AND a.refund_apply_time LIKE CONCAT('%', #{param.refundApplyTime}, '%') + + + AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') + + + AND a.self_take_code LIKE CONCAT('%', #{param.selfTakeCode}, '%') + + + AND a.has_take_gift = #{param.hasTakeGift} + + + AND a.check_bill = #{param.checkBill} + + + AND a.is_settled = #{param.isSettled} + + + AND a.version = #{param.version} + + + AND a.user_id = #{param.userId} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/param/CmsOrderParam.java b/src/main/java/com/gxwebsoft/cms/param/CmsOrderParam.java new file mode 100644 index 0000000..aff69a7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/CmsOrderParam.java @@ -0,0 +1,284 @@ +package com.gxwebsoft.cms.param; + +import java.math.BigDecimal; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 网站订单查询参数 + * + * @author 科技小王子 + * @since 2026-01-27 13:03:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "CmsOrderParam对象", description = "网站订单查询参数") +public class CmsOrderParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "id") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "订单类型,0售前咨询 1售后服务 2意见反馈") + @QueryField(type = QueryType.EQ) + private Integer type; + + @Schema(description = "订单标题") + private String title; + + @Schema(description = "公司/团队名称") + private String company; + + @Schema(description = "订单内容") + private String content; + + @Schema(description = "订单编号") + private String orderNo; + + @Schema(description = "快递/自提") + @QueryField(type = QueryType.EQ) + private Integer deliveryType; + + @Schema(description = "下单渠道,0网站 1微信小程序 2其他") + @QueryField(type = QueryType.EQ) + private Integer channel; + + @Schema(description = "微信支付交易号号") + private String transactionId; + + @Schema(description = "微信退款订单号") + private String refundOrder; + + @Schema(description = "商户ID") + @QueryField(type = QueryType.EQ) + private Long merchantId; + + @Schema(description = "商户名称") + private String merchantName; + + @Schema(description = "商户编号") + private String merchantCode; + + @Schema(description = "使用的优惠券id") + @QueryField(type = QueryType.EQ) + private Integer couponId; + + @Schema(description = "使用的会员卡id") + private String cardId; + + @Schema(description = "关联管理员id") + @QueryField(type = QueryType.EQ) + private Integer adminId; + + @Schema(description = "核销管理员id") + @QueryField(type = QueryType.EQ) + private Integer confirmId; + + @Schema(description = "IC卡号") + private String icCard; + + @Schema(description = "真实姓名") + private String realName; + + @Schema(description = "关联收货地址") + @QueryField(type = QueryType.EQ) + private Integer addressId; + + @Schema(description = "收货地址") + private String address; + + private String addressLat; + + private String addressLng; + + @Schema(description = "自提店铺id") + @QueryField(type = QueryType.EQ) + private Integer selfTakeMerchantId; + + @Schema(description = "自提店铺") + private String selfTakeMerchantName; + + @Schema(description = "配送开始时间") + private String sendStartTime; + + @Schema(description = "配送结束时间") + private String sendEndTime; + + @Schema(description = "发货店铺id") + @QueryField(type = QueryType.EQ) + private Integer expressMerchantId; + + @Schema(description = "发货店铺") + private String expressMerchantName; + + @Schema(description = "订单总额") + @QueryField(type = QueryType.EQ) + private BigDecimal totalPrice; + + @Schema(description = "减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格") + @QueryField(type = QueryType.EQ) + private BigDecimal reducePrice; + + @Schema(description = "实际付款") + @QueryField(type = QueryType.EQ) + private BigDecimal payPrice; + + @Schema(description = "用于统计") + @QueryField(type = QueryType.EQ) + private BigDecimal price; + + @Schema(description = "价钱,用于积分赠送") + @QueryField(type = QueryType.EQ) + private BigDecimal money; + + @Schema(description = "取消时间") + private String cancelTime; + + @Schema(description = "取消原因") + private String cancelReason; + + @Schema(description = "退款金额") + @QueryField(type = QueryType.EQ) + private BigDecimal refundMoney; + + @Schema(description = "教练价格") + @QueryField(type = QueryType.EQ) + private BigDecimal coachPrice; + + @Schema(description = "购买数量") + @QueryField(type = QueryType.EQ) + private Integer totalNum; + + @Schema(description = "教练id") + @QueryField(type = QueryType.EQ) + private Integer coachId; + + @Schema(description = "商品ID") + @QueryField(type = QueryType.EQ) + private Integer formId; + + @Schema(description = "支付的用户id") + @QueryField(type = QueryType.EQ) + private Integer payUserId; + + @Schema(description = "0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付") + @QueryField(type = QueryType.EQ) + private Integer payType; + + @Schema(description = "微信支付子类型:JSAPI小程序支付,NATIVE扫码支付") + private String wechatPayType; + + @Schema(description = "0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付") + @QueryField(type = QueryType.EQ) + private Integer friendPayType; + + @Schema(description = "0未付款,1已付款") + @QueryField(type = QueryType.EQ) + private Integer payStatus; + + @Schema(description = "0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款") + @QueryField(type = QueryType.EQ) + private Integer orderStatus; + + @Schema(description = "发货状态(10未发货 20已发货 30部分发货)") + @QueryField(type = QueryType.EQ) + private Integer deliveryStatus; + + @Schema(description = "无需发货备注") + private String deliveryNote; + + @Schema(description = "发货时间") + private String deliveryTime; + + @Schema(description = "评价状态(0未评价 1已评价)") + @QueryField(type = QueryType.EQ) + private Integer evaluateStatus; + + @Schema(description = "评价时间") + private String evaluateTime; + + @Schema(description = "优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡") + @QueryField(type = QueryType.EQ) + private Integer couponType; + + @Schema(description = "优惠说明") + private String couponDesc; + + @Schema(description = "二维码地址,保存订单号,支付成功后才生成") + private String qrcode; + + @Schema(description = "vip月卡年卡、ic月卡年卡回退次数") + @QueryField(type = QueryType.EQ) + private Integer returnNum; + + @Schema(description = "vip充值回退金额") + @QueryField(type = QueryType.EQ) + private BigDecimal returnMoney; + + @Schema(description = "预约详情开始时间数组") + private String startTime; + + @Schema(description = "是否已开具发票:0未开发票,1已开发票,2不能开具发票") + @QueryField(type = QueryType.EQ) + private Integer isInvoice; + + @Schema(description = "发票流水号") + private String invoiceNo; + + @Schema(description = "商家留言") + private String merchantRemarks; + + @Schema(description = "支付时间") + private String payTime; + + @Schema(description = "退款时间") + private String refundTime; + + @Schema(description = "申请退款时间") + private String refundApplyTime; + + @Schema(description = "过期时间") + private String expirationTime; + + @Schema(description = "自提码") + private String selfTakeCode; + + @Schema(description = "是否已收到赠品") + @QueryField(type = QueryType.EQ) + private Boolean hasTakeGift; + + @Schema(description = "对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单") + @QueryField(type = QueryType.EQ) + private Integer checkBill; + + @Schema(description = "订单是否已结算(0未结算 1已结算)") + @QueryField(type = QueryType.EQ) + private Integer isSettled; + + @Schema(description = "系统版本号 0当前版本 value=其他版本") + @QueryField(type = QueryType.EQ) + private Integer version; + + @Schema(description = "用户id") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/CmsOrderService.java b/src/main/java/com/gxwebsoft/cms/service/CmsOrderService.java new file mode 100644 index 0000000..4b3c6d4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/CmsOrderService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.cms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.cms.entity.CmsOrder; +import com.gxwebsoft.cms.param.CmsOrderParam; + +import java.util.List; + +/** + * 网站订单Service + * + * @author 科技小王子 + * @since 2026-01-27 13:03:24 + */ +public interface CmsOrderService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CmsOrderParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CmsOrderParam param); + + /** + * 根据id查询 + * + * @param id id + * @return CmsOrder + */ + CmsOrder getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/CmsOrderServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/CmsOrderServiceImpl.java new file mode 100644 index 0000000..736ba73 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/CmsOrderServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.cms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.cms.mapper.CmsOrderMapper; +import com.gxwebsoft.cms.service.CmsOrderService; +import com.gxwebsoft.cms.entity.CmsOrder; +import com.gxwebsoft.cms.param.CmsOrderParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 网站订单Service实现 + * + * @author 科技小王子 + * @since 2026-01-27 13:03:24 + */ +@Service +public class CmsOrderServiceImpl extends ServiceImpl implements CmsOrderService { + + @Override + public PageResult pageRel(CmsOrderParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CmsOrderParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time desc"); + return page.sortRecords(list); + } + + @Override + public CmsOrder getByIdRel(Integer id) { + CmsOrderParam param = new CmsOrderParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +}