dev798
parent
42d21106be
commit
db1479a922
|
@ -0,0 +1,112 @@
|
||||||
|
package com.muyu.product.domain.Resp;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: wangxinyuan
|
||||||
|
* @Date: 2024/3/30 12:27
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProductResp {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
@NotEmpty(message = "名称不能为空")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "货号")
|
||||||
|
@NotNull(message = "货号不能为空")
|
||||||
|
private String productNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "审核状态 (1:通过, 2:驳回)")
|
||||||
|
private Integer productExamine;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "品牌")
|
||||||
|
@NotNull(message = "品牌不能不选择")
|
||||||
|
private Integer brandId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品类型")
|
||||||
|
@NotNull(message = "商品类型不能不选择")
|
||||||
|
private Integer typeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "副标题")
|
||||||
|
private String productSubheading;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品介绍")
|
||||||
|
private String productInformation;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单位")
|
||||||
|
private String productUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "重量")
|
||||||
|
private Double productWeight;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private Integer productSort;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "促销表id")
|
||||||
|
private Integer promotionId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "积分")
|
||||||
|
private Integer productPoints;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "成长值")
|
||||||
|
private Integer productGrowth;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "最大积分值")
|
||||||
|
private Integer productMaxPoints;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预告商品 (1:是, 2:否)")
|
||||||
|
private Integer productForeknow;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上下架状态 (1:上架, 2:下架)")
|
||||||
|
private Integer productStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "新品 (1:是, 2:否)")
|
||||||
|
private Integer productNew;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "推荐 (1:是, 2:否)")
|
||||||
|
private Integer productRecommended;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "详情标题")
|
||||||
|
private String detailsTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "详情描述")
|
||||||
|
private String detailsInformation;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String detailsKeyWord;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String detailsRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "优惠方法")
|
||||||
|
@NotNull(message = "优惠方式不能不选择")
|
||||||
|
private Integer methodType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "优惠Id")
|
||||||
|
private Integer methodId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "移动端信息")
|
||||||
|
private String moveInformation;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "PC端信息")
|
||||||
|
private String pcInformation;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "售价")
|
||||||
|
private Double salePrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "品牌名称")
|
||||||
|
private String brandName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型名称")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
package com.muyu.product.domain.req;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: wangxinyuan
|
|
||||||
* @Date: 2024/3/29 10:23
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
|
|
||||||
public class ProductInfoReq {
|
|
||||||
|
|
||||||
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
public List<ProductInfoReq> getSkuList(ProductInfoReq productInfoReq) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set keySet() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object get(Object key) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +1,8 @@
|
||||||
package com.muyu.product.domain.req;
|
package com.muyu.product.domain.req;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.product.domain.*;
|
|
||||||
import com.muyu.product.domain.DTO.*;
|
import com.muyu.product.domain.DTO.*;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -22,11 +21,12 @@ import java.util.List;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@ApiModel(value = "ProductReq", description = "商品添加接收信息")
|
@ApiModel(value = "ProductReq", description = "商品添加接收信息")
|
||||||
public class ProductReq extends HashMap {
|
public class ProductReq {
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品")
|
@ApiModelProperty(value = "商品")
|
||||||
@Valid
|
@Valid
|
||||||
private Product product;
|
private Product product;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品图片列表")
|
@ApiModelProperty(value = "商品图片列表")
|
||||||
private List<String> productImages;
|
private List<String> productImages;
|
||||||
|
|
||||||
|
@ -37,26 +37,18 @@ public class ProductReq extends HashMap {
|
||||||
private List<Integer> serviceIds;
|
private List<Integer> serviceIds;
|
||||||
|
|
||||||
@ApiModelProperty(value = "阶梯优惠")
|
@ApiModelProperty(value = "阶梯优惠")
|
||||||
@Valid
|
private List<Ladder> ladder;
|
||||||
private Ladder ladder;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "会员信息")
|
@ApiModelProperty(value = "会员信息")
|
||||||
@Valid
|
|
||||||
private Member member;
|
private Member member;
|
||||||
|
|
||||||
@ApiModelProperty(value = "优惠信息")
|
@ApiModelProperty(value = "优惠信息")
|
||||||
@Valid
|
|
||||||
private Preference preference;
|
private Preference preference;
|
||||||
|
|
||||||
@ApiModelProperty(value = "价格信息")
|
@ApiModelProperty(value = "价格信息")
|
||||||
@Valid
|
private List<Price> price;
|
||||||
private Price price;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "分页参数")
|
|
||||||
private Integer pageNum = 1;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "分页参数")
|
|
||||||
private Integer pageSize = 10;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.muyu.product.domain.req;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: wangxinyuan
|
||||||
|
* @Date: 2024/3/29 20:00
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProductSkuNew extends BaseEntity {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "SKUId")
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "销售价格")
|
||||||
|
private Double salePrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "促销价格")
|
||||||
|
private Double promotionPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "库存")
|
||||||
|
private Integer stock;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预警库存")
|
||||||
|
private Integer stockAlert;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品Id")
|
||||||
|
private Integer productId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "SKU背景图地址")
|
||||||
|
private String bgImg;
|
||||||
|
}
|
|
@ -1,18 +0,0 @@
|
||||||
package com.muyu.product.domain.req;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: wangxinyuan
|
|
||||||
* @Date: 2024/3/29 10:32
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class ProductSkuReq extends HashMap {
|
|
||||||
|
|
||||||
|
|
||||||
private Integer productId;
|
|
||||||
}
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.muyu.product.domain.req;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: wangxinyuan
|
||||||
|
* @Date: 2024/3/29 19:58
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QueryProductReq {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "货号")
|
||||||
|
private String productNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上下架状态 (1:上架, 2:下架)")
|
||||||
|
private Integer productStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "审核状态 (1:通过, 2:驳回)")
|
||||||
|
private Integer productExamine;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "品牌")
|
||||||
|
private Integer brandId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品类型")
|
||||||
|
private Integer typeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分页参数")
|
||||||
|
private Integer pageNum = 1;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分页参数")
|
||||||
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.muyu.product.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: wangxinyuan
|
||||||
|
* @Date: 2024/3/30 12:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(description = "商品类别")
|
||||||
|
public class ProductCategoryVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类别ID")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类别名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父类别ID")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "子类别列表")
|
||||||
|
private List<ProductCategoryVo> childrenList;
|
||||||
|
}
|
|
@ -1,10 +1,22 @@
|
||||||
package com.muyu.product.controller;
|
package com.muyu.product.controller;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.AjaxResult;
|
||||||
|
import com.muyu.product.domain.DTO.Brand;
|
||||||
|
import com.muyu.product.domain.DTO.Services;
|
||||||
|
import com.muyu.product.domain.util.R;
|
||||||
|
import com.muyu.product.domain.vo.ProductCategoryVo;
|
||||||
|
import com.muyu.product.service.ArgumentService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.muyu.common.core.domain.AjaxResult.success;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: wangxinyuan
|
* @Author: wangxinyuan
|
||||||
* @Date: 2024/3/29 17:09
|
* @Date: 2024/3/29 17:09
|
||||||
|
@ -13,4 +25,28 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
@RequestMapping("argument")
|
@RequestMapping("argument")
|
||||||
@Api(value = "下拉框管理")
|
@Api(value = "下拉框管理")
|
||||||
public class ArgumentController {
|
public class ArgumentController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ArgumentService argumentService;
|
||||||
|
|
||||||
|
@GetMapping("/queryBrand")
|
||||||
|
public AjaxResult queryBrand(){
|
||||||
|
List<Brand>list = argumentService.queryBrand();
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/queryService")
|
||||||
|
public AjaxResult queryService(){
|
||||||
|
List<Services>list=argumentService.queryService();
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryCategory")
|
||||||
|
public R<List<ProductCategoryVo>>queryCategory(){
|
||||||
|
return R.ok(argumentService.queryCategory());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,18 @@ import com.github.pagehelper.PageInfo;
|
||||||
import com.muyu.common.core.domain.AjaxResult;
|
import com.muyu.common.core.domain.AjaxResult;
|
||||||
import com.muyu.common.system.remote.RemoteFileService;
|
import com.muyu.common.system.remote.RemoteFileService;
|
||||||
import com.muyu.product.domain.DTO.Product;
|
import com.muyu.product.domain.DTO.Product;
|
||||||
|
import com.muyu.product.domain.Resp.ProductResp;
|
||||||
import com.muyu.product.domain.req.ProductReq;
|
import com.muyu.product.domain.req.ProductReq;
|
||||||
|
import com.muyu.product.domain.req.QueryProductReq;
|
||||||
|
import com.muyu.product.domain.util.R;
|
||||||
import com.muyu.product.service.ProductService;
|
import com.muyu.product.service.ProductService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import javax.validation.Valid;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import static com.muyu.common.core.domain.AjaxResult.success;
|
import static com.muyu.common.core.domain.AjaxResult.success;
|
||||||
|
|
||||||
|
@ -31,11 +34,19 @@ public class ProductController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RemoteFileService remoteFileService;
|
private RemoteFileService remoteFileService;
|
||||||
|
|
||||||
@ApiModelProperty("查询商品信息")
|
@ApiOperation("查询商品信息")
|
||||||
@GetMapping("/queryProduct")
|
@GetMapping("/queryProduct")
|
||||||
public AjaxResult queryProduct(@RequestBody ProductReq req){
|
public AjaxResult queryProduct(QueryProductReq req){
|
||||||
PageInfo<Product> list = productService.queryProduct(req);
|
PageInfo<ProductResp> list = productService.queryProduct(req);
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加商品")
|
||||||
|
@PostMapping("/productInsert")
|
||||||
|
public R<Product>productInsert(@Valid @RequestBody ProductReq productReq){
|
||||||
|
productService.productInsert(productReq);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
package com.muyu.product.mapper;
|
package com.muyu.product.mapper;
|
||||||
|
|
||||||
|
import com.muyu.product.domain.DTO.Brand;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: wangxinyuan
|
* @Author: wangxinyuan
|
||||||
* @Date: 2024/3/29 17:07
|
* @Date: 2024/3/29 17:07
|
||||||
*/
|
*/
|
||||||
public interface ArgumentMapper {
|
public interface ArgumentMapper {
|
||||||
|
List<Brand> queryBrand();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,17 @@
|
||||||
package com.muyu.product.mapper;
|
package com.muyu.product.mapper;
|
||||||
|
|
||||||
|
import com.muyu.product.domain.DTO.Product;
|
||||||
|
import com.muyu.product.domain.Resp.ProductResp;
|
||||||
|
import com.muyu.product.domain.req.ProductReq;
|
||||||
|
import com.muyu.product.domain.req.QueryProductReq;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: wangxinyuan
|
* @Author: wangxinyuan
|
||||||
* @Date: 2024/3/29 17:06
|
* @Date: 2024/3/29 17:06
|
||||||
*/
|
*/
|
||||||
public interface ProductMapper {
|
public interface ProductMapper {
|
||||||
|
|
||||||
|
List<ProductResp> queryProduct(QueryProductReq productReq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.muyu.product.mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: wangxinyuan
|
||||||
|
* @Date: 2024/3/29 17:29
|
||||||
|
*/
|
||||||
|
public interface ProductSkuMapper {
|
||||||
|
}
|
|
@ -1,8 +1,20 @@
|
||||||
package com.muyu.product.service;
|
package com.muyu.product.service;
|
||||||
|
|
||||||
|
import com.muyu.product.domain.DTO.Brand;
|
||||||
|
import com.muyu.product.domain.DTO.Services;
|
||||||
|
import com.muyu.product.domain.vo.ProductCategoryVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: wangxinyuan
|
* @Author: wangxinyuan
|
||||||
* @Date: 2024/3/29 17:05
|
* @Date: 2024/3/29 17:05
|
||||||
*/
|
*/
|
||||||
public interface ArgumentService {
|
public interface ArgumentService {
|
||||||
|
List<Brand> queryBrand();
|
||||||
|
|
||||||
|
List<Services> queryService();
|
||||||
|
|
||||||
|
List<ProductCategoryVo> queryCategory();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,16 @@ package com.muyu.product.service;
|
||||||
|
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.muyu.product.domain.DTO.Product;
|
import com.muyu.product.domain.DTO.Product;
|
||||||
|
import com.muyu.product.domain.Resp.ProductResp;
|
||||||
import com.muyu.product.domain.req.ProductReq;
|
import com.muyu.product.domain.req.ProductReq;
|
||||||
|
import com.muyu.product.domain.req.QueryProductReq;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: wangxinyuan
|
* @Author: wangxinyuan
|
||||||
* @Date: 2024/3/29 17:05
|
* @Date: 2024/3/29 17:05
|
||||||
*/
|
*/
|
||||||
public interface ProductService {
|
public interface ProductService {
|
||||||
PageInfo<Product> queryProduct(ProductReq req);
|
PageInfo<ProductResp> queryProduct(QueryProductReq req);
|
||||||
|
|
||||||
|
void productInsert(ProductReq productReq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,36 @@
|
||||||
package com.muyu.product.service.impl;
|
package com.muyu.product.service.impl;
|
||||||
|
|
||||||
|
import com.muyu.product.domain.DTO.Brand;
|
||||||
|
import com.muyu.product.domain.DTO.Services;
|
||||||
|
import com.muyu.product.domain.vo.ProductCategoryVo;
|
||||||
|
import com.muyu.product.mapper.ArgumentMapper;
|
||||||
import com.muyu.product.service.ArgumentService;
|
import com.muyu.product.service.ArgumentService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: wangxinyuan
|
* @Author: wangxinyuan
|
||||||
* @Date: 2024/3/29 17:06
|
* @Date: 2024/3/29 17:06
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ArgumentServiceImpl implements ArgumentService {
|
public class ArgumentServiceImpl implements ArgumentService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ArgumentMapper argumentMapper;
|
||||||
|
@Override
|
||||||
|
public List<Brand> queryBrand() {
|
||||||
|
return argumentMapper.queryBrand();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Services> queryService() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProductCategoryVo> queryCategory() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,24 @@
|
||||||
package com.muyu.product.service.impl;
|
package com.muyu.product.service.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.muyu.product.domain.DTO.Product;
|
import com.muyu.product.domain.DTO.Product;
|
||||||
|
import com.muyu.product.domain.Resp.ProductResp;
|
||||||
import com.muyu.product.domain.req.ProductReq;
|
import com.muyu.product.domain.req.ProductReq;
|
||||||
|
import com.muyu.product.domain.req.QueryProductReq;
|
||||||
|
import com.muyu.product.mapper.ProductMapper;
|
||||||
|
import com.muyu.product.mapper.ProductSkuMapper;
|
||||||
|
import com.muyu.product.mapper.PromotionMapper;
|
||||||
import com.muyu.product.service.ProductService;
|
import com.muyu.product.service.ProductService;
|
||||||
|
import com.muyu.product.service.ServiceService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.management.Query;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: wangxinyuan
|
* @Author: wangxinyuan
|
||||||
* @Date: 2024/3/29 17:06
|
* @Date: 2024/3/29 17:06
|
||||||
|
@ -18,8 +30,38 @@ public class ProductServiceImpl implements ProductService {
|
||||||
private final Integer min = 0;
|
private final Integer min = 0;
|
||||||
|
|
||||||
private final Integer max = 5;
|
private final Integer max = 5;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProductMapper productMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ServiceService serviceService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PromotionMapper promotionMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProductSkuMapper productSkuMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<Product> queryProduct(ProductReq req) {
|
public PageInfo<ProductResp> queryProduct(QueryProductReq productReq) {
|
||||||
return null;
|
PageHelper.startPage(productReq.getPageNum(),productReq.getPageSize());
|
||||||
|
List<ProductResp>products=productMapper.queryProduct(productReq);
|
||||||
|
PageInfo<ProductResp> pageInfo = new PageInfo<>(products);
|
||||||
|
return pageInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void productInsert(ProductReq productReq) {
|
||||||
|
long start =System.currentTimeMillis();
|
||||||
|
|
||||||
|
insertProduct(productReq.getProduct());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void insertProduct(Product product) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,4 +5,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<mapper namespace="com.muyu.product.mapper.ArgumentMapper">
|
<mapper namespace="com.muyu.product.mapper.ArgumentMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="queryBrand" resultType="com.muyu.product.domain.DTO.Brand">
|
||||||
|
select id,brand_name from t_product_brand
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -5,59 +5,45 @@
|
||||||
<mapper namespace="com.muyu.product.mapper.ProductMapper">
|
<mapper namespace="com.muyu.product.mapper.ProductMapper">
|
||||||
|
|
||||||
|
|
||||||
<insert id="insertProcuduct" useGeneratedKeys="true" keyProperty="id">
|
<sql id="sql">
|
||||||
INSERT INTO `cargo`.`t_product` (
|
t_product.id,product_name,product_number,brand_id,type_id,product_subheading,product_examine,
|
||||||
`product_name`,
|
product_information,product_unit,product_weight,product_sort,product_points,
|
||||||
`product_number`,
|
product_growth,product_max_points,product_foreknow,product_status,product_new,
|
||||||
`brand_id`,
|
product_recommended,details_title,details_information,details_key_word,details_remark,
|
||||||
`type_id`,
|
method_type,t_product_brand.brand_name,t_product_type.type_name,sale_price
|
||||||
`product_subheading`,
|
</sql>
|
||||||
`product_information`,
|
<select id="queryProduct" resultType="com.muyu.product.domain.Resp.ProductResp">
|
||||||
`product_unit`,
|
select <include refid="sql"></include> from t_product
|
||||||
`product_weight`,
|
LEFT JOIN t_product_brand ON t_product.brand_id = t_product_brand.id
|
||||||
`product_sort`,
|
LEFT join t_product_type ON t_product.type_id = t_product_type.id
|
||||||
`product_points`,
|
left JOIN t_product_sku on t_product_sku.product_id = t_product.id
|
||||||
`product_growth`,
|
<where>
|
||||||
`product_max_points`,
|
t_product.id_delete = 1
|
||||||
`product_foreknow`,
|
<if test="productName != null and productName != ''">
|
||||||
`product_staus`,
|
and product_name like concat('%',#{productName},'%')
|
||||||
`product_new`,
|
</if>
|
||||||
`product_recommended`,
|
<if test="productNumber != null and productNumber != ''">
|
||||||
`details_title`,
|
and product_number like concat('%',#{productNumber},'%')
|
||||||
`details_information`,
|
</if>
|
||||||
`details_key_word`,
|
<if test="productStatus != null">
|
||||||
`details_remark`,
|
and product_status = #{productStatus}
|
||||||
`method_type`,
|
</if>
|
||||||
`create_by`,
|
<if test="productExamine != null">
|
||||||
`create_time`
|
and product_examine = #{productExamine}
|
||||||
)
|
</if>
|
||||||
VALUES
|
<if test="brandId != null and brandId>0">
|
||||||
(
|
and t_product.brand_id = #{brandId}
|
||||||
#{productName},
|
</if>
|
||||||
#{productNumber},
|
<if test="typeId != null and typeId >0">
|
||||||
#{brandId},
|
and t_product.type_id = #{typeId}
|
||||||
#{typeId},
|
</if>
|
||||||
#{productSubheading},
|
</where>
|
||||||
#{productInformation},
|
order by product_sort
|
||||||
#{productUnit},
|
</select>
|
||||||
#{productWeight},
|
|
||||||
#{productSort},
|
|
||||||
#{productPoints},
|
|
||||||
#{productGrowth},
|
|
||||||
#{productForeknow},
|
|
||||||
#{productStatus},
|
|
||||||
#{productNew},
|
|
||||||
#{productRecommended},
|
|
||||||
#{detailsTitle},
|
|
||||||
#{detailsInformation},
|
|
||||||
#{detailsKeyWord},
|
|
||||||
#{detailsRemark},
|
|
||||||
#{methodType},
|
|
||||||
#{createBy},
|
|
||||||
now()
|
|
||||||
);
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<!-- 添加其他操作方法如插入、更新、删除等 -->
|
<!-- 添加其他操作方法如插入、更新、删除等 -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.muyu.product.mapper.ProductSkuMapper">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 添加其他操作方法如插入、更新、删除等 -->
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue