Sfoglia il codice sorgente

银行卡以及提现

licailing 5 anni fa
parent
commit
d6404f8f09
39 ha cambiato i file con 1016 aggiunte e 222 eliminazioni
  1. 2 1
      src/main/java/com/izouma/dingdong/domain/BankCard.java
  2. 12 1
      src/main/java/com/izouma/dingdong/domain/MoneyRecord.java
  3. 21 10
      src/main/java/com/izouma/dingdong/domain/WithdrawApply.java
  4. 5 1
      src/main/java/com/izouma/dingdong/domain/merchant/Goods.java
  5. 4 5
      src/main/java/com/izouma/dingdong/dto/MerchantDTO.java
  6. 18 0
      src/main/java/com/izouma/dingdong/enums/FinancialType.java
  7. 3 3
      src/main/java/com/izouma/dingdong/enums/WithdrawStatus.java
  8. 1 1
      src/main/java/com/izouma/dingdong/repo/BankCardRepo.java
  9. 11 0
      src/main/java/com/izouma/dingdong/repo/MoneyRecordRepo.java
  10. 9 1
      src/main/java/com/izouma/dingdong/repo/WithdrawApplyRepo.java
  11. 14 0
      src/main/java/com/izouma/dingdong/service/MoneyRecordService.java
  12. 22 8
      src/main/java/com/izouma/dingdong/service/OrderInfoService.java
  13. 22 9
      src/main/java/com/izouma/dingdong/service/WithdrawApplyService.java
  14. 5 3
      src/main/java/com/izouma/dingdong/service/merchant/MerchantService.java
  15. 1 0
      src/main/java/com/izouma/dingdong/service/merchant/SalesService.java
  16. 5 3
      src/main/java/com/izouma/dingdong/web/BankCardController.java
  17. 67 0
      src/main/java/com/izouma/dingdong/web/MoneyRecordController.java
  18. 17 6
      src/main/java/com/izouma/dingdong/web/OrderInfoController.java
  19. 93 0
      src/main/java/com/izouma/dingdong/web/WithdrawApplyController.java
  20. 2 2
      src/main/java/com/izouma/dingdong/web/backstage/BlackListController.java
  21. 0 1
      src/main/java/com/izouma/dingdong/web/merchant/MerchantController.java
  22. 15 8
      src/main/java/com/izouma/dingdong/web/user/UserCouponController.java
  23. 1 0
      src/main/resources/genjson/MoneyRecord.json
  24. 24 8
      src/main/vue/src/router.js
  25. 51 48
      src/main/vue/src/views/CouponList.vue
  26. 26 4
      src/main/vue/src/views/OrderInfoEdit.vue
  27. 1 1
      src/main/vue/src/views/OrderInfoList.vue
  28. 149 76
      src/main/vue/src/views/UserEdit.vue
  29. 2 2
      src/main/vue/src/views/UserList.vue
  30. 0 1
      src/main/vue/src/views/UserOrderList.vue
  31. 0 0
      src/main/vue/src/views/backstage/BackUserEdit.vue
  32. 0 0
      src/main/vue/src/views/backstage/BackUserList.vue
  33. 13 6
      src/main/vue/src/views/backstage/BlackListList.vue
  34. 107 0
      src/main/vue/src/views/backstage/WithdrawApplyEdit.vue
  35. 232 0
      src/main/vue/src/views/backstage/WithdrawApplyList.vue
  36. 0 0
      src/main/vue/src/views/merchant/GoodsEdit.vue
  37. 4 4
      src/main/vue/src/views/merchant/GoodsList.vue
  38. 9 6
      src/main/vue/src/views/merchant/MerchantEdit.vue
  39. 48 3
      src/main/vue/src/views/merchant/MerchantList.vue

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

@@ -14,10 +14,11 @@ import javax.persistence.Entity;
 @AllArgsConstructor
 @AllArgsConstructor
 @NoArgsConstructor
 @NoArgsConstructor
 @Builder
 @Builder
-@Where(clause = "enabled = 1")
+//@Where(clause = "enabled = 1")
 @ApiModel(value = "用户", description = "用户")
 @ApiModel(value = "用户", description = "用户")
 public class BankCard extends BaseEntity {
 public class BankCard extends BaseEntity {
 
 
+    //商家端和骑手端的用户Id
     @ApiModelProperty(value = "用户ID", name = "userId")
     @ApiModelProperty(value = "用户ID", name = "userId")
     private Long userId;
     private Long userId;
 
 

+ 12 - 1
src/main/java/com/izouma/dingdong/domain/MoneyRecord.java

@@ -1,5 +1,6 @@
 package com.izouma.dingdong.domain;
 package com.izouma.dingdong.domain;
 
 
+import com.izouma.dingdong.enums.FinancialType;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
@@ -9,6 +10,8 @@ import lombok.NoArgsConstructor;
 
 
 import javax.persistence.Column;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 
 
@@ -26,6 +29,13 @@ public class MoneyRecord extends BaseEntity {
     @ApiModelProperty(value = "消费名称", name = "name")
     @ApiModelProperty(value = "消费名称", name = "name")
     private String name;
     private String name;
 
 
+    @ApiModelProperty(value = "流水号",name = "num")
+    private String num;
+
+    @Enumerated(EnumType.STRING)
+    @ApiModelProperty(value = "类型", name = "type")
+    private FinancialType type;
+
     @ApiModelProperty(value = "时间", name = "time")
     @ApiModelProperty(value = "时间", name = "time")
     private LocalDateTime time;
     private LocalDateTime time;
 
 
@@ -33,6 +43,7 @@ public class MoneyRecord extends BaseEntity {
     @ApiModelProperty(value = "金额", name = "amount")
     @ApiModelProperty(value = "金额", name = "amount")
     private BigDecimal amount;
     private BigDecimal amount;
 
 
-
+    @ApiModelProperty(value = "备注", name = "remark")
+    private String remark;
 
 
 }
 }

+ 21 - 10
src/main/java/com/izouma/dingdong/domain/WithdrawApply.java

@@ -1,5 +1,6 @@
 package com.izouma.dingdong.domain;
 package com.izouma.dingdong.domain;
 
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.izouma.dingdong.annotations.Searchable;
 import com.izouma.dingdong.annotations.Searchable;
 import com.izouma.dingdong.enums.PayMethod;
 import com.izouma.dingdong.enums.PayMethod;
 import com.izouma.dingdong.enums.WithdrawStatus;
 import com.izouma.dingdong.enums.WithdrawStatus;
@@ -9,11 +10,11 @@ import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Builder;
 import lombok.Data;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NoArgsConstructor;
+import org.hibernate.annotations.NotFound;
+import org.hibernate.annotations.NotFoundAction;
+import org.hibernate.annotations.Where;
 
 
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
+import javax.persistence.*;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 
 
@@ -22,6 +23,7 @@ import java.time.LocalDateTime;
 @AllArgsConstructor
 @AllArgsConstructor
 @NoArgsConstructor
 @NoArgsConstructor
 @Builder
 @Builder
+@Where(clause = "enabled = 1")
 @ApiModel(value = "提现申请", description = "提现申请")
 @ApiModel(value = "提现申请", description = "提现申请")
 public class WithdrawApply extends BaseEntity {
 public class WithdrawApply extends BaseEntity {
     @ApiModelProperty(value = "用户ID", name = "userId")
     @ApiModelProperty(value = "用户ID", name = "userId")
@@ -34,21 +36,20 @@ public class WithdrawApply extends BaseEntity {
 //    @ApiModelProperty(value = "工号", name = "jobNumber")
 //    @ApiModelProperty(value = "工号", name = "jobNumber")
 //    private String jobNumber;
 //    private String jobNumber;
 
 
-    @ApiModelProperty(value = "金额",name = "amount")
+    @ApiModelProperty(value = "金额", name = "amount")
     private BigDecimal amount;
     private BigDecimal amount;
 
 
     private Long bankCardId;
     private Long bankCardId;
 
 
-    @Searchable
-    @ApiModelProperty(value = "卡号", name = "cardId")
-    private String cardNo;
-//
+//    @Searchable
+//    @ApiModelProperty(value = "卡号", name = "cardId")
+//    private String cardNo;
+
 //    @Searchable
 //    @Searchable
 //    @ApiModelProperty(value = "真实姓名", name = "realName")
 //    @ApiModelProperty(value = "真实姓名", name = "realName")
 //    private String realName;
 //    private String realName;
 
 
     @ApiModelProperty(value = "是否成功", name = "consent")
     @ApiModelProperty(value = "是否成功", name = "consent")
-    @Column(nullable = false)
     private Boolean consent;
     private Boolean consent;
 
 
     @ApiModelProperty(value = "提现时间", name = "withdrawTime")
     @ApiModelProperty(value = "提现时间", name = "withdrawTime")
@@ -61,5 +62,15 @@ public class WithdrawApply extends BaseEntity {
     @ApiModelProperty(value = "提现状态", name = "status")
     @ApiModelProperty(value = "提现状态", name = "status")
     private WithdrawStatus status;
     private WithdrawStatus status;
 
 
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "bankCardId", insertable = false, updatable = false, foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
+    @NotFound(action = NotFoundAction.IGNORE)
+//    @Transient
+    @ExcelIgnore
+    private BankCard bankCard;
+
+    @Builder.Default
+    @Column(nullable = false)
+    private Boolean enabled = true;
 
 
 }
 }

+ 5 - 1
src/main/java/com/izouma/dingdong/domain/merchant/Goods.java

@@ -1,5 +1,6 @@
 package com.izouma.dingdong.domain.merchant;
 package com.izouma.dingdong.domain.merchant;
 
 
+import com.izouma.dingdong.converter.StringArrayConverter;
 import com.izouma.dingdong.domain.BaseEntity;
 import com.izouma.dingdong.domain.BaseEntity;
 import com.izouma.dingdong.enums.ApplyStatus;
 import com.izouma.dingdong.enums.ApplyStatus;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
@@ -11,6 +12,7 @@ import javax.persistence.*;
 import java.io.Serializable;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.time.LocalTime;
 import java.time.LocalTime;
+import java.util.List;
 
 
 @EqualsAndHashCode(callSuper = true)
 @EqualsAndHashCode(callSuper = true)
 @Data
 @Data
@@ -32,8 +34,10 @@ public class Goods extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "简介", name = "introduction")
     @ApiModelProperty(value = "简介", name = "introduction")
     private String introduction;
     private String introduction;
 
 
+    @Column(columnDefinition = "text")
+    @Convert(converter = StringArrayConverter.class)
     @ApiModelProperty(value = "图片", name = "img")
     @ApiModelProperty(value = "图片", name = "img")
-    private String img;
+    private List<String> img;
 
 
     @ApiModelProperty(value = "库存", name = "inventory")
     @ApiModelProperty(value = "库存", name = "inventory")
     private Integer inventory;
     private Integer inventory;

+ 4 - 5
src/main/java/com/izouma/dingdong/dto/MerchantDTO.java

@@ -50,6 +50,7 @@ public class MerchantDTO {
         banner = merchant.getBanner();
         banner = merchant.getBanner();
         logo = merchantSettings.getLogo();
         logo = merchantSettings.getLogo();
         proclamation = merchantSettings.getProclamation();
         proclamation = merchantSettings.getProclamation();
+        userId = merchant.getUserId();
 //        money = merchant.getMoney();
 //        money = merchant.getMoney();
     }
     }
 
 
@@ -107,11 +108,6 @@ public class MerchantDTO {
     @ApiModelProperty(value = "新用户优惠", name = "newUser")
     @ApiModelProperty(value = "新用户优惠", name = "newUser")
     private BigDecimal newUser;
     private BigDecimal newUser;
 
 
-    /*    @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.DETACH})
-        @JoinTable(
-                name = "mer_cate",
-                joinColumns = {@JoinColumn(name = "mer_id", referencedColumnName = "id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))},
-                inverseJoinColumns = {@JoinColumn(name = "cate_name", referencedColumnName = "name", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))})*/
     @BatchSize(size = 20)
     @BatchSize(size = 20)
     @ApiModelProperty(value = "经营品类", name = "category")
     @ApiModelProperty(value = "经营品类", name = "category")
     private Set<Category> category;
     private Set<Category> category;
@@ -154,4 +150,7 @@ public class MerchantDTO {
     private String proclamation;
     private String proclamation;
 
 
 //    private BigDecimal money;
 //    private BigDecimal money;
+
+    @ApiModelProperty(value = "用户id", name = "userId")
+    private Long userId;
 }
 }

+ 18 - 0
src/main/java/com/izouma/dingdong/enums/FinancialType.java

@@ -0,0 +1,18 @@
+package com.izouma.dingdong.enums;
+
+public enum FinancialType {
+    BUY("购买"),
+    INCOME("收入"),
+    REFUND("退款"),
+    WITHDRAW("提现");
+
+    private final String description;
+
+    FinancialType(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 3 - 3
src/main/java/com/izouma/dingdong/enums/WithdrawStatus.java

@@ -1,9 +1,9 @@
 package com.izouma.dingdong.enums;
 package com.izouma.dingdong.enums;
 
 
 public enum WithdrawStatus {
 public enum WithdrawStatus {
-    SUCCESS("提现成功"),
-    FAIL("提现失败"),
-    PENDING("待处理");
+    SUCCESS("完成"),
+    FAIL("拒绝"),
+    PENDING("待审核");
     private final String description;
     private final String description;
 
 
     WithdrawStatus(String description) {
     WithdrawStatus(String description) {

+ 1 - 1
src/main/java/com/izouma/dingdong/repo/BankCardRepo.java

@@ -16,5 +16,5 @@ public interface BankCardRepo extends JpaRepository<BankCard, Long>, JpaSpecific
     void deleteById(Long id);
     void deleteById(Long id);
 
 
     //按userId查找所有卡号
     //按userId查找所有卡号
-    List<BankCard> findAllByUserId(Long userId);
+    List<BankCard> findAllByUserIdAndEnabledTrue(Long userId);
 }
 }

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

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

+ 9 - 1
src/main/java/com/izouma/dingdong/repo/WithdrawalsApplyRepo.java → src/main/java/com/izouma/dingdong/repo/WithdrawApplyRepo.java

@@ -5,10 +5,13 @@ import com.izouma.dingdong.domain.WithdrawApply;
 import com.izouma.dingdong.enums.WithdrawStatus;
 import com.izouma.dingdong.enums.WithdrawStatus;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
 
 
+import javax.transaction.Transactional;
 import java.util.List;
 import java.util.List;
 
 
-public interface WithdrawalsApplyRepo extends JpaRepository<WithdrawApply, Long>, JpaSpecificationExecutor<WithdrawApply> {
+public interface WithdrawApplyRepo extends JpaRepository<WithdrawApply, Long>, JpaSpecificationExecutor<WithdrawApply> {
 
 
     //查看个人的提现记录
     //查看个人的提现记录
     List<WithdrawApply> findByUserId(Long userId);
     List<WithdrawApply> findByUserId(Long userId);
@@ -17,4 +20,9 @@ public interface WithdrawalsApplyRepo extends JpaRepository<WithdrawApply, Long>
 
 
     List<WithdrawApply> findByUserIdAndConsentFalse(Long userId);
     List<WithdrawApply> findByUserIdAndConsentFalse(Long userId);
 
 
+    @Query("update WithdrawApply t set t.enabled = false where t.id = ?1")
+    @Modifying
+    @Transactional
+    void deleteById(Long id);
+
 }
 }

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

@@ -0,0 +1,14 @@
+package com.izouma.dingdong.service;
+
+import com.izouma.dingdong.domain.MoneyRecord;
+import com.izouma.dingdong.repo.MoneyRecordRepo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class MoneyRecordService {
+
+    private MoneyRecordRepo moneyRecordRepo;
+
+}

+ 22 - 8
src/main/java/com/izouma/dingdong/service/OrderInfoService.java

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.izouma.dingdong.converter.StringArrayConverter;
 import com.izouma.dingdong.converter.StringArrayConverter;
+import com.izouma.dingdong.domain.MoneyRecord;
 import com.izouma.dingdong.domain.OrderInfo;
 import com.izouma.dingdong.domain.OrderInfo;
 import com.izouma.dingdong.domain.user.ShoppingCart;
 import com.izouma.dingdong.domain.user.ShoppingCart;
 import com.izouma.dingdong.domain.User;
 import com.izouma.dingdong.domain.User;
@@ -13,19 +14,17 @@ import com.izouma.dingdong.domain.user.Address;
 import com.izouma.dingdong.domain.Coupon;
 import com.izouma.dingdong.domain.Coupon;
 import com.izouma.dingdong.domain.user.UserCoupon;
 import com.izouma.dingdong.domain.user.UserCoupon;
 import com.izouma.dingdong.dto.UserOrderDTO;
 import com.izouma.dingdong.dto.UserOrderDTO;
+import com.izouma.dingdong.enums.FinancialType;
 import com.izouma.dingdong.enums.MerchantStatus;
 import com.izouma.dingdong.enums.MerchantStatus;
 import com.izouma.dingdong.enums.OrderStatus;
 import com.izouma.dingdong.enums.OrderStatus;
 import com.izouma.dingdong.enums.RiderStatus;
 import com.izouma.dingdong.enums.RiderStatus;
 import com.izouma.dingdong.exception.BusinessException;
 import com.izouma.dingdong.exception.BusinessException;
-import com.izouma.dingdong.repo.OrderGoodsSpecRepo;
-import com.izouma.dingdong.repo.OrderInfoRepo;
+import com.izouma.dingdong.repo.*;
 import com.izouma.dingdong.repo.user.ShoppingCartRepo;
 import com.izouma.dingdong.repo.user.ShoppingCartRepo;
-import com.izouma.dingdong.repo.UserRepo;
 import com.izouma.dingdong.repo.merchant.GoodsRepo;
 import com.izouma.dingdong.repo.merchant.GoodsRepo;
 import com.izouma.dingdong.repo.merchant.MerchantRepo;
 import com.izouma.dingdong.repo.merchant.MerchantRepo;
 import com.izouma.dingdong.repo.merchant.MerchantSettingsRepo;
 import com.izouma.dingdong.repo.merchant.MerchantSettingsRepo;
 import com.izouma.dingdong.repo.user.AddressRepo;
 import com.izouma.dingdong.repo.user.AddressRepo;
-import com.izouma.dingdong.repo.CouponRepo;
 import com.izouma.dingdong.repo.user.UserCouponRepo;
 import com.izouma.dingdong.repo.user.UserCouponRepo;
 import com.izouma.dingdong.service.merchant.GoodsService;
 import com.izouma.dingdong.service.merchant.GoodsService;
 import com.izouma.dingdong.service.merchant.MerchantService;
 import com.izouma.dingdong.service.merchant.MerchantService;
@@ -56,6 +55,7 @@ public class OrderInfoService {
     private SalesService salesService;
     private SalesService salesService;
     private MerchantRepo merchantRepo;
     private MerchantRepo merchantRepo;
     private UserCouponRepo userCouponRepo;
     private UserCouponRepo userCouponRepo;
+    private MoneyRecordRepo moneyRecordRepo;
 
 
     /*
     /*
     用户下单
     用户下单
@@ -95,7 +95,7 @@ public class OrderInfoService {
         //orderInfo.setUserAddress(address.getAddressName());
         //orderInfo.setUserAddress(address.getAddressName());
         orderInfo.setUserAddress(JSONObject.toJSONString(address));
         orderInfo.setUserAddress(JSONObject.toJSONString(address));
 
 
-       // 使用优惠券(满减优惠券)
+        // 使用优惠券(满减优惠券)
         if (ObjectUtil.isNotNull(userOrderDTO.getUserCouponId())) {
         if (ObjectUtil.isNotNull(userOrderDTO.getUserCouponId())) {
             //Coupon coupon = couponRepo.findById(userOrderDTO.getCouponId()).orElseThrow(new BusinessException("优惠券不存在"));
             //Coupon coupon = couponRepo.findById(userOrderDTO.getCouponId()).orElseThrow(new BusinessException("优惠券不存在"));
             UserCoupon userCoupon = userCouponRepo.findById(userOrderDTO.getUserCouponId()).orElseThrow(new BusinessException("无此优惠券"));
             UserCoupon userCoupon = userCouponRepo.findById(userOrderDTO.getUserCouponId()).orElseThrow(new BusinessException("无此优惠券"));
@@ -104,8 +104,8 @@ public class OrderInfoService {
             if (coupon.getEndDate().isAfter(now.toLocalDate()) && !userCoupon.getIsUsed()) {
             if (coupon.getEndDate().isAfter(now.toLocalDate()) && !userCoupon.getIsUsed()) {
                 //判断是否限制手机号
                 //判断是否限制手机号
                 if (ObjectUtil.isNotNull(userCoupon.getPhone())) {
                 if (ObjectUtil.isNotNull(userCoupon.getPhone())) {
-                    if (!address.getPhone().equals(userCoupon.getPhone())){
-                        throw new BusinessException("限手机"+userCoupon.getPhone()+"使用");
+                    if (!address.getPhone().equals(userCoupon.getPhone())) {
+                        throw new BusinessException("限手机" + userCoupon.getPhone() + "使用");
                     }
                     }
                 }
                 }
 
 
@@ -184,7 +184,9 @@ public class OrderInfoService {
         OrderInfo orderInfo = orderInfoRepo.findById(orderId).orElseThrow(new BusinessException("无订单"));
         OrderInfo orderInfo = orderInfoRepo.findById(orderId).orElseThrow(new BusinessException("无订单"));
         if (pass) {
         if (pass) {
             orderInfo.setMerchantStatus(MerchantStatus.RECEIVED);
             orderInfo.setMerchantStatus(MerchantStatus.RECEIVED);
-            //通知骑手
+            //通知骑手 手动
+            orderInfo.setRiderId(151L);
+
         } else {
         } else {
             orderInfo.setMerchantStatus(MerchantStatus.REJECTED);
             orderInfo.setMerchantStatus(MerchantStatus.REJECTED);
             orderInfo.setCancel(true);
             orderInfo.setCancel(true);
@@ -257,6 +259,18 @@ public class OrderInfoService {
                         userMer.setMoney(userMer.getMoney().add(orderInfo.getRealAmount().subtract(orderInfo.getDeliveryAmount())));
                         userMer.setMoney(userMer.getMoney().add(orderInfo.getRealAmount().subtract(orderInfo.getDeliveryAmount())));
                         userRepo.save(userMer);
                         userRepo.save(userMer);
 
 
+                        //记录到对账单
+                        moneyRecordRepo.save(
+                                MoneyRecord.builder()
+                                        .name("购买")
+                                        .type(FinancialType.INCOME)
+                                        .time(LocalDateTime.now())
+                                        .amount(orderInfo.getRealAmount())
+                                        .userId(merchantRepo.findUserIdById(orderInfo.getMerchantId()))
+                                        .build()
+                        );
+
+
                         //骑手应得
                         //骑手应得
 
 
 
 

+ 22 - 9
src/main/java/com/izouma/dingdong/service/WithdrawApplyService.java

@@ -2,16 +2,16 @@ package com.izouma.dingdong.service;
 
 
 
 
 import com.izouma.dingdong.domain.BankCard;
 import com.izouma.dingdong.domain.BankCard;
+import com.izouma.dingdong.domain.MoneyRecord;
 import com.izouma.dingdong.domain.User;
 import com.izouma.dingdong.domain.User;
 import com.izouma.dingdong.domain.WithdrawApply;
 import com.izouma.dingdong.domain.WithdrawApply;
-import com.izouma.dingdong.domain.merchant.Merchant;
-import com.izouma.dingdong.enums.Identity;
+import com.izouma.dingdong.enums.FinancialType;
 import com.izouma.dingdong.enums.WithdrawStatus;
 import com.izouma.dingdong.enums.WithdrawStatus;
 import com.izouma.dingdong.exception.BusinessException;
 import com.izouma.dingdong.exception.BusinessException;
 import com.izouma.dingdong.repo.BankCardRepo;
 import com.izouma.dingdong.repo.BankCardRepo;
+import com.izouma.dingdong.repo.MoneyRecordRepo;
 import com.izouma.dingdong.repo.UserRepo;
 import com.izouma.dingdong.repo.UserRepo;
-import com.izouma.dingdong.repo.WithdrawalsApplyRepo;
-import com.izouma.dingdong.repo.merchant.MerchantRepo;
+import com.izouma.dingdong.repo.WithdrawApplyRepo;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -24,24 +24,25 @@ import java.time.LocalDateTime;
 @Service
 @Service
 public class WithdrawApplyService {
 public class WithdrawApplyService {
 
 
-    private WithdrawalsApplyRepo withdrawalsApplyRepo;
+    private WithdrawApplyRepo withdrawalsApplyRepo;
     private UserRepo userRepo;
     private UserRepo userRepo;
     private BankCardRepo bankCardRepo;
     private BankCardRepo bankCardRepo;
+    private MoneyRecordRepo moneyRecordRepo;
 
 
     /*
     /*
     提现申请
     提现申请
      */
      */
     @Transactional
     @Transactional
     public WithdrawApply apply(Long userId, BigDecimal amount, Long bankCardId) {
     public WithdrawApply apply(Long userId, BigDecimal amount, Long bankCardId) {
-        if (BigDecimal.ZERO.compareTo(amount) <= 0) {
+        if (BigDecimal.ZERO.compareTo(amount) >= 0) {
             throw new BusinessException("提现金额小于等于0");
             throw new BusinessException("提现金额小于等于0");
         }
         }
 
 
         User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
         User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
         BankCard bankCard = bankCardRepo.findById(bankCardId).orElseThrow(new BusinessException("银行卡信息不存在"));
         BankCard bankCard = bankCardRepo.findById(bankCardId).orElseThrow(new BusinessException("银行卡信息不存在"));
 
 
-        if (BigDecimal.ZERO.compareTo(user.getMoney()) <= 0) {
-            throw new BusinessException("当前可提现金额小于等于0");
+        if (BigDecimal.ZERO.compareTo(user.getMoney()) == 0) {
+            throw new BusinessException("当前可提现金额0");
         }
         }
         if (amount.compareTo(user.getMoney()) > 0) {
         if (amount.compareTo(user.getMoney()) > 0) {
             throw new BusinessException("提现金额大于余额");
             throw new BusinessException("提现金额大于余额");
@@ -50,10 +51,10 @@ public class WithdrawApplyService {
         WithdrawApply apply = WithdrawApply.builder()
         WithdrawApply apply = WithdrawApply.builder()
                 .amount(amount)
                 .amount(amount)
                 .bankCardId(bankCardId)
                 .bankCardId(bankCardId)
-                .cardNo(bankCard.getCardNo())
                 .status(WithdrawStatus.PENDING)
                 .status(WithdrawStatus.PENDING)
                 .userId(userId)
                 .userId(userId)
                 .withdrawTime(LocalDateTime.now())
                 .withdrawTime(LocalDateTime.now())
+                //.bankCard(bankCard)
                 .build();
                 .build();
 
 
         return withdrawalsApplyRepo.save(apply);
         return withdrawalsApplyRepo.save(apply);
@@ -78,6 +79,18 @@ public class WithdrawApplyService {
             user.setMoney(user.getMoney().subtract(withdrawals.getAmount()));
             user.setMoney(user.getMoney().subtract(withdrawals.getAmount()));
             userRepo.save(user);
             userRepo.save(user);
 
 
+
+            //记录到对账单
+            moneyRecordRepo.save(
+                    MoneyRecord.builder()
+                            .name("提现")
+                            .userId(withdrawals.getUserId())
+                            .time(LocalDateTime.now())
+                            .type(FinancialType.WITHDRAW)
+                            .remark(withdrawals.getBankCard().getBankName())
+                            .build()
+            );
+
         } else {
         } else {
             withdrawals.setConsent(false);
             withdrawals.setConsent(false);
             withdrawals.setStatus(WithdrawStatus.FAIL);
             withdrawals.setStatus(WithdrawStatus.FAIL);

+ 5 - 3
src/main/java/com/izouma/dingdong/service/merchant/MerchantService.java

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollUtil;
 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.domain.BankCard;
 import com.izouma.dingdong.domain.User;
 import com.izouma.dingdong.domain.User;
 import com.izouma.dingdong.domain.merchant.Merchant;
 import com.izouma.dingdong.domain.merchant.Merchant;
 import com.izouma.dingdong.domain.merchant.MerchantClassification;
 import com.izouma.dingdong.domain.merchant.MerchantClassification;
@@ -12,6 +13,7 @@ import com.izouma.dingdong.dto.MerchantDTO;
 import com.izouma.dingdong.enums.ApplyStatus;
 import com.izouma.dingdong.enums.ApplyStatus;
 import com.izouma.dingdong.enums.Identity;
 import com.izouma.dingdong.enums.Identity;
 import com.izouma.dingdong.exception.BusinessException;
 import com.izouma.dingdong.exception.BusinessException;
+import com.izouma.dingdong.repo.BankCardRepo;
 import com.izouma.dingdong.repo.UserRepo;
 import com.izouma.dingdong.repo.UserRepo;
 import com.izouma.dingdong.repo.merchant.MerchantClassificationRepo;
 import com.izouma.dingdong.repo.merchant.MerchantClassificationRepo;
 import com.izouma.dingdong.repo.merchant.MerchantRepo;
 import com.izouma.dingdong.repo.merchant.MerchantRepo;
@@ -47,6 +49,8 @@ public class MerchantService {
 
 
     private UserService userService;
     private UserService userService;
 
 
+    private BankCardRepo bankCardRepo;
+
 
 
     /*
     /*
     商户注册申请
     商户注册申请
@@ -81,7 +85,6 @@ public class MerchantService {
 //    user.setIdentity(Identity.MERCHANT);
 //    user.setIdentity(Identity.MERCHANT);
 //        userRepo.save(user);
 //        userRepo.save(user);
 
 
-
         //新建商家
         //新建商家
         Merchant merchant = new Merchant();
         Merchant merchant = new Merchant();
         MerchantSettings merchantSettings = new MerchantSettings();
         MerchantSettings merchantSettings = new MerchantSettings();
@@ -115,7 +118,6 @@ public class MerchantService {
 
 
         merchantSettingsRepo.save(merchantSettings);
         merchantSettingsRepo.save(merchantSettings);
 
 
-
         return merchantDTO;
         return merchantDTO;
     }
     }
 
 
@@ -140,7 +142,7 @@ public class MerchantService {
         BeanUtil.copyProperties(dto, merchantSettings);
         BeanUtil.copyProperties(dto, merchantSettings);
         merchantRepo.save(merchant);
         merchantRepo.save(merchant);
         merchantSettingsRepo.save(merchantSettings);
         merchantSettingsRepo.save(merchantSettings);
-        return merchantDTO;
+        return dto;
     }
     }
 
 
     /**
     /**

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

@@ -54,6 +54,7 @@ public class SalesService {
                                 .dayBad(0)
                                 .dayBad(0)
                                 .popularity(0)
                                 .popularity(0)
                                 .praise(0)
                                 .praise(0)
+                                .daySales(0)
                                 .build();
                                 .build();
                     }
                     }
 
 

+ 5 - 3
src/main/java/com/izouma/dingdong/web/BankCardController.java

@@ -1,4 +1,5 @@
 package com.izouma.dingdong.web;
 package com.izouma.dingdong.web;
+
 import com.izouma.dingdong.domain.BankCard;
 import com.izouma.dingdong.domain.BankCard;
 import com.izouma.dingdong.service.BankCardService;
 import com.izouma.dingdong.service.BankCardService;
 import com.izouma.dingdong.dto.PageQuery;
 import com.izouma.dingdong.dto.PageQuery;
@@ -10,6 +11,7 @@ import com.izouma.dingdong.utils.excel.ExcelUtils;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageImpl;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
@@ -39,7 +41,7 @@ public class BankCardController extends BaseController {
     //@PreAuthorize("hasRole('ADMIN')")
     //@PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/all")
     @GetMapping("/all")
     public Page<BankCard> all(PageQuery pageQuery) {
     public Page<BankCard> all(PageQuery pageQuery) {
-        return bankCardRepo.findAll(toSpecification(pageQuery,BankCard.class), toPageRequest(pageQuery));
+        return bankCardRepo.findAll(toSpecification(pageQuery, BankCard.class), toPageRequest(pageQuery));
     }
     }
 
 
     @GetMapping("/get/{id}")
     @GetMapping("/get/{id}")
@@ -61,8 +63,8 @@ public class BankCardController extends BaseController {
 
 
     @GetMapping("/my")
     @GetMapping("/my")
     @ApiOperation("我的银行卡信息(包括商家和骑手)")
     @ApiOperation("我的银行卡信息(包括商家和骑手)")
-    public List<BankCard> my(){
-        return bankCardRepo.findAllByUserId(SecurityUtils.getAuthenticatedUser().getId());
+    public Page<BankCard> my(PageQuery pageQuery) {
+        return new PageImpl<>(bankCardRepo.findAllByUserIdAndEnabledTrue(SecurityUtils.getAuthenticatedUser().getId()), toPageRequest(pageQuery), pageQuery.getSize());
     }
     }
 
 
 }
 }

+ 67 - 0
src/main/java/com/izouma/dingdong/web/MoneyRecordController.java

@@ -0,0 +1,67 @@
+package com.izouma.dingdong.web;
+import com.izouma.dingdong.domain.MoneyRecord;
+import com.izouma.dingdong.service.MoneyRecordService;
+import com.izouma.dingdong.dto.PageQuery;
+import com.izouma.dingdong.exception.BusinessException;
+import com.izouma.dingdong.repo.MoneyRecordRepo;
+import com.izouma.dingdong.utils.ObjUtils;
+import com.izouma.dingdong.utils.SecurityUtils;
+import com.izouma.dingdong.utils.excel.ExcelUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageImpl;
+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("/moneyRecord")
+@AllArgsConstructor
+public class MoneyRecordController extends BaseController {
+    private MoneyRecordService moneyRecordService;
+    private MoneyRecordRepo moneyRecordRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public MoneyRecord save(@RequestBody MoneyRecord record) {
+        if (record.getId() != null) {
+            MoneyRecord orig = moneyRecordRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return moneyRecordRepo.save(orig);
+        }
+        return moneyRecordRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @GetMapping("/all")
+    public Page<MoneyRecord> all(PageQuery pageQuery) {
+        return moneyRecordRepo.findAll(toSpecification(pageQuery,MoneyRecord.class), toPageRequest(pageQuery));
+    }
+
+    @GetMapping("/get/{id}")
+    public MoneyRecord get(@PathVariable Long id) {
+        return moneyRecordRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        moneyRecordRepo.deleteById(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<MoneyRecord> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+
+    @GetMapping("/my")
+    public Page<MoneyRecord> my(PageQuery pageQuery){
+        return new PageImpl<>(moneyRecordRepo.findAllByUserId(SecurityUtils.getAuthenticatedUser().getId()),toPageRequest(pageQuery),pageQuery.getSize());
+    }
+}
+

+ 17 - 6
src/main/java/com/izouma/dingdong/web/OrderInfoController.java

@@ -3,6 +3,7 @@ package com.izouma.dingdong.web;
 import com.izouma.dingdong.domain.OrderInfo;
 import com.izouma.dingdong.domain.OrderInfo;
 import com.izouma.dingdong.dto.UserOrderDTO;
 import com.izouma.dingdong.dto.UserOrderDTO;
 
 
+import com.izouma.dingdong.enums.MerchantStatus;
 import com.izouma.dingdong.service.OrderInfoService;
 import com.izouma.dingdong.service.OrderInfoService;
 import com.izouma.dingdong.dto.PageQuery;
 import com.izouma.dingdong.dto.PageQuery;
 import com.izouma.dingdong.exception.BusinessException;
 import com.izouma.dingdong.exception.BusinessException;
@@ -13,6 +14,7 @@ import com.izouma.dingdong.utils.excel.ExcelUtils;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageImpl;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
@@ -72,16 +74,16 @@ public class OrderInfoController extends BaseController {
 
 
     @GetMapping("/my")
     @GetMapping("/my")
     @ApiOperation("个人订单")
     @ApiOperation("个人订单")
-    public List<OrderInfo> my() {
-        return orderInfoService.my(SecurityUtils.getAuthenticatedUser().getId());
+    public Page<OrderInfo> my(PageQuery pageQuery) {
+        return new PageImpl<>(orderInfoService.my(SecurityUtils.getAuthenticatedUser().getId()),toPageRequest(pageQuery),pageQuery.getSize());
     }
     }
 
 
 
 
-    @GetMapping("/list")
+    @PostMapping("/list")
     @ApiOperation("/按userId查订单")
     @ApiOperation("/按userId查订单")
-    public List<OrderInfo> list(Long id) {
+    public Page<OrderInfo> list(Long id,PageQuery pageQuery) {
         //        new PageImpl<>(list,toPageRequest(pageQuery),pageQuery.getSize())
         //        new PageImpl<>(list,toPageRequest(pageQuery),pageQuery.getSize())
-        return orderInfoService.my(id);
+        return new PageImpl<>(orderInfoService.my(id),toPageRequest(pageQuery),pageQuery.getSize());
     }
     }
 
 
     @GetMapping("/received")
     @GetMapping("/received")
@@ -90,7 +92,16 @@ public class OrderInfoController extends BaseController {
         return orderInfoService.merReceiveOrder(orderId, pass);
         return orderInfoService.merReceiveOrder(orderId, pass);
     }
     }
 
 
-    @GetMapping("/riderStatus")
+/*    @GetMapping("/updateMerStatus")
+    @ApiOperation("商家改状态")
+    public OrderInfo updateMerStatus(Long orderId, MerchantStatus status) {
+
+        return null;
+    }*/
+
+
+
+    @PostMapping("/riderStatus")
     @ApiOperation("骑手改变状态")
     @ApiOperation("骑手改变状态")
     public void riderStatus(Long orderId, Boolean pass) {
     public void riderStatus(Long orderId, Boolean pass) {
         orderInfoService.carryOut(orderId, pass);
         orderInfoService.carryOut(orderId, pass);

+ 93 - 0
src/main/java/com/izouma/dingdong/web/WithdrawApplyController.java

@@ -0,0 +1,93 @@
+package com.izouma.dingdong.web;
+
+import com.izouma.dingdong.domain.WithdrawApply;
+import com.izouma.dingdong.dto.PageQuery;
+import com.izouma.dingdong.enums.WithdrawStatus;
+import com.izouma.dingdong.exception.BusinessException;
+import com.izouma.dingdong.repo.WithdrawApplyRepo;
+import com.izouma.dingdong.service.WithdrawApplyService;
+import com.izouma.dingdong.utils.ObjUtils;
+import com.izouma.dingdong.utils.SecurityUtils;
+import com.izouma.dingdong.utils.excel.ExcelUtils;
+
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.List;
+
+@AllArgsConstructor
+@RestController
+@RequestMapping("/withdrawApply")
+public class WithdrawApplyController extends BaseController {
+    /*generatedStart*/
+    private WithdrawApplyService withdrawApplyService;
+
+    private WithdrawApplyRepo withdrawApplyRepo;
+    /*generatedEnd*/
+
+    /*generatedStart*/
+//    @PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public WithdrawApply save(@RequestBody WithdrawApply record) {
+        if (record.getId() != null) {
+            WithdrawApply orig = withdrawApplyRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return withdrawApplyRepo.save(orig);
+        }
+        return withdrawApplyRepo.save(record);
+    }
+
+
+    //    @PreAuthorize("hasRole('ADMIN')")
+    @GetMapping("/all")
+    public Page<WithdrawApply> all(PageQuery pageQuery) {
+        return withdrawApplyRepo.findAll(toSpecification(pageQuery, WithdrawApply.class), toPageRequest(pageQuery));
+    }
+
+    @GetMapping("/get/{id}")
+    public WithdrawApply get(@PathVariable Long id) {
+        return withdrawApplyRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        withdrawApplyRepo.deleteById(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<WithdrawApply> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+    /*generatedEnd*/
+
+    @GetMapping("/audit")
+    @ApiOperation("提现是否通过")
+    public WithdrawApply success(@RequestParam Long id, @RequestParam Boolean consent) {
+        return withdrawApplyService.audit(id, consent);
+    }
+
+    @PostMapping("/apply")
+    @ApiOperation("申请提现")
+    public WithdrawApply apply(@RequestParam BigDecimal amount, Long bankCardId) {
+        return withdrawApplyService.apply(SecurityUtils.getAuthenticatedUser().getId(), amount, bankCardId);
+    }
+
+    @PostMapping("/my")
+    @ApiOperation("提现未成功记录")
+    public List<WithdrawApply> my() {
+        return withdrawApplyRepo.findByUserIdAndConsentFalse(SecurityUtils.getAuthenticatedUser().getId());
+    }
+
+/*    @GetMapping("/name")
+    public Page<WithdrawApply> getWithdrawApplyApply(String search, Pageable pageable) {
+        return WithdrawApplyService.getWithdrawApplyApply(search, pageable);
+    }*/
+}
+

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

@@ -61,9 +61,9 @@ public class BlackListController extends BaseController {
         ExcelUtils.export(response, data);
         ExcelUtils.export(response, data);
     }
     }
 
 
-    @GetMapping("/move")
+    @PostMapping("/move")
     @ApiOperation("移入黑名单")
     @ApiOperation("移入黑名单")
-    public BlackList move(Long userId, String reason) {
+    public BlackList move(@RequestParam Long userId, @RequestParam String reason) {
         return blackListService.move(userId, reason);
         return blackListService.move(userId, reason);
     }
     }
 
 

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

@@ -102,6 +102,5 @@ public class MerchantController extends BaseController {
         Long merchantId = merchantService.findMerchantId(SecurityUtils.getAuthenticatedUser().getId());
         Long merchantId = merchantService.findMerchantId(SecurityUtils.getAuthenticatedUser().getId());
         merchantService.closeMer(merchantId);
         merchantService.closeMer(merchantId);
     }
     }
-
 }
 }
 
 

+ 15 - 8
src/main/java/com/izouma/dingdong/web/user/UserCouponController.java

@@ -1,5 +1,6 @@
 package com.izouma.dingdong.web.user;
 package com.izouma.dingdong.web.user;
 
 
+import com.izouma.dingdong.converter.StringArrayConverter;
 import com.izouma.dingdong.web.BaseController;
 import com.izouma.dingdong.web.BaseController;
 import com.izouma.dingdong.domain.user.UserCoupon;
 import com.izouma.dingdong.domain.user.UserCoupon;
 import com.izouma.dingdong.service.user.UserCouponService;
 import com.izouma.dingdong.service.user.UserCouponService;
@@ -41,7 +42,7 @@ public class UserCouponController extends BaseController {
     //@PreAuthorize("hasRole('ADMIN')")
     //@PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/all")
     @GetMapping("/all")
     public Page<UserCoupon> all(PageQuery pageQuery) {
     public Page<UserCoupon> all(PageQuery pageQuery) {
-        return userCouponRepo.findAll(toSpecification(pageQuery,UserCoupon.class), toPageRequest(pageQuery));
+        return userCouponRepo.findAll(toSpecification(pageQuery, UserCoupon.class), toPageRequest(pageQuery));
     }
     }
 
 
     @GetMapping("/get/{id}")
     @GetMapping("/get/{id}")
@@ -62,13 +63,19 @@ public class UserCouponController extends BaseController {
     }
     }
 
 
     @ApiOperation("后台发放优惠券")
     @ApiOperation("后台发放优惠券")
-    @GetMapping("/issue")
-    public void issue(Long userId,Long couponId){
-        UserCoupon.builder()
-                .couponId(couponId)
-                .isUsed(false)
-                .userId(userId)
-                .build();
+    @PostMapping("/issue")
+    public void issue(@RequestParam Long userId, String couponId) {
+        //转换
+        StringArrayConverter converter = new StringArrayConverter();
+        List<String> strings = converter.convertToEntityAttribute(couponId);
+        strings.forEach(id->{
+            UserCoupon build = UserCoupon.builder()
+                    .couponId(Long.parseLong(id))
+                    .isUsed(false)
+                    .userId(userId)
+                    .build();
+            userCouponRepo.save(build);
+        });
     }
     }
 }
 }
 
 

+ 1 - 0
src/main/resources/genjson/MoneyRecord.json

@@ -0,0 +1 @@
+{"tableName":"MoneyRecord","className":"MoneyRecord","remark":"对账单","genTable":true,"genClass":true,"genList":false,"genForm":false,"genRouter":false,"javaPath":"/Users/qiufangchao/Desktop/project/dingdong/src/main/java/com/izouma/dingdong","viewPath":"/Users/qiufangchao/Desktop/project/dingdong/src/main/vue/src/views","routerPath":"/Users/qiufangchao/Desktop/project/dingdong/src/main/vue/src","resourcesPath":"/Users/qiufangchao/Desktop/project/dingdong/src/main/resources","dataBaseType":"Mysql","fields":[{"name":"userId","modelName":"userId","remark":"用户ID","showInList":true,"showInForm":true,"formType":"number"},{"name":"name","modelName":"name","remark":"消费名称","showInList":true,"showInForm":true,"formType":"singleLineText"},{"name":"num","modelName":"num","remark":"流水号","showInList":true,"showInForm":true,"formType":"singleLineText"},{"name":"type","modelName":"type","remark":"类型","showInList":true,"showInForm":true,"formType":"select","apiFlag":"1","optionsValue":"[{\"label\":\"购买\",\"value\":\"BUY\"},{\"label\":\"退款\",\"value\":\"REFUND\"},{\"label\":\"提现\",\"value\":\"WITHDRAW\"}]"},{"name":"time","modelName":"time","remark":"时间","showInList":true,"showInForm":true,"formType":"datetime"},{"name":"amount","modelName":"amount","remark":"金额","showInList":true,"showInForm":true,"formType":"number"},{"name":"remark","modelName":"remark","remark":"备注","showInList":true,"showInForm":true,"formType":"singleLineText"}],"readTable":false,"dataSourceCode":"dataSource","genJson":"","subtables":[],"update":false,"basePackage":"com.izouma.dingdong","tablePackage":"com.izouma.dingdong.domain.MoneyRecord"}

+ 24 - 8
src/main/vue/src/router.js

@@ -82,7 +82,7 @@ const router = new Router({
                 {
                 {
                     path: '/goodsEdit',
                     path: '/goodsEdit',
                     name: 'GoodsEdit',
                     name: 'GoodsEdit',
-                    component: () => import(/* webpackChunkName: "goodsEdit" */ '@/views/GoodsEdit.vue'),
+                    component: () => import(/* webpackChunkName: "goodsEdit" */ '@/views/merchant/GoodsEdit.vue'),
                     meta: {
                     meta: {
                        title: '商品编辑',
                        title: '商品编辑',
                     },
                     },
@@ -90,7 +90,7 @@ const router = new Router({
                 {
                 {
                     path: '/goodsList',
                     path: '/goodsList',
                     name: 'GoodsList',
                     name: 'GoodsList',
-                    component: () => import(/* webpackChunkName: "goodsList" */ '@/views/GoodsList.vue'),
+                    component: () => import(/* webpackChunkName: "goodsList" */ '@/views/merchant/GoodsList.vue'),
                     meta: {
                     meta: {
                        title: '商品',
                        title: '商品',
                     },
                     },
@@ -297,17 +297,17 @@ const router = new Router({
                     },
                     },
                 },
                 },
                 {
                 {
-                    path: '/blackUserEdit',
-                    name: 'BlackUserEdit',
-                    component: () => import(/* webpackChunkName: "blackUserEdit" */ '@/views/backstage/BlackUserEdit.vue'),
+                    path: '/backUserEdit',
+                    name: 'BackUserEdit',
+                    component: () => import(/* webpackChunkName: "blackUserEdit" */ '@/views/backstage/BackUserEdit.vue'),
                     meta: {
                     meta: {
                         title: '管理员编辑',
                         title: '管理员编辑',
                     },
                     },
                 },
                 },
                 {
                 {
-                    path: '/blackUserList',
-                    name: 'BlackUserList',
-                    component: () => import(/* webpackChunkName: "blackUserList" */ '@/views/backstage/BlackUserList.vue'),
+                    path: '/backUserList',
+                    name: 'BackUserList',
+                    component: () => import(/* webpackChunkName: "blackUserList" */ '@/views/backstage/BackUserList.vue'),
                     meta: {
                     meta: {
                         title: '管理员列表',
                         title: '管理员列表',
                     },
                     },
@@ -328,6 +328,22 @@ const router = new Router({
                         title: '退款申请',
                         title: '退款申请',
                     },
                     },
                 },
                 },
+                {
+                    path: '/withdrawApplyEdit',
+                    name: 'WithdrawApplyEdit',
+                    component: () => import(/* webpackChunkName: "withdrawalsRecordEdit" */ '@/views/backstage/WithdrawApplyEdit.vue'),
+                    meta: {
+                        title: '退款申请编辑',
+                    },
+                },
+                {
+                    path: '/withdrawApplyList',
+                    name: 'WithdrawApplyList',
+                    component: () => import(/* webpackChunkName: "withdrawalsRecordList" */ '@/views/backstage/WithdrawApplyList.vue'),
+                    meta: {
+                        title: '退款申请',
+                    },
+                },
 /*                {
 /*                {
                     path: '/userOrderList',
                     path: '/userOrderList',
                     name: 'UserOrderList',
                     name: 'UserOrderList',

+ 51 - 48
src/main/vue/src/views/CouponList.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-    <div  class="list-view">
+    <div class="list-view">
         <div class="filters-container">
         <div class="filters-container">
             <el-input placeholder="输入关键字" v-model="search" clearable
             <el-input placeholder="输入关键字" v-model="search" clearable
                       class="filter-item"></el-input>
                       class="filter-item"></el-input>
@@ -23,40 +23,40 @@
             </el-table-column>
             </el-table-column>
             <el-table-column prop="id" label="ID" width="100">
             <el-table-column prop="id" label="ID" width="100">
             </el-table-column>
             </el-table-column>
-                    <el-table-column prop="name" label="优惠券名称"
->
-                    </el-table-column>
-                    <el-table-column prop="amount" label="金额"
->
-                    </el-table-column>
-                    <el-table-column prop="startDate" label="开始时间"
-                            :formatter="dateFormatter"
->
-                    </el-table-column>
-                    <el-table-column prop="endDate" label="截止时间"
-                            :formatter="dateFormatter"
->
-                    </el-table-column>
-<!--                    <el-table-column prop="isExpired" label="是否过期"
->
-                            <template slot-scope="{row}">
-                                <el-tag :type="row.isExpired?'':'info'">{{row.isExpired}}</el-tag>
-                            </template>
-                    </el-table-column>-->
+            <el-table-column prop="name" label="优惠券名称"
+            >
+            </el-table-column>
+            <el-table-column prop="amount" label="金额"
+            >
+            </el-table-column>
+            <el-table-column prop="startDate" label="开始时间"
+                             :formatter="dateFormatter"
+            >
+            </el-table-column>
+            <el-table-column prop="endDate" label="截止时间"
+                             :formatter="dateFormatter"
+            >
+            </el-table-column>
+            <!--                    <el-table-column prop="isExpired" label="是否过期"
+            >
+                                        <template slot-scope="{row}">
+                                            <el-tag :type="row.isExpired?'':'info'">{{row.isExpired}}</el-tag>
+                                        </template>
+                                </el-table-column>-->
 
 
-<!--                    <el-table-column prop="type" label="优惠券类型"-->
-<!--                            :formatter="typeFormatter"-->
-<!--                        >-->
-<!--                    </el-table-column>-->
-                    <el-table-column prop="fullAmount" label="满额"
->
-                    </el-table-column>
-<!--                    <el-table-column prop="discount" label="折扣"-->
-<!--&gt;-->
-<!--                    </el-table-column>-->
-                    <el-table-column prop="merchantId" label="商家ID"
->
-                    </el-table-column>
+            <!--                    <el-table-column prop="type" label="优惠券类型"-->
+            <!--                            :formatter="typeFormatter"-->
+            <!--                        >-->
+            <!--                    </el-table-column>-->
+            <el-table-column prop="fullAmount" label="满额"
+            >
+            </el-table-column>
+            <!--                    <el-table-column prop="discount" label="折扣"-->
+            <!--&gt;-->
+            <!--                    </el-table-column>-->
+            <el-table-column prop="merchantId" label="商家ID"
+            >
+            </el-table-column>
             <el-table-column
             <el-table-column
                     label="操作"
                     label="操作"
                     align="center"
                     align="center"
@@ -88,7 +88,7 @@
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
-    import { mapState } from "vuex";
+    import {mapState} from "vuex";
     import pageableTable from "@/mixins/pageableTable";
     import pageableTable from "@/mixins/pageableTable";
 
 
     export default {
     export default {
@@ -103,7 +103,10 @@
                 search: "",
                 search: "",
                 url: "/coupon/all",
                 url: "/coupon/all",
                 downloading: false,
                 downloading: false,
-                        typeOptions:[{"label":"DISCOUNT","value":"DISCOUNT"},{"label":"CREDIT","value":"CREDIT"},{"label":"REDUCTION","value":"REDUCTION"}],
+                typeOptions: [{"label": "DISCOUNT", "value": "DISCOUNT"}, {
+                    "label": "CREDIT",
+                    "value": "CREDIT"
+                }, {"label": "REDUCTION", "value": "REDUCTION"}],
             }
             }
         },
         },
         computed: {
         computed: {
@@ -112,16 +115,16 @@
             }
             }
         },
         },
         methods: {
         methods: {
-                    typeFormatter(row, column, cellValue, index) {
-                        let selectedOption = this.typeOptions.find(i => i.value === cellValue);
-                        if (selectedOption) {
-                            return selectedOption.label;
-                        }
-                        return '';
-                    },
+            typeFormatter(row, column, cellValue, index) {
+                let selectedOption = this.typeOptions.find(i => i.value === cellValue);
+                if (selectedOption) {
+                    return selectedOption.label;
+                }
+                return '';
+            },
             beforeGetData() {
             beforeGetData() {
                 if (this.search) {
                 if (this.search) {
-                    return { search: this.search };
+                    return {search: this.search};
                 }
                 }
             },
             },
             toggleMultipleMode(multipleMode) {
             toggleMultipleMode(multipleMode) {
@@ -134,7 +137,7 @@
                 this.$router.push({
                 this.$router.push({
                     path: "/couponEdit",
                     path: "/couponEdit",
                     query: {
                     query: {
-                    ...this.$route.query
+                        ...this.$route.query
                     }
                     }
                 });
                 });
             },
             },
@@ -142,16 +145,16 @@
                 this.$router.push({
                 this.$router.push({
                     path: "/couponEdit",
                     path: "/couponEdit",
                     query: {
                     query: {
-                    id: row.id
+                        id: row.id
                     }
                     }
                 });
                 });
             },
             },
             download() {
             download() {
                 this.downloading = true;
                 this.downloading = true;
                 this.$axios
                 this.$axios
-                    .get("/coupon/excel", { 
+                    .get("/coupon/excel", {
                         responseType: "blob",
                         responseType: "blob",
-                        params: { size: 10000 }
+                        params: {size: 10000}
                     })
                     })
                     .then(res => {
                     .then(res => {
                         console.log(res);
                         console.log(res);

+ 26 - 4
src/main/vue/src/views/OrderInfoEdit.vue

@@ -18,8 +18,13 @@
             <!--                <el-input v-model="formData.merchantAddress"></el-input>-->
             <!--                <el-input v-model="formData.merchantAddress"></el-input>-->
             <!--            </el-form-item>-->
             <!--            </el-form-item>-->
             <el-form-item prop="jobNumber" label="骑手工号">
             <el-form-item prop="jobNumber" label="骑手工号">
-                <el-input v-model="formData.jobNumber"></el-input>
+                <el-input v-model="formData.riderId"></el-input>
+                <el-button type="primary" @click="changeStatus">{{formData.riderStatus}}</el-button>
             </el-form-item>
             </el-form-item>
+
+            <!--      <el-form-item prop="riderStatus" label="骑手状态">
+                      <el-input v-model="formData.riderStatus"></el-input>
+                  </el-form-item>-->
             <el-form-item prop="riderStatus" label="骑手状态">
             <el-form-item prop="riderStatus" label="骑手状态">
                 <el-select v-model="formData.riderStatus" clearable filterable placeholder="请选择">
                 <el-select v-model="formData.riderStatus" clearable filterable placeholder="请选择">
                     <el-option
                     <el-option
@@ -160,9 +165,9 @@
                 formData: {},
                 formData: {},
                 rules: {},
                 rules: {},
                 riderStatusOptions: [
                 riderStatusOptions: [
-                    {"label": "接单", "value": "RECEIVED"},
-                    {"label": "取餐", "value": "TAKE_MEAL"},
-                    {"label": "送餐", "value": "MEAL_DELIVERY"},
+                    {"label": "接单", "value": "RECEIVED"},
+                    {"label": "取餐", "value": "TAKE_MEAL"},
+                    {"label": "送餐", "value": "MEAL_DELIVERY"},
                     {"label": "完成", "value": "CARRY_OUT"}],
                     {"label": "完成", "value": "CARRY_OUT"}],
                 payMethodOptions: [
                 payMethodOptions: [
                     {"label": "支付宝", "value": "ALI_PAY"},
                     {"label": "支付宝", "value": "ALI_PAY"},
@@ -211,6 +216,23 @@
                     }
                     }
                 })
                 })
             },
             },
+            changeStatus() {
+                this.$alert('确认此状态已完成?', '提示').then(() => {
+                    return this.$http.post("/orderInfo/riderStatus", {
+                        orderId: this.formData.id,
+                        pass: true
+                    })
+                }).then(() => {
+                    this.$message.success('状态已改');
+                    this.$router.go(0);
+                    //this.$router.go(-1);
+                }).catch(e => {
+                    if (e !== 'cancel') {
+                        console.log(e);
+                        this.$message.error(e.error);
+                    }
+                })
+            }
         }
         }
     }
     }
 </script>
 </script>

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

@@ -36,7 +36,7 @@
                              :formatter="merchantStatusFormatter"
                              :formatter="merchantStatusFormatter"
             >
             >
             </el-table-column>
             </el-table-column>
-            <el-table-column prop="jobNumber" label="骑手工号"
+            <el-table-column prop="riderId" label="骑手工号"
             >
             >
             </el-table-column>
             </el-table-column>
             <el-table-column prop="riderStatus" label="骑手状态"
             <el-table-column prop="riderStatus" label="骑手状态"

+ 149 - 76
src/main/vue/src/views/UserEdit.vue

@@ -11,13 +11,13 @@
             <el-form-item prop="nickname" label="昵称">
             <el-form-item prop="nickname" label="昵称">
                 <el-input v-model="formData.nickname"></el-input>
                 <el-input v-model="formData.nickname"></el-input>
             </el-form-item>
             </el-form-item>
-            <el-form-item v-if="formData.id" label="密码">
-                <el-button type="primary" plain @click="resetPassword">重置
-                </el-button>
-            </el-form-item>
-            <el-form-item v-else prop="password" label="密码">
-                <el-input v-model="formData.password"></el-input>
-            </el-form-item>
+            <!-- <el-form-item v-if="formData.id" label="密码">
+                 <el-button type="primary" plain @click="resetPassword">重置
+                 </el-button>
+             </el-form-item>-->
+            <!--    <el-form-item v-else prop="password" label="密码">
+                    <el-input v-model="formData.password"></el-input>
+                </el-form-item>-->
             <el-form-item prop="phone" label="手机">
             <el-form-item prop="phone" label="手机">
                 <el-input v-model="formData.phone"></el-input>
                 <el-input v-model="formData.phone"></el-input>
             </el-form-item>
             </el-form-item>
@@ -30,48 +30,64 @@
                             </el-select>
                             </el-select>
                         </el-form-item>-->
                         </el-form-item>-->
             <el-form-item>
             <el-form-item>
-                <el-button @click="onSave" :loading="$store.state.fetchingData"
-                                           type="primary">保存</el-button>
+                <!-- <el-button @click="onSave" :loading="$store.state.fetchingData"
+                            type="primary">保存
+                 </el-button>-->
                 <!--             <el-button @click="del" :loading="$store.state.fetchingData"
                 <!--             <el-button @click="del" :loading="$store.state.fetchingData"
                                       type="danger" v-if="formData.id">删除
                                       type="danger" v-if="formData.id">删除
                            </el-button>-->
                            </el-button>-->
-                <el-button @click="showSetLogistics=true"
+                <el-button @click="moveRow"
                            type="danger" v-if="formData.id && !formData.blacklist">移入黑名单
                            type="danger" v-if="formData.id && !formData.blacklist">移入黑名单
                 </el-button>
                 </el-button>
                 <el-button @click=""
                 <el-button @click=""
                            type="danger" v-if="formData.id && formData.blacklist">移出黑名单
                            type="danger" v-if="formData.id && formData.blacklist">移出黑名单
                 </el-button>
                 </el-button>
-                <el-button @click="" :loading="$store.state.fetchingData"
+                <el-button @click="showCoupon" :loading="$store.state.fetchingData"
                            type="primary" v-if="formData.id">发送优惠券
                            type="primary" v-if="formData.id">发送优惠券
                 </el-button>
                 </el-button>
+                <el-button @click="showOrder" :loading="$store.state.fetchingData"
+                           type="primary" v-if="formData.id">订单
+                </el-button>
                 <el-button @click="$router.go(-1)">返回</el-button>
                 <el-button @click="$router.go(-1)">返回</el-button>
             </el-form-item>
             </el-form-item>
         </el-form>
         </el-form>
-
         <el-dialog
         <el-dialog
-                title="填写理由"
+                title="优惠券列表"
                 center
                 center
-                width="400px"
-                :visible.sync="showSetLogistics"
+                :visible.sync="dislogTableCoupon"
         >
         >
-            <el-form :model="formData">
-                <el-form-item>
-                    <el-input type="textarea"
-                              placeholder="请输入拉入黑名单理由"
-                              v-model="reason"
-                    ></el-input>
-                </el-form-item>
-                <el-form-item>
-                    <el-button type="primary" @click="moveRow(formData.id)" size="mini">确认</el-button>
-                </el-form-item>
-            </el-form>
+            <el-table :data="coupons" ref="table">
+                <el-table-column align="center" type="selection"
+                                 width="50">
+                </el-table-column>
+                <el-table-column prop="name" label="优惠券名称"></el-table-column>
+                <el-table-column prop="amount" label="金额"></el-table-column>
+                <el-table-column prop="fullAmount" label="限制"></el-table-column>
+                <el-table-column prop="endDate" label="结束时间"></el-table-column>
+                <!--       <el-table-column label="操作" align="center" fixed="right">
+                           <template slot-scope="{ row }">
+                               <el-button @click="issue(row)">发放</el-button>
+                           </template>
+                       </el-table-column>-->
+            </el-table>
+            <div class="pagination-wrapper">
+                <el-button @click="operation1">确定</el-button>
+            </div>
         </el-dialog>
         </el-dialog>
-
-        <el-dialog>
-            <el-table>
-
+        <el-dialog
+                title="订单列表"
+                center
+                :visible.sync="dislogTableOrder"
+        >
+            <el-table :data="orders" ref="table">
+                <el-table-column prop="remark" label="备注"></el-table-column>
+                <el-table-column prop="merchantId" label="商家"></el-table-column>
+                <el-table-column prop="riderId" label="骑手"></el-table-column>
+                <el-table-column prop="realAmount" label="实付金额"></el-table-column>
             </el-table>
             </el-table>
-
+            <div class="pagination-wrapper">
+<!--                <el-button @click="operation1">确定</el-button>-->
+            </div>
         </el-dialog>
         </el-dialog>
     </div>
     </div>
 </template>
 </template>
@@ -89,14 +105,7 @@
                         this.$message.error(e.error);
                         this.$message.error(e.error);
                     });
                     });
             }
             }
-            /*        this.$http
-                        .get('/authority/all')
-                        .then(res => {
-                            this.authorities = res;
-                        })
-                        .catch(e => {
-                            console.log(e);
-                        });*/
+
         },
         },
         data() {
         data() {
             return {
             return {
@@ -135,11 +144,19 @@
                                         { required: true, message: '请选择角色', trigger: 'blur' },
                                         { required: true, message: '请选择角色', trigger: 'blur' },
                                     ],*/
                                     ],*/
                 },
                 },
-                showSetLogistics: false,
+                dislogTableCoupon: false,
+                coupons: [],
                 // authorities: [],
                 // authorities: [],
-                reason: "",
+                dislogTableOrder: false,
+                orders: [],
+
             };
             };
         },
         },
+        computed: {
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
         methods: {
         methods: {
             onSave() {
             onSave() {
                 this.$refs.form.validate(valid => {
                 this.$refs.form.validate(valid => {
@@ -152,7 +169,7 @@
             },
             },
             submit() {
             submit() {
                 this.$http
                 this.$http
-                    .post('/user/save', this.formData, { body: 'json' })
+                    .post('/user/save', this.formData, {body: 'json'})
                     .then(res => {
                     .then(res => {
                         this.$message.success('成功');
                         this.$message.success('成功');
                         this.formData = res;
                         this.formData = res;
@@ -167,7 +184,7 @@
                         this.$message.error(e.error);
                         this.$message.error(e.error);
                     });
                     });
             },
             },
-            del(){
+            del() {
                 this.$confirm('确认删除吗?', '提示', {type: 'warning'})
                 this.$confirm('确认删除吗?', '提示', {type: 'warning'})
                     .then(() => {
                     .then(() => {
                         this.$http
                         this.$http
@@ -189,43 +206,32 @@
                     .catch(() => {
                     .catch(() => {
                     });
                     });
             },
             },
-            moveRow(id) {
-                /*this.$confirm('确认移入黑名单吗?', '提示', {type: 'warning'})
-                    .then(() => {
-                        this.$http
-                            .post({
-                                url: '/blacklist/move',
-                                data: {
-                                    id: this.formData.id,
-                                    reason: this.reason,
-                                },
+            moveRow() {
+                this.$prompt('请输入理由', '提示', {
+                    inputType: 'textarea'
+                })
+                    .then(res => {
+                        // console.log(res);
+                        if (res.value) {
+                            this.$alert('确定拉入黑名单?', '提示', {
+                                showCancelButton: true
                             })
                             })
-                            .then(res => {
-                                if (res.success) {
-                                    this.$message.success('成功');
+                                .then(() => {
+                                    return this.$http.post('/blackList/move', {
+                                        userId: this.formData.id,
+                                        reason: res.value
+                                    });
+                                })
+                                .then(res => {
+                                    this.$message.success('拉入黑名单成功');
                                     this.$router.go(-1);
                                     this.$router.go(-1);
-                                } else {
-                                    this.$message.warning('失败');
-                                }
-                            });
+                                })
+                                .catch(() => {
+                                    this.$message.error(res.error || '拉入黑名单失败');
+                                });
+                        }
                     })
                     })
                     .catch(() => {
                     .catch(() => {
-                    });*/
-                this.$http
-                    .post({
-                        url: "/blacklist/move", data: {
-                            id: id,
-                            reason: this.reason,
-                        },
-                    })
-                    .then(res => {
-                        this.$message.success("成功");
-                        this.showSetLogistics = false;
-                        this.$router.go(0);
-                    })
-                    .catch(e => {
-                        console.log(e);
-                        this.$message.error(e.error);
                     });
                     });
             },
             },
             resetPassword() {
             resetPassword() {
@@ -253,6 +259,73 @@
                     .catch(() => {
                     .catch(() => {
                     });
                     });
             },
             },
+
+            issue(row) {
+                this.$http
+                    .post("/userCoupon/issue", {
+                            userId: this.formData.id,
+                            couponId: row.id,
+                        },
+                    )
+                    .then(res => {
+                        this.$message.success("发放成功");
+                        this.showSetLogistics = false;
+                        this.$router.go(0);
+                    })
+                    .catch(e => {
+                        console.log(e);
+                        this.$message.error(e.error || '发放失败');
+                    });
+            },
+            operation1() {
+                /*this.$notify({
+                    title: '发放',
+                    message: this.selection
+                });*/
+                this.$http
+                    .post("/userCoupon/issue", {
+                            userId: this.formData.id,
+                            couponId: this.selection.toString(),
+
+                        },
+                    )
+                    .then(res => {
+                        this.$message.success("发放成功");
+                        //this.showSetLogistics = false;
+                        this.$router.go(0);
+                    })
+                    .catch(e => {
+                        console.log(e);
+                        this.$message.error(e.error || '发放失败');
+                    });
+            },
+            showCoupon() {
+                this.dislogTableCoupon = true;
+                this.$http
+                    .get('/coupon/all')
+                    .then(res => {
+                        this.coupons = res.content;
+                        //console.log(this.coupons)
+                    })
+                    .catch(e => {
+                        console.log(e);
+                    });
+            },
+            showOrder() {
+                this.dislogTableOrder = true;
+                this.$http
+                    .post('/orderInfo/list', {
+                        id: this.formData.id,
+                    })
+                    .then(res => {
+                        this.orders = res.content;
+                        console.log(this.orders)
+                    })
+                    .catch(e => {
+                        console.log(e);
+                    });
+            }
+
         },
         },
     };
     };
 </script>
 </script>

+ 2 - 2
src/main/vue/src/views/UserList.vue

@@ -49,8 +49,8 @@
                 <template slot-scope="{row}">
                 <template slot-scope="{row}">
                     <el-button @click="editRow(row)" type="primary" size="mini"
                     <el-button @click="editRow(row)" type="primary" size="mini"
                         plain>详情</el-button>
                         plain>详情</el-button>
-                    <el-button @click="orderRow(row)" type="primary" size="mini"
-                        plain>订单</el-button>
+<!--                    <el-button @click="orderRow(row)" type="primary" size="mini"-->
+<!--                        plain>订单</el-button>-->
                 </template>
                 </template>
             </el-table-column>
             </el-table-column>
         </el-table>
         </el-table>

+ 0 - 1
src/main/vue/src/views/UserOrderList.vue

@@ -23,7 +23,6 @@
       cell-class-name="table-cell"
       cell-class-name="table-cell"
       :height="tableHeight"
       :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="id" label="ID" width="100"></el-table-column>
       <el-table-column prop="userId" label="用户ID"></el-table-column>
       <el-table-column prop="userId" label="用户ID"></el-table-column>
       <el-table-column prop="userAddress" label="配送地址"></el-table-column>
       <el-table-column prop="userAddress" label="配送地址"></el-table-column>

+ 0 - 0
src/main/vue/src/views/backstage/BlackUserEdit.vue → src/main/vue/src/views/backstage/BackUserEdit.vue


+ 0 - 0
src/main/vue/src/views/backstage/BlackUserList.vue → src/main/vue/src/views/backstage/BackUserList.vue


+ 13 - 6
src/main/vue/src/views/backstage/BlackListList.vue

@@ -65,7 +65,8 @@
                 <template slot-scope="{row}">
                 <template slot-scope="{row}">
                     <!--<el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>-->
                     <!--<el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>-->
                     <!--                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>-->
                     <!--                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>-->
-                    <el-button @click="userRow(row)" type="primary" size="mini" plain>详情</el-button>
+                    <el-button @click="userRow(row)" type="primary" size="mini" plain v-if="row.identity==='USER'">详情</el-button>
+                    <el-button @click="merRow(row)" type="primary" size="mini" plain v-if="row.identity==='MERCHANT'">详情</el-button>
                     <el-button @click="removeRow(row)" type="danger" size="mini" plain v-if="!row.remove">移除</el-button>
                     <el-button @click="removeRow(row)" type="danger" size="mini" plain v-if="!row.remove">移除</el-button>
                 </template>
                 </template>
             </el-table-column>
             </el-table-column>
@@ -217,13 +218,11 @@
                 })
                 })
             },
             },
             removeRow(row) {
             removeRow(row) {
-                this.$alert('移除将无法恢复,确认移除么?', '提示', {type: 'error'}).then(() => {
-                    return this.$http.post({
-                        url: `/blackList/remove`,
-                        date: {
+                this.$alert('确认移除么?', '提示', {type: 'primary'}).then(() => {
+                    return this.$http.get(`/blackList/remove`, {
                             id: row.id,
                             id: row.id,
                         },
                         },
-                    })
+                    )
                 }).then(() => {
                 }).then(() => {
                     this.$message.success('移除成功');
                     this.$message.success('移除成功');
                     this.getData();
                     this.getData();
@@ -242,6 +241,14 @@
                         id: row.userId
                         id: row.userId
                     }
                     }
                 });
                 });
+            },
+            merRow(row) {
+                this.$router.push({
+                    path: "/merchantEdit",
+                    query: {
+                        id: row.otherId
+                    }
+                });
             }
             }
         }
         }
     }
     }

+ 107 - 0
src/main/vue/src/views/backstage/WithdrawApplyEdit.vue

@@ -0,0 +1,107 @@
+<template>
+    <div class="edit-view">
+        <el-form
+            :model="formData"
+            :rules="rules"
+            ref="form"
+            label-width="80px"
+            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="amount" label="金额">
+                <el-input-number type="number" v-model="formData.amount"></el-input-number>
+            </el-form-item>
+            <el-form-item prop="status" label="状态">
+                <el-select v-model="formData.status" clearable filterable placeholder="请选择">
+                    <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value">
+                    </el-option>
+                </el-select>
+            </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: 'WithdrawApplyEdit',
+    created() {
+        if (this.$route.query.id) {
+            this.$http
+                .get('withdrawApply/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: {},
+            statusOptions: [
+                { label: '待审核', value: 'PENDING' },
+                { label: '待打款', value: 'WAIT_TRANSFER' },
+                { label: '已打款', value: 'TRANSFERRED' },
+                { label: '无效', value: 'CANCELLED' }
+            ]
+        };
+    },
+    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('/withdrawApply/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(`/withdrawApply/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>

+ 232 - 0
src/main/vue/src/views/backstage/WithdrawApplyList.vue

@@ -0,0 +1,232 @@
+<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="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 prop="id" label="ID" width="100"> </el-table-column>
+            <el-table-column prop="userId" label="用户ID"> </el-table-column>
+            <el-table-column prop="bankCard.realName" label="真实姓名"> </el-table-column>
+            <el-table-column prop="bankCard.phone" label="电话"> </el-table-column>
+            <el-table-column prop="bankCard.bankName" label="银行"> </el-table-column>
+            <el-table-column prop="bankCard.cardNo" label="卡号"> </el-table-column>
+            <el-table-column prop="amount" label="金额"> </el-table-column>
+            <el-table-column prop="withdrawTime" label="提现时间"> </el-table-column>
+            <el-table-column prop="status" label="状态" :formatter="statusFormatter"> </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'"
+                        @click="audit(row, true)"
+                        type="primary"
+                        size="mini"
+                        plain
+                        >通过</el-button
+                    >
+                    <el-button
+                        v-if="row.status === 'PENDING'"
+                        @click="audit(row, false)"
+                        type="primary"
+                        size="mini"
+                        plain
+                        >拒绝</el-button
+                    >
+<!--                    <el-button
+                        v-if="row.status === 'WAIT_TRANSFER'"
+                        @click="updateStatus(row, 'SUCCESS')"
+                        type="primary"
+                        size="mini"
+                        plain
+                        >已打款</el-button
+                    >-->
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <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: 'WithdrawApplyList',
+    mixins: [pageableTable],
+    created() {
+        this.getData();
+    },
+    data() {
+        return {
+            multipleMode: false,
+            search: '',
+            url: '/withdrawApply/all',
+            downloading: false,
+            statusOptions: [
+                { label: '待审核', value: 'PENDING' },
+                { label: '完成', value: 'SUCCESS' },
+                { label: '拒绝', value: 'FAIL' }
+            ]
+        };
+    },
+    computed: {
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        }
+    },
+    methods: {
+        statusFormatter(row, column, cellValue, index) {
+            let selectedOption = this.statusOptions.find(i => i.value === cellValue);
+            if (selectedOption) {
+                return selectedOption.label;
+            }
+            return '';
+        },
+        beforeGetData() {
+            if (this.search) {
+                return { search: this.search };
+            }
+        },
+        toggleMultipleMode(multipleMode) {
+            this.multipleMode = multipleMode;
+            if (!multipleMode) {
+                this.$refs.table.clearSelection();
+            }
+        },
+        addRow() {
+            this.$router.push({
+                path: '/withdrawApplyEdit',
+                query: {
+                    ...this.$route.query
+                }
+            });
+        },
+        editRow(row) {
+            this.$router.push({
+                path: '/withdrawApplyEdit',
+                query: {
+                    id: row.id
+                }
+            });
+        },
+        download() {
+            this.downloading = true;
+            this.$axios
+                .get('/withdrawApply/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(`/withdrawApply/del/${row.id}`);
+                })
+                .then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                })
+                .catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                });
+        },
+        /*updateStatus(row, status) {
+            this.$alert('此操作无法恢复,确认继续?', '提示')
+                .then(() => {
+                    return this.$http.post('/withdrawApply/updateStatus', {
+                        withdrawApplyId: row.id,
+                        status: status
+                    });
+                })
+                .then(res => {
+                    this.$message.success('成功');
+                    this.getData();
+                })
+                .catch(action => {
+                    if (action === 'cancel') {
+                        return;
+                    } else {
+                        this.$message.error('失败');
+                    }
+                });
+        }*/
+        audit(row, consent) {
+            this.$set(row, 'loading', true);
+            this.$http
+                .get('/withdrawApply/audit', {
+                    id: row.id,
+                    consent: consent
+                })
+                .then(res => {
+                    this.$set(row, 'loading', false);
+                    this.$message.success('OK');
+                    this.getData();
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.$set(row, 'loading', false);
+                    this.$message.error(e.error);
+                });
+        }
+    }
+};
+</script>
+<style lang="less" scoped></style>

+ 0 - 0
src/main/vue/src/views/GoodsEdit.vue → src/main/vue/src/views/merchant/GoodsEdit.vue


+ 4 - 4
src/main/vue/src/views/GoodsList.vue → src/main/vue/src/views/merchant/GoodsList.vue

@@ -36,8 +36,8 @@
             >
             >
                 <template slot-scope="{row}">
                 <template slot-scope="{row}">
                     <el-image style="width: 30px; height: 30px"
                     <el-image style="width: 30px; height: 30px"
-                              :src="row.img[0]" fit="cover"
-                              :preview-src-list="row.img"></el-image>
+                              :src="row.img" fit="cover"
+                              :preview-src-list="[row.img]"></el-image>
                 </template>
                 </template>
             </el-table-column>
             </el-table-column>
             <el-table-column prop="inventory" label="库存"
             <el-table-column prop="inventory" label="库存"
@@ -119,14 +119,14 @@
             </el-table-column>
             </el-table-column>
         </el-table>
         </el-table>
         <div class="pagination-wrapper">
         <div class="pagination-wrapper">
-            <!-- <div class="multiple-mode-wrapper">
+             <div class="multiple-mode-wrapper">
                 <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
                 <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
                 <el-button-group v-else>
                 <el-button-group v-else>
                     <el-button @click="operation1">批量操作1</el-button>
                     <el-button @click="operation1">批量操作1</el-button>
                     <el-button @click="operation2">批量操作2</el-button>
                     <el-button @click="operation2">批量操作2</el-button>
                     <el-button @click="toggleMultipleMode(false)">取消</el-button>
                     <el-button @click="toggleMultipleMode(false)">取消</el-button>
                 </el-button-group>
                 </el-button-group>
-            </div> -->
+            </div>
             <el-pagination background @size-change="onSizeChange"
             <el-pagination background @size-change="onSizeChange"
                            @current-change="onCurrentChange" :current-page="page"
                            @current-change="onCurrentChange" :current-page="page"
                            :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize"
                            :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize"

+ 9 - 6
src/main/vue/src/views/merchant/MerchantEdit.vue

@@ -17,6 +17,9 @@
             <el-form-item prop="introduction" label="简介">
             <el-form-item prop="introduction" label="简介">
                 <el-input type="textarea" v-model="formData.introduction" :rows="2"></el-input>
                 <el-input type="textarea" v-model="formData.introduction" :rows="2"></el-input>
             </el-form-item>
             </el-form-item>
+            <el-form-item prop="proclamation" label="公告">
+                <el-input type="textarea" v-model="formData.proclamation" :rows="2"></el-input>
+            </el-form-item>
             <el-form-item prop="banner" label="banner">
             <el-form-item prop="banner" label="banner">
                 <single-upload v-model="formData.banner"></single-upload>
                 <single-upload v-model="formData.banner"></single-upload>
             </el-form-item>
             </el-form-item>
@@ -37,12 +40,12 @@
             </el-form-item>
             </el-form-item>
             <el-form-item prop="businessNature" label="营业性质">
             <el-form-item prop="businessNature" label="营业性质">
                 <!--<el-input v-model="formData.businessNature"></el-input>-->
                 <!--<el-input v-model="formData.businessNature"></el-input>-->
-                <el-select v-model="formData.businessNature"
-                           placeholder="请选择" value-key="value">
-                    <el-option value="自营">自营</el-option>
-                    <el-option value="连锁">连锁</el-option>
-                    <el-option value="加盟">加盟</el-option>
-                </el-select>
+<!--                <el-select v-model="formData.businessNature"-->
+<!--                           placeholder="请选择" value-key="value">-->
+<!--                    <el-option value="自营">自营</el-option>-->
+<!--                    <el-option value="连锁">连锁</el-option>-->
+<!--                    <el-option value="加盟">加盟</el-option>-->
+<!--                </el-select>-->
             </el-form-item>
             </el-form-item>
             <el-form-item prop="week" label="周几" id="week">
             <el-form-item prop="week" label="周几" id="week">
                 <el-select v-model="formData.week" multiple
                 <el-select v-model="formData.week" multiple

+ 48 - 3
src/main/vue/src/views/merchant/MerchantList.vue

@@ -1,3 +1,5 @@
+import format from "date-fns/format";import startOfDay from "date-fns/startOfDay";import endOfDay
+    from "date-fns/endOfDay";
 <template>
 <template>
     <div class="list-view">
     <div class="list-view">
         <div class="filters-container">
         <div class="filters-container">
@@ -12,6 +14,9 @@
             <el-button @click="download" type="primary" icon="el-icon-download"
             <el-button @click="download" type="primary" icon="el-icon-download"
                        :loading="downloading" class="filter-item">导出EXCEL
                        :loading="downloading" class="filter-item">导出EXCEL
             </el-button>
             </el-button>
+
+            <el-checkbox-button label="新店"></el-checkbox-button>
+
         </div>
         </div>
         <el-table :data="tableData" row-key="mid" ref="table"
         <el-table :data="tableData" row-key="mid" ref="table"
                   header-row-class-name="table-header-row"
                   header-row-class-name="table-header-row"
@@ -168,11 +173,12 @@
                 <div class="info-item">成立时间:{{formData.establishTime}}</div>
                 <div class="info-item">成立时间:{{formData.establishTime}}</div>
                 <div class="info-item">营业资质:{{formData.qualification}}</div>
                 <div class="info-item">营业资质:{{formData.qualification}}</div>
                 <div class="info-item">营业性质:{{formData.businessNature}}</div>
                 <div class="info-item">营业性质:{{formData.businessNature}}</div>
+                <div class="info-item">公告:{{formData.proclamation}}</div>
                 <div class="info-item">经营品类:{{formData.category}}</div>
                 <div class="info-item">经营品类:{{formData.category}}</div>
                 <div class="info-item">营业:{{formData.week}}</div>
                 <div class="info-item">营业:{{formData.week}}</div>
                 <div class="info-item">营业时间:{{formData.startTime}} - {{formData.endTime}}</div>
                 <div class="info-item">营业时间:{{formData.startTime}} - {{formData.endTime}}</div>
                 <!--                <div class="info-item">申请状态:{{formData.status}}</div>-->
                 <!--                <div class="info-item">申请状态:{{formData.status}}</div>-->
-                <el-button @click="showSetLogistics=true"
+                <el-button @click="moveRow"
                            type="danger" v-if="formData.mid && !formData.blacklist">移入黑名单
                            type="danger" v-if="formData.mid && !formData.blacklist">移入黑名单
                 </el-button>
                 </el-button>
                 <el-button @click="editRow(formData)" type="primary" size="mini" plain>编辑</el-button>
                 <el-button @click="editRow(formData)" type="primary" size="mini" plain>编辑</el-button>
@@ -205,9 +211,10 @@
                 drawer: false,
                 drawer: false,
                 formData: {
                 formData: {
                     img: [],
                     img: [],
-                    category: {}
+                    // category: []
                 },
                 },
                 showSetLogistics: false,
                 showSetLogistics: false,
+                dateRange: [],
             }
             }
         },
         },
         computed: {
         computed: {
@@ -216,6 +223,17 @@
             }
             }
         },
         },
         methods: {
         methods: {
+            beforeOnCreate() {
+                if (this.$route.query.dateRange) {
+                    this.dateRange = decodeURIComponent(this.$route.query.dateRange).split(',');
+                } else {
+                    this.dateRange = [
+                        format(startOfDay(new Date()), 'yyyy-MM-dd HH:mm:ss'),
+                        format(endOfDay(new Date()), 'yyyy-MM-dd HH:mm:ss')
+                    ];
+                }
+            },
+
             showDrawer(row) {
             showDrawer(row) {
                 this.drawer = true;
                 this.drawer = true;
                 this.$http
                 this.$http
@@ -344,7 +362,34 @@
                         this.$set(row, 'loading', false);
                         this.$set(row, 'loading', false);
                         this.$message.error(e.error);
                         this.$message.error(e.error);
                     });
                     });
-            }
+            },
+            moveRow() {
+                this.$prompt('请输入理由', '提示', {
+                    inputType: 'textarea'})
+                    .then(res => {
+                        // console.log(res);
+                        if (res.value) {
+                            this.$alert('确定拉入黑名单?', '提示', {
+                                showCancelButton: true
+                            })
+                                .then(() => {
+                                    return this.$http.post('/blackList/move', {
+                                        userId: this.formData.userId,
+                                        reason: res.value
+                                    });
+                                })
+                                .then(res => {
+                                    this.$message.success('拉入黑名单成功');
+                                    this.$router.go(-1);
+                                })
+                                .catch(() => {
+                                    this.$message.error(res.error || '拉入黑名单失败');
+                                });
+                        }
+                    })
+                    .catch(() => {
+                    });
+            },
         }
         }
     }
     }
 </script>
 </script>