添加超市spu列表接口,spu详情接口
This commit is contained in:
1 parent
f02d27933f
commit
d2d43f8c24
12 files changed
+593
-57
No files matched your search
+2
-2
@@ -73,7 +73,7 @@ public interface SecurityConstants {
|
|||||||
/**
|
/**
|
||||||
* 项目的license
|
* 项目的license
|
||||||
*/
|
*/
|
||||||
String PIGX_LICENSE = "https://pig4cloud.com";
|
// String PIGX_LICENSE = "https://pig4cloud.com";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内部
|
* 内部
|
||||||
@@ -212,7 +212,7 @@ public interface SecurityConstants {
|
|||||||
/**
|
/**
|
||||||
* 协议字段
|
* 协议字段
|
||||||
*/
|
*/
|
||||||
String DETAILS_LICENSE = "license";
|
// String DETAILS_LICENSE = "license";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 激活字段 兼容外围系统接入
|
* 激活字段 兼容外围系统接入
|
||||||
|
|||||||
+15
@@ -23,6 +23,7 @@ package com.bsd.pjcloud.supermarket.api.feign;
|
|||||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||||
import com.bsd.pjcloud.common.core.util.R;
|
import com.bsd.pjcloud.common.core.util.R;
|
||||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||||
|
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -37,6 +38,20 @@ public interface RemoteSupermarketSpuService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有的超市spu列表信息,根据条件
|
||||||
|
* @return R
|
||||||
|
*/
|
||||||
|
@PostMapping("/supermarketSpu/ad/selectListAll")
|
||||||
|
R getSupermarketSpu(@RequestBody SupermarketSpuQueryDTO supermarketSpuQueryDTO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据spu id 查询spu详情,详情包括辅助条码和包装单位基本信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/supermarketSpu/ad/SpuDetails")
|
||||||
|
R getSupermarketSpuDetailById(@RequestParam("id")Long id);
|
||||||
}
|
}
|
||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
package com.bsd.pjcloud.supermarket.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "AD商品 SPU 查询参数")
|
||||||
|
public class SupermarketSpuQueryDTO {
|
||||||
|
/**
|
||||||
|
* 商品 SPU 编号,自增
|
||||||
|
*/
|
||||||
|
@Schema(description="商品 SPU 编号,自增")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 货号
|
||||||
|
*/
|
||||||
|
@Schema(description="货号")
|
||||||
|
private String productCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自编码/条码
|
||||||
|
*/
|
||||||
|
@Schema(description="自编码/条码")
|
||||||
|
private String barcode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
@Schema(description="商品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品分类编号
|
||||||
|
*/
|
||||||
|
@Schema(description="商品分类编号")
|
||||||
|
private Long categoryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品性质(字典)
|
||||||
|
*/
|
||||||
|
@Schema(description="商品性质(字典)")
|
||||||
|
private String productNature;
|
||||||
|
}
|
||||||
+83
@@ -0,0 +1,83 @@
|
|||||||
|
package com.bsd.pjcloud.supermarket.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品辅助条码
|
||||||
|
*
|
||||||
|
* @author zjf
|
||||||
|
* @date 2024-12-23 10:15:43
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TenantTable
|
||||||
|
@TableName("supermarket_auxiliary_code")
|
||||||
|
@Schema(description = "商品辅助条码")
|
||||||
|
public class SupermarketAuxiliaryCodeVo {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 辅助条码id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description="辅助条码id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条码
|
||||||
|
*/
|
||||||
|
@Schema(description="条码")
|
||||||
|
private String barCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* spuID
|
||||||
|
*/
|
||||||
|
@Schema(description="spuID")
|
||||||
|
private Long spuId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
@Schema(description="创建者")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
@Schema(description="创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
@Schema(description="更新者")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
@Schema(description="更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
@Schema(description="是否删除")
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户编号
|
||||||
|
*/
|
||||||
|
@Schema(description="租户编号")
|
||||||
|
private Long tenantId;
|
||||||
|
}
|
||||||
+158
@@ -0,0 +1,158 @@
|
|||||||
|
package com.bsd.pjcloud.supermarket.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description="ad spu详情")
|
||||||
|
public class SupermarketSpuDetailsVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品 SPU 编号,自增
|
||||||
|
*/
|
||||||
|
@Schema(description="商品 SPU 编号,自增")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 货号
|
||||||
|
*/
|
||||||
|
@Schema(description="货号")
|
||||||
|
private String productCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自编码/条码
|
||||||
|
*/
|
||||||
|
@Schema(description="自编码/条码")
|
||||||
|
private String barcode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
@Schema(description="商品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@Schema(description="单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品简介
|
||||||
|
*/
|
||||||
|
@Schema(description="商品简介")
|
||||||
|
private String introduction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品详情
|
||||||
|
*/
|
||||||
|
@Schema(description="商品详情")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品分类编号
|
||||||
|
*/
|
||||||
|
@Schema(description="商品分类编号")
|
||||||
|
private Long categoryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品封面图
|
||||||
|
*/
|
||||||
|
@Schema(description="商品封面图")
|
||||||
|
private String picUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品轮播图地址
|
||||||
|
数组,以逗号分隔
|
||||||
|
最多上传15张
|
||||||
|
*/
|
||||||
|
@Schema(description="商品轮播图地址")
|
||||||
|
private String sliderPicUrls;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存
|
||||||
|
*/
|
||||||
|
@Schema(description="总库存")
|
||||||
|
private Integer stock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 赠送积分
|
||||||
|
*/
|
||||||
|
@Schema(description="赠送积分")
|
||||||
|
private Integer giveIntegral;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户编号
|
||||||
|
*/
|
||||||
|
@Schema(description="商户编号")
|
||||||
|
private Long merchantId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产地
|
||||||
|
*/
|
||||||
|
@Schema(description="产地")
|
||||||
|
private String origin;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品性质(字典)
|
||||||
|
*/
|
||||||
|
@Schema(description="商品性质(字典)")
|
||||||
|
private String productNature;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌id
|
||||||
|
*/
|
||||||
|
@Schema(description="品牌id")
|
||||||
|
private Long brandId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 货商id
|
||||||
|
*/
|
||||||
|
@Schema(description="货商id")
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
@Schema(description="创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
@Schema(description="创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
@Schema(description="更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
@Schema(description="更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "销量")
|
||||||
|
private Integer salesCount;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+8
-45
@@ -10,12 +10,12 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@Schema(description="ad Spuvo")
|
||||||
public class SupermarketSpuVo {
|
public class SupermarketSpuVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品 SPU 编号,自增
|
* 商品 SPU 编号,自增
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
@Schema(description="商品 SPU 编号,自增")
|
@Schema(description="商品 SPU 编号,自增")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@@ -76,17 +76,10 @@ public class SupermarketSpuVo {
|
|||||||
private String sliderPicUrls;
|
private String sliderPicUrls;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 成本单价,单位: 分
|
|
||||||
*/
|
|
||||||
@Schema(description="成本单价,单位: 分")
|
|
||||||
private Integer costPrice;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存
|
* 库存
|
||||||
*/
|
*/
|
||||||
@Schema(description="库存")
|
@Schema(description="总库存")
|
||||||
private Integer stock;
|
private Integer stock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,42 +95,13 @@ public class SupermarketSpuVo {
|
|||||||
private Long merchantId;
|
private Long merchantId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 规格
|
|
||||||
*/
|
|
||||||
@Schema(description="规格")
|
|
||||||
private String specification;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产地
|
* 产地
|
||||||
*/
|
*/
|
||||||
@Schema(description="产地")
|
@Schema(description="产地")
|
||||||
private String origin;
|
private String origin;
|
||||||
|
|
||||||
/**
|
|
||||||
* 装数
|
|
||||||
*/
|
|
||||||
@Schema(description="装数")
|
|
||||||
private Integer packingQuantity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 进价(分为单位)
|
|
||||||
*/
|
|
||||||
@Schema(description="进价(分为单位)")
|
|
||||||
private Integer purchasePrice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 零售价(分为单位)
|
|
||||||
*/
|
|
||||||
@Schema(description="零售价(分为单位)")
|
|
||||||
private Integer retailPrice;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 促销价(分为单位)
|
|
||||||
*/
|
|
||||||
@Schema(description="促销价(分为单位)")
|
|
||||||
private Integer promotionPrice;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品性质(字典)
|
* 商品性质(字典)
|
||||||
@@ -145,13 +109,6 @@ public class SupermarketSpuVo {
|
|||||||
@Schema(description="商品性质(字典)")
|
@Schema(description="商品性质(字典)")
|
||||||
private String productNature;
|
private String productNature;
|
||||||
|
|
||||||
/**
|
|
||||||
* 签名上锁
|
|
||||||
*/
|
|
||||||
@Schema(description="签名上锁")
|
|
||||||
private String archiverSignature;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 品牌id
|
* 品牌id
|
||||||
@@ -199,4 +156,10 @@ public class SupermarketSpuVo {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "辅助条码集合")
|
||||||
|
private List<SupermarketAuxiliaryCodeVo> supermarketAuxiliaryCodeEntityList;
|
||||||
|
|
||||||
|
@Schema(description = "包装对象集合")
|
||||||
|
private List<SupermarketUnitVo> supermarketUnitEntityList;
|
||||||
|
|
||||||
}
|
}
|
||||||
+144
@@ -0,0 +1,144 @@
|
|||||||
|
package com.bsd.pjcloud.supermarket.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.bsd.pjcloud.common.core.util.MoneyDeserializer;
|
||||||
|
import com.bsd.pjcloud.common.core.util.MoneySerializer;
|
||||||
|
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品包装单位(sku)
|
||||||
|
*
|
||||||
|
* @author zjf
|
||||||
|
* @date 2024-12-26 11:06:54
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TenantTable
|
||||||
|
@TableName("supermarket_unit")
|
||||||
|
@Schema(description = "商品包装单位(sku)")
|
||||||
|
public class SupermarketUnitVo{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 包装单位id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description="包装单位id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条码
|
||||||
|
*/
|
||||||
|
@Schema(description="条码")
|
||||||
|
private String barCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格
|
||||||
|
*/
|
||||||
|
@Schema(description="规格")
|
||||||
|
private String spec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@Schema(description="单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0正常,1停销)
|
||||||
|
*/
|
||||||
|
@Schema(description="状态(0正常,1停销)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内装数量
|
||||||
|
*/
|
||||||
|
@Schema(description="内装数量")
|
||||||
|
private Integer packageNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进价/单位分
|
||||||
|
*/
|
||||||
|
@Schema(description="进价/单位分")
|
||||||
|
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||||
|
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||||
|
private Integer purchasePrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 零售价/单位分
|
||||||
|
*/
|
||||||
|
@Schema(description="零售价/单位分")
|
||||||
|
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||||
|
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||||
|
private Integer retailPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* spuID
|
||||||
|
*/
|
||||||
|
@Schema(description="spuID")
|
||||||
|
private Long spuId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 促销价
|
||||||
|
*/
|
||||||
|
@Schema(description="促销价")
|
||||||
|
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||||
|
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||||
|
private Integer promotionPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成本价
|
||||||
|
*/
|
||||||
|
@Schema(description="成本价")
|
||||||
|
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||||
|
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||||
|
private Integer costPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
@Schema(description="创建者")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
@Schema(description="创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
@Schema(description="更新者")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
@Schema(description="更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
@Schema(description="是否删除")
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户编号
|
||||||
|
*/
|
||||||
|
@Schema(description="租户编号")
|
||||||
|
private Long tenantId;
|
||||||
|
}
|
||||||
+18
-4
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.bsd.pjcloud.common.core.util.R;
|
import com.bsd.pjcloud.common.core.util.R;
|
||||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||||
|
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO;
|
||||||
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
||||||
import com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity;
|
import com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity;
|
||||||
import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
|
import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
|
||||||
@@ -151,13 +152,26 @@ public class SupermarketSpuController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 条件查询
|
* 条件查询
|
||||||
* @param supermarketSpu 商品spu
|
* @param supermarketSpuQueryDTO 商品spu
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "条件查询所有" , description = "条件查询所有" )
|
@Operation(summary = "条件查询所有" , description = "条件查询所有" )
|
||||||
@GetMapping("/ad/selectListAll" )
|
@PostMapping("/ad/selectListAll" )
|
||||||
@PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_view')" )
|
@PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_view')" )
|
||||||
public R getSupermarketSpuPage(@ParameterObject SupermarketSpuEntity supermarketSpu) {
|
public R getSupermarketSpu(@RequestBody SupermarketSpuQueryDTO supermarketSpuQueryDTO) {
|
||||||
return R.ok(supermarketSpuService.selectListAllScope(supermarketSpu));
|
return R.ok(supermarketSpuService.selectListAllScope(supermarketSpuQueryDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据spu id 查询spu详情,详情包括辅助条码和包装单位基本信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Operation(summary = "条件查询所有" , description = "条件查询所有" )
|
||||||
|
@GetMapping("/ad/SpuDetails" )
|
||||||
|
public R getSupermarketSpuDetailById(@RequestParam("id")Long id) {
|
||||||
|
return R.ok(supermarketSpuService.getSupermarketSpuDetailById(id));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+8
@@ -1,9 +1,14 @@
|
|||||||
package com.bsd.pjcloud.supermarket.mapper;
|
package com.bsd.pjcloud.supermarket.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||||
|
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO;
|
||||||
import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
|
import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface SupermarketSpuMapper extends PjcloudBaseMapper<SupermarketSpuEntity> {
|
public interface SupermarketSpuMapper extends PjcloudBaseMapper<SupermarketSpuEntity> {
|
||||||
@@ -32,4 +37,7 @@ public interface SupermarketSpuMapper extends PjcloudBaseMapper<SupermarketSpuEn
|
|||||||
.eq(SupermarketSpuEntity::getId, id);
|
.eq(SupermarketSpuEntity::getId, id);
|
||||||
return update(null, updateWrapper);
|
return update(null, updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<SupermarketSpuEntity> selectListAllScope(@Param("supermarketSpuQueryDTO") SupermarketSpuQueryDTO supermarketSpuQueryDTO
|
||||||
|
, DataScope dataScope);
|
||||||
}
|
}
|
||||||
+11
-2
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.bsd.pjcloud.common.core.util.R;
|
import com.bsd.pjcloud.common.core.util.R;
|
||||||
|
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO;
|
||||||
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
||||||
import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
|
import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
|
||||||
|
|
||||||
@@ -39,8 +40,16 @@ public interface SupermarketSpuService extends IService<SupermarketSpuEntity> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件查询所有数据,app/收银机接口
|
* 根据条件查询所有数据,app/收银机接口
|
||||||
* @param supermarketSpu
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Object selectListAllScope(SupermarketSpuEntity supermarketSpu);
|
Object selectListAllScope(SupermarketSpuQueryDTO supermarketSpuQueryDTO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询商品详情
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Object getSupermarketSpuDetailById(Long id);
|
||||||
}
|
}
|
||||||
+22
-4
@@ -3,8 +3,10 @@ package com.bsd.pjcloud.supermarket.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||||
import com.bsd.pjcloud.common.core.util.R;
|
import com.bsd.pjcloud.common.core.util.R;
|
||||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||||
|
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO;
|
||||||
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
||||||
import com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity;
|
import com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity;
|
||||||
import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
|
import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
|
||||||
@@ -13,6 +15,9 @@ import com.bsd.pjcloud.supermarket.mapper.SupermarketSpuMapper;
|
|||||||
import com.bsd.pjcloud.supermarket.service.SupermarketAuxiliaryCodeService;
|
import com.bsd.pjcloud.supermarket.service.SupermarketAuxiliaryCodeService;
|
||||||
import com.bsd.pjcloud.supermarket.service.SupermarketSpuService;
|
import com.bsd.pjcloud.supermarket.service.SupermarketSpuService;
|
||||||
import com.bsd.pjcloud.supermarket.service.SupermarketUnitService;
|
import com.bsd.pjcloud.supermarket.service.SupermarketUnitService;
|
||||||
|
import com.bsd.pjcloud.supermarket.vo.SupermarketAuxiliaryCodeVo;
|
||||||
|
import com.bsd.pjcloud.supermarket.vo.SupermarketSpuVo;
|
||||||
|
import com.bsd.pjcloud.supermarket.vo.SupermarketUnitVo;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -134,12 +139,25 @@ public class SupermarketSpuServiceImpl extends ServiceImpl<SupermarketSpuMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object selectListAllScope(SupermarketSpuEntity supermarketSpu) {
|
public Object selectListAllScope(SupermarketSpuQueryDTO supermarketSpuQueryDTO) {
|
||||||
|
|
||||||
|
List<SupermarketSpuEntity> list=baseMapper.selectListAllScope(supermarketSpuQueryDTO, DataScope.of());
|
||||||
|
List<SupermarketSpuVo> bean = BeanUtils.toBean(list, SupermarketSpuVo.class);
|
||||||
return null;
|
return bean;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getSupermarketSpuDetailById(Long id) {
|
||||||
|
SupermarketSpuEntity supermarketSpuEntity = baseMapper.selectById(id);
|
||||||
|
List<SupermarketUnitEntity> supermarketUnitEntityList = supermarketUnitService.list(new LambdaQueryWrapper<SupermarketUnitEntity>().eq(SupermarketUnitEntity::getSpuId, id));
|
||||||
|
List<SupermarketAuxiliaryCodeEntity> supermarketAuxiliaryCodeEntities = supermarketAuxiliaryCodeService.list(new LambdaQueryWrapper<SupermarketAuxiliaryCodeEntity>().eq(SupermarketAuxiliaryCodeEntity::getSpuId, id));
|
||||||
|
SupermarketSpuVo supermarketSpuVo = BeanUtils.toBean(supermarketSpuEntity, SupermarketSpuVo.class);
|
||||||
|
List<SupermarketUnitVo> supermarketUnitVoList = BeanUtils.toBean(supermarketUnitEntityList, SupermarketUnitVo.class);
|
||||||
|
List<SupermarketAuxiliaryCodeVo> supermarketAuxiliaryCodeVos = BeanUtils.toBean(supermarketAuxiliaryCodeEntities, SupermarketAuxiliaryCodeVo.class);
|
||||||
|
supermarketSpuVo.setSupermarketUnitEntityList(supermarketUnitVoList);
|
||||||
|
supermarketSpuVo.setSupermarketAuxiliaryCodeEntityList(supermarketAuxiliaryCodeVos);
|
||||||
|
return supermarketSpuVo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+77
@@ -52,4 +52,81 @@
|
|||||||
<result property="tenantId" column="tenant_id"/>
|
<result property="tenantId" column="tenant_id"/>
|
||||||
<result property="salesCount" column="sales_count"/>
|
<result property="salesCount" column="sales_count"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
<!-- 基本字段映射 -->
|
||||||
|
<sql id="BaseColumnList">
|
||||||
|
id,
|
||||||
|
product_code,
|
||||||
|
barcode,
|
||||||
|
product_name,
|
||||||
|
unit,
|
||||||
|
introduction,
|
||||||
|
description,
|
||||||
|
category_id,
|
||||||
|
pic_url,
|
||||||
|
slider_pic_urls,
|
||||||
|
sort,
|
||||||
|
status,
|
||||||
|
cost_price,
|
||||||
|
stock,
|
||||||
|
give_integral,
|
||||||
|
merchant_id,
|
||||||
|
dept_id,
|
||||||
|
specification,
|
||||||
|
origin,
|
||||||
|
packing_quantity,
|
||||||
|
purchase_price,
|
||||||
|
retail_price,
|
||||||
|
member_price1,
|
||||||
|
member_price2,
|
||||||
|
member_price3,
|
||||||
|
wholesale_price1,
|
||||||
|
wholesale_price2,
|
||||||
|
wholesale_price3,
|
||||||
|
promotion_price,
|
||||||
|
product_nature,
|
||||||
|
archiver_signature,
|
||||||
|
inventory_area,
|
||||||
|
commission_rate,
|
||||||
|
joint_deduction_rate,
|
||||||
|
inventory_upper_limit,
|
||||||
|
inventory_lower_limit,
|
||||||
|
gross_margin,
|
||||||
|
auxiliary_barcode_id,
|
||||||
|
brand_id,
|
||||||
|
supplier_id,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time,
|
||||||
|
del_flag,
|
||||||
|
tenant_id,
|
||||||
|
sales_count
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectListAllScope" parameterType="com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO" resultMap="supermarketSpuMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="BaseColumnList" />
|
||||||
|
FROM supermarket_spu
|
||||||
|
<where>
|
||||||
|
<if test="supermarketSpuQueryDTO.id != null">
|
||||||
|
AND id = #{supermarketSpuQueryDTO.id}
|
||||||
|
</if>
|
||||||
|
<if test="supermarketSpuQueryDTO.productCode != null">
|
||||||
|
AND product_code = #{supermarketSpuQueryDTO.productCode}
|
||||||
|
</if>
|
||||||
|
<if test="supermarketSpuQueryDTO.barcode != null">
|
||||||
|
AND barcode = #{supermarketSpuQueryDTO.barcode}
|
||||||
|
</if>
|
||||||
|
<if test="supermarketSpuQueryDTO.productName != null">
|
||||||
|
AND product_name LIKE CONCAT('%', #{supermarketSpuQueryDTO.productName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="supermarketSpuQueryDTO.categoryId != null">
|
||||||
|
AND category_id = #{supermarketSpuQueryDTO.categoryId}
|
||||||
|
</if>
|
||||||
|
<if test="supermarketSpuQueryDTO.productNature != null">
|
||||||
|
AND product_nature = #{supermarketSpuQueryDTO.productNature}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY create_time DESC
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in new issue
Block a user