From c4dcdec3c5419bffdf98a021cac170a5cec2e114 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 25 Jun 2021 18:42:29 +0800
Subject: [PATCH] 20210625 商品分类

---
 gc-shop/src/main/java/com/xzx/gc/shop/dto/UpdateGoodsDto.java                 |    2 +-
 gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminJhyOrderController.java |    2 +-
 gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminGoodsController.java    |   11 ++++++++++-
 gc-shop/src/main/java/com/xzx/gc/shop/dto/AddGoodsDto.java                    |    2 +-
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminGoodsController.java b/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminGoodsController.java
index 255c1c1..1c6c804 100644
--- a/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminGoodsController.java
+++ b/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminGoodsController.java
@@ -1,5 +1,6 @@
 package com.xzx.gc.shop.controller;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.ObjectUtil;
 import com.xzx.gc.common.constant.CommonEnum;
@@ -23,6 +24,7 @@
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 @RestController
@@ -53,7 +55,10 @@
     @PostMapping(Constants.ADMIN_VIEW_PREFIX+"/score/goods/addGoods.json")
     @ApiOperation(value = "商品管理-添加商品", notes = "test: 仅0有正确返回")
     public JsonResult<String> addGoods(@RequestBody AddGoodsDto model, HttpServletRequest request) {
-
+        List<ScoreGoodsStyleDto> scoreGoodsStyles = model.getScoreGoodsStyles();
+        if(CollUtil.isNotEmpty(scoreGoodsStyles)){
+            return JsonResult.failMessage("样式不能为空!");
+        }
         model.setCreatedBy(getAdminName(request));
         model.setCreatedTime(new Date());
         Long scoreGoodsId = goodsService.addGoods(model);
@@ -121,6 +126,10 @@
         if(ScoreGoods.ISSALE_YES == isSale){
             return JsonResult.failMessage("请先下架商品!");
         }
+        List<ScoreGoodsStyleDto> scoreGoodsStyles = model.getScoreGoodsStyles();
+        if(CollUtil.isNotEmpty(scoreGoodsStyles)){
+            return JsonResult.failMessage("样式不能为空!");
+        }
         goodsService.updateGoods(model);
         OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request))
                 .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("商品管理-更新商品-" + id).build();
diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminJhyOrderController.java b/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminJhyOrderController.java
index 973ed03..8afc9bb 100644
--- a/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminJhyOrderController.java
+++ b/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminJhyOrderController.java
@@ -42,7 +42,7 @@
     }
 
     /**
-     * 查看商品详情
+     * 查看订单详情
      */
     @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/score/jhy/viewJhyOrder.json")
     @ApiResponses({@ApiResponse( code = 200, message = "success", response = ViewJhyOrderVo.class)})
diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/dto/AddGoodsDto.java b/gc-shop/src/main/java/com/xzx/gc/shop/dto/AddGoodsDto.java
index f54e534..527189e 100644
--- a/gc-shop/src/main/java/com/xzx/gc/shop/dto/AddGoodsDto.java
+++ b/gc-shop/src/main/java/com/xzx/gc/shop/dto/AddGoodsDto.java
@@ -70,7 +70,7 @@
     @ApiModelProperty(value="主图")
     private List<String> goodsImages;
 
-    @ApiModelProperty(value="积分商品样式")
+    @ApiModelProperty(value="积分商品样式",required=true)
     private List<ScoreGoodsStyleDto> scoreGoodsStyles;
 
     @ApiModelProperty(value="创建人")
diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/dto/UpdateGoodsDto.java b/gc-shop/src/main/java/com/xzx/gc/shop/dto/UpdateGoodsDto.java
index a9a8717..2b182f4 100644
--- a/gc-shop/src/main/java/com/xzx/gc/shop/dto/UpdateGoodsDto.java
+++ b/gc-shop/src/main/java/com/xzx/gc/shop/dto/UpdateGoodsDto.java
@@ -67,7 +67,7 @@
     @ApiModelProperty(value="积分商品轮播图")
     private List<String> goodsImages;
 
-    @ApiModelProperty(value="积分商品样式")
+    @ApiModelProperty(value="积分商品样式",required=true)
     private List<ScoreGoodsStyleDto> scoreGoodsStyles;
 
 //    @ApiModelProperty(value="创建人")

--
Gitblit v1.9.1