orders实体类

Aaaaaaaa 2024-08-21 20:36:45 +08:00
parent 09e29cbb84
commit fb48df83d3
8 changed files with 185 additions and 19 deletions

View File

@ -22,12 +22,12 @@ public class Orders extends BaseEntity {
/**
* ID
*/
private Integer ordersId;
private Long ordersId;
/**
*
*/
private Integer ordersNum;
private String ordersNum;
/**
*

View File

@ -1,11 +1,16 @@
package com.muyu.cloud.market.domin;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Authorweiran
@ -24,7 +29,7 @@ public class Product extends BaseEntity {
/**
*
*/
private String productId;
private Long productId;
/**
*
*/
@ -32,7 +37,7 @@ public class Product extends BaseEntity {
/**
*
*/
private String productPrice;
private BigDecimal productPrice;
/**
*
*/
@ -40,7 +45,7 @@ public class Product extends BaseEntity {
/**
* 0 1
*/
private String productState;
private Integer productState;
/**
*/
*/
@ -48,15 +53,17 @@ public class Product extends BaseEntity {
/**
*
*/
private String productInventory;
private Integer productInventory;
/**
*
*/
private String product_sales;
private Integer productSales;
/**
*
*/
private String product_shelvesdate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date productShelvesdate;

View File

@ -1,13 +1,16 @@
package com.muyu.cloud.market.domin.req;
import com.muyu.common.core.validation.custom.IsSystemYesNo;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
@Tag(name = "订单信息列表请求对象",description = "根据入参进行服务的添加")
@ -17,7 +20,6 @@ import java.util.Date;
@Builder
public class OrdersAddReq {
/**
*
*/
@ -29,8 +31,63 @@ public class OrdersAddReq {
defaultValue = "订单服务",
requiredProperties = {"ordersNum"}
)
private Integer ordersNum;
private String ordersNum;
/**
*
*/
@Schema(title = "订单产品(产品外键)",
type = "Integer")
@NotEmpty(message = "订单产品不可为空")
private Integer ordersProduct;
/**
* user
*/
@Schema(title = "订单所属人(用户外键)",
type = "Integer")
@NotEmpty(message = "订单所属人不可为空")
private Integer ordersUser;
/**
*
*/
@NotBlank(message = "订单金额不可为空")
@Schema(
title = "订单金额",
description = "订单金额方向需使用特殊操作处理",
type = "BigDecimal"
)
private BigDecimal ordersPrice;
/**
*
*/
@Schema(
description = "订单规格",
type = "String"
)
private String ordersSpecification;
/**
*
*/
@Schema(
title = "订单状态",
description = "订单状态:1-待支付 2-已付款 3-已取消",
type = "Interger"
)
@NotEmpty(message = "客户使用状态不能为空")
private Integer ordersState;
/**
*
*/
@Schema(
description = "订单日期",
type = "Date"
)
private Date ordersLaunchdate;

View File

@ -1,5 +1,6 @@
package com.muyu.cloud.market.domin.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotEmpty;
@ -7,6 +8,7 @@ import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@ -31,7 +33,7 @@ public class OrdersListReq {
*
*/
@Schema(
description = "订单状态:1-待支付 2-已付 3-已取消",
description = "订单状态:1-待支付 2-已付 3-已取消",
type = "Integer"
)
private Integer ordersState;
@ -43,6 +45,8 @@ public class OrdersListReq {
description = "订单日期",
type = "Date"
)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date ordersLaunchdate;

View File

@ -6,6 +6,9 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Authorweiran
* @Packagecom.muyu.cloud.market.domin.resp
@ -20,4 +23,5 @@ import lombok.experimental.SuperBuilder;
@Tag(name = "客户信息", description = "客户详细信息情况")
public class CustomerListResp {
}

View File

@ -1,17 +1,101 @@
package com.muyu.cloud.market.domin.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.cloud.market.domin.Orders;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.function.Supplier;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Tag(name = "订单信息响应对象",description = "负责订单信息查询的响应结果")
public class OrdersResp {
/**
* ID
*/
@Schema(description = "订单表ID",
defaultValue = "1",
type = "Long")
private Long ordersId;
/**
*
*/
@Schema(description = "订单编号",
type = "String")
private String ordersNum;
/**
*
*/
@Schema(description = "订单产品(产品外键)",
type = "Integer")
private Integer ordersProduct;
/**
* user
*/
@Schema(description = "订单所属人user外键",
type = "Integer")
private Integer ordersUser;
/**
*
*/
@Schema(description = "订单金额",
type = "BigDecimal")
private BigDecimal ordersPrice;
/**
*
*/
@Schema(description = "订单规格",
type = "String")
private String ordersSpecification;
/**
*
*/
@Schema(description = "订单状态(已付款,未付款,待支付)",
type = "Integer")
private Integer ordersState;
/**
*
*/
@Schema(description = "订单日期",
type = "Date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date ordersLaunchdate;
public static OrdersResp ordersresp(Orders orders, Supplier<List<OrdersResp>> function){
return OrdersResp.builder()
.ordersId(orders.getOrdersId())
.ordersNum(orders.getOrdersNum())
.ordersProduct(orders.getOrdersProduct())
.ordersUser(orders.getOrdersUser())
.ordersPrice(orders.getOrdersPrice())
.ordersSpecification(orders.getOrdersSpecification())
.ordersState(orders.getOrdersState())
.ordersLaunchdate(orders.getOrdersLaunchdate())
.build();
}

View File

@ -2,12 +2,19 @@ package com.muyu.cloud.market.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.cloud.market.domin.Orders;
import com.muyu.cloud.market.domin.req.OrdersListReq;
import java.util.List;
public interface OrderShowService extends IService<Orders> {
/**
*
* @param req
* @return
*/
List<Orders> selectOrderShow(OrdersListReq req);
List<Orders> selectOrderShowAndLimit();
}

View File

@ -3,6 +3,7 @@ package com.muyu.cloud.market.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.cloud.market.domin.Orders;
import com.muyu.cloud.market.domin.req.OrdersListReq;
import com.muyu.cloud.market.mapper.OrderShowMapper;
import com.muyu.cloud.market.service.OrderShowService;
import com.muyu.common.core.utils.StringUtils;
@ -21,13 +22,15 @@ public class OrderShowServiceImpl extends ServiceImpl<OrderShowMapper, Orders> i
@Override
public List<Orders> selectOrderShowAndLimit() {
LambdaQueryWrapper<Orders> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(
StringUtils.isNotEmpty()
)
}
public List<Orders> selectOrderShow(OrdersListReq req) {
return null;
}
}