yangyb 4 týždňov pred
rodič
commit
c9b827004e

+ 3 - 8
mall-service/src/main/java/com/txz/mall/controller/CombinationController.java

@@ -139,17 +139,12 @@ public class CombinationController {
     @ApiOperation(value = "添加活动商品")
     public Result addActivityProduct(@RequestBody List<StoreCombination> list, @RequestParam("activityId") Long activityId) {
         if (CollectionUtils.isEmpty(list)) {
-            return Result.fail(ResultCode.OBJECT_IS_NULL);
+            throw new ServiceException("添加商品不能为空");
         }
         if (activityId == null) {
-            return Result.fail(ResultCode.USERID_IS_NULL);
-        }
-        try {
-            storeCombinationService.addActivityProduct(list, activityId);
-        } catch (Exception e) {
-            log.error("新增对象操作异常e:{}", e);
-            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+            return Result.fail(ResultCode.ID_IS_NULL);
         }
+        storeCombinationService.addActivityProduct(list, activityId);
         return Result.success();
     }
 

+ 1 - 2
mall-service/src/main/java/com/txz/mall/controller/ProductAttrController.java

@@ -6,7 +6,6 @@ import com.txz.mall.core.Result;
 import com.txz.mall.core.ResultCode;
 import com.txz.mall.model.ProductAttr;
 import com.txz.mall.service.ProductAttrService;
-import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -21,7 +20,7 @@ import java.util.List;
 /**
  * Created by CodeGenerator on 2025/07/16.
  */
-@Api(tags = "[后台]商品属性管理")
+//@Api(tags = "[后台]商品属性管理")
 @RestController
 @RequestMapping("/product/attr")
 public class ProductAttrController {

+ 1 - 2
mall-service/src/main/java/com/txz/mall/controller/ProductAttrResultController.java

@@ -6,7 +6,6 @@ import com.txz.mall.core.Result;
 import com.txz.mall.core.ResultCode;
 import com.txz.mall.model.StoreProductAttrResult;
 import com.txz.mall.service.StoreProductAttrResultService;
-import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -21,7 +20,7 @@ import java.util.List;
 /**
  * Created by CodeGenerator on 2025/07/11.
  */
-@Api(tags = "[后台]商品属性详情管理")
+//@Api(tags = "[后台]商品属性详情管理")
 @RestController
 @RequestMapping("/product/attr/result")
 public class ProductAttrResultController {

+ 1 - 2
mall-service/src/main/java/com/txz/mall/controller/ProductAttrValueController.java

@@ -6,7 +6,6 @@ import com.txz.mall.core.Result;
 import com.txz.mall.core.ResultCode;
 import com.txz.mall.model.ProductAttrValue;
 import com.txz.mall.service.ProductAttrValueService;
-import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -21,7 +20,7 @@ import java.util.List;
 /**
  * Created by CodeGenerator on 2025/07/16.
  */
-@Api(tags = "[后台]SKU")
+//@Api(tags = "[后台]SKU")
 @RestController
 @RequestMapping("/product/attr/value")
 public class ProductAttrValueController {

+ 5 - 67
mall-service/src/main/java/com/txz/mall/controller/ProductController.java

@@ -41,51 +41,6 @@ public class ProductController {
     @Resource
     private StoreProductService storeProductService;
 
-    @PostMapping("/add")
-    @ApiOperation(value = "商品新增")
-    public Result<Long> add(@RequestBody StoreProduct storeProduct) {
-        if (storeProduct == null) {
-            return Result.fail(ResultCode.OBJECT_IS_NULL);
-        }
-
-        try {
-            storeProduct.setCreateTime(new Date());
-//            storeProduct.setCreateUserId(userId);
-            // 生成货号
-            String itemNumber = generateItemNumber(storeProduct.getCateId());
-            storeProduct.setItemNumber(itemNumber);
-            storeProductService.save(storeProduct);
-        } catch (Exception e) {
-            log.error("新增对象操作异常e:{}", e);
-            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
-        }
-        return Result.success(storeProduct.getId());
-    }
-
-    // 生成货号的方法
-    private String generateItemNumber(Long cateId) {
-        // 1. 获取类目ID的字符串形式
-        String cateIdStr = String.valueOf(cateId);
-        int cateIdLength = cateIdStr.length();
-        // 2. 确定随机部分的长度
-        int randomPartLength = 12 - cateIdLength;
-        // 3. 生成随机部分
-        String randomPart = generateRandomString(randomPartLength);
-        // 4. 拼接类目ID和随机部分
-        return cateIdStr + randomPart;
-    }
-
-    // 生成指定长度的随机字符串(数字和字母)
-    private String generateRandomString(int length) {
-        String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
-        StringBuilder sb = new StringBuilder();
-        java.util.Random random = new java.util.Random();
-        for (int i = 0; i < length; i++) {
-            sb.append(chars.charAt(random.nextInt(chars.length())));
-        }
-        return sb.toString();
-    }
-
     @PostMapping("/delete")
     @ApiOperation(value = "商品删除")
     public Result delete(@RequestParam("ids") List<Long> ids) {
@@ -96,8 +51,8 @@ public class ProductController {
             ids.forEach(id -> {
                 StoreProduct storeProduct = new StoreProduct();
                 storeProduct.setId(id);
-                storeProduct.setIsRecycle(1);
-//                storeProduct.setIsDelete(1);
+//                storeProduct.setIsRecycle(1);
+                storeProduct.setIsDelete(1);
                 storeProduct.setUpdateTime(new Date());
                 storeProductService.update(storeProduct);
             });
@@ -153,23 +108,6 @@ public class ProductController {
         return Result.success();
     }
 
-    @PostMapping("/detail")
-    @ApiOperation(value = "商品获取详情")
-    public Result<StoreProduct> detail(@RequestParam Long id) {
-        if (id == null) {
-            return Result.fail(ResultCode.ID_IS_NULL);
-        }
-
-        StoreProduct storeProduct = null;
-        try {
-            storeProduct = storeProductService.findById(id);
-        } catch (Exception e) {
-            log.error("查询对象操作异常e:{}", e);
-            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
-        }
-        return Result.success(storeProduct);
-    }
-
     @PostMapping("/list")
     @ApiOperation(value = "商品获取列表")
     public Result<List<StoreProduct>> list(@RequestBody StoreProductDTO dto, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) {
@@ -225,8 +163,8 @@ public class ProductController {
     }
 
     @ApiOperation(value = "商品详情")
-    @GetMapping(value = "/info/{id}")
-    public Result<StoreProductInfoVO> info(@PathVariable Integer id) {
+    @PostMapping(value = "/detail")
+    public Result<StoreProductInfoVO> info(@RequestParam Long id) {
         return Result.success(storeProductService.getInfo(id));
     }
 
@@ -263,7 +201,7 @@ public class ProductController {
     }
 
     @ApiOperation(value = "新增商品")
-    @PostMapping(value = "/save")
+    @PostMapping(value = "/add")
     public Result<String> save(@RequestBody @Validated StoreProductAddRequest request) {
         storeProductService.save(request);
         return Result.success();

+ 3 - 8
mall-service/src/main/java/com/txz/mall/controller/ProductRuleController.java

@@ -38,14 +38,9 @@ public class ProductRuleController {
             return Result.fail(ResultCode.OBJECT_IS_NULL);
         }
 
-        try {
-            storeProductRule.setCreateTime(new Date());
+        storeProductRule.setCreateTime(new Date());
 //            storeProductRule.setCreateUserId(userId);
-            storeProductRuleService.saveRule(storeProductRule);
-        } catch (Exception e) {
-            log.error("新增对象操作异常e:{}", e);
-            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
-        }
+        storeProductRuleService.saveRule(storeProductRule);
         return Result.success();
     }
 
@@ -109,7 +104,7 @@ public class ProductRuleController {
     @PostMapping("/list")
     @ApiOperation(value = "商品规则获取列表")
     public Result<List<StoreProductRule>> list(@RequestBody StoreProductRule storeProductRule, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) {
-        
+
         PageHelper.startPage(page, size);
 
         Condition condition = new Condition(storeProductRule.getClass());

+ 2 - 2
mall-service/src/main/java/com/txz/mall/model/StoreProduct.java

@@ -55,7 +55,7 @@ public class StoreProduct {
      */
     @Column(name = "cate_id")
     @ApiModelProperty(value = "分类id")
-    private Long cateId;
+    private String cateId;
 
     /**
      * 商品价格
@@ -80,7 +80,7 @@ public class StoreProduct {
     /**
      * 邮费
      */
-    @ApiModelProperty(value = "市场价")
+    @ApiModelProperty(value = "邮费")
     private BigDecimal postage;
 
     /**

+ 1 - 1
mall-service/src/main/java/com/txz/mall/service/StoreProductService.java

@@ -35,7 +35,7 @@ public interface StoreProductService extends Service<StoreProduct> {
      * @param id 商品id
      * @return StoreProductInfoResponse
      */
-    StoreProductInfoVO getInfo(Integer id);
+    StoreProductInfoVO getInfo(Long id);
 
     /**
      * 获取订单状态数量

+ 18 - 10
mall-service/src/main/java/com/txz/mall/service/impl/StoreCombinationServiceImpl.java

@@ -3,7 +3,6 @@ package com.txz.mall.service.impl;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.txz.mall.constants.Constants;
@@ -61,28 +60,36 @@ public class StoreCombinationServiceImpl extends AbstractService<StoreCombinatio
         if (flashActivity == null || flashActivity.getIsDelete().equals(1)) {
             throw new ServiceException("找不到对应的活动");
         }
-        if (CollectionUtils.isEmpty(list)) {
-            throw new ServiceException("添加商品不能为空");
-        }
         FlashActivityVO activityVO = JSONObject.parseObject(flashActivity.getContent(), FlashActivityVO.class);
+        String idsStr = list.stream()
+                .map(storeCombination -> storeCombination.getProductId().toString())
+                .collect(Collectors.joining(","));
+        List<StoreProduct> productList = storeProductService.findByIds(idsStr);
         for (StoreCombination storeCombination : list) {
+            StoreProduct product = productList.stream()
+                    .filter(item -> item.getId().equals(storeCombination.getProductId()))
+                    .findFirst().orElse(null);
+            BeanUtils.copyProperties(product, storeCombination);
             storeCombination.setStartTime(flashActivity.getStartTime());
             storeCombination.setStopTime(flashActivity.getEndTime());
-            storeCombination.setPeople(activityVO.getGroupNumber());
-            storeCombination.setEffectiveTime(activityVO.getCountdownTime());
-            storeCombination.setStock(activityVO.getInventory());
+            if (activityVO != null) {
+                storeCombination.setPeople(activityVO.getGroupNumber());
+                storeCombination.setEffectiveTime(activityVO.getCountdownTime());
+                storeCombination.setStock(activityVO.getInventory());
+            }
+            storeCombination.setTitle(flashActivity.getName());
             storeCombination.setActivityId(activityId);
         }
         //  直接进行覆盖
-        Condition condition = new Condition(StoreFlashActivity.class);
+        Condition condition = new Condition(StoreCombination.class);
         Example.Criteria criteria = condition.createCriteria();
         criteria.andEqualTo("activityId", activityId);
         criteria.andEqualTo("isDelete", 0);
-        List<StoreFlashActivity> activityList = storeFlashActivityService.findByCondition(condition);
+        List<StoreCombination> activityList = findByCondition(condition);
         if (CollUtil.isNotEmpty(activityList)) {
             activityList.forEach(item -> {
                 item.setIsDelete(1);
-                storeFlashActivityService.update(item);
+                update(item);
             });
         }
         save(list);
@@ -223,6 +230,7 @@ public class StoreCombinationServiceImpl extends AbstractService<StoreCombinatio
         uidList.add(teamPink.getUid());
 //        if (uidList.contains(user.getUid())) {
 //            userBool = 1;
+//            throw new ServiceException("您已加入该拼团");
 //        }
 //
 //        // 处理用户头像昵称

+ 15 - 1
mall-service/src/main/java/com/txz/mall/service/impl/StoreFlashActivityServiceImpl.java

@@ -13,6 +13,7 @@ import tk.mybatis.mapper.entity.Condition;
 import tk.mybatis.mapper.entity.Example;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.List;
 
 
@@ -47,6 +48,19 @@ public class StoreFlashActivityServiceImpl extends AbstractService<StoreFlashAct
         if (storeFlashActivity.getActiveState() != null) {
             criteria.andEqualTo("activeState", storeFlashActivity.getActiveState());
         }
-        return findByCondition(condition);
+        Date date = new Date();
+        List<StoreFlashActivity> activityList = findByCondition(condition);
+        for (StoreFlashActivity flashActivity : activityList) {
+            Date startTime = flashActivity.getStartTime();
+            Date endTime = flashActivity.getEndTime();
+            if (startTime.getTime() > date.getTime()) {
+                flashActivity.setActiveState(0);
+            } else if (endTime.getTime() < date.getTime()) {
+                flashActivity.setActiveState(2);
+            } else {
+                flashActivity.setActiveState(1);
+            }
+        }
+        return activityList;
     }
 }

+ 49 - 7
mall-service/src/main/java/com/txz/mall/service/impl/StoreProductServiceImpl.java

@@ -24,6 +24,7 @@ import dto.StoreProductAddRequest;
 import dto.StoreProductAttrAddRequest;
 import dto.StoreProductAttrValueAddRequest;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -38,6 +39,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.OutputStream;
 import java.net.URLEncoder;
+import java.time.LocalTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -94,7 +96,7 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
     }
 
     @Override
-    public StoreProductInfoVO getInfo(Integer id) {
+    public StoreProductInfoVO getInfo(Long id) {
         StoreProduct storeProduct = findById(id);
         if (ObjectUtil.isNull(storeProduct)) {
             throw new ServiceException("未找到对应商品信息");
@@ -103,8 +105,10 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
         BeanUtils.copyProperties(storeProduct, storeProductResponse);
 
         // 设置商品所参与的活动
-        List<String> activityList = getProductActivityList(storeProduct.getActivity());
-        storeProductResponse.setActivity(activityList);
+        if (StrUtil.isNotBlank(storeProduct.getActivity())) {
+            List<String> activityList = getProductActivityList(storeProduct.getActivity());
+            storeProductResponse.setActivity(activityList);
+        }
 
         List<ProductAttr> attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL);
         storeProductResponse.setAttr(attrList);
@@ -181,9 +185,10 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
         return response;
     }
 
+    @Transactional
     public void save(StoreProductAddRequest request) {
         // 多规格需要校验规格参数
-        if (!request.getSpecType()) {
+        if (request.getSpecType().equals(0)) {
             if (request.getAttrValue().size() > 1) {
                 throw new ServiceException("单规格商品属性值不能大于1");
             }
@@ -195,10 +200,8 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
 
         // 设置activity活动
         storeProduct.setActivity(getProductActivityStr(request.getActivity()));
-
         //主图
         storeProduct.setImage(storeProduct.getImage());
-
         //轮播图
         storeProduct.setSliderImage(storeProduct.getSliderImage());
         // 展示图
@@ -214,12 +217,14 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
         storeProduct.setCost(minAttrValue.getCost());
         storeProduct.setStock(attrValueAddRequestList.stream().mapToInt(StoreProductAttrValueAddRequest::getStock).sum());
 
-
+        Date date = new Date();
         List<StoreProductAttrAddRequest> addRequestList = request.getAttr();
         List<ProductAttr> attrList = addRequestList.stream().map(e -> {
             ProductAttr attr = new ProductAttr();
             BeanUtils.copyProperties(e, attr);
             attr.setType(Constants.PRODUCT_TYPE_NORMAL);
+            attr.setCreateTime(date);
+            attr.setIsDelete(0);
             return attr;
         }).collect(Collectors.toList());
 
@@ -227,14 +232,28 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
             ProductAttrValue attrValue = new ProductAttrValue();
             BeanUtils.copyProperties(e, attrValue);
             attrValue.setId(null);
+            attrValue.setStockThreshold(0);
+            attrValue.setSales(0);
+            // 生成sku  根据传进来spu再加当前时分秒
+            LocalTime now = LocalTime.now();
+            attrValue.setSkuCode(request.getItemNumber() + now.getHour() + now.getMinute());
+            attrValue.setPrice(e.getPrice());
+            attrValue.setCost(e.getPrice());
+            attrValue.setOtPrice(e.getPrice());
             attrValue.setSuk(getSku(e.getAttrValue()));
             attrValue.setQuota(0);
             attrValue.setQuotaShow(0);
             attrValue.setType(Constants.PRODUCT_TYPE_NORMAL);
             attrValue.setImage(e.getImage());
+            attrValue.setIsDelete(0);
+            attrValue.setCreateTime(date);
             return attrValue;
         }).collect(Collectors.toList());
 
+        if (StringUtils.isBlank(storeProduct.getItemNumber())) {
+            String itemNumber = generateItemNumber(storeProduct.getCateId());
+            storeProduct.setItemNumber(itemNumber);
+        }
         save(storeProduct);
         attrList.forEach(attr -> attr.setProductId(storeProduct.getId()));
         attrValueList.forEach(value -> value.setProductId(storeProduct.getId()));
@@ -252,6 +271,29 @@ public class StoreProductServiceImpl extends AbstractService<StoreProduct> imple
 //            }
     }
 
+    // 生成货号的方法
+    private String generateItemNumber(String cateIdStr) {
+        // 1. 获取类目ID的字符串形式
+        int cateIdLength = cateIdStr.length();
+        // 2. 确定随机部分的长度
+        int randomPartLength = 8 - cateIdLength;
+        // 3. 生成随机部分
+        String randomPart = generateRandomString(randomPartLength);
+        // 4. 拼接类目ID和随机部分
+        return cateIdStr + randomPart;
+    }
+
+    // 生成指定长度的随机字符串(数字和字母)
+    private String generateRandomString(int length) {
+        String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+        StringBuilder sb = new StringBuilder();
+        java.util.Random random = new java.util.Random();
+        for (int i = 0; i < length; i++) {
+            sb.append(chars.charAt(random.nextInt(chars.length())));
+        }
+        return sb.toString();
+    }
+
     /**
      * 商品sku
      *

+ 1 - 1
mall-service/src/main/java/dto/StoreFlashActivityDTO.java

@@ -22,7 +22,7 @@ public class StoreFlashActivityDTO implements Serializable {
     /**
      *
      */
-    private Integer id;
+    private Long id;
     /**
      * 活动名称
      */

+ 37 - 12
mall-service/src/main/java/dto/StoreProductAddRequest.java

@@ -12,6 +12,7 @@ import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.List;
 
 
@@ -43,13 +44,13 @@ public class StoreProductAddRequest implements Serializable {
     private String storeName;
 
     @ApiModelProperty(value = "商品简介", required = true)
-    @NotBlank(message = "商品简介不能为空")
+//    @NotBlank(message = "商品简介不能为空")
     @Length(max = 256, message = "商品简介长度不能超过256个字符")
     private String storeInfo;
 
     @ApiModelProperty(value = "关键字", required = true)
     @Length(max = 255, message = "关键字长度不能超过255个字符")
-    @NotBlank(message = "关键字不能为空")
+//    @NotBlank(message = "关键字不能为空")
     private String keyword;
 
     @ApiModelProperty(value = "分类id|逗号分隔", required = true)
@@ -58,7 +59,7 @@ public class StoreProductAddRequest implements Serializable {
     private String cateId;
 
     @ApiModelProperty(value = "单位名", required = true)
-    @NotBlank(message = "单位名称不能为空")
+//    @NotBlank(message = "单位名称不能为空")
     @Length(max = 32, message = "单位名长度不能超过32个字符")
     private String unitName;
 
@@ -66,37 +67,37 @@ public class StoreProductAddRequest implements Serializable {
     private Integer sort;
 
     @ApiModelProperty(value = "是否热卖")
-    private Boolean isHot;
+    private Integer isHot;
 
     @ApiModelProperty(value = "是否优惠")
-    private Boolean isBenefit;
+    private Integer isBenefit;
 
     @ApiModelProperty(value = "是否精品")
-    private Boolean isBest;
+    private Integer isBest;
 
     @ApiModelProperty(value = "是否新品")
-    private Boolean isNew;
+    private Integer isNew;
 
     @ApiModelProperty(value = "是否优品推荐")
-    private Boolean isGood;
+    private Integer isGood;
 
     @ApiModelProperty(value = "获得积分")
     private Integer giveIntegral;
 
     @ApiModelProperty(value = "是否单独分佣", required = true)
-    @NotNull(message = "是否单独分佣不能为空")
-    private Boolean isSub;
+//    @NotNull(message = "是否单独分佣不能为空")
+    private Integer isSub;
 
     @ApiModelProperty(value = "虚拟销量")
     private Integer ficti;
 
     @ApiModelProperty(value = "运费模板ID", required = true)
-    @NotNull(message = "运费模板不能为空")
+//    @NotNull(message = "运费模板不能为空")
     private Integer tempId;
 
     @ApiModelProperty(value = "规格 0单 1多", required = true)
     @NotNull(message = "商品规格类型不能为空")
-    private Boolean specType;
+    private Integer specType;
 
     @ApiModelProperty(value = "活动显示排序 0=默认,1=秒杀,2=砍价,3=拼团")
     private List<String> activity;
@@ -118,4 +119,28 @@ public class StoreProductAddRequest implements Serializable {
     @ApiModelProperty(value = "展示图")
     @Length(max = 1000, message = "展示图名称长度不能超过1000个字符")
     private String flatPattern;
+
+    @ApiModelProperty("品牌")
+    private String itemBrand;
+
+    @ApiModelProperty("货号")
+    private String itemNumber;
+
+    @ApiModelProperty("库存预警值")
+    private Integer stockThreshold;
+
+    @ApiModelProperty("供应商")
+    private String itemSupplier;
+
+    @ApiModelProperty(value = "状态 (0:未上架,1:上架)")
+    private Integer isShow;
+
+    @ApiModelProperty(value = "商品价格")
+    private BigDecimal price;
+
+    @ApiModelProperty(value = "市场价")
+    private BigDecimal otPrice;
+
+    @ApiModelProperty(value = "库存")
+    private Integer stock;
 }

+ 32 - 10
mall-service/src/main/java/vo/StoreProductInfoVO.java

@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.List;
 
 
@@ -50,25 +51,25 @@ public class StoreProductInfoVO implements Serializable {
     private Integer sort;
 
     @ApiModelProperty(value = "是否热卖")
-    private Boolean isHot;
+    private Integer isHot;
 
     @ApiModelProperty(value = "是否优惠")
-    private Boolean isBenefit;
+    private Integer isBenefit;
 
     @ApiModelProperty(value = "是否精品")
-    private Boolean isBest;
+    private Integer isBest;
 
     @ApiModelProperty(value = "是否新品")
-    private Boolean isNew;
+    private Integer isNew;
 
     @ApiModelProperty(value = "获得积分")
     private Integer giveIntegral;
 
     @ApiModelProperty(value = "是否优品推荐")
-    private Boolean isGood;
+    private Integer isGood;
 
     @ApiModelProperty(value = "是否单独分佣")
-    private Boolean isSub;
+    private Integer isSub;
 
     @ApiModelProperty(value = "虚拟销量")
     private Integer ficti;
@@ -77,7 +78,7 @@ public class StoreProductInfoVO implements Serializable {
     private Integer tempId;
 
     @ApiModelProperty(value = "规格 0单 1多")
-    private Boolean specType;
+    private Integer specType;
 
     @ApiModelProperty(value = "活动显示排序 0=默认,1=秒杀,2=砍价,3=拼团")
     private List<String> activity;
@@ -141,12 +142,33 @@ public class StoreProductInfoVO implements Serializable {
     @ApiModelProperty(value = "参团人数|拼团专用")
     private Integer people;
 
-    @ApiModelProperty(value = "商品状态|拼团专用")
-    private Boolean isShow;
-
     @ApiModelProperty(value = "简介|拼团专用")
     private String info;
 
     @ApiModelProperty(value = "展示图")
     private String flatPattern;
+
+    @ApiModelProperty("品牌")
+    private String itemBrand;
+
+    @ApiModelProperty("货号")
+    private String itemNumber;
+
+    @ApiModelProperty(value = "商品价格")
+    private BigDecimal price;
+
+    @ApiModelProperty(value = "市场价")
+    private BigDecimal otPrice;
+
+    @ApiModelProperty(value = "库存")
+    private Integer stock;
+
+    @ApiModelProperty(value = "状态 (0:未上架,1:上架)")
+    private Integer isShow;
+
+    @ApiModelProperty("库存预警值")
+    private Integer stockThreshold;
+
+    @ApiModelProperty("供应商")
+    private String itemSupplier;
 }

+ 1 - 1
mall-service/src/main/resources/mapper/StoreProductMapper.xml

@@ -11,7 +11,7 @@
     <result column="store_name" jdbcType="VARCHAR" property="storeName"/>
     <result column="store_info" jdbcType="VARCHAR" property="storeInfo"/>
     <result column="keyword" jdbcType="VARCHAR" property="keyword"/>
-    <result column="cate_id" jdbcType="BIGINT" property="cateId"/>
+    <result column="cate_id" jdbcType="VARCHAR" property="cateId"/>
     <result column="price" jdbcType="DECIMAL" property="price"/>
     <result column="vip_price" jdbcType="DECIMAL" property="vipPrice"/>
     <result column="ot_price" jdbcType="DECIMAL" property="otPrice"/>