licailing 5 lat temu
rodzic
commit
a084fdab8d

+ 4 - 2
src/main/java/com/izouma/dingdong/domain/merchant/MerchantClassification.java

@@ -47,8 +47,10 @@ public class MerchantClassification extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "商品列表", name = "goodsList")
     @ApiModelProperty(value = "商品列表", name = "goodsList")
     private Set<Goods> goodsList;*/
     private Set<Goods> goodsList;*/
 
 
-    @Convert(converter = LongArrayConverter.class)
-    private List<Long> goodsIds ;
+//    @Convert(converter = LongArrayConverter.class)
+//    private List<Long> goodsIds ;
+
+    private String goodsIds;
 
 
     @ApiModelProperty(value = "是否开启", name = "isOpen")
     @ApiModelProperty(value = "是否开启", name = "isOpen")
     private Boolean isOpen;
     private Boolean isOpen;

+ 7 - 1
src/main/java/com/izouma/dingdong/dto/MerchantClassificationDTO.java

@@ -18,6 +18,9 @@ import java.util.Set;
 @Builder
 @Builder
 @ApiModel(value = "商家自定义分类")
 @ApiModel(value = "商家自定义分类")
 public class MerchantClassificationDTO implements Serializable {
 public class MerchantClassificationDTO implements Serializable {
+
+    private Long id;
+
     @ApiModelProperty(value = "名称", name = "name")
     @ApiModelProperty(value = "名称", name = "name")
     @Column(length = 50)
     @Column(length = 50)
     @Size(max = 50)
     @Size(max = 50)
@@ -31,10 +34,13 @@ public class MerchantClassificationDTO implements Serializable {
 
 
 
 
     @ApiModelProperty(value = "商品列表", name = "goodsList")
     @ApiModelProperty(value = "商品列表", name = "goodsList")
-    private Set<String> goodsIds;
+    private String goodsIds;
 
 
 
 
     @ApiModelProperty(value = "是否开启", name = "isOpen")
     @ApiModelProperty(value = "是否开启", name = "isOpen")
     private Boolean isOpen;
     private Boolean isOpen;
 
 
+    @ApiModelProperty(value = "是否显示", name = "isShow")
+    private Boolean isShow;
+
 }
 }

+ 8 - 2
src/main/java/com/izouma/dingdong/service/merchant/GoodsService.java

@@ -2,6 +2,7 @@ package com.izouma.dingdong.service.merchant;
 
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.izouma.dingdong.config.Constants;
 import com.izouma.dingdong.config.Constants;
+import com.izouma.dingdong.converter.LongArrayConverter;
 import com.izouma.dingdong.domain.merchant.Goods;
 import com.izouma.dingdong.domain.merchant.Goods;
 import com.izouma.dingdong.domain.merchant.MerchantClassification;
 import com.izouma.dingdong.domain.merchant.MerchantClassification;
 import com.izouma.dingdong.enums.ApplyStatus;
 import com.izouma.dingdong.enums.ApplyStatus;
@@ -15,6 +16,7 @@ import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.List;
 
 
 
 
 @Service
 @Service
@@ -79,8 +81,12 @@ public class GoodsService {
             goods.setIsFullReduction(true);
             goods.setIsFullReduction(true);
 
 
             //移除折扣商品
             //移除折扣商品
-            if (goods.getId() != null)
-                classification.getGoodsIds().remove(goods.getId());
+            if (goods.getId() != null) {
+                LongArrayConverter converter = new LongArrayConverter();
+                String goodsIds = classification.getGoodsIds();
+                List<Long> list = converter.convertToEntityAttribute(goodsIds);
+                list.remove(goods.getId());
+            }
 
 
         } else {
         } else {
             goods.setIsFullReduction(false);
             goods.setIsFullReduction(false);

+ 24 - 7
src/main/java/com/izouma/dingdong/service/merchant/MerchantClassificationService.java

@@ -32,6 +32,8 @@ public class MerchantClassificationService {
     添加商家自定义分类
     添加商家自定义分类
      */
      */
     public MerchantClassification add(Long id, MerchantClassification classification) {
     public MerchantClassification add(Long id, MerchantClassification classification) {
+
+
         Long merchantId = merchantService.findMerchantId(id);
         Long merchantId = merchantService.findMerchantId(id);
         if (ObjectUtil.isNotNull(merchantClassificationRepo.findByMerchantIdAndName(merchantId, classification.getName()))) {
         if (ObjectUtil.isNotNull(merchantClassificationRepo.findByMerchantIdAndName(merchantId, classification.getName()))) {
             throw new BusinessException("该分类已存在");
             throw new BusinessException("该分类已存在");
@@ -59,7 +61,10 @@ public class MerchantClassificationService {
      */
      */
     public List<Goods> showGoods(Long classificationId) {
     public List<Goods> showGoods(Long classificationId) {
         MerchantClassification merchantClassification = merchantClassificationRepo.findById(classificationId).orElseThrow(new BusinessException("分类不存在"));
         MerchantClassification merchantClassification = merchantClassificationRepo.findById(classificationId).orElseThrow(new BusinessException("分类不存在"));
-        List<Long> goodsIds = merchantClassification.getGoodsIds();
+        LongArrayConverter converter = new LongArrayConverter();
+        //List<Long> goodsIds = merchantClassification.getGoodsIds();
+        List<Long> goodsIds = converter.convertToEntityAttribute(merchantClassification.getGoodsIds());
+
         List<Goods> goods = CollUtil.newArrayList();
         List<Goods> goods = CollUtil.newArrayList();
         goodsIds.forEach(s -> {
         goodsIds.forEach(s -> {
             goods.add(goodsRepo.findById(s).orElseThrow(new BusinessException("商品不存在")));
             goods.add(goodsRepo.findById(s).orElseThrow(new BusinessException("商品不存在")));
@@ -78,13 +83,18 @@ public class MerchantClassificationService {
         //查找分类
         //查找分类
         MerchantClassification merchantClassification = merchantClassificationRepo.findById(classificationId).orElseThrow(new BusinessException("无分类"));
         MerchantClassification merchantClassification = merchantClassificationRepo.findById(classificationId).orElseThrow(new BusinessException("无分类"));
 
 
-        List<Long> goodsIds = merchantClassification.getGoodsIds();
+        //List<Long> goodsIds = merchantClassification.getGoodsIds();
         LongArrayConverter converter = new LongArrayConverter();
         LongArrayConverter converter = new LongArrayConverter();
         List<Long> longs = converter.convertToEntityAttribute(string);
         List<Long> longs = converter.convertToEntityAttribute(string);
+
+        List<Long> goodsIds = converter.convertToEntityAttribute(merchantClassification.getGoodsIds());
+
         longs.stream().filter(l -> !goodsIds.contains(l)).forEach(goodsIds::add);
         longs.stream().filter(l -> !goodsIds.contains(l)).forEach(goodsIds::add);
         //goodsIds.addAll(longs);
         //goodsIds.addAll(longs);
 
 
-        merchantClassification.setGoodsIds(goodsIds);
+        String ids = converter.convertToDatabaseColumn(goodsIds);
+
+        merchantClassification.setGoodsIds(ids);
 
 
         return merchantClassificationRepo.save(merchantClassification);
         return merchantClassificationRepo.save(merchantClassification);
     }
     }
@@ -96,11 +106,14 @@ public class MerchantClassificationService {
         //查找分类
         //查找分类
         MerchantClassification merchantClassification = merchantClassificationRepo.findById(classificationId).orElseThrow(new BusinessException("无分类"));
         MerchantClassification merchantClassification = merchantClassificationRepo.findById(classificationId).orElseThrow(new BusinessException("无分类"));
 
 
-        List<Long> ids = merchantClassification.getGoodsIds();
+//        List<Long> ids = merchantClassification.getGoodsIds();
+
+        LongArrayConverter converter = new LongArrayConverter();
+        List<Long> ids = converter.convertToEntityAttribute(merchantClassification.getGoodsIds());
 
 
         if (!ids.contains(goodsId)) {
         if (!ids.contains(goodsId)) {
             ids.add(goodsId);
             ids.add(goodsId);
-            merchantClassification.setGoodsIds(ids);
+            merchantClassification.setGoodsIds(converter.convertToDatabaseColumn(ids));
             merchantClassificationRepo.save(merchantClassification);
             merchantClassificationRepo.save(merchantClassification);
         }
         }
     }
     }
@@ -112,9 +125,13 @@ public class MerchantClassificationService {
         //查找分类
         //查找分类
         MerchantClassification merchantClassification = merchantClassificationRepo.findById(classificationId).orElseThrow(new BusinessException("无分类"));
         MerchantClassification merchantClassification = merchantClassificationRepo.findById(classificationId).orElseThrow(new BusinessException("无分类"));
 
 
-        List<Long> goodsIds = merchantClassification.getGoodsIds();
+        LongArrayConverter converter = new LongArrayConverter();
+        List<Long> goodsIds = converter.convertToEntityAttribute(merchantClassification.getGoodsIds());
+
+        //List<Long> goodsIds = merchantClassification.getGoodsIds();
         goodsIds.remove(goodId);
         goodsIds.remove(goodId);
-        merchantClassification.setGoodsIds(goodsIds);
+
+        merchantClassification.setGoodsIds(converter.convertToDatabaseColumn(goodsIds));
 
 
         merchantClassificationRepo.save(merchantClassification);
         merchantClassificationRepo.save(merchantClassification);
     }
     }

+ 1 - 1
src/main/vue/src/views/OrderInfoList.vue

@@ -142,7 +142,7 @@
                     { "label": "已支付","value": "PAID"},
                     { "label": "已支付","value": "PAID"},
                     { "label": "待评价","value": "RATED"},
                     { "label": "待评价","value": "RATED"},
                     { "label": "已取消","value": "CANCELLED"},
                     { "label": "已取消","value": "CANCELLED"},
-                    { "label": "申请退款中","value": "PENDING"},
+                    { "label": "申请退款中","value": "REFUNDED_PENDING"},
                     {"label": "已退款", "value": "REFUNDED"},
                     {"label": "已退款", "value": "REFUNDED"},
                     {"label": "已完成", "value": "COMPLETED"}],
                     {"label": "已完成", "value": "COMPLETED"}],