licailing 6 лет назад
Родитель
Сommit
fde11464e2
30 измененных файлов с 945 добавлено и 105 удалено
  1. 5 2
      src/main/java/com/izouma/dingdong/domain/Appraisal.java
  2. 1 0
      src/main/java/com/izouma/dingdong/domain/OrderInfo.java
  3. 37 0
      src/main/java/com/izouma/dingdong/domain/ShoppingCart.java
  4. 5 4
      src/main/java/com/izouma/dingdong/domain/User.java
  5. 2 1
      src/main/java/com/izouma/dingdong/domain/merchant/FullReduction.java
  6. 3 0
      src/main/java/com/izouma/dingdong/domain/merchant/Goods.java
  7. 20 2
      src/main/java/com/izouma/dingdong/domain/merchant/Merchant.java
  8. 1 0
      src/main/java/com/izouma/dingdong/domain/merchant/MerchantSettings.java
  9. 6 0
      src/main/java/com/izouma/dingdong/domain/merchant/Sales.java
  10. 20 0
      src/main/java/com/izouma/dingdong/dto/MerchantDTO.java
  11. 7 0
      src/main/java/com/izouma/dingdong/enums/ApplyStatus.java
  12. 16 0
      src/main/java/com/izouma/dingdong/enums/Identity.java
  13. 5 0
      src/main/java/com/izouma/dingdong/repo/merchant/GoodsRepo.java
  14. 11 0
      src/main/java/com/izouma/dingdong/repo/merchant/MerchantClassificationRepo.java
  15. 1 0
      src/main/java/com/izouma/dingdong/repo/merchant/MerchantRepo.java
  16. 11 0
      src/main/java/com/izouma/dingdong/repo/merchant/MerchantSettingsRepo.java
  17. 9 0
      src/main/java/com/izouma/dingdong/repo/merchant/SalesRepo.java
  18. 1 0
      src/main/java/com/izouma/dingdong/service/UserService.java
  19. 14 0
      src/main/java/com/izouma/dingdong/service/merchant/MerchantClassificationService.java
  20. 134 0
      src/main/java/com/izouma/dingdong/service/merchant/MerchantService.java
  21. 14 0
      src/main/java/com/izouma/dingdong/service/merchant/MerchantSettingsService.java
  22. 3 0
      src/main/java/com/izouma/dingdong/web/AuthenticationController.java
  23. 2 0
      src/main/java/com/izouma/dingdong/web/backstage/CategoryController.java
  24. 71 0
      src/main/java/com/izouma/dingdong/web/merchant/MerchantClassificationController.java
  25. 11 0
      src/main/java/com/izouma/dingdong/web/merchant/MerchantController.java
  26. 63 0
      src/main/java/com/izouma/dingdong/web/merchant/MerchantSettingsController.java
  27. 75 49
      src/main/vue/src/views/MerchantEdit.vue
  28. 74 47
      src/main/vue/src/views/MerchantList.vue
  29. 125 0
      src/main/vue/src/views/MerchantSettingsEdit.vue
  30. 198 0
      src/main/vue/src/views/MerchantSettingsList.vue

+ 5 - 2
src/main/java/com/izouma/dingdong/domain/Appraisal.java

@@ -26,13 +26,13 @@ public class Appraisal extends BaseEntity {
     @ApiModelProperty(value = "图片", name = "img")
     private String img;
 
-    @ApiModelProperty(value = "商品评分",name = "goodsScore")
+    @ApiModelProperty(value = "商品评分", name = "goodsScore")
     private Integer goodsScore;
 
     @ApiModelProperty(value = "商品评价", name = "goodsAppraise")
     private String goodsAppraise;
 
-    @ApiModelProperty(value = "骑手评分",name = "riderScore")
+    @ApiModelProperty(value = "骑手评分", name = "riderScore")
     private Integer riderScore;
 
     @ApiModelProperty(value = "骑手评价", name = "riderAppraise")
@@ -41,4 +41,7 @@ public class Appraisal extends BaseEntity {
     @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.DETACH)
     @JoinColumn(name = "orderId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
     private OrderInfo order;
+
+    @ApiModelProperty(value = "商家回复评价", name = "merchantReply")
+    private String merchantReply;
 }

+ 1 - 0
src/main/java/com/izouma/dingdong/domain/OrderInfo.java

@@ -32,6 +32,7 @@ public class OrderInfo extends BaseEntity {
 
     @ApiModelProperty(value = "商品ID", name = "goodsId")
     private Long goodsId;
+   // private
 
     @ApiModelProperty(value = "商家地址", name = "merchantAddress")
     private String merchantAddress;

+ 37 - 0
src/main/java/com/izouma/dingdong/domain/ShoppingCart.java

@@ -0,0 +1,37 @@
+package com.izouma.dingdong.domain;
+
+import com.izouma.dingdong.domain.merchant.Goods;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.security.core.parameters.P;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+public class ShoppingCart extends BaseEntity implements Serializable {
+    @ApiModelProperty(value = "用户ID", name = "userId")
+    private Long userId;
+
+    @ApiModelProperty(value = "商户ID", name = "merchantId")
+    private Long merchantId;
+
+/*    @ApiModelProperty(value = "商品ID", name = "goodsId")
+    private List<Long> goodsId;*/
+
+    @ApiModelProperty(value = "商品数量", name = "num")
+    private Integer num;
+
+    @ApiModelProperty(value = "配送费", name = "deliveryAmount")
+    private BigDecimal deliveryAmount;
+
+    @ApiModelProperty(value = "总价", name = "totalAmount")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty(value = "商品总价", name = "goodsAmount")
+    private BigDecimal goodsAmount;
+
+    private List<Goods> goods;
+
+    @ApiModelProperty(value = "已减优惠")
+    private BigDecimal amount;
+}

+ 5 - 4
src/main/java/com/izouma/dingdong/domain/User.java

@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.izouma.dingdong.annotations.Searchable;
 import com.izouma.dingdong.config.Constants;
+import com.izouma.dingdong.enums.Identity;
 import com.izouma.dingdong.security.Authority;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -71,11 +72,11 @@ public class User extends BaseEntity implements Serializable {
 
     private String email;
 
-/*    @ApiModelProperty(value = "身份", name = "identity")
-    private String identity;*/
+    @ApiModelProperty(value = "身份", name = "identity")
+    private Identity identity;
 
-    @ApiModelProperty(value = "合作申请", name = "apply")
-    private String apply;
+/*    @ApiModelProperty(value = "合作申请", name = "apply")
+    private String apply;*/
 
     @Column(nullable = false)
     @ApiModelProperty(value = "黑名单", name = "blacklist")

+ 2 - 1
src/main/java/com/izouma/dingdong/domain/merchant/FullReduction.java

@@ -9,6 +9,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import javax.persistence.Entity;
+import java.io.Serializable;
 import java.math.BigDecimal;
 
 @Data
@@ -17,7 +18,7 @@ import java.math.BigDecimal;
 @NoArgsConstructor
 @Builder
 @ApiModel(value = "满减表", description = "满减表")
-public class FullReduction extends BaseEntity {
+public class FullReduction extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "商户ID",name = "merchantSettingsId")
     private Long merchantId;
 

+ 3 - 0
src/main/java/com/izouma/dingdong/domain/merchant/Goods.java

@@ -46,6 +46,9 @@ public class Goods extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "点赞数量", name = "likes")
     private Integer likes;
 
+    @ApiModelProperty(value = "差评数量", name = "bad")
+    private Integer bad;
+
     @ApiModelProperty(value = "价格", name = "amount")
     private BigDecimal amount;
 

+ 20 - 2
src/main/java/com/izouma/dingdong/domain/merchant/Merchant.java

@@ -1,8 +1,12 @@
 package com.izouma.dingdong.domain.merchant;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.izouma.dingdong.annotations.Searchable;
 import com.izouma.dingdong.domain.BaseEntity;
 import com.izouma.dingdong.domain.backstage.Category;
 import com.izouma.dingdong.domain.backstage.Tag;
+import com.izouma.dingdong.enums.ApplyStatus;
+import com.izouma.dingdong.security.Authority;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.*;
@@ -24,17 +28,23 @@ import java.util.Set;
 @ApiModel(value = "商户信息", description = "商户信息")
 public class Merchant extends BaseEntity implements Serializable {
 
+    @ApiModelProperty(value = "用户ID", name = "userId")
+    private Long userId;
+
+    @Searchable
     @ApiModelProperty(value = "商户名称", name = "name")
     private String name;
 
+    @Searchable
     @ApiModelProperty(value = "显示名称", name = "showName")
     private String showName;
 
+    @Searchable
     @ApiModelProperty(value = "商户电话", name = "phone")
     private String phone;
 
-    @ApiModelProperty(value = "密码", name = "password")
-    private String password;
+/*    @ApiModelProperty(value = "密码", name = "password")
+    private String password;*/
 
     @ApiModelProperty(value = "简介", name = "introduction")
     private String introduction;
@@ -49,9 +59,11 @@ public class Merchant extends BaseEntity implements Serializable {
     @Column(nullable = false)
     private Boolean enabled = true;
 
+    @Searchable
     @ApiModelProperty(value = "支付宝名称", name = "aliName")
     private String aliName;
 
+    @Searchable
     @ApiModelProperty(value = "支付宝账号", name = "aliAccount")
     private String aliAccount;
 
@@ -63,4 +75,10 @@ public class Merchant extends BaseEntity implements Serializable {
 
     @ApiModelProperty(value = "月销", name = "monthSales")
     private Integer monthSales;
+
+    @ApiModelProperty(value = "通过", name = "isPass")
+    private Boolean isPass;
+
+    @ApiModelProperty(value = "状态", name = "status")
+    private ApplyStatus status;
 }

+ 1 - 0
src/main/java/com/izouma/dingdong/domain/merchant/MerchantSettings.java

@@ -1,5 +1,6 @@
 package com.izouma.dingdong.domain.merchant;
 
+import com.izouma.dingdong.annotations.Searchable;
 import com.izouma.dingdong.domain.BaseEntity;
 import com.izouma.dingdong.domain.backstage.Category;
 import com.izouma.dingdong.domain.backstage.Tag;

+ 6 - 0
src/main/java/com/izouma/dingdong/domain/merchant/Sales.java

@@ -28,6 +28,12 @@ public class Sales extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "日销售数量")
     private Integer daySales;
 
+    @ApiModelProperty(value = "日点赞数")
+    private Integer dayLikes;
+
+    @ApiModelProperty(value = "日差评数")
+    private Integer datBad;
+
     @ApiModelProperty(value = "日期")
     private LocalDate day;
 

+ 20 - 0
src/main/java/com/izouma/dingdong/dto/MerchantDTO.java

@@ -1,7 +1,12 @@
 package com.izouma.dingdong.dto;
 
+import cn.hutool.core.bean.BeanUtil;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.izouma.dingdong.annotations.Searchable;
 import com.izouma.dingdong.domain.backstage.Category;
 import com.izouma.dingdong.domain.backstage.Tag;
+import com.izouma.dingdong.domain.merchant.Merchant;
+import com.izouma.dingdong.domain.merchant.MerchantSettings;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
@@ -19,15 +24,28 @@ import java.util.Set;
 @NoArgsConstructor
 @Builder
 public class MerchantDTO {
+    public MerchantDTO(Merchant merchant, MerchantSettings merchantSettings){
+        MerchantDTO merchantDTO = new MerchantDTO();
+        BeanUtil.copyProperties(merchant,merchantDTO);
+        BeanUtil.copyProperties(merchant,merchantDTO);
+    }
+
+
+    private Long id;
+
+    @Searchable
     @ApiModelProperty(value = "商户名称", name = "name")
     private String name;
 
+    @Searchable
     @ApiModelProperty(value = "显示名称", name = "showName")
     private String showName;
 
+    @Searchable
     @ApiModelProperty(value = "商户电话", name = "phone")
     private String phone;
 
+    @JsonIgnore
     @ApiModelProperty(value = "密码", name = "password")
     private String password;
 
@@ -44,9 +62,11 @@ public class MerchantDTO {
     @Column(nullable = false)
     private Boolean enabled = true;
 
+    @Searchable
     @ApiModelProperty(value = "支付宝名称", name = "aliName")
     private String aliName;
 
+    @Searchable
     @ApiModelProperty(value = "支付宝账号", name = "aliAccount")
     private String aliAccount;
 

+ 7 - 0
src/main/java/com/izouma/dingdong/enums/ApplyStatus.java

@@ -0,0 +1,7 @@
+package com.izouma.dingdong.enums;
+
+public enum  ApplyStatus {
+    PASS,
+    DENY,
+    PENDING;
+}

+ 16 - 0
src/main/java/com/izouma/dingdong/enums/Identity.java

@@ -0,0 +1,16 @@
+package com.izouma.dingdong.enums;
+
+public enum Identity {
+    /*
+    用户
+     */
+    USER,
+    /*
+    商户
+     */
+    MERCHANT,
+    /*
+    骑手
+     */
+    RIDER;
+}

+ 5 - 0
src/main/java/com/izouma/dingdong/repo/merchant/GoodsRepo.java

@@ -4,5 +4,10 @@ import com.izouma.dingdong.domain.merchant.Goods;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 
+import java.util.List;
+
 public interface GoodsRepo extends JpaRepository<Goods, Long>, JpaSpecificationExecutor<Goods> {
+    List<Goods> findAllByMerchantId(Long merchantId);
+
+    List<Goods> findAllByMerchantIdAndTotalSalesIsLessThanEqual(Long merchant,Integer num);
 }

+ 11 - 0
src/main/java/com/izouma/dingdong/repo/merchant/MerchantClassificationRepo.java

@@ -0,0 +1,11 @@
+package com.izouma.dingdong.repo.merchant;
+
+import com.izouma.dingdong.domain.merchant.MerchantClassification;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+import java.util.List;
+
+public interface MerchantClassificationRepo extends JpaRepository<MerchantClassification, Long>, JpaSpecificationExecutor<MerchantClassification> {
+    List<MerchantClassification> findAllByMerchantId(Long merchantId);
+}

+ 1 - 0
src/main/java/com/izouma/dingdong/repo/merchant/MerchantRepo.java

@@ -15,4 +15,5 @@ public interface MerchantRepo extends JpaRepository<Merchant, Long>, JpaSpecific
     @Transactional
     void deleteById(Long id);
 
+    Merchant findByPhone(String phone);
 }

+ 11 - 0
src/main/java/com/izouma/dingdong/repo/merchant/MerchantSettingsRepo.java

@@ -0,0 +1,11 @@
+package com.izouma.dingdong.repo.merchant;
+
+import com.izouma.dingdong.domain.merchant.MerchantSettings;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+public interface MerchantSettingsRepo extends JpaRepository<MerchantSettings, Long>, JpaSpecificationExecutor<MerchantSettings> {
+    MerchantSettings findByMerchantId(Long merchantId);
+
+    void deleteByMerchantId(Long merchantId);
+}

+ 9 - 0
src/main/java/com/izouma/dingdong/repo/merchant/SalesRepo.java

@@ -4,5 +4,14 @@ import com.izouma.dingdong.domain.merchant.Sales;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 
+import java.time.LocalDate;
+import java.util.List;
+
 public interface SalesRepo extends JpaRepository<Sales, Long>, JpaSpecificationExecutor<Sales> {
+    //前一日起,最近n天,日销量达num
+    Boolean findByGoodsIdAndDayAfterAndDaySalesGreaterThanEqual(Long goodsId, LocalDate day, Integer num);
+
+    List<Sales> findAllByGoodsId(Long goodsId);
+
+
 }

+ 1 - 0
src/main/java/com/izouma/dingdong/service/UserService.java

@@ -145,4 +145,5 @@ public class UserService {
         user = userRepo.save(user);
         return jwtTokenUtil.generateToken(JwtUserFactory.create(user));
     }
+
 }

+ 14 - 0
src/main/java/com/izouma/dingdong/service/merchant/MerchantClassificationService.java

@@ -0,0 +1,14 @@
+package com.izouma.dingdong.service.merchant;
+
+import com.izouma.dingdong.domain.merchant.MerchantClassification;
+import com.izouma.dingdong.repo.merchant.MerchantClassificationRepo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class MerchantClassificationService {
+
+    private MerchantClassificationRepo merchantClassificationRepo;
+
+}

+ 134 - 0
src/main/java/com/izouma/dingdong/service/merchant/MerchantService.java

@@ -1,17 +1,151 @@
 package com.izouma.dingdong.service.merchant;
 
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.izouma.dingdong.domain.User;
 import com.izouma.dingdong.domain.merchant.Merchant;
+import com.izouma.dingdong.domain.merchant.MerchantSettings;
+import com.izouma.dingdong.dto.MerchantDTO;
+import com.izouma.dingdong.enums.ApplyStatus;
+import com.izouma.dingdong.enums.Identity;
+import com.izouma.dingdong.exception.BusinessException;
+import com.izouma.dingdong.repo.UserRepo;
 import com.izouma.dingdong.repo.merchant.MerchantRepo;
+import com.izouma.dingdong.repo.merchant.MerchantSettingsRepo;
 import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageImpl;
+import org.springframework.data.domain.Pageable;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 @AllArgsConstructor
 public class MerchantService {
 
     private MerchantRepo merchantRepo;
 
+    private MerchantSettingsRepo merchantSettingsRepo;
+
+    private UserRepo userRepo;
+
+    /*
+    商户注册申请
+     */
+    public MerchantDTO registerApply(MerchantDTO merchantDTO) {
+        //用于商家登录
+        User user = userRepo.findByPhone(merchantDTO.getPhone());
+        if (ObjectUtil.isNull(user)) {
+            user = User.builder().username(merchantDTO.getPhone())
+                    .password(merchantDTO.getPassword())
+                    .blacklist(false)
+                    .enabled(true)
+                    .identity(Identity.MERCHANT)
+                    .phone(merchantDTO.getPhone())
+                    .build();
+        }
+        user.setPassword(merchantDTO.getPassword());
+
+        //查看商家是否已存在
+        Merchant merchant1 = merchantRepo.findByPhone(merchantDTO.getPhone());
+
+        if (ObjectUtil.isNotNull(merchant1)) {
+            if (merchant1.getStatus().equals(ApplyStatus.PENDING)) {
+                throw new BusinessException("申请中");
+            }
+            if (merchant1.getStatus().equals(ApplyStatus.PASS)) {
+                throw new BusinessException("已申请");
+            }
+        }
+
+
+/*        if (ObjectUtil.isEmpty(merchantDTO.getBusinessNature())) {
+            throw new BusinessException("商家性质未填");
+        }*/
+
+        //新建商家
+        Merchant merchant = new Merchant();
+        MerchantSettings merchantSettings = new MerchantSettings();
+
+        //dto转实体
+        BeanUtil.copyProperties(merchantDTO, merchant);
+        merchant.setUserId(user.getId());
+        merchant.setStatus(ApplyStatus.PENDING);
+
+        //dto转实体
+        BeanUtil.copyProperties(merchantDTO, merchantSettings);
+        merchantSettings.setMerchantId(merchant.getId());
+
+        userRepo.save(user);
+        merchantRepo.save(merchant);
+        merchantSettingsRepo.save(merchantSettings);
+        return merchantDTO;
+    }
+
+    /*
+    商户修改
+     */
+    public MerchantDTO change(MerchantDTO merchantDTO) {
+        Merchant merchant = merchantRepo.findById(merchantDTO.getId()).orElseThrow(new BusinessException("商户不存在"));
+        MerchantSettings merchantSettings = merchantSettingsRepo.findByMerchantId(merchantDTO.getId());
+        if (ObjectUtil.isNull(merchantSettings)) {
+            throw new BusinessException("商户不存在");
+        }
+
+        //dto转实体
+        BeanUtil.copyProperties(merchantDTO, merchant);
+        BeanUtil.copyProperties(merchantDTO, merchantSettings);
+        merchantRepo.save(merchant);
+        merchantSettingsRepo.save(merchantSettings);
+        return merchantDTO;
+    }
+
+    /*
+    商户删除
+     */
+    public void del(Long id) {
+        merchantRepo.deleteById(id);
+        merchantSettingsRepo.deleteByMerchantId(id);
+    }
+
+    /*
+    商户过审
+     */
+    public void audit(Long id, Boolean pass) {
+        Merchant merchant = merchantRepo.findById(id).orElseThrow(new BusinessException("商户不存在"));
+        if (pass) {
+            merchant.setStatus(ApplyStatus.PASS);
+            merchant.setIsPass(true);
+        } else {
+            merchant.setStatus(ApplyStatus.DENY);
+            merchant.setIsPass(false);
+        }
+        merchantRepo.save(merchant);
+
+    }
 
+    /*
+    显示所有
+     */
+    public Page<MerchantDTO> showAll(Pageable pageable) {
+        List<MerchantDTO> merchantDTOS = CollUtil.newArrayList();
+        List<Merchant> merchants = merchantRepo.findAll();
+        List<MerchantSettings> merchantSettings = merchantSettingsRepo.findAll();
+        for (int i = 0; i < merchants.size(); i++) {
+            merchantDTOS.add(new MerchantDTO(merchants.get(i), merchantSettings.get(i)));
+        }
+        return new PageImpl<>(merchantDTOS, pageable, merchantDTOS.size());
+    }
 
+    /*
+    显示个人
+     */
+    public MerchantDTO my(Long id) {
+        Merchant merchant = merchantRepo.findById(id).orElseThrow(new BusinessException("商户不存在"));
+        MerchantSettings merchantSettings = merchantSettingsRepo.findByMerchantId(id);
+        return new MerchantDTO(merchant, merchantSettings);
+    }
 
 }

+ 14 - 0
src/main/java/com/izouma/dingdong/service/merchant/MerchantSettingsService.java

@@ -0,0 +1,14 @@
+package com.izouma.dingdong.service.merchant;
+
+import com.izouma.dingdong.domain.merchant.MerchantSettings;
+import com.izouma.dingdong.repo.merchant.MerchantSettingsRepo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class MerchantSettingsService {
+
+    private MerchantSettingsRepo merchantSettingsRepo;
+
+}

+ 3 - 0
src/main/java/com/izouma/dingdong/web/AuthenticationController.java

@@ -92,4 +92,7 @@ public class AuthenticationController {
             throw new AuthenticationException("Bad credentials!", e);
         }
     }
+
+
+
 }

+ 2 - 0
src/main/java/com/izouma/dingdong/web/backstage/CategoryController.java

@@ -76,5 +76,7 @@ public class CategoryController extends BaseController {
         return categories;
     }
 
+    //public List<Category> tree()
+
 }
 

+ 71 - 0
src/main/java/com/izouma/dingdong/web/merchant/MerchantClassificationController.java

@@ -0,0 +1,71 @@
+package com.izouma.dingdong.web.merchant;
+
+import com.izouma.dingdong.web.BaseController;
+import com.izouma.dingdong.domain.merchant.MerchantClassification;
+import com.izouma.dingdong.service.merchant.MerchantClassificationService;
+import com.izouma.dingdong.dto.PageQuery;
+import com.izouma.dingdong.exception.BusinessException;
+import com.izouma.dingdong.repo.merchant.MerchantClassificationRepo;
+import com.izouma.dingdong.utils.ObjUtils;
+import com.izouma.dingdong.utils.excel.ExcelUtils;
+
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Comparator;
+import java.util.List;
+
+@RestController
+@RequestMapping("/merchantClassification")
+@AllArgsConstructor
+public class MerchantClassificationController extends BaseController {
+    private MerchantClassificationService merchantClassificationService;
+    private MerchantClassificationRepo merchantClassificationRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public MerchantClassification save(@RequestBody MerchantClassification record) {
+        if (record.getId() != null) {
+            MerchantClassification orig = merchantClassificationRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return merchantClassificationRepo.save(orig);
+        }
+        return merchantClassificationRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @GetMapping("/all")
+    public Page<MerchantClassification> all(PageQuery pageQuery) {
+        return merchantClassificationRepo.findAll(toSpecification(pageQuery,MerchantClassification.class), toPageRequest(pageQuery));
+    }
+
+    @GetMapping("/get/{id}")
+    public MerchantClassification get(@PathVariable Long id) {
+        return merchantClassificationRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        merchantClassificationRepo.deleteById(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<MerchantClassification> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+
+    @GetMapping("/my")
+    public List<MerchantClassification> my(Long id){
+        List<MerchantClassification> merchantClassifications = merchantClassificationRepo.findAllByMerchantId(id);
+        merchantClassifications.sort(Comparator.comparing(MerchantClassification::getSort));
+        return merchantClassifications;
+    }
+}
+

+ 11 - 0
src/main/java/com/izouma/dingdong/web/merchant/MerchantController.java

@@ -1,5 +1,6 @@
 package com.izouma.dingdong.web.merchant;
 
+import com.izouma.dingdong.dto.MerchantDTO;
 import com.izouma.dingdong.web.BaseController;
 import com.izouma.dingdong.domain.merchant.Merchant;
 import com.izouma.dingdong.service.merchant.MerchantService;
@@ -59,5 +60,15 @@ public class MerchantController extends BaseController {
         List<Merchant> data = all(pageQuery).getContent();
         ExcelUtils.export(response, data);
     }
+
+    @GetMapping("/showAll")
+    public Page<MerchantDTO> showAll(PageQuery pageQuery){
+        return merchantService.showAll(toPageRequest(pageQuery));
+    }
+
+    @GetMapping("/reg")
+    public MerchantDTO reg(@RequestBody MerchantDTO merchantDTO){
+        return merchantService.registerApply(merchantDTO);
+    }
 }
 

+ 63 - 0
src/main/java/com/izouma/dingdong/web/merchant/MerchantSettingsController.java

@@ -0,0 +1,63 @@
+package com.izouma.dingdong.web.merchant;
+
+import com.izouma.dingdong.web.BaseController;
+import com.izouma.dingdong.domain.merchant.MerchantSettings;
+import com.izouma.dingdong.service.merchant.MerchantSettingsService;
+import com.izouma.dingdong.dto.PageQuery;
+import com.izouma.dingdong.exception.BusinessException;
+import com.izouma.dingdong.repo.merchant.MerchantSettingsRepo;
+import com.izouma.dingdong.utils.ObjUtils;
+import com.izouma.dingdong.utils.excel.ExcelUtils;
+
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/merchantSettings")
+@AllArgsConstructor
+public class MerchantSettingsController extends BaseController {
+    private MerchantSettingsService merchantSettingsService;
+    private MerchantSettingsRepo merchantSettingsRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public MerchantSettings save(@RequestBody MerchantSettings record) {
+        if (record.getId() != null) {
+            MerchantSettings orig = merchantSettingsRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return merchantSettingsRepo.save(orig);
+        }
+        return merchantSettingsRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @GetMapping("/all")
+    public Page<MerchantSettings> all(PageQuery pageQuery) {
+        return merchantSettingsRepo.findAll(toSpecification(pageQuery,MerchantSettings.class), toPageRequest(pageQuery));
+    }
+
+    @GetMapping("/get/{id}")
+    public MerchantSettings get(@PathVariable Long id) {
+        return merchantSettingsRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        merchantSettingsRepo.deleteById(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<MerchantSettings> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+}
+

+ 75 - 49
src/main/vue/src/views/MerchantEdit.vue

@@ -2,51 +2,64 @@
     <div class="edit-view">
         <el-form :model="formData" :rules="rules" ref="form" label-width="94px" label-position="right" size="small"
                  style="max-width: 500px;">
-                <el-form-item prop="userId" label="用户ID">
-                            <el-input-number type="number" v-model="formData.userId"></el-input-number>
-                </el-form-item>
-                <el-form-item prop="name" label="名称">
-                            <el-input v-model="formData.name"></el-input>
-                </el-form-item>
-                <el-form-item prop="introduction" label="简介">
-                            <el-input v-model="formData.introduction"></el-input>
-                </el-form-item>
-                <el-form-item prop="img" label="图片">
-                            <multi-upload v-model="formData.img"></multi-upload>
-                </el-form-item>
-                <el-form-item prop="address" label="地址">
-                            <el-input v-model="formData.address"></el-input>
-                </el-form-item>
-                <el-form-item prop="blacklist" label="黑名单">
-                            <el-switch v-model="formData.blacklist"></el-switch>
-                </el-form-item>
-                <el-form-item prop="firstOrder" label="首单优惠">
-                            <el-input-number type="number" v-model="formData.firstOrder"></el-input-number>
-                </el-form-item>
-                <el-form-item prop="newUser" label="新用户优惠">
-                            <el-input-number type="number" v-model="formData.newUser"></el-input-number>
-                </el-form-item>
-                <el-form-item prop="category" label="类别">
-                            <el-tree
-                                    :props="props"
-                                    :load="loadNode"
-                                    lazy
-                                    show-checkbox
-                                    @check-change="handleCheckChange">
-                            </el-tree>
-                </el-form-item>
-                <el-form-item prop="tag" label="标签">
-                            <el-tree
-                                    :props="props"
-                                    :load="loadNode"
-                                    lazy
-                                    show-checkbox
-                                    @check-change="handleCheckChange">
-                            </el-tree>
-                </el-form-item>
+            <el-form-item prop="userId" label="用户ID">
+                <el-input-number type="number" v-model="formData.userId"></el-input-number>
+            </el-form-item>
+            <el-form-item prop="name" label="名称">
+                <el-input v-model="formData.name"></el-input>
+            </el-form-item>
+            <el-form-item prop="introduction" label="简介">
+                <el-input v-model="formData.introduction"></el-input>
+            </el-form-item>
+            <el-form-item prop="img" label="图片">
+                <multi-upload v-model="formData.img"></multi-upload>
+            </el-form-item>
+            <el-form-item prop="address" label="地址">
+                <el-input v-model="formData.address"></el-input>
+            </el-form-item>
+            <el-form-item prop="blacklist" label="黑名单">
+                <el-switch v-model="formData.blacklist"></el-switch>
+            </el-form-item>
+            <el-form-item prop="firstOrder" label="首单优惠">
+                <el-input-number type="number" v-model="formData.firstOrder"></el-input-number>
+            </el-form-item>
+            <el-form-item prop="newUser" label="新用户优惠">
+                <el-input-number type="number" v-model="formData.newUser"></el-input-number>
+            </el-form-item>
+            <el-form-item prop="category" label="类别">
+                <el-select v-model="formData.category" multiple
+                           placeholder="请选择" value-key="name">
+                    <el-option v-for="item in category" :key="item.name"
+                               :label="item.name" :value="item">
+                    </el-option>
+                </el-select>
+
+<!--                    <el-cascader
+                            v-model="name"
+                            :options="category"
+                            @change="handleChange"></el-cascader>-->
+            </el-form-item>
+
+<!--            <div class="block">
+                <el-cascader
+                        v-model="name"
+                        :options="category"
+                        :props="{ expandTrigger: 'hover' }"
+                        @change="handleChange"></el-cascader>
+            </div>-->
+            <el-form-item prop="tag" label="标签">
+                <!--                            <el-tree
+                                                    :props="props"
+                                                    :load="loadNode"
+                                                    lazy
+                                                    show-checkbox
+                                                    @check-change="handleCheckChange">
+                                            </el-tree>-->
+            </el-form-item>
             <el-form-item>
                 <el-button @click="onSave" :loading="saving"
-                           type="primary">保存</el-button>
+                           type="primary">保存
+                </el-button>
                 <el-button @click="onDelete" :loading="saving"
                            type="danger" v-if="formData.id">删除
                 </el-button>
@@ -61,7 +74,7 @@
         created() {
             if (this.$route.query.id) {
                 this.$http
-                    .get('merchant/get/'+this.$route.query.id)
+                    .get('merchant/get/' + this.$route.query.id)
                     .then(res => {
                         this.formData = res;
                     })
@@ -70,14 +83,24 @@
                         this.$message.error(e.error);
                     });
             }
+            this.$http
+                .get('/category/tree',{
+                    id:1
+                })
+                .then(res => {
+                    this.category = res;
+                    console.log(res)
+                })
+                .catch(e => {
+                    console.log(e);
+                });
         },
         data() {
             return {
                 saving: false,
-                formData: {
-                },
-                rules: {
-                },
+                formData: {},
+                rules: {},
+                category: [],
             }
         },
         methods: {
@@ -95,7 +118,7 @@
 
                 this.saving = true;
                 this.$http
-                    .post('/merchant/save', data, {body: 'json'})
+                    .post('/merchant/reg', data, {body: 'json'})
                     .then(res => {
                         this.saving = false;
                         this.$message.success('成功');
@@ -120,6 +143,9 @@
                     }
                 })
             },
+            handleChange(name) {
+                console.log(name);
+            }
         }
     }
 </script>

+ 74 - 47
src/main/vue/src/views/MerchantList.vue

@@ -1,5 +1,5 @@
 <template>
-    <div  class="list-view">
+    <div class="list-view">
         <div class="filters-container">
             <el-input placeholder="输入关键字" v-model="search" clearable
                       class="filter-item"></el-input>
@@ -23,45 +23,49 @@
             </el-table-column>
             <el-table-column prop="id" label="ID" width="100">
             </el-table-column>
-                                <el-table-column prop="userId" label="用户ID"
->
-                    </el-table-column>
-                    <el-table-column prop="name" label="名称"
->
-                    </el-table-column>
-                    <el-table-column prop="introduction" label="简介"
->
-                    </el-table-column>
-                    <el-table-column prop="img" label="图片"
->
-                            <template slot-scope="{row}">
-                                <el-image style="width: 30px; height: 30px"
-                                          :src="row.img[0]" fit="cover"
-                                          :preview-src-list="row.img"></el-image>
-                            </template>
-                    </el-table-column>
-                    <el-table-column prop="address" label="地址"
->
-                    </el-table-column>
-                    <el-table-column prop="blacklist" label="黑名单"
->
-                            <template slot-scope="{row}">
-                                <el-tag :type="row.blacklist?'':'info'">{{row.blacklist}}</el-tag>
-                            </template>
-                    </el-table-column>
-                    <el-table-column prop="firstOrder" label="首单优惠"
->
-                    </el-table-column>
-                    <el-table-column prop="newUser" label="新用户优惠"
->
-                    </el-table-column>
-                    <el-table-column prop="category" label="类别"
->
-                    </el-table-column>
-                    <el-table-column prop="tag" label="标签"
->
-                    </el-table-column>
-            <el-table-column
+ <!--           <el-table-column prop="userId" label="用户ID"
+            >
+            </el-table-column>-->
+            <el-table-column prop="name" label="名称"
+            >
+            </el-table-column>
+            <el-table-column prop="introduction" label="简介"
+            >
+            </el-table-column>
+            <el-table-column prop="img" label="图片"
+            >
+                <template slot-scope="{row}">
+                    <el-image style="width: 30px; height: 30px"
+                              :src="row.img[0]" fit="cover"
+                              :preview-src-list="row.img"></el-image>
+                </template>
+            </el-table-column>
+            <el-table-column prop="address" label="地址"
+            >
+            </el-table-column>
+            <el-table-column prop="firstOrder" label="首单优惠"
+            >
+            </el-table-column>
+            <el-table-column prop="newUser" label="新用户优惠"
+            >
+            </el-table-column>
+            <el-table-column prop="category" label="类别"
+            >
+            </el-table-column>
+            <el-table-column prop="tag" label="标签"
+            >
+            </el-table-column>
+            <el-table-column prop="status" label="状态"
+            >
+            </el-table-column>
+
+            <el-table-column prop="blacklist" label="黑名单"
+            >
+                <template slot-scope="{row}">
+                    <el-tag :type="row.blacklist?'':'info'">{{row.blacklist}}</el-tag>
+                </template>
+            </el-table-column>
+            <!--<el-table-column
                     label="操作"
                     align="center"
                     fixed="right"
@@ -70,6 +74,29 @@
                     <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
                     <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
                 </template>
+            </el-table-column>-->
+            <el-table-column label="操作" align="center" fixed="right" min-width="150">
+                <template slot-scope="{ row }">
+                    <el-button
+                            v-if="row.status === 'PENDING'"
+                            :loading="row.loading"
+                            @click="audit(row, true)"
+                            type="primary"
+                            size="mini"
+                            plain
+                    >通过
+                    </el-button
+                    >
+                    <el-button
+                            v-if="row.status === 'PENDING'"
+                            @click="audit(row, false)"
+                            type="danger"
+                            size="mini"
+                            plain
+                    >拒绝
+                    </el-button
+                    >
+                </template>
             </el-table-column>
         </el-table>
         <div class="pagination-wrapper">
@@ -92,7 +119,7 @@
     </div>
 </template>
 <script>
-    import { mapState } from "vuex";
+    import {mapState} from "vuex";
     import pageableTable from "@/mixins/pageableTable";
 
     export default {
@@ -105,7 +132,7 @@
             return {
                 multipleMode: false,
                 search: "",
-                url: "/merchant/all",
+                url: "/merchant/showAll",
                 downloading: false,
             }
         },
@@ -117,7 +144,7 @@
         methods: {
             beforeGetData() {
                 if (this.search) {
-                    return { search: this.search };
+                    return {search: this.search};
                 }
             },
             toggleMultipleMode(multipleMode) {
@@ -130,7 +157,7 @@
                 this.$router.push({
                     path: "/merchantEdit",
                     query: {
-                    ...this.$route.query
+                        ...this.$route.query
                     }
                 });
             },
@@ -138,16 +165,16 @@
                 this.$router.push({
                     path: "/merchantEdit",
                     query: {
-                    id: row.id
+                        id: row.id
                     }
                 });
             },
             download() {
                 this.downloading = true;
                 this.$axios
-                    .get("/merchant/excel", { 
+                    .get("/merchant/excel", {
                         responseType: "blob",
-                        params: { size: 10000 }
+                        params: {size: 10000}
                     })
                     .then(res => {
                         console.log(res);

+ 125 - 0
src/main/vue/src/views/MerchantSettingsEdit.vue

@@ -0,0 +1,125 @@
+<template>
+    <div class="edit-view">
+        <el-form :model="formData" :rules="rules" ref="form" label-width="94px" label-position="right" size="small"
+                 style="max-width: 500px;">
+                <el-form-item prop="merchantId" label="商户ID">
+                            <el-input-number type="number" v-model="formData.merchantId"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="address" label="商户地址">
+                            <el-input v-model="formData.address"></el-input>
+                </el-form-item>
+                <el-form-item prop="firstOrder" label="首单优惠">
+                            <el-input-number type="number" v-model="formData.firstOrder"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="newUser" label="新用户优惠">
+                            <el-input-number type="number" v-model="formData.newUser"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="category" label="经营品类">
+                            <el-input v-model="formData.category"></el-input>
+                </el-form-item>
+                <el-form-item prop="tag" label="标签">
+                            <el-input v-model="formData.tag"></el-input>
+                </el-form-item>
+                <el-form-item prop="startTime" label="营业时间">
+                            <el-date-picker
+                                    v-model="formData.startTime"
+                                    type="datetime"
+                                    value-format="yyyy-MM-dd HH:mm:ss"
+                                    placeholder="选择日期时间">
+                            </el-date-picker>
+                </el-form-item>
+                <el-form-item prop="endTime" label="营业时间">
+                            <el-date-picker
+                                    v-model="formData.endTime"
+                                    type="datetime"
+                                    value-format="yyyy-MM-dd HH:mm:ss"
+                                    placeholder="选择日期时间">
+                            </el-date-picker>
+                </el-form-item>
+                <el-form-item prop="qualification" label="营业资质">
+                            <multi-upload v-model="formData.qualification"></multi-upload>
+                </el-form-item>
+                <el-form-item prop="businessNature" label="营业性质">
+                            <el-input v-model="formData.businessNature"></el-input>
+                </el-form-item>
+            <el-form-item>
+                <el-button @click="onSave" :loading="saving"
+                           type="primary">保存</el-button>
+                <el-button @click="onDelete" :loading="saving"
+                           type="danger" v-if="formData.id">删除
+                </el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+    export default {
+        name: 'MerchantSettingsEdit',
+        created() {
+            if (this.$route.query.id) {
+                this.$http
+                    .get('merchantSettings/get/'+this.$route.query.id)
+                    .then(res => {
+                        this.formData = res;
+                    })
+                    .catch(e => {
+                        console.log(e);
+                        this.$message.error(e.error);
+                    });
+            }
+        },
+        data() {
+            return {
+                saving: false,
+                formData: {
+                },
+                rules: {
+                },
+            }
+        },
+        methods: {
+            onSave() {
+                this.$refs.form.validate((valid) => {
+                    if (valid) {
+                        this.submit();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            submit() {
+                let data = {...this.formData};
+
+                this.saving = true;
+                this.$http
+                    .post('/merchantSettings/save', data, {body: 'json'})
+                    .then(res => {
+                        this.saving = false;
+                        this.$message.success('成功');
+                        this.$router.go(-1);
+                    })
+                    .catch(e => {
+                        console.log(e);
+                        this.saving = false;
+                        this.$message.error(e.error);
+                    });
+            },
+            onDelete() {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
+                    return this.$http.post(`/merchantSettings/del/${this.formData.id}`)
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                }).catch(e => {
+                    if (e !== 'cancel') {
+                        console.log(e);
+                        this.$message.error(e.error);
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

+ 198 - 0
src/main/vue/src/views/MerchantSettingsList.vue

@@ -0,0 +1,198 @@
+<template>
+    <div  class="list-view">
+        <div class="filters-container">
+            <el-input placeholder="输入关键字" v-model="search" clearable
+                      class="filter-item"></el-input>
+            <el-button @click="getData" type="primary" icon="el-icon-search"
+                       class="filter-item">搜索
+            </el-button>
+            <el-button @click="addRow" type="primary" icon="el-icon-plus"
+                       class="filter-item">添加
+            </el-button>
+            <el-button @click="download" type="primary" icon="el-icon-download"
+                       :loading="downloading" class="filter-item">导出EXCEL
+            </el-button>
+        </div>
+        <el-table :data="tableData" row-key="id" ref="table"
+                  header-row-class-name="table-header-row"
+                  header-cell-class-name="table-header-cell"
+                  row-class-name="table-row" cell-class-name="table-cell"
+                  :height="tableHeight">
+            <el-table-column v-if="multipleMode" align="center" type="selection"
+                             width="50">
+            </el-table-column>
+            <el-table-column prop="id" label="ID" width="100">
+            </el-table-column>
+                                <el-table-column prop="merchantId" label="商户ID"
+>
+                    </el-table-column>
+                    <el-table-column prop="address" label="商户地址"
+>
+                    </el-table-column>
+                    <el-table-column prop="firstOrder" label="首单优惠"
+>
+                    </el-table-column>
+                    <el-table-column prop="newUser" label="新用户优惠"
+>
+                    </el-table-column>
+                    <el-table-column prop="category" label="经营品类"
+>
+                    </el-table-column>
+                    <el-table-column prop="tag" label="标签"
+>
+                    </el-table-column>
+                    <el-table-column prop="startTime" label="营业时间"
+                            :formatter="datetimeFormatter"
+>
+                    </el-table-column>
+                    <el-table-column prop="endTime" label="营业时间"
+                            :formatter="datetimeFormatter"
+>
+                    </el-table-column>
+                    <el-table-column prop="qualification" label="营业资质"
+>
+                            <template slot-scope="{row}">
+                                <el-image style="width: 30px; height: 30px"
+                                          :src="row.qualification[0]" fit="cover"
+                                          :preview-src-list="row.qualification"></el-image>
+                            </template>
+                    </el-table-column>
+                    <el-table-column prop="businessNature" label="营业性质"
+>
+                    </el-table-column>
+            <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    min-width="150">
+                <template slot-scope="{row}">
+                    <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <!-- <div class="multiple-mode-wrapper">
+                <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button @click="operation1">批量操作1</el-button>
+                    <el-button @click="operation2">批量操作2</el-button>
+                    <el-button @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div> -->
+            <el-pagination background @size-change="onSizeChange"
+                           @current-change="onCurrentChange" :current-page="page"
+                           :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize"
+                           layout="total, sizes, prev, pager, next, jumper"
+                           :total="totalElements">
+            </el-pagination>
+        </div>
+
+    </div>
+</template>
+<script>
+    import { mapState } from "vuex";
+    import pageableTable from "@/mixins/pageableTable";
+
+    export default {
+        name: 'MerchantSettingsList',
+        mixins: [pageableTable],
+        created() {
+            this.getData();
+        },
+        data() {
+            return {
+                multipleMode: false,
+                search: "",
+                url: "/merchantSettings/all",
+                downloading: false,
+            }
+        },
+        computed: {
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+            beforeGetData() {
+                if (this.search) {
+                    return { search: this.search };
+                }
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
+                }
+            },
+            addRow() {
+                this.$router.push({
+                    path: "/merchantSettingsEdit",
+                    query: {
+                    ...this.$route.query
+                    }
+                });
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: "/merchantSettingsEdit",
+                    query: {
+                    id: row.id
+                    }
+                });
+            },
+            download() {
+                this.downloading = true;
+                this.$axios
+                    .get("/merchantSettings/excel", { 
+                        responseType: "blob",
+                        params: { size: 10000 }
+                    })
+                    .then(res => {
+                        console.log(res);
+                        this.downloading = false;
+                        const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
+                        const link = document.createElement("a");
+                        link.href = downloadUrl;
+                        link.setAttribute(
+                            "download",
+                            res.headers["content-disposition"].split("filename=")[1]
+                        );
+                        document.body.appendChild(link);
+                        link.click();
+                        link.remove();
+                    })
+                    .catch(e => {
+                        console.log(e);
+                        this.downloading = false;
+                        this.$message.error(e.error);
+                    });
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            deleteRow(row) {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
+                    return this.$http.post(`/merchantSettings/del/${row.id}`)
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>