安卓机超市商品详情接口
This commit is contained in:
1 parent
d1512a8e58
commit
f10a53cf68
7 files changed
+70
-207
No files matched your search
+50
@@ -0,0 +1,50 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.ad;
|
||||
|
||||
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
|
||||
@Schema(description = "商品辅助条码")
|
||||
public class SmErpAuxiliaryCodeVo {
|
||||
|
||||
|
||||
/**
|
||||
* 辅助条码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 LocalDateTime createTime;
|
||||
|
||||
|
||||
@Schema(description="包装单位id")
|
||||
private Long unitId;
|
||||
|
||||
}
|
||||
+4
-63
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.erp;
|
||||
package com.bsd.pjcloud.supermarket.vo.ad;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description="ad Spuvo")
|
||||
public class SmErpSpuVo {
|
||||
public class SmErpSpuDetailsVo {
|
||||
|
||||
/**
|
||||
* 商品 SPU 编号,自增
|
||||
@@ -24,35 +24,12 @@ public class SmErpSpuVo {
|
||||
@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;
|
||||
|
||||
/**
|
||||
* 商品分类编号
|
||||
@@ -66,26 +43,11 @@ public class SmErpSpuVo {
|
||||
@Schema(description="商品封面图")
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 商品轮播图地址
|
||||
数组,以逗号分隔
|
||||
最多上传15张
|
||||
*/
|
||||
@Schema(description="商品轮播图地址")
|
||||
private String sliderPicUrls;
|
||||
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
@Schema(description="总库存")
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
@Schema(description="赠送积分")
|
||||
private Integer giveIntegral;
|
||||
@Schema(description="剩余库存")
|
||||
private Double stock;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
@@ -121,13 +83,6 @@ public class SmErpSpuVo {
|
||||
@Schema(description="货商id")
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@@ -135,20 +90,6 @@ public class SmErpSpuVo {
|
||||
@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;
|
||||
+1
-48
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.erp;
|
||||
package com.bsd.pjcloud.supermarket.vo.ad;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.bsd.pjcloud.common.core.util.MoneyDeserializer;
|
||||
@@ -18,7 +18,6 @@ import java.time.LocalDateTime;
|
||||
* @date 2024-12-26 11:06:54
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@Schema(description = "商品包装单位(sku)")
|
||||
public class SmErpUnitVo {
|
||||
|
||||
@@ -26,7 +25,6 @@ public class SmErpUnitVo {
|
||||
/**
|
||||
* 包装单位id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="包装单位id")
|
||||
private Long id;
|
||||
|
||||
@@ -64,16 +62,12 @@ public class SmErpUnitVo {
|
||||
* 进价/单位分
|
||||
*/
|
||||
@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;
|
||||
|
||||
/**
|
||||
@@ -86,24 +80,9 @@ public class SmErpUnitVo {
|
||||
* 促销价
|
||||
*/
|
||||
@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;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
@@ -112,31 +91,5 @@ public class SmErpUnitVo {
|
||||
@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;
|
||||
}
|
||||
-3
@@ -2,13 +2,10 @@ package com.bsd.pjcloud.supermarket.vo.ad;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpAuxiliaryCodeVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpUnitVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SpuVo {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.bsd.pjcloud.supermarket.vo.app;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpUnitVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
-83
@@ -1,83 +0,0 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.erp;
|
||||
|
||||
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 SmErpAuxiliaryCodeVo {
|
||||
|
||||
|
||||
/**
|
||||
* 辅助条码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;
|
||||
}
|
||||
+14
-9
@@ -16,19 +16,17 @@ import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.ErpCgPlanDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.erpspu.SmErpSpuImportDto;
|
||||
import com.bsd.pjcloud.supermarket.dto.inventoryrecords.UpdateStockDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.supplier.SmErpSupplierImportDto;
|
||||
import com.bsd.pjcloud.supermarket.entity.*;
|
||||
import com.bsd.pjcloud.supermarket.mapper.*;
|
||||
import com.bsd.pjcloud.supermarket.service.*;
|
||||
import com.bsd.pjcloud.supermarket.task.TaskStoreService;
|
||||
import com.bsd.pjcloud.supermarket.validarot.ErpSpuValidator;
|
||||
import com.bsd.pjcloud.supermarket.validarot.SupplierValidator;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SpuVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.app.SupermarketAppSpuDetailsVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.app.SupermarketAppUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpAuxiliaryCodeVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpSpuVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpAuxiliaryCodeVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpSpuDetailsVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.ErpSpuWithUnitPageVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.ErpUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.sm.smspu.SmErpPageScopeVo;
|
||||
@@ -393,12 +391,19 @@ public class SmErpSpuServiceImpl extends ServiceImpl<SmErpSpuMapper, SmErpSpuEnt
|
||||
SmErpSpuEntity smErpSpuEntity = baseMapper.selectById(id);
|
||||
List<SmErpUnitEntity> smErpUnitEntityList = smErpUnitService.list(new LambdaQueryWrapper<SmErpUnitEntity>().eq(SmErpUnitEntity::getSpuId, id));
|
||||
List<SmErpAuxiliaryCodeEntity> supermarketAuxiliaryCodeEntities = smErpAuxiliaryCodeService.list(new LambdaQueryWrapper<SmErpAuxiliaryCodeEntity>().eq(SmErpAuxiliaryCodeEntity::getSpuId, id));
|
||||
SmErpSpuVo smErpSpuVo = BeanUtils.toBean(smErpSpuEntity, SmErpSpuVo.class);
|
||||
SmErpSpuDetailsVo smErpSpuDetailsVo = BeanUtils.toBean(smErpSpuEntity, SmErpSpuDetailsVo.class);
|
||||
List<SmErpUnitVo> smErpUnitVoList = BeanUtils.toBean(smErpUnitEntityList, SmErpUnitVo.class);
|
||||
List<SmErpAuxiliaryCodeVo> smErpAuxiliaryCodeVos = BeanUtils.toBean(supermarketAuxiliaryCodeEntities, SmErpAuxiliaryCodeVo.class);
|
||||
smErpSpuVo.setSupermarketUnitEntityList(smErpUnitVoList);
|
||||
smErpSpuVo.setSupermarketAuxiliaryCodeEntityList(smErpAuxiliaryCodeVos);
|
||||
return smErpSpuVo;
|
||||
smErpSpuDetailsVo.setSupermarketUnitEntityList(smErpUnitVoList);
|
||||
smErpSpuDetailsVo.setSupermarketAuxiliaryCodeEntityList(smErpAuxiliaryCodeVos);
|
||||
|
||||
//库存
|
||||
LambdaQueryWrapper<SmErpStockEntity> stocmEq = new LambdaQueryWrapper<SmErpStockEntity>()
|
||||
.eq(SmErpStockEntity::getErpSpuId, id);
|
||||
SmErpStockEntity smErpStockEntity = smErpStockMapper.selectOne(stocmEq);
|
||||
smErpSpuDetailsVo.setStock(smErpStockEntity.getCurrentStock());
|
||||
return smErpSpuDetailsVo;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user