修改订单、商品模块
This commit is contained in:
parent
12e888152d
commit
9683642563
@ -155,7 +155,6 @@ tenant:
|
||||
- oms_order_operate_history
|
||||
- oms_wechat_payment_history
|
||||
- pms_brand
|
||||
- pms_product
|
||||
- pms_product_category
|
||||
- pms_product_snapshot
|
||||
- pms_sku
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.wzj.soopin.goods.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.goods.convert.ProductConvert;
|
||||
import com.wzj.soopin.goods.domain.bo.BrandBo;
|
||||
@ -13,6 +14,7 @@ import com.wzj.soopin.goods.domain.query.ProductQuery;
|
||||
import com.wzj.soopin.goods.domain.vo.BrandVO;
|
||||
import com.wzj.soopin.goods.domain.vo.ProductCategoryVO;
|
||||
import com.wzj.soopin.goods.domain.vo.ProductVO;
|
||||
import com.wzj.soopin.goods.service.ProductService;
|
||||
import com.wzj.soopin.goods.service.impl.ProductServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -41,12 +43,13 @@ public class ProductController extends BaseController {
|
||||
private ProductServiceImpl service;
|
||||
@Autowired
|
||||
private ProductConvert convert;
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
|
||||
@Tag(name ="查询商品信息列表")
|
||||
@PostMapping("list")
|
||||
public R<Page<ProductVO>> list(@RequestBody ProductBo query, Page<Product> page) {
|
||||
Page<Product> productPage = service.page(page,query.toWrapper());
|
||||
return R.ok(convert.toVO(productPage));
|
||||
public R<IPage<ProductVO>> list(@RequestBody ProductBo query, Page<Product> page) {
|
||||
return R.ok(productService.getList(query,page));
|
||||
}
|
||||
|
||||
|
||||
@ -70,6 +73,7 @@ public class ProductController extends BaseController {
|
||||
@Log(title = "商品信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public R add(@RequestBody Product product) {
|
||||
product.setAuthFlag(1);
|
||||
return R.ok(service.save(product));
|
||||
}
|
||||
|
||||
|
@ -3,30 +3,28 @@ package com.wzj.soopin.goods.domain.bo;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.wzj.soopin.goods.domain.entity.Brand;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(description="品牌管理 查询 对象")
|
||||
@Schema(description = "品牌管理 查询 对象")
|
||||
public class BrandBo {
|
||||
|
||||
@ApiModelProperty("NAME 精确匹配")
|
||||
@Schema(description = "NAME 模糊匹配")
|
||||
private String nameLike;
|
||||
|
||||
@ApiModelProperty("SORT 精确匹配")
|
||||
@Schema(description = "SORT 精确匹配")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("SHOW_STATUS 精确匹配")
|
||||
@Schema(description = "SHOW_STATUS 精确匹配")
|
||||
private Integer showStatus;
|
||||
|
||||
@ApiModelProperty("品牌logo 精确匹配")
|
||||
@Schema(description = "品牌logo 精确匹配")
|
||||
private String logo;
|
||||
|
||||
public Wrapper<Brand> toWrapper() {
|
||||
LambdaQueryWrapper<Brand> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
if (nameLike != null && !nameLike.isEmpty()) {
|
||||
queryWrapper.like(Brand::getName, nameLike);
|
||||
}
|
||||
@ -45,4 +43,3 @@ public class BrandBo {
|
||||
return queryWrapper;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,79 +4,86 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.wzj.soopin.goods.domain.entity.Product;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "商品信息 查询 对象")
|
||||
@Schema(description = "商品信息 查询 对象")
|
||||
public class ProductBo {
|
||||
|
||||
@ApiModelProperty("BRAND_ID 精确匹配")
|
||||
@Schema(description = "BRAND_ID 精确匹配")
|
||||
private Long brandId;
|
||||
|
||||
@ApiModelProperty("CATEGORY_ID 精确匹配")
|
||||
@Schema(description = "CATEGORY_ID 精确匹配")
|
||||
private Long categoryId;
|
||||
|
||||
@ApiModelProperty("商品编码 精确匹配")
|
||||
@Schema(description = "商品编码 精确匹配")
|
||||
private String outProductId;
|
||||
|
||||
@ApiModelProperty("NAME 模糊匹配")
|
||||
@Schema(description = "NAME 模糊匹配")
|
||||
private String nameLike;
|
||||
|
||||
@ApiModelProperty("主图 精确匹配")
|
||||
@Schema(description = "主图 精确匹配")
|
||||
private String pic;
|
||||
|
||||
@ApiModelProperty("画册图片,连产品图片限制为5张,以逗号分割 精确匹配")
|
||||
@Schema(description = "画册图片,连产品图片限制为5张,以逗号分割 精确匹配")
|
||||
private String albumPics;
|
||||
|
||||
@ApiModelProperty("上架状态:0->下架;1->上架 精确匹配")
|
||||
@Schema(description = "上架状态:0->下架;1->上架 精确匹配")
|
||||
private Integer publishStatus;
|
||||
|
||||
@ApiModelProperty("排序 精确匹配")
|
||||
@Schema(description = "排序 精确匹配")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("PRICE 精确匹配")
|
||||
@Schema(description = "PRICE 精确匹配")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty("单位 精确匹配")
|
||||
@Schema(description = "单位 精确匹配")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(name = "商品销售属性,json格式")
|
||||
@Schema(description = "商品销售属性,json格式")
|
||||
private String productAttr;
|
||||
|
||||
@ApiModelProperty("商品重量,默认为克 精确匹配")
|
||||
@Schema(description = "商品重量,默认为克 精确匹配")
|
||||
private BigDecimal weight;
|
||||
|
||||
@ApiModelProperty("产品详情网页内容 精确匹配")
|
||||
@Schema(description = "产品详情网页内容 精确匹配")
|
||||
private String detailHtml;
|
||||
|
||||
@ApiModelProperty("移动端网页详情 精确匹配")
|
||||
@Schema(description = "移动端网页详情 精确匹配")
|
||||
private String detailMobileHtml;
|
||||
|
||||
@ApiModelProperty("品牌名称 模糊匹配")
|
||||
@Schema(description = "品牌名称 模糊匹配")
|
||||
private String brandNameLike;
|
||||
|
||||
@ApiModelProperty("商品分类名称 模糊匹配")
|
||||
@Schema(description = "商品分类名称 模糊匹配")
|
||||
private String productCategoryNameLike;
|
||||
|
||||
@ApiModelProperty("排序字段")
|
||||
@Schema(description = "排序字段")
|
||||
private String orderField = "sort";
|
||||
|
||||
@ApiModelProperty("排序规则")
|
||||
@Schema(description = "排序规则")
|
||||
private String orderSort = "desc";
|
||||
|
||||
@ApiModelProperty("搜索关键字")
|
||||
@Schema(description = "搜索关键字")
|
||||
private String search;
|
||||
|
||||
// 排查的id
|
||||
@Schema(description = "排除的商品ID列表")
|
||||
private List<Long> excludeProductIds;
|
||||
|
||||
@Schema(description = "指定的商品ID列表")
|
||||
private List<Long> ids;
|
||||
|
||||
@Schema(description = "审核状态")
|
||||
private String authFlag;
|
||||
|
||||
@Schema(description = "店家手机号")
|
||||
private String contactPhone;
|
||||
|
||||
public Wrapper<Product> toWrapper() {
|
||||
LambdaQueryWrapper<Product> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
@ -144,5 +151,4 @@ public class ProductBo {
|
||||
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,33 +3,32 @@ package com.wzj.soopin.goods.domain.bo;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.wzj.soopin.goods.domain.entity.ProductCategory;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel(description="商品分类 查询 对象")
|
||||
@Schema(description = "商品分类 查询 对象")
|
||||
public class ProductCategoryBo {
|
||||
|
||||
@ApiModelProperty("上级分类的编号:0表示一级分类 精确匹配")
|
||||
@Schema(description = "上级分类的编号:0表示一级分类 精确匹配")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty("NAME 精确匹配")
|
||||
@Schema(description = "NAME 模糊匹配")
|
||||
private String nameLike;
|
||||
|
||||
@ApiModelProperty("分类级别:0->1级;1->2级 精确匹配")
|
||||
@Schema(description = "分类级别:0->1级;1->2级 精确匹配")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty("显示状态:0->不显示;1->显示 精确匹配")
|
||||
@Schema(description = "显示状态:0->不显示;1->显示 精确匹配")
|
||||
private Integer showStatus;
|
||||
|
||||
@ApiModelProperty("SORT 精确匹配")
|
||||
@Schema(description = "SORT 精确匹配")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("图标 精确匹配")
|
||||
@Schema(description = "图标 精确匹配")
|
||||
private String icon;
|
||||
|
||||
public Wrapper<ProductCategory> toWrapper() {
|
||||
@ -59,8 +58,4 @@ public class ProductCategoryBo {
|
||||
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -3,29 +3,28 @@ package com.wzj.soopin.goods.domain.bo;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.wzj.soopin.goods.domain.entity.Sku;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ApiModel(description="sku信息 查询 对象")
|
||||
@Schema(description = "SKU信息 查询 对象")
|
||||
public class SkuBo {
|
||||
|
||||
@ApiModelProperty("PRODUCT_ID 精确匹配")
|
||||
@Schema(description = "PRODUCT_ID 精确匹配")
|
||||
private Long productId;
|
||||
|
||||
@ApiModelProperty("sku编码 精确匹配")
|
||||
@Schema(description = "sku编码 精确匹配")
|
||||
private String outSkuId;
|
||||
|
||||
@ApiModelProperty("PRICE 精确匹配")
|
||||
@Schema(description = "PRICE 精确匹配")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty("展示图片 精确匹配")
|
||||
@Schema(description = "展示图片 精确匹配")
|
||||
private String pic;
|
||||
|
||||
@ApiModelProperty("商品销售属性,json格式 精确匹配")
|
||||
@Schema(description = "商品销售属性,json格式 精确匹配")
|
||||
private String spData;
|
||||
|
||||
public Wrapper<Sku> toWrapper() {
|
||||
@ -50,5 +49,4 @@ public class SkuBo {
|
||||
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,15 +1,26 @@
|
||||
package com.wzj.soopin.goods.domain.dto;
|
||||
|
||||
import com.wzj.soopin.goods.domain.vo.H5ProductVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "商品分类数据传输对象")
|
||||
@Data
|
||||
public class CategoryDTO {
|
||||
@Schema(description = "分类ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "分类名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "分类图标")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "分类下的商品列表")
|
||||
private List<H5ProductVO> productList;
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.wzj.soopin.goods.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.model.BaseAudit;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
@ -12,29 +11,28 @@ import org.dromara.common.excel.annotation.Excel;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="品牌管理对象")
|
||||
@Schema(description = "品牌管理对象")
|
||||
@Data
|
||||
@TableName("pms_brand")
|
||||
public class Brand extends BaseAudit {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("NAME")
|
||||
@Schema(description = "NAME")
|
||||
@Excel(name = "NAME")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("SORT")
|
||||
@Schema(description = "SORT")
|
||||
@Excel(name = "SORT")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("SHOW_STATUS")
|
||||
@Schema(description = "SHOW_STATUS")
|
||||
@Excel(name = "SHOW_STATUS")
|
||||
private Integer showStatus;
|
||||
|
||||
@ApiModelProperty("品牌logo")
|
||||
@Schema(description = "品牌logo")
|
||||
@Excel(name = "品牌logo")
|
||||
private String logo;
|
||||
|
||||
}
|
||||
|
@ -1,89 +1,104 @@
|
||||
package com.wzj.soopin.goods.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.model.BaseAudit;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品信息对象 pms_product
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="商品信息对象")
|
||||
@Schema(description = "商品信息对象")
|
||||
@Data
|
||||
@TableName("pms_product")
|
||||
public class Product extends BaseAudit {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("BRAND_ID")
|
||||
@Schema(description = "BRAND_ID")
|
||||
@Excel(name = "BRAND_ID")
|
||||
private Long brandId;
|
||||
|
||||
@ApiModelProperty("CATEGORY_ID")
|
||||
@Schema(description = "CATEGORY_ID")
|
||||
@Excel(name = "CATEGORY_ID")
|
||||
private Long categoryId;
|
||||
|
||||
@ApiModelProperty("商品编码")
|
||||
@Schema(description = "商品编码")
|
||||
@Excel(name = "商品编码")
|
||||
private String outProductId;
|
||||
|
||||
@ApiModelProperty("NAME")
|
||||
@Schema(description = "NAME")
|
||||
@Excel(name = "NAME")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("主图")
|
||||
@Schema(description = "主图")
|
||||
@Excel(name = "主图")
|
||||
private String pic;
|
||||
|
||||
@ApiModelProperty("画册图片,连产品图片限制为5张,以逗号分割")
|
||||
@Schema(description = "画册图片,连产品图片限制为5张,以逗号分割")
|
||||
@Excel(name = "画册图片,连产品图片限制为5张,以逗号分割")
|
||||
private String albumPics;
|
||||
|
||||
@ApiModelProperty("上架状态:0->下架;1->上架")
|
||||
@Schema(description = "上架状态:0->下架;1->上架")
|
||||
@Excel(name = "上架状态:0->下架;1->上架")
|
||||
private Integer publishStatus;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@Schema(description = "排序")
|
||||
@Excel(name = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("PRICE")
|
||||
@Schema(description = "PRICE")
|
||||
@Excel(name = "PRICE")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
@Schema(description = "单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("商品重量,默认为克")
|
||||
@Schema(description = "商品重量,默认为克")
|
||||
@Excel(name = "商品重量,默认为克")
|
||||
private BigDecimal weight;
|
||||
|
||||
@ApiModelProperty("商品销售属性,json格式")
|
||||
@Schema(description = "商品销售属性,json格式")
|
||||
@Excel(name = "商品销售属性,json格式")
|
||||
private String productAttr;
|
||||
|
||||
@ApiModelProperty("产品详情网页内容")
|
||||
@Schema(description = "产品详情网页内容")
|
||||
@Excel(name = "产品详情网页内容")
|
||||
private String detailHtml;
|
||||
|
||||
@ApiModelProperty("移动端网页详情")
|
||||
@Schema(description = "移动端网页详情")
|
||||
@Excel(name = "移动端网页详情")
|
||||
private String detailMobileHtml;
|
||||
|
||||
@ApiModelProperty("品牌名称")
|
||||
@Schema(description = "品牌名称")
|
||||
@Excel(name = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
@ApiModelProperty("商品分类名称")
|
||||
@Schema(description = "商品分类名称")
|
||||
@Excel(name = "商品分类名称")
|
||||
private String productCategoryName;
|
||||
|
||||
@Schema(description = "商品类型 1.团购;->2.拼团;3->秒杀")
|
||||
@Excel(name = "商品类型 1.团购;->2.拼团;3->秒杀")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "店铺id")
|
||||
@Excel(name = "店铺id")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "审核状态 1.待审核;->2.审核通过;3->审核驳回")
|
||||
@Excel(name = "审核状态 1.待审核;->2.审核通过;3->审核驳回")
|
||||
private Integer authFlag;
|
||||
|
||||
@Schema(description = "销量")
|
||||
@Excel(name = "销量")
|
||||
private String sales;
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.wzj.soopin.goods.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.model.BaseAudit;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
@ -12,37 +11,36 @@ import org.dromara.common.excel.annotation.Excel;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="商品分类对象")
|
||||
@Schema(description = "商品分类对象")
|
||||
@Data
|
||||
@TableName("pms_product_category")
|
||||
public class ProductCategory extends BaseAudit {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("上级分类的编号:0表示一级分类")
|
||||
@Schema(description = "上级分类的编号:0表示一级分类")
|
||||
@Excel(name = "上级分类的编号:0表示一级分类")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty("NAME")
|
||||
@Schema(description = "NAME")
|
||||
@Excel(name = "NAME")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("分类级别:0->1级;1->2级")
|
||||
@Schema(description = "分类级别:0->1级;1->2级")
|
||||
@Excel(name = "分类级别:0->1级;1->2级")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty("显示状态:0->不显示;1->显示")
|
||||
@Schema(description = "显示状态:0->不显示;1->显示")
|
||||
@Excel(name = "显示状态:0->不显示;1->显示")
|
||||
private Integer showStatus;
|
||||
|
||||
@ApiModelProperty("SORT")
|
||||
@Schema(description = "SORT")
|
||||
@Excel(name = "SORT")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("图标")
|
||||
@Schema(description = "图标")
|
||||
@Excel(name = "图标")
|
||||
private String icon;
|
||||
|
||||
}
|
||||
|
@ -1,49 +1,48 @@
|
||||
package com.wzj.soopin.goods.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.model.BaseAudit;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* sku信息对象 pms_sku
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="sku信息对象")
|
||||
@Schema(description = "SKU信息对象")
|
||||
@Data
|
||||
@TableName("pms_sku")
|
||||
public class Sku extends BaseAudit {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("PRODUCT_ID")
|
||||
@Schema(description = "PRODUCT_ID")
|
||||
@Excel(name = "PRODUCT_ID")
|
||||
private Long productId;
|
||||
|
||||
@ApiModelProperty("sku编码")
|
||||
@Excel(name = "sku编码")
|
||||
@Schema(description = "SKU编码")
|
||||
@Excel(name = "SKU编码")
|
||||
private String outSkuId;
|
||||
|
||||
@ApiModelProperty("PRICE")
|
||||
@Excel(name = "PRICE")
|
||||
@Schema(description = "价格")
|
||||
@Excel(name = "价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty("展示图片")
|
||||
@Schema(description = "展示图片")
|
||||
@Excel(name = "展示图片")
|
||||
private String pic;
|
||||
|
||||
@ApiModelProperty("商品销售属性,json格式")
|
||||
@Excel(name = "商品销售属性,json格式")
|
||||
@Schema(description = "商品销售属性,JSON格式")
|
||||
@Excel(name = "商品销售属性,JSON格式")
|
||||
private String spData;
|
||||
|
||||
@ApiModelProperty("库存数")
|
||||
@Schema(description = "库存数")
|
||||
@Excel(name = "库存数")
|
||||
private Integer stock;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.wzj.soopin.goods.domain.query;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -9,19 +8,18 @@ import lombok.Data;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="品牌管理 查询 对象")
|
||||
@Schema(description = "品牌管理查询对象")
|
||||
@Data
|
||||
public class BrandQuery {
|
||||
@ApiModelProperty("NAME 精确匹配")
|
||||
@Schema(description = "NAME 精确匹配")
|
||||
private String nameLike;
|
||||
|
||||
@ApiModelProperty("SORT 精确匹配")
|
||||
@Schema(description = "SORT 精确匹配")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("SHOW_STATUS 精确匹配")
|
||||
@Schema(description = "SHOW_STATUS 精确匹配")
|
||||
private Integer showStatus;
|
||||
|
||||
@ApiModelProperty("品牌logo 精确匹配")
|
||||
@Schema(description = "品牌logo 精确匹配")
|
||||
private String logo;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.wzj.soopin.goods.domain.query;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -9,25 +8,24 @@ import lombok.Data;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="商品分类 查询 对象")
|
||||
@Schema(description = "商品分类查询对象")
|
||||
@Data
|
||||
public class ProductCategoryQuery {
|
||||
@ApiModelProperty("上级分类的编号:0表示一级分类 精确匹配")
|
||||
@Schema(description = "上级分类的编号:0表示一级分类 精确匹配")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty("NAME 精确匹配")
|
||||
@Schema(description = "NAME 模糊匹配")
|
||||
private String nameLike;
|
||||
|
||||
@ApiModelProperty("分类级别:0->1级;1->2级 精确匹配")
|
||||
@Schema(description = "分类级别:0->1级;1->2级 精确匹配")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty("显示状态:0->不显示;1->显示 精确匹配")
|
||||
@Schema(description = "显示状态:0->不显示;1->显示 精确匹配")
|
||||
private Integer showStatus;
|
||||
|
||||
@ApiModelProperty("SORT 精确匹配")
|
||||
@Schema(description = "SORT 精确匹配")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("图标 精确匹配")
|
||||
@Schema(description = "图标 精确匹配")
|
||||
private String icon;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.wzj.soopin.goods.domain.query;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -12,69 +11,69 @@ import java.util.List;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="商品信息 查询 对象")
|
||||
@Schema(description = "商品信息查询对象")
|
||||
@Data
|
||||
public class ProductQuery {
|
||||
@ApiModelProperty("BRAND_ID 精确匹配")
|
||||
@Schema(description = "BRAND_ID 精确匹配")
|
||||
private Long brandId;
|
||||
|
||||
@ApiModelProperty("CATEGORY_ID 精确匹配")
|
||||
@Schema(description = "CATEGORY_ID 精确匹配")
|
||||
private Long categoryId;
|
||||
|
||||
@ApiModelProperty("商品编码 精确匹配")
|
||||
@Schema(description = "商品编码 精确匹配")
|
||||
private String outProductId;
|
||||
|
||||
@ApiModelProperty("NAME 精确匹配")
|
||||
@Schema(description = "NAME 模糊匹配")
|
||||
private String nameLike;
|
||||
|
||||
@ApiModelProperty("主图 精确匹配")
|
||||
@Schema(description = "主图 精确匹配")
|
||||
private String pic;
|
||||
|
||||
@ApiModelProperty("画册图片,连产品图片限制为5张,以逗号分割 精确匹配")
|
||||
@Schema(description = "画册图片,连产品图片限制为5张,以逗号分割 精确匹配")
|
||||
private String albumPics;
|
||||
|
||||
@ApiModelProperty("上架状态:0->下架;1->上架 精确匹配")
|
||||
@Schema(description = "上架状态:0->下架;1->上架 精确匹配")
|
||||
private Integer publishStatus;
|
||||
|
||||
@ApiModelProperty("排序 精确匹配")
|
||||
@Schema(description = "排序 精确匹配")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("PRICE 精确匹配")
|
||||
@Schema(description = "PRICE 精确匹配")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty("单位 精确匹配")
|
||||
@Schema(description = "单位 精确匹配")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(name = "商品销售属性,json格式")
|
||||
@Schema(description = "商品销售属性,JSON格式")
|
||||
private String productAttr;
|
||||
|
||||
@ApiModelProperty("商品重量,默认为克 精确匹配")
|
||||
@Schema(description = "商品重量,默认为克 精确匹配")
|
||||
private BigDecimal weight;
|
||||
|
||||
@ApiModelProperty("产品详情网页内容 精确匹配")
|
||||
@Schema(description = "产品详情网页内容 精确匹配")
|
||||
private String detailHtml;
|
||||
|
||||
@ApiModelProperty("移动端网页详情 精确匹配")
|
||||
@Schema(description = "移动端网页详情 精确匹配")
|
||||
private String detailMobileHtml;
|
||||
|
||||
@ApiModelProperty("品牌名称 精确匹配")
|
||||
@Schema(description = "品牌名称 模糊匹配")
|
||||
private String brandNameLike;
|
||||
|
||||
@ApiModelProperty("商品分类名称 精确匹配")
|
||||
@Schema(description = "商品分类名称 模糊匹配")
|
||||
private String productCategoryNameLike;
|
||||
|
||||
@ApiModelProperty("排序字段")
|
||||
@Schema(description = "排序字段,默认值:sort")
|
||||
private String orderField = "sort";
|
||||
|
||||
@ApiModelProperty("排序规则")
|
||||
@Schema(description = "排序规则,默认值:desc")
|
||||
private String orderSort = "desc";
|
||||
|
||||
@ApiModelProperty("搜索关键字")
|
||||
@Schema(description = "搜索关键字,支持多字段模糊匹配")
|
||||
private String search;
|
||||
|
||||
//排查的id
|
||||
@Schema(description = "排除的商品ID列表")
|
||||
private List<Long> excludeProductIds;
|
||||
|
||||
@Schema(description = "包含的商品ID列表")
|
||||
private List<Long> ids;
|
||||
|
||||
}
|
||||
|
@ -1,32 +1,30 @@
|
||||
package com.wzj.soopin.goods.domain.query;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* sku信息 查询 对象
|
||||
* SKU信息 查询 对象
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="sku信息 查询 对象")
|
||||
@Schema(description = "SKU信息查询对象")
|
||||
@Data
|
||||
public class SkuQuery {
|
||||
@ApiModelProperty("PRODUCT_ID 精确匹配")
|
||||
@Schema(description = "PRODUCT_ID 精确匹配")
|
||||
private Long productId;
|
||||
|
||||
@ApiModelProperty("sku编码 精确匹配")
|
||||
@Schema(description = "SKU编码 精确匹配")
|
||||
private String outSkuId;
|
||||
|
||||
@ApiModelProperty("PRICE 精确匹配")
|
||||
@Schema(description = "价格 精确匹配")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty("展示图片 精确匹配")
|
||||
@Schema(description = "展示图片 精确匹配")
|
||||
private String pic;
|
||||
|
||||
@ApiModelProperty("商品销售属性,json格式 精确匹配")
|
||||
@Schema(description = "商品销售属性,JSON格式 精确匹配")
|
||||
private String spData;
|
||||
|
||||
}
|
||||
|
@ -91,6 +91,9 @@ public class ProductVO extends BaseAudit {
|
||||
@Excel(name = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
@Schema(description = "品牌logo")
|
||||
private String brandLogo;
|
||||
|
||||
/** 商品分类名称 */
|
||||
@Schema(description = "商品分类名称")
|
||||
@Excel(name = "商品分类名称")
|
||||
@ -102,4 +105,23 @@ public class ProductVO extends BaseAudit {
|
||||
|
||||
@Schema(description = "SKU列表")
|
||||
private List<Sku> skuList;
|
||||
|
||||
@Schema(description = "店铺名称")
|
||||
private String contactUserName;
|
||||
|
||||
@Schema(description = "店铺手机号")
|
||||
private String contactPhone;
|
||||
|
||||
@Schema(description = "店铺id")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "审核状态")
|
||||
private String authFlag;
|
||||
|
||||
@Schema(description = "销量")
|
||||
private String sales;
|
||||
|
||||
@Schema(description = "配送方式 1->到店核销;2->自提;3->配送;")
|
||||
private Integer distribution;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,12 @@
|
||||
package com.wzj.soopin.goods.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.goods.domain.bo.ProductBo;
|
||||
import com.wzj.soopin.goods.domain.entity.Product;
|
||||
import com.wzj.soopin.goods.domain.vo.ProductVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -18,4 +23,6 @@ public interface ProductMapper extends BaseMapper<Product> {
|
||||
* @return 商品信息集合
|
||||
*/
|
||||
List<Product> selectByEntity(Product product);
|
||||
|
||||
IPage<ProductVO> getlist(@Param("page") Page<Product> page, @Param("query") ProductBo query);
|
||||
}
|
||||
|
@ -1,7 +1,12 @@
|
||||
package com.wzj.soopin.goods.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.goods.domain.bo.ProductBo;
|
||||
import com.wzj.soopin.goods.domain.entity.Product;
|
||||
import com.wzj.soopin.goods.domain.vo.ProductVO;
|
||||
|
||||
public interface ProductService extends IService<Product> {
|
||||
IPage<ProductVO> getList(ProductBo query, Page<Product> page);
|
||||
}
|
||||
|
@ -4,8 +4,11 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
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.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.goods.convert.ProductConvert;
|
||||
import com.wzj.soopin.goods.domain.bo.ProductBo;
|
||||
import com.wzj.soopin.goods.domain.entity.Product;
|
||||
import com.wzj.soopin.goods.domain.entity.Sku;
|
||||
import com.wzj.soopin.goods.domain.query.ProductQuery;
|
||||
@ -209,4 +212,10 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ProductVO> getList(ProductBo query, Page<Product> page) {
|
||||
IPage<ProductVO> resultPage = productMapper.getlist(page,query);
|
||||
return resultPage;
|
||||
}
|
||||
}
|
||||
|
@ -55,4 +55,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="productCategoryName != null and productCategoryName != ''"> and product_category_name like concat('%', #{productCategoryName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getlist" resultType="ProductVO">
|
||||
SELECT
|
||||
p.*,
|
||||
b.name AS brandName,
|
||||
b.logo AS brandLogo,
|
||||
t.contact_user_name AS contactUserName,
|
||||
t.contact_phone AS contactPhone,
|
||||
o.distribution AS distribution
|
||||
FROM
|
||||
pms_product p
|
||||
LEFT JOIN
|
||||
pms_brand b ON p.brand_id = b.id
|
||||
LEFT JOIN
|
||||
sys_tenant t ON p.tenant_id = t.tenant_id
|
||||
LEFT JOIN
|
||||
oms_order_item oi ON p.id = oi.product_id
|
||||
LEFT JOIN
|
||||
oms_order o ON oi.order_id = o.id
|
||||
WHERE 1=1
|
||||
<if test="query.contactPhone != null and query.contactPhone != ''">
|
||||
AND t.contact_phone LIKE '%${query.contactPhone}%'
|
||||
</if>
|
||||
<if test="query.nameLike != null and query.nameLike != ''">
|
||||
AND p.name LIKE CONCAT('%', #{query.nameLike}, '%')
|
||||
</if>
|
||||
<if test="query.publishStatus != null">
|
||||
AND p.publish_status = #{query.publishStatus}
|
||||
</if>
|
||||
<if test="query.authFlag != null">
|
||||
AND p.auth_flag = #{query.authFlag}
|
||||
</if>
|
||||
ORDER BY
|
||||
p.sales DESC,
|
||||
p.price ASC,
|
||||
CASE p.auth_flag
|
||||
WHEN 1 THEN 1
|
||||
WHEN 3 THEN 2
|
||||
WHEN 2 THEN 3
|
||||
ELSE 4
|
||||
END
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -99,7 +99,8 @@ public class OrderController extends BaseController {
|
||||
@Log(title = "订单表", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public R add(@RequestBody Order order) {
|
||||
return R.ok(service.save(order));
|
||||
order.setWithdrawStatus(1);
|
||||
return service.insert(order);
|
||||
}
|
||||
|
||||
@Tag(name ="修改订单表")
|
||||
|
@ -119,6 +119,12 @@ public class OrderBo {
|
||||
@Schema(description ="创建订单结束时间 精确匹配")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "订单类型:1->团购;2->拼团;3->秒杀;")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "提现状态:1->等待转账;2->转帐中;3->转账成功;4->转账失败")
|
||||
private Integer withdrawStatus;
|
||||
|
||||
public Wrapper<Order> toWrapper() {
|
||||
LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
@ -171,4 +171,13 @@ public class Order extends BaseAudit {
|
||||
|
||||
@Schema(description = "核销码url")
|
||||
private String codeUrl;
|
||||
|
||||
@Schema(description = "订单类型:1->团购;2->拼团;3->秒杀;")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "提现状态:1->等待转账;2->转帐中;3->转账成功;4->转账失败")
|
||||
private Integer withdrawStatus;
|
||||
|
||||
@Schema(description = "配送方式 1->到店核销;2->自提;3->配送;")
|
||||
private Integer distribution;
|
||||
}
|
||||
|
@ -60,4 +60,10 @@ public class ManagerOrderDetailVO {
|
||||
|
||||
@Schema(description = "优惠卷金额")
|
||||
private BigDecimal couponAmount;
|
||||
|
||||
@Schema(description = "店铺名称")
|
||||
private String contactUserName;
|
||||
|
||||
@Schema(description = "店铺手机号")
|
||||
private String contactPhone;
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ import org.dromara.common.excel.annotation.Excel;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 订单表 数据视图对象
|
||||
*
|
||||
@ -188,4 +190,19 @@ public class OrderVO extends BaseAudit {
|
||||
@Excel(name = "商品价格")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "订单类型:1->团购;2->拼团;3->秒杀;")
|
||||
@Excel(name = "订单类型:1->团购;2->拼团;3->秒杀;")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "提现状态:1->等待转账;2->转帐中;3->转账成功;4->转账失败")
|
||||
@Excel(name = "提现状态:1->等待转账;2->转帐中;3->转账成功;4->转账失败")
|
||||
private Integer withdrawStatus;
|
||||
|
||||
@Schema(name = "productInfo", description = "订单商品数据")
|
||||
private List<Map<String, Object>> productList;
|
||||
|
||||
@Schema(description = "配送方式 1->到店核销;2->自提;3->配送;")
|
||||
private Integer distribution;
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.goods.convert.SkuConvert;
|
||||
import com.wzj.soopin.goods.domain.entity.Sku;
|
||||
import com.wzj.soopin.goods.mapper.ProductMapper;
|
||||
import com.wzj.soopin.goods.mapper.SkuMapper;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
@ -29,13 +30,16 @@ import com.wzj.soopin.order.mapper.OrderItemMapper;
|
||||
import com.wzj.soopin.order.mapper.OrderMapper;
|
||||
import com.wzj.soopin.order.mapper.OrderOperateHistoryMapper;
|
||||
import com.wzj.soopin.order.service.OrderService;
|
||||
import com.wzj.soopin.order.service.VerificationCodeService;
|
||||
import com.wzj.soopin.order.utils.PageUtil;
|
||||
import com.wzj.soopin.order.utils.SecurityUtils;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.event.Constants;
|
||||
import org.dromara.common.core.utils.PhoneUtils;
|
||||
import org.dromara.system.domain.SysOperLog;
|
||||
import org.dromara.system.domain.SysTenant;
|
||||
import org.dromara.system.mapper.SysOperLogMapper;
|
||||
import org.dromara.system.mapper.SysTenantMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@ -88,6 +92,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
@Autowired
|
||||
private SysOperLogMapper sysOperLogMapper;
|
||||
|
||||
@Autowired
|
||||
private VerificationCodeService verificationCodeService;
|
||||
|
||||
@Autowired
|
||||
private SysTenantMapper sysTenantMapper;
|
||||
/**
|
||||
* 查询订单表
|
||||
*
|
||||
@ -95,10 +104,13 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
* @return 订单表
|
||||
*/
|
||||
public ManagerOrderDetailVO selectById(Long id) {
|
||||
// 1. 原有订单查询逻辑保持不变
|
||||
Order order = orderMapper.selectById(id);
|
||||
if (order == null){
|
||||
throw new RuntimeException("查不到订单信息");
|
||||
}
|
||||
|
||||
// 2. 原有VO封装逻辑保持不变
|
||||
ManagerOrderDetailVO managerOrderDetailVO = new ManagerOrderDetailVO();
|
||||
//封装订单信息
|
||||
managerOrderDetailVO.setOrderId(id);
|
||||
@ -115,21 +127,37 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
managerOrderDetailVO.setTotalAmount(order.getTotalAmount());
|
||||
managerOrderDetailVO.setPayAmount(order.getPayAmount());
|
||||
managerOrderDetailVO.setReceiveTime(order.getReceiveTime());
|
||||
|
||||
//封装订单地址信息
|
||||
ManagerOrderAddressVo managerOrderAddressVo = new ManagerOrderAddressVo();
|
||||
managerOrderAddressVo.setUserPhone(order.getReceiverPhone());
|
||||
managerOrderAddressVo.setAddress(order.getReceiverDetailAddress());
|
||||
managerOrderAddressVo.setArea(
|
||||
order.getReceiverProvince() +
|
||||
order.getReceiverProvince() +
|
||||
order.getReceiverCity() +
|
||||
order.getReceiverDistrict());
|
||||
managerOrderAddressVo.setName(order.getReceiverName());
|
||||
managerOrderDetailVO.setAddressInfo(managerOrderAddressVo);
|
||||
//查询会员信息
|
||||
|
||||
// 3. 原有会员查询逻辑保持不变
|
||||
Member member = memberMapper.selectById(order.getMemberId());
|
||||
managerOrderDetailVO.setUserName(member.getNickname());
|
||||
managerOrderDetailVO.setUserPhone(member.getPhoneHidden());
|
||||
//查询购买商品信息
|
||||
|
||||
// 4. 新增租户信息查询(完全独立新增,不影响原有逻辑)
|
||||
if (order.getTenantId() != null) {
|
||||
SysTenant tenant = sysTenantMapper.selectOne(
|
||||
new QueryWrapper<SysTenant>()
|
||||
.eq("tenant_id", order.getTenantId())
|
||||
.select("contact_user_name", "contact_phone")
|
||||
);
|
||||
if (tenant != null) {
|
||||
managerOrderDetailVO.setContactUserName(tenant.getContactUserName());
|
||||
managerOrderDetailVO.setContactPhone(tenant.getContactPhone());
|
||||
}
|
||||
}
|
||||
|
||||
// 5. 原有商品查询逻辑保持不变
|
||||
QueryWrapper<OrderItem> qw = new QueryWrapper<>();
|
||||
qw.eq("order_id", order.getId());
|
||||
List<OrderItem> orderItemList = orderItemMapper.selectList(qw);
|
||||
@ -145,6 +173,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
productList.add(productVO);
|
||||
});
|
||||
managerOrderDetailVO.setProductInfo(productList);
|
||||
|
||||
return managerOrderDetailVO;
|
||||
}
|
||||
|
||||
@ -202,10 +231,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
*/
|
||||
public R<Order> insert(Order order) {
|
||||
order.setCreateTime(LocalDateTime.now());
|
||||
order.setWithdrawStatus(1);
|
||||
int insert = orderMapper.insert(order);
|
||||
if (insert>1){
|
||||
return R.fail("订单创建失败");
|
||||
}else {
|
||||
verificationCodeService.generateVerificationCode(order.getId());
|
||||
return R.ok(order);
|
||||
}
|
||||
}
|
||||
@ -404,9 +435,17 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
// List<OrderOperateHistory> historyList = orderOperateHistoryMapper.selectList(wrapper);
|
||||
// return historyList;
|
||||
|
||||
LambdaQueryWrapper<SysOperLog> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SysOperLog::getTitle, "订单表");
|
||||
wrapper.eq(SysOperLog::getOperatorType, 1);
|
||||
LambdaQueryWrapper<SysOperLog> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SysOperLog::getTitle, "订单表")
|
||||
.eq(SysOperLog::getOperatorType, 1)
|
||||
.select(
|
||||
SysOperLog::getTitle,
|
||||
SysOperLog::getBusinessType,
|
||||
SysOperLog::getOperName,
|
||||
SysOperLog::getDeptName,
|
||||
SysOperLog::getStatus,
|
||||
SysOperLog::getOperTime
|
||||
);
|
||||
return sysOperLogMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
@ -445,13 +484,67 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
|
||||
@Override
|
||||
public IPage<OrderVO> getlist(Page<Order> page, OrderBo query) {
|
||||
|
||||
IPage<OrderVO> resultPage = orderMapper.getlist(page,query);
|
||||
List<OrderVO> orderVOList = resultPage.getRecords();
|
||||
if (orderVOList.isEmpty()) {
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
// 获取所有订单id
|
||||
List<Long> orderIds = orderVOList.stream()
|
||||
.map(OrderVO::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 根据订单id查询订单详情(oms_order_item表)
|
||||
QueryWrapper<OrderItem> orderItemQueryWrapper = new QueryWrapper<>();
|
||||
orderItemQueryWrapper.in("order_id", orderIds);
|
||||
List<OrderItem> orderItemList = orderItemMapper.selectList(orderItemQueryWrapper);
|
||||
|
||||
// 按照订单id分组订单详情
|
||||
Map<Long, List<OrderItem>> orderItemMapByOrderId = orderItemList.stream()
|
||||
.collect(Collectors.groupingBy(OrderItem::getOrderId));
|
||||
|
||||
// 获取所有sku_id
|
||||
List<Long> skuIds = orderItemList.stream()
|
||||
.map(OrderItem::getSkuId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 根据sku_id查询pms_sku表数据
|
||||
QueryWrapper<Sku> skuQueryWrapper = new QueryWrapper<>();
|
||||
skuQueryWrapper.in("id", skuIds);
|
||||
List<Sku> skuList = skuMapper.selectList(skuQueryWrapper);
|
||||
|
||||
// 按照sku_id分组pms_sku数据
|
||||
Map<Long, Sku> skuMapById = skuList.stream()
|
||||
.collect(Collectors.toMap(Sku::getId, sku -> sku));
|
||||
|
||||
for (OrderVO orderVO : orderVOList) {
|
||||
List<Map<String, Object>> productList = new ArrayList<>();
|
||||
List<OrderItem> orderItems = orderItemMapByOrderId.get(orderVO.getId());
|
||||
if (orderItems != null) {
|
||||
for (OrderItem orderItem : orderItems) {
|
||||
Sku sku = skuMapById.get(orderItem.getSkuId());
|
||||
if (sku != null) {
|
||||
Map<String, Object> productMap = new HashMap<>();
|
||||
productMap.put("price", sku.getPrice());
|
||||
productMap.put("pic", sku.getPic());
|
||||
productMap.put("stock", sku.getStock());
|
||||
productMap.put("spData", sku.getSpData());
|
||||
productList.add(productMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
orderVO.setProductList(productList);
|
||||
}
|
||||
|
||||
return resultPage;
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public IPage<OrderVO> getlist(PageVO pageVO, OrderBo query) {
|
||||
// IPage<OrderVO> resultPage = orderMapper.getlist(PageUtil.initPage(pageVO),query);
|
||||
// return resultPage;
|
||||
// }
|
||||
}
|
||||
|
||||
|
@ -295,9 +295,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="query.memberId != null and query.memberId != ''">
|
||||
AND o.member_id LIKE CONCAT('%', #{query.memberId}, '%')
|
||||
</if>
|
||||
<if test="query.receiverPhone != null and query.receiverPhone != ''">
|
||||
AND o.receiver_phone LIKE CONCAT('%', #{receiverPhone}, '%')
|
||||
</if>
|
||||
<if test="query.status != null and query.status != ''">
|
||||
AND o.status LIKE CONCAT('%', #{query.status}, '%')
|
||||
</if>
|
||||
<if test="query.type != null and query.type != ''">
|
||||
AND o.type LIKE CONCAT('%', #{query.type}, '%')
|
||||
</if>
|
||||
<if test="query.withdrawStatus != null and query.withdrawStatus != ''">
|
||||
AND o.withdraw_status LIKE CONCAT('%', #{withdrawStatus}, '%')
|
||||
</if>
|
||||
<if test="query.aftersaleStatus != null and query.aftersaleStatus != ''">
|
||||
AND o.aftersale_status LIKE CONCAT('%', #{aftersaleStatus}, '%')
|
||||
</if>
|
||||
<if test="query.startTime != null">
|
||||
AND o.create_time >= #{query.startTime, jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
@ -2,6 +2,7 @@ package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
@ -16,6 +17,7 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("sys_oper_log")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class SysOperLog implements Serializable {
|
||||
|
||||
@Serial
|
||||
|
@ -11,4 +11,5 @@ import org.dromara.system.domain.vo.SysOperLogVo;
|
||||
*/
|
||||
public interface SysOperLogMapper extends BaseMapperPlus<SysOperLog, SysOperLogVo> {
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,26 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.system.mapper.SysOperLogMapper">
|
||||
|
||||
<select id="selectLog" resultType="SysOperLog">
|
||||
SELECT
|
||||
title,
|
||||
business_type,
|
||||
oper_name,
|
||||
dept_name,
|
||||
status,
|
||||
oper_time
|
||||
FROM sys_oper_log
|
||||
<where>
|
||||
<if test="title != null and title != ''">
|
||||
AND title = '订单表'
|
||||
</if>
|
||||
<if test="operatorType != null">
|
||||
AND operator_type = 1
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY oper_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
x
Reference in New Issue
Block a user