1、主要解决商品参数后端存储格式问题,结构问题等

2、配送商品超出配送区域提出警告,但是依然可以下单问题处理
This commit is contained in:
Chopper
2021-06-25 09:46:38 +08:00
parent 158234412c
commit 02d23dc217
29 changed files with 179 additions and 379 deletions

View File

@@ -1,8 +1,8 @@
package cn.lili.controller.goods;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.goods.entity.dos.CategoryParameterGroup;
import cn.lili.modules.goods.entity.dos.Parameters;
@@ -14,6 +14,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -50,7 +51,7 @@ public class CategoryParameterGroupManagerController {
@ApiOperation(value = "保存数据")
@PostMapping
public ResultMessage<CategoryParameterGroup> saveOrUpdate(CategoryParameterGroup categoryParameterGroup) {
public ResultMessage<CategoryParameterGroup> saveOrUpdate(@Validated CategoryParameterGroup categoryParameterGroup) {
if (categoryParameterGroupService.save(categoryParameterGroup)) {
return ResultUtil.data(categoryParameterGroup);
@@ -60,7 +61,7 @@ public class CategoryParameterGroupManagerController {
@ApiOperation(value = "更新数据")
@PutMapping
public ResultMessage<CategoryParameterGroup> update(CategoryParameterGroup categoryParameterGroup) {
public ResultMessage<CategoryParameterGroup> update(@Validated CategoryParameterGroup categoryParameterGroup) {
if (categoryParameterGroupService.updateById(categoryParameterGroup)) {
return ResultUtil.data(categoryParameterGroup);

View File

@@ -3,7 +3,6 @@ package cn.lili.controller.goods;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.goods.entity.vos.GoodsParamsGroupVO;
import cn.lili.modules.goods.service.GoodsParamsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;

View File

@@ -5,7 +5,6 @@ import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.goods.entity.dos.Parameters;
import cn.lili.modules.goods.service.GoodsParamsService;
import cn.lili.modules.goods.service.ParametersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;

View File

@@ -2,9 +2,8 @@ package cn.lili.controller.other;
import cn.hutool.json.JSONUtil;
import cn.lili.modules.goods.entity.dos.Goods;
import cn.lili.modules.goods.entity.dos.GoodsParams;
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
import cn.lili.modules.goods.entity.dos.GoodsSku;
import cn.lili.modules.goods.entity.dos.Parameters;
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
import cn.lili.modules.goods.service.GoodsService;
@@ -15,7 +14,6 @@ import cn.lili.modules.search.entity.dos.EsGoodsIndex;
import cn.lili.modules.search.service.EsGoodsIndexService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import org.junit.jupiter.api.Assertions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
@@ -73,8 +71,8 @@ public class ElasticsearchController {
Goods goods = goodsService.getById(goodsId);
EsGoodsIndex index = new EsGoodsIndex(goodsSku);
if (goods.getParams() != null && !goods.getParams().isEmpty()) {
List<GoodsParams> goodsParams = JSONUtil.toList(goods.getParams(), GoodsParams.class);
index = new EsGoodsIndex(goodsSku, goodsParams);
List<GoodsParamsDTO> goodsParamDTOS = JSONUtil.toList(goods.getParams(), GoodsParamsDTO.class);
index = new EsGoodsIndex(goodsSku, goodsParamDTOS);
}
Map<String, Object> goodsCurrentPromotionMap = promotionService.getGoodsCurrentPromotionMap(index);
index.setPromotionMap(goodsCurrentPromotionMap);