超市接口
This commit is contained in:
1 parent
89bd014f11
commit
b754a24c8f
2 files changed
+128
-1
No files matched your search
+115
@@ -0,0 +1,115 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.sm.smspu;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Schema(description = "后台线上商品-分页查询")
|
||||
public class SmSpuEditVo {
|
||||
|
||||
/**
|
||||
* 线上SPU 编号,自增
|
||||
*/
|
||||
@Schema(description="线上SPU 编号,自增")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description="商品名称")
|
||||
private String erpSpuName;
|
||||
/**
|
||||
* 库存商品id
|
||||
*/
|
||||
@Schema(description="库存商品id")
|
||||
private Long erpSpuId;
|
||||
|
||||
/**
|
||||
* 商品详情
|
||||
*/
|
||||
@Schema(description="商品详情")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 商品轮播图地址
|
||||
数组,以逗号分隔
|
||||
最多上传15张
|
||||
*/
|
||||
@Schema(description="商品轮播图地址")
|
||||
private String sliderPicUrls;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@Schema(description="排序字段")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 商品状态: 1 上架(开启) 0 下架(禁用) -1 回收
|
||||
*/
|
||||
@Schema(description="商品状态: 1 上架(开启) 0 下架(禁用) -1 回收")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
@Schema(description="赠送积分")
|
||||
private Integer giveIntegral;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 销量
|
||||
*/
|
||||
@Schema(description="销量")
|
||||
private Integer salesCount;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+13
-1
@@ -6,10 +6,15 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpSpuEntity;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmSpuEntity;
|
||||
import com.bsd.pjcloud.supermarket.mapper.SmErpSpuMapper;
|
||||
import com.bsd.pjcloud.supermarket.service.SmErpSpuService;
|
||||
import com.bsd.pjcloud.supermarket.service.SmSpuService;
|
||||
import com.bsd.pjcloud.supermarket.vo.sm.smspu.SmSpuEditVo;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
@@ -38,6 +43,8 @@ public class SmSpuController {
|
||||
|
||||
private final SmSpuService smSpuService;
|
||||
|
||||
private final SmErpSpuService smErpSpuService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
@@ -61,7 +68,12 @@ public class SmSpuController {
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smSpu_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
return R.ok(smSpuService.getById(id));
|
||||
SmSpuEntity smSpuEntity = smSpuService.getById(id);
|
||||
Long erpSpuId = smSpuEntity.getErpSpuId();
|
||||
SmErpSpuEntity smErpSpuEntity = smErpSpuService.getById(erpSpuId);
|
||||
SmSpuEditVo spuEditVo= BeanUtils.toBean(smSpuEntity, SmSpuEditVo.class);
|
||||
spuEditVo.setErpSpuName(smErpSpuEntity.getProductName());
|
||||
return R.ok(spuEditVo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user