Kaynağa Gözat

推荐商家的显示方法

licailing 5 yıl önce
ebeveyn
işleme
685d989141

+ 40 - 0
src/main/java/com/izouma/dingdong/dto/FilterDTO.java

@@ -0,0 +1,40 @@
+package com.izouma.dingdong.dto;
+
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ApiModel(value = "筛选的条件")
+public class FilterDTO {
+
+    /*
+    优惠活动
+    首单立减 1
+    满减优惠 2
+    折扣商家 3
+    下单返红包 4
+    可用红包 5
+    */
+    private Integer filter;
+    /*
+    商家标签
+    新商家 1
+    明星商家 2
+    */
+    private Integer tag;
+    /*
+    商家性质
+    */
+    private Long natureId;
+    /*
+    人均范围 start-end
+    */
+    private BigDecimal startAmount;
+    private BigDecimal endAmount;
+}

+ 11 - 2
src/main/java/com/izouma/dingdong/dto/MerchantDTO.java

@@ -66,6 +66,8 @@ public class MerchantDTO implements Serializable {
         promo = merchant.getPromo();
         promo = merchant.getPromo();
         buyAlliance = merchantSettings.getBuyAlliance();
         buyAlliance = merchantSettings.getBuyAlliance();
         monthSales = merchant.getMonthSales();
         monthSales = merchant.getMonthSales();
+        goodNum = merchant.getGoodNum();
+        badNum = merchant.getBadNum();
     }
     }
 
 
     //包含距离
     //包含距离
@@ -108,7 +110,8 @@ public class MerchantDTO implements Serializable {
         monthSales = merchant.getMonthSales();
         monthSales = merchant.getMonthSales();
         this.distance = distance;
         this.distance = distance;
         priority = merchantSettings.getPriority();
         priority = merchantSettings.getPriority();
-
+        goodNum = merchant.getGoodNum();
+        badNum = merchant.getBadNum();
     }
     }
 
 
     private Long mid;
     private Long mid;
@@ -237,7 +240,7 @@ public class MerchantDTO implements Serializable {
     private Boolean buyAlliance;
     private Boolean buyAlliance;
 
 
     @ApiModelProperty(value = "月销", name = "monthSales")
     @ApiModelProperty(value = "月销", name = "monthSales")
-    private Integer monthSales = 0;
+    private Integer monthSales;
 
 
     @ApiModelProperty(value = "距离")
     @ApiModelProperty(value = "距离")
     private Double distance;
     private Double distance;
@@ -247,4 +250,10 @@ public class MerchantDTO implements Serializable {
 
 
     @ApiModelProperty(value = "优先级", name = "priority")
     @ApiModelProperty(value = "优先级", name = "priority")
     private Integer priority;
     private Integer priority;
+
+    @ApiModelProperty(value = "总好评数量", name = "goodNum")
+    private Integer goodNum;
+
+    @ApiModelProperty(value = "差评数量", name = "badNum")
+    private Integer badNum;
 }
 }

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

@@ -361,7 +361,7 @@ public class OrderInfoService {
                 }
                 }
             }
             }
         }
         }
-        orderInfo.setCancel(true);
+       // orderInfo.setCancel(true);
         orderInfo.setReason(reason);
         orderInfo.setReason(reason);
         orderInfo.setStatus(OrderStatus.CANCELLED);
         orderInfo.setStatus(OrderStatus.CANCELLED);
         return orderInfoRepo.save(orderInfo);
         return orderInfoRepo.save(orderInfo);

+ 10 - 0
src/main/java/com/izouma/dingdong/service/OrderRefundApplyService.java

@@ -58,6 +58,16 @@ public class OrderRefundApplyService {
      */
      */
     public OrderRefundApply apply(Long orderId, RefundReason reason, String remark) {
     public OrderRefundApply apply(Long orderId, RefundReason reason, String remark) {
         OrderInfo order = orderInfoRepo.findById(orderId).orElseThrow(new BusinessException("无记录"));
         OrderInfo order = orderInfoRepo.findById(orderId).orElseThrow(new BusinessException("无记录"));
+
+        OrderRefundApply apply = orderRefundApplyRepo.findByOrderId(orderId);
+        if (apply!=null){
+            if (RefundStatus.PENDING.equals(apply.getStatus())){
+                throw new BusinessException("申请中");
+            } else {
+                throw new BusinessException("已申请过");
+            }
+        }
+
         //记录原来的订单状态
         //记录原来的订单状态
         status = order.getStatus();
         status = order.getStatus();
         switch (status) {
         switch (status) {

+ 6 - 37
src/main/java/com/izouma/dingdong/service/merchant/MerchantService.java

@@ -269,8 +269,6 @@ public class MerchantService {
      */
      */
     public List<MerchantDTO> showAll(PageQuery pageQuery, Double longitude, Double latitude, String popularTag, Long userId) {
     public List<MerchantDTO> showAll(PageQuery pageQuery, Double longitude, Double latitude, String popularTag, Long userId) {
 
 
-//        Specification<Merchant> specification = toSpecification(pageQuery, Merchant.class);
-
         List<Merchant> merchantList = merchantRepo.findAll((root, criteriaQuery, criteriaBuilder) -> {
         List<Merchant> merchantList = merchantRepo.findAll((root, criteriaQuery, criteriaBuilder) -> {
                     List<Predicate> predicates = new ArrayList<>();
                     List<Predicate> predicates = new ArrayList<>();
                     predicates.add(criteriaBuilder.equal(root.get("status"), ApplyStatus.PASS));
                     predicates.add(criteriaBuilder.equal(root.get("status"), ApplyStatus.PASS));
@@ -424,8 +422,6 @@ public class MerchantService {
     距离排序,如果有范围,范围内进行排序
     距离排序,如果有范围,范围内进行排序
      */
      */
     public Map<Merchant, Double> distanceSorting(Set<Merchant> merchants, Double longitude, Double latitude, Double range) {
     public Map<Merchant, Double> distanceSorting(Set<Merchant> merchants, Double longitude, Double latitude, Double range) {
-        //List<Merchant> merchants = merchantRepo.findAll();
-
         //所有商家要按距离排序规则
         //所有商家要按距离排序规则
         Map<Merchant, Double> map = new HashMap<>();
         Map<Merchant, Double> map = new HashMap<>();
         //算距离
         //算距离
@@ -445,8 +441,6 @@ public class MerchantService {
         //排序
         //排序
         List<Map.Entry<Merchant, Double>> list = new ArrayList<>(map.entrySet());
         List<Map.Entry<Merchant, Double>> list = new ArrayList<>(map.entrySet());
         list.sort(Comparator.comparing(Map.Entry<Merchant, Double>::getValue));
         list.sort(Comparator.comparing(Map.Entry<Merchant, Double>::getValue));
-
-
         //List<Merchant> mers = new ArrayList<>();
         //List<Merchant> mers = new ArrayList<>();
 
 
         Map<Merchant, Double> map1 = new HashMap<>();
         Map<Merchant, Double> map1 = new HashMap<>();
@@ -458,38 +452,13 @@ public class MerchantService {
         return map1;
         return map1;
     }
     }
 
 
-    /*
-    //好评优先 1
-    //起送费最低 2
-    //配送最快 3
-    //配送费最低 4
-    //人均最低 5
-    //人均最高 6
-    //距离 7
-    //销量 8
-
-    */
-    public void list(PageQuery pageQuery, Double longitude, Double latitude, String popularTag, Long userId,Integer sort){
-        //处于营业内
-        LocalTime now = LocalTime.now();
-        List<MerchantSettings> all = merchantSettingsRepo.findAll();
-        List<MerchantSettings> collect = all.stream()
-                .filter(a -> a.getStartTime().isBefore(now) && a.getEndTime().isAfter(now) && a.getPriority()>=2)
-                .collect(Collectors.toList());
-        List<Merchant> merchantList = new ArrayList<>();
+    //带距离的商家
+    public List<MerchantDTO> withDistance(Set<Merchant> merchants, Double longitude, Double latitude, Double range) {
+        Map<Merchant, Double> mers = this.distanceSorting(merchants, longitude, latitude, null);
         List<MerchantDTO> dtos = new ArrayList<>();
         List<MerchantDTO> dtos = new ArrayList<>();
-        collect.forEach(c->{
-            merchantRepo.findById(c.getMerchantId()).ifPresent(merchantList::add);
-            Merchant merchant = merchantRepo.findById(c.getMerchantId()).orElse(null);
-            if (merchant!=null){
-                dtos.add(new MerchantDTO(merchant,c));
-            }
-        });
-        switch (sort){
-            case 1:
-                merchantList.sort((a,b)->a.getGoodNum()-b.getBadNum().compareTo(b.getGoodNum()-b.getBadNum()));
-
+        for (Map.Entry<Merchant, Double> m : mers.entrySet()) {
+            merchantSettingsRepo.findByMerchantId(m.getKey().getId()).ifPresent(s -> dtos.add(new MerchantDTO(m.getKey(), s, m.getValue())));
         }
         }
-
+        return dtos;
     }
     }
 }
 }

+ 242 - 9
src/main/java/com/izouma/dingdong/service/merchant/MerchantSettingsService.java

@@ -1,6 +1,8 @@
 package com.izouma.dingdong.service.merchant;
 package com.izouma.dingdong.service.merchant;
 
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import com.izouma.dingdong.domain.MoneyRecord;
 import com.izouma.dingdong.domain.MoneyRecord;
 import com.izouma.dingdong.domain.OrderInfo;
 import com.izouma.dingdong.domain.OrderInfo;
 import com.izouma.dingdong.domain.User;
 import com.izouma.dingdong.domain.User;
@@ -11,24 +13,25 @@ import com.izouma.dingdong.domain.backstage.TimeTag;
 import com.izouma.dingdong.domain.merchant.Goods;
 import com.izouma.dingdong.domain.merchant.Goods;
 import com.izouma.dingdong.domain.merchant.Merchant;
 import com.izouma.dingdong.domain.merchant.Merchant;
 import com.izouma.dingdong.domain.merchant.MerchantSettings;
 import com.izouma.dingdong.domain.merchant.MerchantSettings;
+import com.izouma.dingdong.domain.user.UserCoupon;
+import com.izouma.dingdong.dto.FilterDTO;
 import com.izouma.dingdong.dto.MerchantDTO;
 import com.izouma.dingdong.dto.MerchantDTO;
+import com.izouma.dingdong.dto.PageQuery;
+import com.izouma.dingdong.enums.ApplyStatus;
 import com.izouma.dingdong.enums.FinancialType;
 import com.izouma.dingdong.enums.FinancialType;
 import com.izouma.dingdong.exception.BusinessException;
 import com.izouma.dingdong.exception.BusinessException;
-import com.izouma.dingdong.repo.AppraisalRepo;
-import com.izouma.dingdong.repo.MoneyRecordRepo;
-import com.izouma.dingdong.repo.OrderInfoRepo;
-import com.izouma.dingdong.repo.UserRepo;
+import com.izouma.dingdong.repo.*;
 import com.izouma.dingdong.repo.backstage.BannerRepo;
 import com.izouma.dingdong.repo.backstage.BannerRepo;
 import com.izouma.dingdong.repo.backstage.CategoryRepo;
 import com.izouma.dingdong.repo.backstage.CategoryRepo;
 import com.izouma.dingdong.repo.backstage.PromoteRepo;
 import com.izouma.dingdong.repo.backstage.PromoteRepo;
 import com.izouma.dingdong.repo.backstage.TimeTagRepo;
 import com.izouma.dingdong.repo.backstage.TimeTagRepo;
 import com.izouma.dingdong.repo.merchant.*;
 import com.izouma.dingdong.repo.merchant.*;
+import com.izouma.dingdong.repo.user.UserCouponRepo;
 import com.izouma.dingdong.service.backstage.CategoryService;
 import com.izouma.dingdong.service.backstage.CategoryService;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
-import org.springframework.data.domain.Sort;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
-import org.springframework.web.bind.annotation.PathVariable;
 
 
+import javax.persistence.criteria.Predicate;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
@@ -55,6 +58,9 @@ public class MerchantSettingsService {
     private GoodsSpecificationRepo goodsSpecificationRepo;
     private GoodsSpecificationRepo goodsSpecificationRepo;
     private MerchantClassificationRepo merchantClassificationRepo;
     private MerchantClassificationRepo merchantClassificationRepo;
     private FullReductionRepo fullReductionRepo;
     private FullReductionRepo fullReductionRepo;
+    private MerchantService merchantService;
+    private CouponRepo couponRepo;
+    private UserCouponRepo userCouponRepo;
 
 
     /*
     /*
     显示所有订单
     显示所有订单
@@ -184,8 +190,8 @@ public class MerchantSettingsService {
     /*
     /*
     人均消费 月订单
     人均消费 月订单
      */
      */
-    public BigDecimal consumption(Merchant merchant) {
-        List<OrderInfo> orders = orderInfoRepo.findAllByMerchantId(merchant.getId());
+    public BigDecimal consumption(Long merchantId) {
+        List<OrderInfo> orders = orderInfoRepo.findAllByMerchantId(merchantId);
         List<BigDecimal> collect = orders.stream().map(o ->
         List<BigDecimal> collect = orders.stream().map(o ->
                 o.getRealAmount().subtract(o.getDeliveryAmount())
                 o.getRealAmount().subtract(o.getDeliveryAmount())
         ).collect(Collectors.toList());
         ).collect(Collectors.toList());
@@ -226,12 +232,12 @@ public class MerchantSettingsService {
     }
     }
 
 
     //商家推广语
     //商家推广语
+    //每月一更
     public void merPromo() {
     public void merPromo() {
         List<Category> byParent = categoryRepo.findAllByParent(1L);
         List<Category> byParent = categoryRepo.findAllByParent(1L);
         byParent.forEach(this::accept);
         byParent.forEach(this::accept);
     }
     }
 
 
-
     private void accept(Category c) {
     private void accept(Category c) {
         List<MerchantDTO> list = categoryService.categoryMer(c.getId());
         List<MerchantDTO> list = categoryService.categoryMer(c.getId());
         List<Merchant> merchants = new ArrayList<>();
         List<Merchant> merchants = new ArrayList<>();
@@ -269,4 +275,231 @@ public class MerchantSettingsService {
         dto.setFullReductions(fullReductionRepo.findAllByMerchantId(id));
         dto.setFullReductions(fullReductionRepo.findAllByMerchantId(id));
         return dto;
         return dto;
     }
     }
+
+    /*
+    //好评优先 1
+    //起送费最低 2
+    //配送最快 3
+    //配送费最低 4
+    //人均最低 5
+    //人均最高 6
+    //距离 7
+    //销量 8
+    */
+    //排序
+    public List<MerchantDTO> listSort(Double longitude, Double latitude, Integer sort) {
+        //处于营业内
+        LocalTime now = LocalTime.now();
+        List<MerchantSettings> all = merchantSettingsRepo.findAll();
+
+        List<MerchantSettings> collect = all.stream()
+                .filter(a -> a.getStartTime().isBefore(now) && a.getEndTime().isAfter(now) && a.getPriority() >= 2)
+                .collect(Collectors.toList());
+        Set<Merchant> merchantList = new HashSet<>();
+
+        collect.forEach(c ->
+                merchantRepo.findById(c.getMerchantId()).ifPresent(merchantList::add)
+        );
+        //带距离 且按距离排好序
+        List<MerchantDTO> dtos = merchantService.withDistance(merchantList, longitude, latitude, null);
+
+        if (ObjectUtil.isNotNull(sort)) {
+            switch (sort) {
+                case 1:
+                    //好评
+                    dtos.sort((a, b) -> {
+                        Integer sumA = a.getGoodNum() - a.getBadNum() * 10;
+                        Integer sumB = b.getGoodNum() - b.getBadNum() * 10;
+                    /*if (i == 0) {
+                        return a.getDistance().compareTo(b.getDistance());
+                    }*/
+                        return sumA.compareTo(sumB);
+                    });
+                    break;
+                case 2:
+                    //起送价
+                    dtos.sort(Comparator.comparing(MerchantDTO::getStartingAmount));
+                    break;
+                case 3:
+                    //平均配送时间 暂时 准备时间
+                    dtos.sort(Comparator.comparing(MerchantDTO::getPreparationTime));
+                    break;
+                case 4:
+                    //配送费最低??
+                case 5:
+                    //人均最低
+                    dtos.sort((a, b) -> {
+                        BigDecimal conA = this.consumption(a.getMid());
+                        BigDecimal conB = this.consumption(b.getMid());
+                        return conA.compareTo(conB);
+                    });
+                    break;
+                case 6:
+                    //人均最高
+                    dtos.sort((a, b) -> {
+                        BigDecimal conA = this.consumption(a.getMid());
+                        BigDecimal conB = this.consumption(b.getMid());
+
+                        return conB.compareTo(conA);
+                    });
+                    break;
+                case 7:
+                    //距离
+                    //dtos.sort(Comparator.comparing(MerchantDTO::getDistance));
+                case 8:
+                    //月销
+                    dtos.sort((a, b) -> b.getMonthSales().compareTo(a.getMonthSales()));
+                    break;
+            }
+        }
+        return dtos;
+    }
+
+    public List<MerchantDTO> listFilter(List<MerchantDTO> dtos, Integer filter, Long userId) {
+        List<MerchantDTO> collect = new ArrayList<>();
+//        if (filter != null) {
+        switch (filter) {
+            case 1:
+                //首单立减
+                collect.addAll(dtos.stream()
+                        .filter(d -> d.getFirstOrder() != null && d.getFirstOrder().compareTo(BigDecimal.ZERO) > 0)
+                        .collect(Collectors.toList()));
+                break;
+            case 2:
+                //满减优惠
+                collect.addAll(dtos.stream()
+                        .filter(d -> CollUtil.isNotEmpty(fullReductionRepo.findAllByMerchantId(d.getMid())))
+                        .collect(Collectors.toList()));
+                break;
+            case 3:
+                //折扣商家
+                collect.addAll(dtos.stream()
+                        .filter(d -> StrUtil.isNotEmpty(merchantClassificationRepo.findByMerchantIdAndType(d.getMid(), 2).getGoodsIds()))
+                        .collect(Collectors.toList()));
+                break;
+            case 4:
+                //下单返红包
+                collect.addAll(dtos.stream()
+                        .filter(d -> CollUtil.isNotEmpty(couponRepo.findAllByMerchantIdAndEnabledTrue(d.getMid())))
+                        .collect(Collectors.toList()));
+                break;
+            case 5:
+                //可用红包
+                List<UserCoupon> coupons = userCouponRepo.findAllByUserIdAndIsUsedFalse(userId);
+                collect.addAll(dtos.stream()
+                        .filter(d ->
+                                ObjectUtil.isNotEmpty(coupons.stream().filter(c ->
+                                        !c.getCoupon().getEndDate().isBefore(LocalDate.now())
+                                                && (c.getCoupon().getMerchantId() == null || c.getCoupon().getMerchantId().equals(d.getMid()))
+                                ).collect(Collectors.toList()))
+                        )
+                        .collect(Collectors.toList()));
+                break;
+        }
+//        }
+        return collect;
+    }
+
+    //其他筛选条件
+    public List<MerchantDTO> otherFilter(List<MerchantDTO> dtos, FilterDTO filterDto) {
+        List<MerchantDTO> collect = new ArrayList<>();
+        if (filterDto.getNatureId() != null) {
+            //商家性质筛选
+            collect.addAll(dtos.stream()
+                    .filter(d -> d.getMerchantNatureId().equals(filterDto.getNatureId()))
+                    .collect(Collectors.toList()));
+        }
+
+        if (filterDto.getStartAmount() != null && filterDto.getEndAmount() != null) {
+            collect.addAll(dtos.stream()
+                    .filter(d -> this.consumption(d.getMid()).compareTo(filterDto.getStartAmount()) >= 0
+                            && this.consumption(d.getMid()).compareTo(filterDto.getEndAmount()) <= 0
+                    ).collect(Collectors.toList()));
+
+        } else if (filterDto.getStartAmount() != null) {
+            collect.addAll(dtos.stream()
+                    .filter(d -> this.consumption(d.getMid()).compareTo(filterDto.getStartAmount()) >= 0
+                    ).collect(Collectors.toList()));
+
+        } else if (filterDto.getEndAmount() != null) {
+            collect.addAll(dtos.stream()
+                    .filter(d -> this.consumption(d.getMid()).compareTo(filterDto.getEndAmount()) <= 0
+                    ).collect(Collectors.toList()));
+        } else {
+            collect.addAll(dtos);
+        }
+
+        if (filterDto.getTag() != null) {
+            switch (filterDto.getTag()) {
+                case 1:
+                    //新商家
+                    LocalDate date = LocalDate.now().minusMonths(1);
+                    LocalTime time = LocalTime.parse("00:00:00");
+                    LocalDateTime dateTime = LocalDateTime.of(date, time);
+                    collect.addAll(dtos.stream()
+                            .filter(d -> d.getEstablishTime().isAfter(dateTime))
+                            .collect(Collectors.toList()));
+                    break;
+
+                case 2:
+                    //明星商家
+
+                case 3:
+                    //口碑联盟
+                    collect.addAll(dtos.stream()
+                            .filter(MerchantDTO::getBuyAlliance)
+                            .collect(Collectors.toList()));
+            }
+        }
+        return collect;
+    }
+
+    public List<MerchantDTO> page(Double longitude, Double latitude, Integer sort, FilterDTO filterDto, Long userId) {
+        List<MerchantDTO> dtoList;
+        dtoList = this.listSort(longitude, latitude, sort);
+        if (filterDto.getFilter() != null) {
+            dtoList = this.listFilter(dtoList, filterDto.getFilter(), userId);
+        }
+        return this.otherFilter(dtoList, filterDto);
+    }
+
+
+    public List<MerchantDTO> showAll(PageQuery pageQuery, Double longitude, Double latitude, Integer popularTag, Long userId) {
+
+        List<Merchant> merchantList = merchantRepo.findAll((root, criteriaQuery, criteriaBuilder) -> {
+                    List<Predicate> predicates = new ArrayList<>();
+                    predicates.add(criteriaBuilder.equal(root.get("status"), ApplyStatus.PASS));
+                    if (StrUtil.isNotBlank(pageQuery.getSearch())) {
+                        predicates.add(criteriaBuilder.like(root.get("name"), "%" + pageQuery.getSearch() + "%"));
+                    }
+                    return criteriaBuilder.and(predicates.toArray(new Predicate[0]));
+                }
+        );
+
+        Set<Merchant> merchants = new HashSet<>(merchantList);
+
+        if (StrUtil.isNotBlank(pageQuery.getSearch())) {
+            List<Goods> goods = goodsRepo.findAll((root, criteriaQuery, criteriaBuilder) ->
+                    criteriaQuery.where(
+                            criteriaBuilder.and(
+                                    criteriaBuilder.like(root.get("name"), "%" + pageQuery.getSearch() + "%")),
+                            criteriaBuilder.equal(root.get("status"), ApplyStatus.PASS)).getRestriction()
+            );
+
+            goods.forEach(g -> {
+                Merchant merchant = merchantRepo.findById(g.getMerchantId()).orElse(null);
+                if (ObjectUtil.isNotNull(merchant) && ApplyStatus.PASS.equals(merchant.getStatus())) {
+                    merchants.add(merchant);
+                }
+            });
+        }
+
+        //带距离 且按距离排好序
+        List<MerchantDTO> dtos = merchantService.withDistance(merchants, longitude, latitude, null);
+        if (popularTag != null) {
+            return this.listFilter(dtos, popularTag, userId);
+        }
+        return dtos;
+    }
+
 }
 }

+ 28 - 8
src/main/vue/src/views/backstage/OrderRefundApplyList.vue

@@ -122,9 +122,10 @@
                             plain
                             plain
                     >通过
                     >通过
                     </el-button>
                     </el-button>
+
                     <el-button
                     <el-button
                             v-if="row.status === 'PENDING' && row.report"
                             v-if="row.status === 'PENDING' && row.report"
-                            @click="platformAudit(row, false)"
+                            @click="denyAudit(row)"
                             type="danger"
                             type="danger"
                             size="mini"
                             size="mini"
                             plain
                             plain
@@ -171,7 +172,7 @@
                     <el-input v-model="remark" type="textarea"></el-input>
                     <el-input v-model="remark" type="textarea"></el-input>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item>
                 <el-form-item>
-                    <el-button @click="platformAudit(row)">确定</el-button>
+                    <el-button @click="platformAudit(true)">确定</el-button>
                 </el-form-item>
                 </el-form-item>
             </el-form>
             </el-form>
 
 
@@ -221,6 +222,7 @@
                 merchantLiability: 0,
                 merchantLiability: 0,
                 riderLiability: 0,
                 riderLiability: 0,
                 remark: '',
                 remark: '',
+                value: [],
             }
             }
         },
         },
         computed: {
         computed: {
@@ -327,25 +329,43 @@
                     }
                     }
                 })
                 })
             },
             },
-            platformAudit(row, agree) {
-                this.$set(row, 'loading', true);
+            denyAudit(row){
                 this.$http
                 this.$http
                     .get('/orderRefundApply/platformAudit', {
                     .get('/orderRefundApply/platformAudit', {
                         id: row.id,
                         id: row.id,
-                        agree: agree,
+                        agree: false,
+                    })
+                    .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);
+                    });
+            },
+            platformAudit() {
+                this.$set(this.value, 'loading', true);
+                this.$http
+                    .get('/orderRefundApply/platformAudit', {
+                        id: this.value.id,
+                        agree: true,
                         merchantLiability: this.merchantLiability,
                         merchantLiability: this.merchantLiability,
                         riderLiability: this.riderLiability,
                         riderLiability: this.riderLiability,
                         remark: this.remark
                         remark: this.remark
 
 
                     })
                     })
                     .then(res => {
                     .then(res => {
-                        this.$set(row, 'loading', false);
+                        this.$set(this.value, 'loading', false);
                         this.$message.success('OK');
                         this.$message.success('OK');
+                        this.dislogForm = false;
                         this.getData();
                         this.getData();
                     })
                     })
                     .catch(e => {
                     .catch(e => {
                         console.log(e);
                         console.log(e);
-                        this.$set(row, 'loading', false);
+                        this.$set(this.value, 'loading', false);
                         this.$message.error(e.error);
                         this.$message.error(e.error);
                     });
                     });
             },
             },
@@ -367,7 +387,7 @@
             },
             },
             audit(row) {
             audit(row) {
                 this.dislogForm = true;
                 this.dislogForm = true;
-
+                this.value = row;
             }
             }
         }
         }
     }
     }

+ 16 - 3
src/test/java/com/izouma/dingdong/service/MerchantServiceTest.java

@@ -105,12 +105,25 @@ public class MerchantServiceTest {
         PageQuery pageQuery = new PageQuery();
         PageQuery pageQuery = new PageQuery();
         pageQuery.setPage(0);
         pageQuery.setPage(0);
         pageQuery.setSize(50);
         pageQuery.setSize(50);
-        pageQuery.setSearch("走马");
+        pageQuery.setSearch(null);
+        pageQuery.setSort("");
+        //118.738275 31.991961
+        List<MerchantDTO> list = merchantService.showAll(pageQuery, 1.0,1.0 , "首单立减", 82L);
+
+        System.out.println(list.size());
+    }
+
+    @Test
+    public void testAll2() {
+        PageQuery pageQuery = new PageQuery();
+        pageQuery.setPage(0);
+        pageQuery.setSize(50);
+        pageQuery.setSearch(null);
         pageQuery.setSort("");
         pageQuery.setSort("");
         //118.738275 31.991961
         //118.738275 31.991961
-        List<MerchantDTO> list = merchantService.showAll(pageQuery, 1.0,1.0 , null, 82L);
+        List<MerchantDTO> list = merchantSettingsService.showAll(pageQuery, 1.0,1.0 , 1, 82L);
 
 
-        System.out.println(list);
+        System.out.println(list.size());
     }
     }
 
 
 /*    @Test
 /*    @Test

+ 1 - 1
src/test/java/com/izouma/dingdong/service/OrderInfoServiceTest.java

@@ -15,7 +15,7 @@ public class OrderInfoServiceTest {
 
 
     @Test
     @Test
     public void testCancel(){
     public void testCancel(){
-        System.out.println(orderInfoService.cancel(1359L, RefundReason.ORDER_TIMEOUT));
+        System.out.println(orderInfoService.cancel(296L, RefundReason.ORDER_TIMEOUT));
     }
     }
 
 
 
 

+ 1 - 1
src/test/java/com/izouma/dingdong/service/OrderRefundApplyServiceTest.java

@@ -16,6 +16,6 @@ public class OrderRefundApplyServiceTest {
     @Test
     @Test
     public void test() {
     public void test() {
         //需要商家同意 都需要赔付骑手
         //需要商家同意 都需要赔付骑手
-        orderRefundApplyService.audit(1813L, false, true);
+        orderRefundApplyService.audit(1830L, false, true);
     }
     }
 }
 }