Administrator
2025-07-03 ba11b8586b1f3a6b072d787719083a792e1d1671
feat(mall): 添加衣速达订单相关功能

- 新增订单列表、订单详情、确认收货等接口
- 实现订单分页查询、订单状态筛选等功能
- 优化订单信息展示,包括订单明细、物流信息等
- 修复订单相关的一些小问题
10 files modified
4 files added
473 ■■■■■ changed files
src/main/java/cc/mrbird/febs/mall/controller/clothes/ApiClothesOrderController.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/controller/order/ViewMallOrderController.java 13 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/dto/clothes/ApiClothesOrderListVoDto.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/entity/ClothesOrder.java 2 ●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/entity/MallExpressInfo.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/mapper/ClothesOrderMapper.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/ApiClothesOrderService.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallOrderService.java 23 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java 153 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java 12 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesOrderItemInfoVo.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesOrderListInfoVo.java 104 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesOrderListVo.java 34 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/ClothesOrderMapper.xml 29 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/controller/clothes/ApiClothesOrderController.java
@@ -6,6 +6,7 @@
import cc.mrbird.febs.mall.dto.clothes.*;
import cc.mrbird.febs.mall.service.ApiClothesOrderService;
import cc.mrbird.febs.mall.service.ApiClothesService;
import cc.mrbird.febs.mall.vo.OrderDetailVo;
import cc.mrbird.febs.mall.vo.OrderListVo;
import cc.mrbird.febs.mall.vo.clothes.*;
import io.swagger.annotations.Api;
@@ -86,10 +87,36 @@
            @ApiResponse(code = 200, message = "success", response = ApiClothesOrderPayVo.class)
    })
    @PostMapping(value = "/payOrder")
    public FebsResponse payOrder(@RequestBody ApiClothesOrderPayDto dto) {
    public FebsResponse payOrder(@RequestBody @Validated ApiClothesOrderPayDto dto) {
        return apiClothesOrderService.payOrder(dto);
    }
    @ApiOperation(value = "订单列表", notes = "订单列表")
    @ApiResponses({
            @ApiResponse(code = 200, message = "success", response = ApiClothesOrderListVo.class)
    })
    @PostMapping(value = "/orderList")
    public FebsResponse orderList(@RequestBody @Validated ApiClothesOrderListVoDto dto) {
        return apiClothesOrderService.findOrderList(dto);
    }
    @ApiOperation(value = "订单详情", notes = "订单详情")
    @ApiResponses({
            @ApiResponse(code = 200, message = "success", response = ApiClothesOrderListInfoVo.class)
    })
    @GetMapping(value = "/orderDetails/{id}")
    public FebsResponse orderDetails(@PathVariable("id") Long id) {
        return apiClothesOrderService.orderDetails(id);
    }
    @ApiOperation(value = "确认收货", notes = "确认收货")
    @PostMapping(value = "/confirm/{id}")
    public FebsResponse confirm(@PathVariable("id") Long id) {
        return apiClothesOrderService.confirmOrder(id);
    }
}
src/main/java/cc/mrbird/febs/mall/controller/order/ViewMallOrderController.java
@@ -6,6 +6,7 @@
import cc.mrbird.febs.common.utils.FebsUtil;
import cc.mrbird.febs.common.utils.RedisUtils;
import cc.mrbird.febs.mall.entity.MallExpressInfo;
import cc.mrbird.febs.mall.entity.MallOrderInfo;
import cc.mrbird.febs.mall.entity.MallOrderRefund;
import cc.mrbird.febs.mall.mapper.MallExpressInfoMapper;
import cc.mrbird.febs.mall.mapper.MallInvoiceMapper;
@@ -17,6 +18,7 @@
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
@@ -82,9 +84,16 @@
    @RequiresPermissions("deliverGoods:update")
    public String deliverGoods(@PathVariable long id, Model model) {
        AdminMallOrderVo data = adminMallOrderService.getMallOrderInfoById(id);
        MallOrderInfo mallOrderInfo = adminMallOrderService.getBaseMapper().selectById(id);
        data.setExpressCom("极兔快递");
        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectByOrderId(id);
        if(ObjectUtil.isNotEmpty(mallExpressInfo)){
        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectOne(
                Wrappers.lambdaQuery(MallExpressInfo.class)
                        .eq(MallExpressInfo::getOrderId, id)
                        .eq(MallExpressInfo::getOrderNo, mallOrderInfo.getOrderNo())
                        .last("limit 1")
        );
//        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectByOrderId(id);
        if(ObjectUtil.isNotNull(mallExpressInfo)){
            data.setExpressNo(mallExpressInfo.getExpressNo());
            data.setExpressCom(mallExpressInfo.getExpressCom());
        }else{
src/main/java/cc/mrbird/febs/mall/dto/clothes/ApiClothesOrderListVoDto.java
New file
@@ -0,0 +1,29 @@
package cc.mrbird.febs.mall.dto.clothes;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "ApiClothesOrderListVoDto", description = "参数")
public class ApiClothesOrderListVoDto {
    @NotNull(message = "页码不能为空")
    @ApiModelProperty(value = "页码", example = "1")
    private Integer pageNow;
    @NotNull(message = "每页数量不能为空")
    @ApiModelProperty(value = "每页数量", example = "10")
    private Integer pageSize;
    @ApiModelProperty(value = "搜索参数", example = "1")
    private String query;
    @ApiModelProperty(value = "订单状态", example = "状态 1-待支付 2-待发货 3-待收货 4-已完成 5-已取消")
    private Integer status;
    @ApiModelProperty(hidden = true)
    private Long memberId;
}
src/main/java/cc/mrbird/febs/mall/entity/ClothesOrder.java
@@ -8,7 +8,7 @@
import java.util.Date;
@Data
@TableName("clothes_order_graft")
@TableName("clothes_order")
public class ClothesOrder extends BaseEntity {
    /**
     *
src/main/java/cc/mrbird/febs/mall/entity/MallExpressInfo.java
@@ -17,6 +17,8 @@
    private Long memberId;
    private String orderNo;
    private String expressNo;
    private String expressCom;
src/main/java/cc/mrbird/febs/mall/mapper/ClothesOrderMapper.java
@@ -1,7 +1,14 @@
package cc.mrbird.febs.mall.mapper;
import cc.mrbird.febs.mall.dto.clothes.ApiClothesOrderListVoDto;
import cc.mrbird.febs.mall.entity.ClothesOrder;
import cc.mrbird.febs.mall.vo.clothes.ApiClothesOrderListVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
public interface ClothesOrderMapper extends BaseMapper<ClothesOrder> {
    Page<ApiClothesOrderListVo> selectPageInOrder(Page<ApiClothesOrderListVo> page,  @Param("record")ApiClothesOrderListVoDto dto);
}
src/main/java/cc/mrbird/febs/mall/service/ApiClothesOrderService.java
@@ -1,10 +1,7 @@
package cc.mrbird.febs.mall.service;
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.mall.dto.clothes.ApiClothesOrderDraftDto;
import cc.mrbird.febs.mall.dto.clothes.ApiClothesOrderInfoDto;
import cc.mrbird.febs.mall.dto.clothes.ApiClothesOrderPayDto;
import cc.mrbird.febs.mall.dto.clothes.ApiMyDraftPageDto;
import cc.mrbird.febs.mall.dto.clothes.*;
import cc.mrbird.febs.mall.entity.ClothesOrder;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -25,4 +22,10 @@
    FebsResponse delOrder(Long id);
    FebsResponse payOrder(ApiClothesOrderPayDto dto);
    FebsResponse findOrderList(ApiClothesOrderListVoDto dto);
    FebsResponse orderDetails(Long id);
    FebsResponse confirmOrder(Long id);
}
src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallOrderService.java
@@ -17,6 +17,7 @@
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
@@ -140,8 +141,15 @@
    @Override
    public AdminOrderDetailVo getMallOrderDetailById(long id) {
        AdminOrderDetailVo adminOrderDetailVo = mallOrderInfoMapper.getMallOrderDetailById(id);
        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectByOrderId(id);
        if(ObjectUtil.isNotEmpty(mallExpressInfo)){
        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectOne(
                Wrappers.lambdaQuery(MallExpressInfo.class)
                        .eq(MallExpressInfo::getOrderId, id)
                        .eq(MallExpressInfo::getOrderNo, adminOrderDetailVo.getOrderNo())
                        .last("limit 1")
        );
//        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectByOrderId(id);
        if(ObjectUtil.isNotNull(mallExpressInfo)){
            adminOrderDetailVo.setExpressNo(mallExpressInfo.getExpressNo());
            adminOrderDetailVo.setExpressCom(mallExpressInfo.getExpressCom());
        }
@@ -496,9 +504,15 @@
        if(StrUtil.isEmpty(expressCom)){
            return new FebsResponse().fail().message("请输入物流公司");
        }
        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectByOrderId(mallOrderInfo.getId());
        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectOne(
                Wrappers.lambdaQuery(MallExpressInfo.class)
                        .eq(MallExpressInfo::getOrderId, mallOrderInfo.getId())
                        .eq(MallExpressInfo::getOrderNo, mallOrderInfo.getOrderNo())
                        .last("limit 1")
        );
//        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectByOrderId(mallOrderInfo.getId());
        if(ObjectUtil.isEmpty(mallExpressInfo)){
        if(ObjectUtil.isNull(mallExpressInfo)){
            return new FebsResponse().fail().message("请先发货");
        }
        mallExpressInfo.setExpressNo(expressNo);
@@ -584,6 +598,7 @@
        MallExpressInfo mallExpressInfo = new MallExpressInfo();
        mallExpressInfo.setMemberId(mallOrderInfo.getMemberId());
        mallExpressInfo.setOrderId(mallOrderInfo.getId());
        mallExpressInfo.setOrderNo(deliverGoodsDto.getOrderNo());
        mallExpressInfo.setExpressNo(deliverGoodsDto.getExpressNo());
        mallExpressInfo.setExpressCom(deliverGoodsDto.getExpressCom());
        mallExpressInfo.setExpressCode(deliverGoodsDto.getExpressCode());
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java
@@ -14,14 +14,14 @@
import cc.mrbird.febs.mall.service.ApiClothesOrderService;
import cc.mrbird.febs.mall.service.IApiMallMemberWalletService;
import cc.mrbird.febs.mall.service.IMallMoneyFlowService;
import cc.mrbird.febs.mall.vo.clothes.ApiClothesOrderInfoVo;
import cc.mrbird.febs.mall.vo.clothes.ApiClothesOrderPayVo;
import cc.mrbird.febs.mall.vo.clothes.ApiMyDraftVo;
import cc.mrbird.febs.mall.vo.clothes.*;
import cc.mrbird.febs.pay.model.BrandWCPayRequestData;
import cc.mrbird.febs.pay.service.IPayService;
import cc.mrbird.febs.pay.service.IXcxPayService;
import cc.mrbird.febs.rabbit.producter.AgentProducer;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
@@ -65,6 +65,7 @@
    private final MallAddressInfoMapper mallAddressInfoMapper;
    private final MallMemberCouponMapper mallMemberCouponMapper;
    private final MallGoodsCouponMapper mallGoodsCouponMapper;
    private final MallExpressInfoMapper mallExpressInfoMapper;
    private final AgentProducer agentProducer;
    private final IXcxPayService iXcxPayService;
@@ -460,9 +461,13 @@
                throw new FebsException("详情参数错误");
            }
        }
        /**
         *  计算优惠金额、运费和实际支付金额
         */
        total = total.multiply(new BigDecimal(orderInfo.getGoodsCnt())).setScale(2, RoundingMode.DOWN);
        orderInfo.setAmount(total);
                /**
                 *  计算优惠金额、运费和实际支付金额
                 */
        BigDecimal discountAmount = BigDecimal.ZERO;
        MallMemberCoupon mallMemberCoupon = new MallMemberCoupon();
        if(ObjectUtil.isNotEmpty(dto.getMemberCouponId())){
@@ -484,13 +489,12 @@
                orderInfo.setMemberCouponId(memberCouponId);
            }
        }
        BigDecimal deliveryAmount = dto.getDeliveryAmount() == null ? BigDecimal.ZERO : dto.getDeliveryAmount();
        orderInfo.setAmount(total);
        orderInfo.setDiscountAmount(discountAmount);
        BigDecimal deliveryAmount = dto.getDeliveryAmount() == null ? BigDecimal.ZERO : dto.getDeliveryAmount();
        orderInfo.setCarriage(deliveryAmount);
        BigDecimal realAmount = total.subtract(discountAmount).add(deliveryAmount);
        BigDecimal realAmount = total.subtract(discountAmount).add(deliveryAmount).setScale(2, RoundingMode.DOWN);
        orderInfo.setRealAmount(realAmount);
        clothesOrderMapper.updateById(orderInfo);
@@ -550,6 +554,7 @@
        if(
                ObjectUtil.isNotNull(clothesOrder)
                && ClothesEnum.DOWN.getCode() == clothesOrder.getDelFlag()
                && ClothesOrderStatusEnum.CANCEL.getValue() == clothesOrder.getStatus()
        ){
            clothesOrderMapper.update(null,
                    Wrappers.lambdaUpdate(ClothesOrder.class)
@@ -677,4 +682,132 @@
        return new FebsResponse().success().data(apiClothesOrderPayVo).message("支付成功");
    }
    @Override
    public FebsResponse findOrderList(ApiClothesOrderListVoDto dto) {
        Long memberId = LoginUserUtil.getLoginUser().getId();
        dto.setMemberId(memberId);
        // 创建分页对象,传入当前页和每页大小
        Page<ApiClothesOrderListVo> page = new Page<>(dto.getPageNow(), dto.getPageSize());
        // 调用Mapper方法获取活动分页数据
        Page<ApiClothesOrderListVo> voPage = clothesOrderMapper.selectPageInOrder(page, dto);
        return new FebsResponse().success().data(voPage);
    }
    private List<ApiClothesOrderItemInfoVo> buildOrderItemInfo(Long id) {
        List<ApiClothesOrderItemInfoVo> vos = new ArrayList<>();
        List<ClothesOrderItem> clothesOrderItems = clothesOrderItemMapper.selectList(
                Wrappers.lambdaQuery(ClothesOrderItem.class)
                        .eq(ClothesOrderItem::getOrderId, id)
        );
        if(CollUtil.isNotEmpty(clothesOrderItems)){
            for (ClothesOrderItem item : clothesOrderItems) {
                ApiClothesOrderItemInfoVo vo = new ApiClothesOrderItemInfoVo();
                vo.setName(item.getName());
                vo.setPrice(item.getPrice());
                vo.setType(item.getType());
                vo.setRemark(item.getRemark());
                vos.add( vo);
            }
        }
        return vos;
    }
    @Override
    public FebsResponse orderDetails(Long id) {
        Long memberId = LoginUserUtil.getLoginUser().getId();
        ApiClothesOrderListInfoVo apiClothesOrderListInfoVo = new ApiClothesOrderListInfoVo();
        ClothesOrder clothesOrder = clothesOrderMapper.selectById(id);
        if(ObjectUtil.isNull(clothesOrder)){
            throw new FebsException("订单不存在");
        }
        apiClothesOrderListInfoVo.setId(clothesOrder.getId());
        apiClothesOrderListInfoVo.setOrderNo(clothesOrder.getOrderNo());
        apiClothesOrderListInfoVo.setOrderTime(clothesOrder.getOrderTime());
        apiClothesOrderListInfoVo.setAmount(clothesOrder.getAmount());
        apiClothesOrderListInfoVo.setRealAmount(clothesOrder.getRealAmount());
        ClothesType clothesType = clothesTypeMapper.selectById(clothesOrder.getTypeId());
        if(ObjectUtil.isNotNull(clothesType)){
            apiClothesOrderListInfoVo.setTypeName(clothesType.getName());
            apiClothesOrderListInfoVo.setTypeImage(clothesType.getImage());
        }
        apiClothesOrderListInfoVo.setGoodsCnt(clothesOrder.getGoodsCnt());
        apiClothesOrderListInfoVo.setPayMethod(clothesOrder.getPayMethod());
        apiClothesOrderListInfoVo.setStatus(clothesOrder.getStatus());
        apiClothesOrderListInfoVo.setLongitude(clothesOrder.getLongitude());
        apiClothesOrderListInfoVo.setLatitude(clothesOrder.getLatitude());
        apiClothesOrderListInfoVo.setName(clothesOrder.getName());
        apiClothesOrderListInfoVo.setPhone(clothesOrder.getPhone());
        apiClothesOrderListInfoVo.setAddress(clothesOrder.getAddress());
        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectOne(
                Wrappers.lambdaQuery(MallExpressInfo.class)
                        .eq(MallExpressInfo::getOrderId, clothesOrder.getId())
                        .eq(MallExpressInfo::getOrderNo, clothesOrder.getOrderNo())
                        .last("limit 1")
        );
        if(ObjectUtil.isNotNull(mallExpressInfo)){
            apiClothesOrderListInfoVo.setExpressNo(mallExpressInfo.getExpressNo());
            apiClothesOrderListInfoVo.setExpressCom(mallExpressInfo.getExpressCom());
        }
        List<ApiClothesOrderItemInfoVo> items = buildOrderItemInfo(clothesOrder.getId());
        apiClothesOrderListInfoVo.setItems(items);
        if (OrderStatusEnum.WAIT_PAY.getValue() == clothesOrder.getStatus()) {
            Date endTime = DateUtil.offsetMinute(clothesOrder.getOrderTime(), 1440);
            long remainTime = DateUtil.between(new Date(), endTime, DateUnit.SECOND, false);
            apiClothesOrderListInfoVo.setRemainTime(remainTime);
        }
        apiClothesOrderListInfoVo.setCarriage(clothesOrder.getCarriage());
        apiClothesOrderListInfoVo.setRemark(clothesOrder.getRemark());
        apiClothesOrderListInfoVo.setCommentState(clothesOrder.getCommentState());
        return new FebsResponse().success().data(apiClothesOrderListInfoVo);
    }
    @Override
    public FebsResponse confirmOrder(Long id) {
        MallMember member = LoginUserUtil.getLoginUser();
        ClothesOrder orderInfo =clothesOrderMapper.selectById(id);
        if(ObjectUtil.isNull(orderInfo)){
            throw new FebsException("订单不存在");
        }
        if (member.getId() != orderInfo.getMemberId()) {
            throw new FebsException("无权限操作");
        }
        if (ClothesEnum.UP.getCode() == orderInfo.getDelFlag()) {
            throw new FebsException("订单不存在");
        }
        if (orderInfo.getStatus() != ClothesOrderStatusEnum.WAIT_FINISH.getValue()) {
            throw new FebsException("订单不是待收货状态");
        }
        clothesOrderMapper.update(null,
                Wrappers.lambdaUpdate(ClothesOrder.class)
                .set(ClothesOrder::getStatus, OrderStatusEnum.FINISH.getValue())
                .set(ClothesOrder::getUpdatedTime, new Date())
                .eq(ClothesOrder::getId, id)
                .eq(ClothesOrder::getMemberId, member.getId())
                );
        return new FebsResponse().success().message("操作成功");
    }
}
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -34,6 +34,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
@@ -871,8 +872,15 @@
            }
        }
        MallExpressInfo expressInfo = expressInfoMapper.selectByOrderId(orderInfo.getId());
        if(ObjectUtil.isNotEmpty(expressInfo)){
        MallExpressInfo expressInfo = expressInfoMapper.selectOne(
                Wrappers.lambdaQuery(MallExpressInfo.class)
                        .eq(MallExpressInfo::getOrderId, orderInfo.getId())
                        .eq(MallExpressInfo::getOrderNo, orderInfo.getOrderNo())
                        .last("limit 1")
        );
//        MallExpressInfo expressInfo = expressInfoMapper.selectByOrderId(orderInfo.getId());
        if(ObjectUtil.isNotNull(expressInfo)){
            orderDetailVo.setExpressNo(expressInfo.getExpressNo());
            orderDetailVo.setExpressCom(expressInfo.getExpressCom());
        }
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesOrderItemInfoVo.java
New file
@@ -0,0 +1,25 @@
package cc.mrbird.febs.mall.vo.clothes;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel(value = "ApiClothesOrderItemInfoVo", description = "参数")
public class ApiClothesOrderItemInfoVo {
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "单价")
    private BigDecimal price;
    @ApiModelProperty(value = "类型 1图案 2图案位置 3工艺 4布料 5尺码 6尺码自定义")
    private Integer type;
    @ApiModelProperty(value = "订单编号")
    private String remark;
}
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesOrderListInfoVo.java
New file
@@ -0,0 +1,104 @@
package cc.mrbird.febs.mall.vo.clothes;
import cc.mrbird.febs.mall.vo.OrderItemVo;
import cc.mrbird.febs.mall.vo.OrderRefundVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
@ApiModel(value = "ApiClothesOrderListInfoVo", description = "参数")
public class ApiClothesOrderListInfoVo {
    @ApiModelProperty(value = "订单ID")
    private Long id;
    @ApiModelProperty(value = "订单编号")
    private String orderNo;
    @ApiModelProperty(value = "下单时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date orderTime;
    @ApiModelProperty(value = "总价")
    private BigDecimal amount;
    @ApiModelProperty(value = "实付款")
    private BigDecimal realAmount;
    @ApiModelProperty(value = "类型名称")
    private String typeName;
    @ApiModelProperty(value = "类型图片")
    private String typeImage;
    @ApiModelProperty(value = "数量")
    private Integer goodsCnt;
    @ApiModelProperty(value = "支付方式")
    private String payMethod;
    public Integer getPayMethodType() {
        if (this.payMethod == null) {
            return 0;
        }
        switch (this.payMethod) {
            case "微信支付" :
                return 1;
            case "支付宝支付" :
                return 2;
            case "余额支付" :
                return 3;
            default:
                return 3;
        }
    }
    @ApiModelProperty(value = "支付方式类型")
    private Integer payMethodType;
    @ApiModelProperty(value = "状态")
    private Integer status;
    @ApiModelProperty(value = "送货上门经度")
    private String longitude;
    @ApiModelProperty(value = "送货上门纬度")
    private String latitude;
    @ApiModelProperty(value = "收货人姓名")
    private String name;
    @ApiModelProperty(value = "收货人电话")
    private String phone;
    @ApiModelProperty(value = "收货人地址")
    private String address;
    @ApiModelProperty(value = "物流单号")
    private String expressNo;
    @ApiModelProperty(value = "物流公司")
    private String expressCom;
    @ApiModelProperty(value = "订单明细")
    private List<ApiClothesOrderItemInfoVo> items;
    @ApiModelProperty(value = "剩余时间")
    private Long remainTime;
    @ApiModelProperty(value = "运费")
    private BigDecimal carriage;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "分享社区 1:待分享 2:已分享")
    private Integer commentState;
}
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesOrderListVo.java
New file
@@ -0,0 +1,34 @@
package cc.mrbird.febs.mall.vo.clothes;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel(value = "ApiClothesOrderListVo", description = "参数")
public class ApiClothesOrderListVo {
    @ApiModelProperty(value = "订单ID")
    private Long id;
    @ApiModelProperty(value = "总价")
    private BigDecimal amount;
    @ApiModelProperty(value = "实付款")
    private BigDecimal realAmount;
    @ApiModelProperty(value = "类型名称")
    private String typeName;
    @ApiModelProperty(value = "类型图片")
    private String typeImage;
    @ApiModelProperty(value = "数量")
    private Integer goodsCnt;
    @ApiModelProperty(value = "订单状态", example = "状态 1-待支付 2-待发货 3-待收货 4-已完成 5-已取消")
    private Integer status;
}
src/main/resources/mapper/modules/ClothesOrderMapper.xml
@@ -2,6 +2,33 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cc.mrbird.febs.mall.mapper.ClothesOrderMapper">
    <select id="selectPageInOrder" resultType="cc.mrbird.febs.mall.vo.clothes.ApiClothesOrderListVo">
        select
            a.id as id,
            a.amount as amount,
            a.real_amount as realAmount,
            a.status as status,
            b.name as typeName,
            b.image as typeImage,
            a.goods_cnt as goodsCnt
        from clothes_order_graft a
        left join clothes_type b on a.type_id = b.id
        <where>
            and a.member_id = #{record.memberId}
            <if test="record != null">
                <if test="record.query != null and record.query != ''">
                    and (
                        b.name like CONCAT('%', CONCAT(#{record.query}, '%')) or
                    )
                </if>
                <if test="record.status != null">
                    and (
                        a.status  = #{record.status}
                    )
                </if>
            </if>
        </where>
        order by a.CREATED_TIME desc
    </select>
</mapper>