licailing пре 5 година
родитељ
комит
9e277c5d87
24 измењених фајлова са 1392 додато и 0 уклоњено
  1. 26 0
      src/main/java/com/izouma/dingdong/domain/merchant/GoodsSpecification.java
  2. 20 0
      src/main/java/com/izouma/dingdong/dto/FullReductionDTO.java
  3. 35 0
      src/main/java/com/izouma/dingdong/dto/GoodsSpecDTO.java
  4. 54 0
      src/main/java/com/izouma/dingdong/dto/UserOrderDTO.java
  5. 17 0
      src/main/java/com/izouma/dingdong/enums/BusinessNature.java
  6. 12 0
      src/main/java/com/izouma/dingdong/enums/Week.java
  7. 8 0
      src/main/java/com/izouma/dingdong/repo/OrderInfoRepo.java
  8. 12 0
      src/main/java/com/izouma/dingdong/repo/merchant/FullReductionRepo.java
  9. 12 0
      src/main/java/com/izouma/dingdong/repo/merchant/GoodsSpecificationRepo.java
  10. 8 0
      src/main/java/com/izouma/dingdong/repo/user/CouponRepo.java
  11. 56 0
      src/main/java/com/izouma/dingdong/service/OrderInfoService.java
  12. 50 0
      src/main/java/com/izouma/dingdong/service/merchant/FullReductionService.java
  13. 14 0
      src/main/java/com/izouma/dingdong/service/merchant/GoodsSpecificationService.java
  14. 14 0
      src/main/java/com/izouma/dingdong/service/user/CouponService.java
  15. 60 0
      src/main/java/com/izouma/dingdong/web/OrderInfoController.java
  16. 76 0
      src/main/java/com/izouma/dingdong/web/merchant/FullReductionController.java
  17. 75 0
      src/main/java/com/izouma/dingdong/web/merchant/GoodsSpecificationController.java
  18. 63 0
      src/main/java/com/izouma/dingdong/web/user/CouponController.java
  19. 0 0
      src/main/resources/genjson/Coupon.json
  20. 0 0
      src/main/resources/genjson/OrderInfo.json
  21. 136 0
      src/main/vue/src/views/CouponEdit.vue
  22. 211 0
      src/main/vue/src/views/CouponList.vue
  23. 181 0
      src/main/vue/src/views/OrderInfoEdit.vue
  24. 252 0
      src/main/vue/src/views/OrderInfoList.vue

+ 26 - 0
src/main/java/com/izouma/dingdong/domain/merchant/GoodsSpecification.java

@@ -0,0 +1,26 @@
+package com.izouma.dingdong.domain.merchant;
+
+import com.izouma.dingdong.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+
+import javax.persistence.Entity;
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+//@JsonIgnoreProperties(value = { "hibernateLazyInitializer"})
+@ApiModel(value = "GoodsSpecification", description = "商品规格")
+public class GoodsSpecification extends BaseEntity implements Serializable {
+
+    private Long goodsId;
+
+    private String name;
+
+    private BigDecimal amount;
+}

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

@@ -0,0 +1,20 @@
+package com.izouma.dingdong.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class FullReductionDTO implements Serializable {
+    @ApiModelProperty(value = "满额", name = "fullAmount")
+    private BigDecimal fullAmount;
+
+    @ApiModelProperty(value = "减额", name = "minusAmount")
+    private BigDecimal minusAmount;
+}

+ 35 - 0
src/main/java/com/izouma/dingdong/dto/GoodsSpecDTO.java

@@ -0,0 +1,35 @@
+package com.izouma.dingdong.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+@ApiModel(value = "订单商品及规格", description = "订单商品及规格")
+public class GoodsSpecDTO {
+/*    @ApiModelProperty(value = "订单ID", name = "orderId")
+    private Long orderId;*/
+
+    @ApiModelProperty(value = "商品ID", name = "goodsId")
+    private Long goodsId;
+
+    private String goodsName;
+
+    @ApiModelProperty(value = "规格", name = "specification")
+    private String specification;
+
+    @ApiModelProperty(value = "数量", name = "num")
+    private Integer num;
+
+    @ApiModelProperty(value = "商品价格", name = "goodsPrice")
+    private BigDecimal goodsPrice;
+
+}

+ 54 - 0
src/main/java/com/izouma/dingdong/dto/UserOrderDTO.java

@@ -0,0 +1,54 @@
+package com.izouma.dingdong.dto;
+
+import com.izouma.dingdong.enums.PayMethod;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+@ApiModel(value = "用户下单")
+public class UserOrderDTO {
+
+    private Long userId;
+
+    private Long addressId;
+
+    private List<GoodsSpecDTO> goodsSpecs;
+
+    @ApiModelProperty(value = "包装价格",name = "packingPrice")
+    private BigDecimal packingPrice;
+
+    @ApiModelProperty(value = "配送费", name = "deliveryAmount")
+    private BigDecimal deliveryAmount;
+
+/*    @ApiModelProperty(value = "是否使用优惠券", name = "isCoupon")
+    private Boolean isCoupon;*/
+
+    @ApiModelProperty(value = "优惠券ID", name = "couponId")
+    private Long couponId;
+
+    private BigDecimal fullReduction;
+
+    private BigDecimal firstBuy;
+
+    private BigDecimal redBag;
+
+    private BigDecimal newUser;
+
+    private BigDecimal total;
+
+    @ApiModelProperty(value = "实付金额", name = "realAmount")
+    private BigDecimal realAmount;
+
+    private String remark;
+}

+ 17 - 0
src/main/java/com/izouma/dingdong/enums/BusinessNature.java

@@ -0,0 +1,17 @@
+package com.izouma.dingdong.enums;
+
+public enum BusinessNature {
+    SELF_EMPLOYED("自营"),
+    CHAIN_STORE("连锁"),
+    FRANCHISE("加盟");
+
+    private final String description;
+
+    public String getDescription() {
+        return description;
+    }
+
+    BusinessNature(String description) {
+        this.description = description;
+    }
+}

+ 12 - 0
src/main/java/com/izouma/dingdong/enums/Week.java

@@ -0,0 +1,12 @@
+package com.izouma.dingdong.enums;
+
+public enum Week {
+    EVERYDAY,
+    MONDAY,
+    TUESDAY,
+    WEDNESDAY,
+    THURSDAY,
+    FRIDAY,
+    SATURDAY,
+    SUNDAY;
+}

+ 8 - 0
src/main/java/com/izouma/dingdong/repo/OrderInfoRepo.java

@@ -0,0 +1,8 @@
+package com.izouma.dingdong.repo;
+
+import com.izouma.dingdong.domain.OrderInfo;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+public interface OrderInfoRepo extends JpaRepository<OrderInfo, Long>, JpaSpecificationExecutor<OrderInfo> {
+}

+ 12 - 0
src/main/java/com/izouma/dingdong/repo/merchant/FullReductionRepo.java

@@ -0,0 +1,12 @@
+package com.izouma.dingdong.repo.merchant;
+
+import com.izouma.dingdong.domain.merchant.FullReduction;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+import java.util.List;
+
+public interface FullReductionRepo extends JpaRepository<FullReduction, Long>, JpaSpecificationExecutor<FullReduction> {
+    //查找商户下的所有商品
+    List<FullReduction> findAllByMerchantId(Long merchantId);
+}

+ 12 - 0
src/main/java/com/izouma/dingdong/repo/merchant/GoodsSpecificationRepo.java

@@ -0,0 +1,12 @@
+package com.izouma.dingdong.repo.merchant;
+
+import com.izouma.dingdong.domain.merchant.GoodsSpecification;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+import java.util.List;
+
+public interface GoodsSpecificationRepo extends JpaRepository<GoodsSpecification, Long>, JpaSpecificationExecutor<GoodsSpecification> {
+    //按商品ID查询
+    List<GoodsSpecification> findAllByGoodsId(Long goodsId);
+}

+ 8 - 0
src/main/java/com/izouma/dingdong/repo/user/CouponRepo.java

@@ -0,0 +1,8 @@
+package com.izouma.dingdong.repo.user;
+
+import com.izouma.dingdong.domain.user.Coupon;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+public interface CouponRepo extends JpaRepository<Coupon, Long>, JpaSpecificationExecutor<Coupon> {
+}

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

@@ -0,0 +1,56 @@
+package com.izouma.dingdong.service;
+
+import com.izouma.dingdong.domain.OrderInfo;
+import com.izouma.dingdong.domain.merchant.Goods;
+import com.izouma.dingdong.domain.user.Coupon;
+import com.izouma.dingdong.dto.GoodsSpecDTO;
+import com.izouma.dingdong.dto.UserOrderDTO;
+import com.izouma.dingdong.enums.CouponType;
+import com.izouma.dingdong.exception.BusinessException;
+import com.izouma.dingdong.repo.OrderInfoRepo;
+import com.izouma.dingdong.repo.user.CouponRepo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Service
+@AllArgsConstructor
+public class OrderInfoService {
+
+    private OrderInfoRepo orderInfoRepo;
+    private CouponRepo couponRepo;
+
+    /*
+    用户下单
+     */
+    public void userOrder(UserOrderDTO userOrderDTO) {
+        List<GoodsSpecDTO> goodsSpec = userOrderDTO.getGoodsSpecs();
+
+
+    }
+
+    /*
+    计算价钱
+     */
+    private void sumAmount(OrderInfo orderInfo) {
+
+
+
+        Coupon coupon = couponRepo.findById(orderInfo.getCouponId()).orElseThrow(new BusinessException("优惠卷不存在"));
+        CouponType type = coupon.getType();
+        BigDecimal goodsAmount = orderInfo.getGoodsAmount();
+        if (type == CouponType.REDUCTION) {
+            if (goodsAmount.compareTo(coupon.getFullAmount()) >= 0){
+                goodsAmount.subtract(coupon.getAmount());
+            }
+
+        }
+
+        coupon.setUsedTime(LocalDateTime.now());
+        coupon.setIsUsed(true);
+    }
+
+}

+ 50 - 0
src/main/java/com/izouma/dingdong/service/merchant/FullReductionService.java

@@ -0,0 +1,50 @@
+package com.izouma.dingdong.service.merchant;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.izouma.dingdong.domain.merchant.FullReduction;
+import com.izouma.dingdong.domain.merchant.Merchant;
+import com.izouma.dingdong.dto.FullReductionDTO;
+import com.izouma.dingdong.exception.BusinessException;
+import com.izouma.dingdong.repo.merchant.FullReductionRepo;
+import com.izouma.dingdong.repo.merchant.MerchantRepo;
+import com.izouma.dingdong.utils.ObjUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@AllArgsConstructor
+public class FullReductionService {
+
+    private FullReductionRepo fullReductionRepo;
+
+    private MerchantRepo merchantRepo;
+
+    private MerchantService merchantService;
+
+    /*
+    添加
+     */
+    public void add(Long userId, List<FullReductionDTO> fullReductionDTOS) {
+        Long merchantId = merchantService.findMerchantId(userId);
+
+        for (FullReductionDTO dto : fullReductionDTOS) {
+            toDTO(merchantId, dto);
+        }
+    }
+
+    /*
+    DTO转实体
+     */
+    private void toDTO(Long merchantId, FullReductionDTO dto) {
+        if (dto.getFullAmount().compareTo(dto.getMinusAmount()) <= 0) {
+            throw new BusinessException("减的金额不能大于等于满的金额");
+        }
+        FullReduction fullReduction = new FullReduction();
+        fullReduction.setFullAmount(dto.getFullAmount());
+        fullReduction.setMinusAmount(dto.getMinusAmount());
+        fullReduction.setMerchantId(merchantId);
+        fullReductionRepo.save(fullReduction);
+    }
+}

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

@@ -0,0 +1,14 @@
+package com.izouma.dingdong.service.merchant;
+
+import com.izouma.dingdong.domain.merchant.GoodsSpecification;
+import com.izouma.dingdong.repo.merchant.GoodsSpecificationRepo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class GoodsSpecificationService {
+
+    private GoodsSpecificationRepo goodsSpecificationRepo;
+
+}

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

@@ -0,0 +1,14 @@
+package com.izouma.dingdong.service.user;
+
+import com.izouma.dingdong.domain.user.Coupon;
+import com.izouma.dingdong.repo.user.CouponRepo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class CouponService {
+
+    private CouponRepo couponRepo;
+
+}

+ 60 - 0
src/main/java/com/izouma/dingdong/web/OrderInfoController.java

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

+ 76 - 0
src/main/java/com/izouma/dingdong/web/merchant/FullReductionController.java

@@ -0,0 +1,76 @@
+package com.izouma.dingdong.web.merchant;
+
+import com.izouma.dingdong.repo.merchant.MerchantRepo;
+import com.izouma.dingdong.service.merchant.MerchantService;
+import com.izouma.dingdong.utils.SecurityUtils;
+import com.izouma.dingdong.web.BaseController;
+import com.izouma.dingdong.domain.merchant.FullReduction;
+import com.izouma.dingdong.service.merchant.FullReductionService;
+import com.izouma.dingdong.dto.PageQuery;
+import com.izouma.dingdong.exception.BusinessException;
+import com.izouma.dingdong.repo.merchant.FullReductionRepo;
+import com.izouma.dingdong.utils.ObjUtils;
+import com.izouma.dingdong.utils.excel.ExcelUtils;
+
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/fullReduction")
+@AllArgsConstructor
+public class FullReductionController extends BaseController {
+    private FullReductionService fullReductionService;
+    private FullReductionRepo fullReductionRepo;
+    private MerchantRepo merchantRepo;
+    private MerchantService merchantService;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public FullReduction save(@RequestBody FullReduction record) {
+        if (record.getFullAmount().compareTo(record.getMinusAmount()) <= 0) {
+            throw new BusinessException("减的金额不能大于等于满的金额");
+        }
+        if (record.getId() != null) {
+            FullReduction orig = fullReductionRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return fullReductionRepo.save(orig);
+        }
+        return fullReductionRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @GetMapping("/all")
+    public Page<FullReduction> all(PageQuery pageQuery) {
+        return fullReductionRepo.findAll(toSpecification(pageQuery,FullReduction.class), toPageRequest(pageQuery));
+    }
+
+    @GetMapping("/get/{id}")
+    public FullReduction get(@PathVariable Long id) {
+        return fullReductionRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        fullReductionRepo.deleteById(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<FullReduction> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+
+    @GetMapping("/my")
+    public List<FullReduction> my(){
+        return fullReductionRepo.findAllByMerchantId(merchantService.findMerchantId(SecurityUtils.getAuthenticatedUser().getId()));
+    }
+}
+

+ 75 - 0
src/main/java/com/izouma/dingdong/web/merchant/GoodsSpecificationController.java

@@ -0,0 +1,75 @@
+package com.izouma.dingdong.web.merchant;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.izouma.dingdong.repo.merchant.GoodsRepo;
+import com.izouma.dingdong.web.BaseController;
+import com.izouma.dingdong.domain.merchant.GoodsSpecification;
+import com.izouma.dingdong.service.merchant.GoodsSpecificationService;
+import com.izouma.dingdong.dto.PageQuery;
+import com.izouma.dingdong.exception.BusinessException;
+import com.izouma.dingdong.repo.merchant.GoodsSpecificationRepo;
+import com.izouma.dingdong.utils.ObjUtils;
+import com.izouma.dingdong.utils.excel.ExcelUtils;
+
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/goodsSpecification")
+@AllArgsConstructor
+public class GoodsSpecificationController extends BaseController {
+    private GoodsSpecificationService goodsSpecificationService;
+    private GoodsSpecificationRepo goodsSpecificationRepo;
+
+    private GoodsRepo goodsRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public GoodsSpecification save(/*@RequestBody*/ GoodsSpecification record) {
+        goodsRepo.findById(record.getGoodsId()).orElseThrow(new BusinessException("商品不存在"));
+        if (record.getId() != null) {
+            GoodsSpecification orig = goodsSpecificationRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return goodsSpecificationRepo.save(orig);
+        }
+        return goodsSpecificationRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @GetMapping("/all")
+    public Page<GoodsSpecification> all(PageQuery pageQuery) {
+        return goodsSpecificationRepo.findAll(toSpecification(pageQuery,GoodsSpecification.class), toPageRequest(pageQuery));
+    }
+
+    @GetMapping("/get/{id}")
+    public GoodsSpecification get(@PathVariable Long id) {
+        return goodsSpecificationRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        goodsSpecificationRepo.deleteById(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<GoodsSpecification> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+
+    @GetMapping("/byGoodsId")
+    @ApiOperation("按商品ID查询")
+    public List<GoodsSpecification> byGoodsId(Long goodsId){
+        return goodsSpecificationRepo.findAllByGoodsId(goodsId);
+    }
+}
+

+ 63 - 0
src/main/java/com/izouma/dingdong/web/user/CouponController.java

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

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
src/main/resources/genjson/Coupon.json


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
src/main/resources/genjson/OrderInfo.json


+ 136 - 0
src/main/vue/src/views/CouponEdit.vue

@@ -0,0 +1,136 @@
+<template>
+    <div class="edit-view">
+        <el-form :model="formData" :rules="rules" ref="form" label-width="94px" label-position="right" size="small"
+                 style="max-width: 500px;">
+                <el-form-item prop="userId" label="用户ID">
+                            <el-input-number type="number" v-model="formData.userId"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="name" label="优惠券名称">
+                            <el-input v-model="formData.name"></el-input>
+                </el-form-item>
+                <el-form-item prop="amount" label="金额">
+                            <el-input-number type="number" v-model="formData.amount"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="startDate" label="开始时间">
+                            <el-date-picker
+                                    v-model="formData.startDate"
+                                    type="date"
+                                    value-format="yyyy-MM-dd"
+                                    placeholder="选择日期">
+                            </el-date-picker>
+                </el-form-item>
+                <el-form-item prop="endDate" label="截止时间">
+                            <el-date-picker
+                                    v-model="formData.endDate"
+                                    type="date"
+                                    value-format="yyyy-MM-dd"
+                                    placeholder="选择日期">
+                            </el-date-picker>
+                </el-form-item>
+                <el-form-item prop="isExpired" label="是否过期">
+                            <el-switch v-model="formData.isExpired"></el-switch>
+                </el-form-item>
+                <el-form-item prop="isUsed" label="是否已使用">
+                            <el-switch v-model="formData.isUsed"></el-switch>
+                </el-form-item>
+                <el-form-item prop="type" label="优惠券类型">
+                            <el-select v-model="formData.type" clearable filterable  placeholder="请选择">
+                                <el-option
+                                        v-for="item in typeOptions"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value">
+                                </el-option>
+                            </el-select>
+                </el-form-item>
+                <el-form-item prop="fullAmount" label="满额">
+                            <el-input-number type="number" v-model="formData.fullAmount"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="discount" label="折扣">
+                            <el-input-number type="number" v-model="formData.discount"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="merchantId" label="商家ID">
+                            <el-input-number type="number" v-model="formData.merchantId"></el-input-number>
+                </el-form-item>
+            <el-form-item>
+                <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: 'CouponEdit',
+        created() {
+            if (this.$route.query.id) {
+                this.$http
+                    .get('coupon/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: {
+                },
+                            typeOptions:[{"label":"DISCOUNT","value":"DISCOUNT"},{"label":"CREDIT","value":"CREDIT"},{"label":"REDUCTION","value":"REDUCTION"}],
+            }
+        },
+        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('/coupon/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(`/coupon/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>

+ 211 - 0
src/main/vue/src/views/CouponList.vue

@@ -0,0 +1,211 @@
+<template>
+    <div  class="list-view">
+        <div class="filters-container">
+            <el-input placeholder="输入关键字" v-model="search" clearable
+                      class="filter-item"></el-input>
+            <el-button @click="getData" type="primary" icon="el-icon-search"
+                       class="filter-item">搜索
+            </el-button>
+            <el-button @click="addRow" type="primary" icon="el-icon-plus"
+                       class="filter-item">添加
+            </el-button>
+            <el-button @click="download" type="primary" icon="el-icon-download"
+                       :loading="downloading" class="filter-item">导出EXCEL
+            </el-button>
+        </div>
+        <el-table :data="tableData" row-key="id" ref="table"
+                  header-row-class-name="table-header-row"
+                  header-cell-class-name="table-header-cell"
+                  row-class-name="table-row" cell-class-name="table-cell"
+                  :height="tableHeight">
+            <el-table-column v-if="multipleMode" align="center" type="selection"
+                             width="50">
+            </el-table-column>
+            <el-table-column prop="id" label="ID" width="100">
+            </el-table-column>
+                                <el-table-column prop="userId" label="用户ID"
+>
+                    </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="isUsed" label="是否已使用"
+>
+                            <template slot-scope="{row}">
+                                <el-tag :type="row.isUsed?'':'info'">{{row.isUsed}}</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="折扣"
+>
+                    </el-table-column>
+                    <el-table-column prop="merchantId" label="商家ID"
+>
+                    </el-table-column>
+            <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    min-width="150">
+                <template slot-scope="{row}">
+                    <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <!-- <div class="multiple-mode-wrapper">
+                <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button @click="operation1">批量操作1</el-button>
+                    <el-button @click="operation2">批量操作2</el-button>
+                    <el-button @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div> -->
+            <el-pagination background @size-change="onSizeChange"
+                           @current-change="onCurrentChange" :current-page="page"
+                           :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize"
+                           layout="total, sizes, prev, pager, next, jumper"
+                           :total="totalElements">
+            </el-pagination>
+        </div>
+
+    </div>
+</template>
+<script>
+    import { mapState } from "vuex";
+    import pageableTable from "@/mixins/pageableTable";
+
+    export default {
+        name: 'CouponList',
+        mixins: [pageableTable],
+        created() {
+            this.getData();
+        },
+        data() {
+            return {
+                multipleMode: false,
+                search: "",
+                url: "/coupon/all",
+                downloading: false,
+                        typeOptions:[{"label":"DISCOUNT","value":"DISCOUNT"},{"label":"CREDIT","value":"CREDIT"},{"label":"REDUCTION","value":"REDUCTION"}],
+            }
+        },
+        computed: {
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+                    typeFormatter(row, column, cellValue, index) {
+                        let selectedOption = this.typeOptions.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: "/couponEdit",
+                    query: {
+                    ...this.$route.query
+                    }
+                });
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: "/couponEdit",
+                    query: {
+                    id: row.id
+                    }
+                });
+            },
+            download() {
+                this.downloading = true;
+                this.$axios
+                    .get("/coupon/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(`/coupon/del/${row.id}`)
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

+ 181 - 0
src/main/vue/src/views/OrderInfoEdit.vue

@@ -0,0 +1,181 @@
+<template>
+    <div class="edit-view">
+        <el-form :model="formData" :rules="rules" ref="form" label-width="108px" 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="userAddress" label="配送地址">
+                            <el-input v-model="formData.userAddress"></el-input>
+                </el-form-item>
+                <el-form-item prop="merchantId" label="商户ID">
+                            <el-input-number type="number" v-model="formData.merchantId"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="goodsId" label="商品ID">
+                            <el-input-number type="number" v-model="formData.goodsId"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="merchantStatus" label="商家状态">
+                            <el-input v-model="formData.merchantStatus"></el-input>
+                </el-form-item>
+                <el-form-item prop="merchantAddress" label="商家地址">
+                            <el-input v-model="formData.merchantAddress"></el-input>
+                </el-form-item>
+                <el-form-item prop="jobNumber" label="骑手工号">
+                            <el-input v-model="formData.jobNumber"></el-input>
+                </el-form-item>
+                <el-form-item prop="riderStatus" label="骑手状态">
+                            <el-select v-model="formData.riderStatus" clearable filterable  placeholder="请选择">
+                                <el-option
+                                        v-for="item in riderStatusOptions"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value">
+                                </el-option>
+                            </el-select>
+                </el-form-item>
+                <el-form-item prop="totalAmount" label="总价">
+                            <el-input-number type="number" v-model="formData.totalAmount"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="goodsAmount" label="商品总价">
+                            <el-input-number type="number" v-model="formData.goodsAmount"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="deliveryAmount" label="配送费">
+                            <el-input-number type="number" v-model="formData.deliveryAmount"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="realAmount" label="实付金额">
+                            <el-input-number type="number" v-model="formData.realAmount"></el-input-number>
+                </el-form-item>
+                <el-form-item prop="payMethod" label="支付方式">
+                            <el-select v-model="formData.payMethod" clearable filterable  placeholder="请选择">
+                                <el-option
+                                        v-for="item in payMethodOptions"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value">
+                                </el-option>
+                            </el-select>
+                </el-form-item>
+                <el-form-item prop="cancel" label="取消订单">
+                            <el-switch v-model="formData.cancel"></el-switch>
+                </el-form-item>
+                <el-form-item prop="rated" label="已评价">
+                            <el-switch v-model="formData.rated"></el-switch>
+                </el-form-item>
+                <el-form-item prop="orderTime" label="下单时间">
+                            <el-date-picker
+                                    v-model="formData.orderTime"
+                                    type="datetime"
+                                    value-format="yyyy-MM-dd HH:mm:ss"
+                                    placeholder="选择日期时间">
+                            </el-date-picker>
+                </el-form-item>
+                <el-form-item prop="merchantOrderTime" label="商家接单时间">
+                            <el-date-picker
+                                    v-model="formData.merchantOrderTime"
+                                    type="datetime"
+                                    value-format="yyyy-MM-dd HH:mm:ss"
+                                    placeholder="选择日期时间">
+                            </el-date-picker>
+                </el-form-item>
+                <el-form-item prop="riderOrderTime" label="骑手接单时间">
+                            <el-date-picker
+                                    v-model="formData.riderOrderTime"
+                                    type="datetime"
+                                    value-format="yyyy-MM-dd HH:mm:ss"
+                                    placeholder="选择日期时间">
+                            </el-date-picker>
+                </el-form-item>
+                <el-form-item prop="userReceivedTime" label="用户收到时间">
+                            <el-date-picker
+                                    v-model="formData.userReceivedTime"
+                                    type="datetime"
+                                    value-format="yyyy-MM-dd HH:mm:ss"
+                                    placeholder="选择日期时间">
+                            </el-date-picker>
+                </el-form-item>
+                <el-form-item prop="isCoupon" label="使用优惠券">
+                            <el-switch v-model="formData.isCoupon"></el-switch>
+                </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: 'OrderInfoEdit',
+        created() {
+            if (this.$route.query.id) {
+                this.$http
+                    .get('orderInfo/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: {
+                },
+                            riderStatusOptions:[{"label":"JIEDAN","value":"JIEDAN"},{"label":"QUCAN","value":"QUCAN"},{"label":"SONGCAN","value":"SONGCAN"},{"label":"WANCHENG","value":"WANCHENG"}],
+                            payMethodOptions:[{"label":"支付宝","value":"ALI_PAY"},{"label":"货到付款","value":"CASH_DELIVERY"},{"label":"信用卡","value":"CREDIT_CARD"}],
+            }
+        },
+        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('/orderInfo/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(`/orderInfo/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>

+ 252 - 0
src/main/vue/src/views/OrderInfoList.vue

@@ -0,0 +1,252 @@
+<template>
+    <div  class="list-view">
+        <div class="filters-container">
+            <el-input placeholder="输入关键字" v-model="search" clearable
+                      class="filter-item"></el-input>
+            <el-button @click="getData" type="primary" icon="el-icon-search"
+                       class="filter-item">搜索
+            </el-button>
+            <el-button @click="addRow" type="primary" icon="el-icon-plus"
+                       class="filter-item">添加
+            </el-button>
+            <el-button @click="download" type="primary" icon="el-icon-download"
+                       :loading="downloading" class="filter-item">导出EXCEL
+            </el-button>
+        </div>
+        <el-table :data="tableData" row-key="id" ref="table"
+                  header-row-class-name="table-header-row"
+                  header-cell-class-name="table-header-cell"
+                  row-class-name="table-row" cell-class-name="table-cell"
+                  :height="tableHeight">
+            <el-table-column v-if="multipleMode" align="center" type="selection"
+                             width="50">
+            </el-table-column>
+            <el-table-column prop="id" label="ID" width="100">
+            </el-table-column>
+                                <el-table-column prop="userId" label="用户ID"
+>
+                    </el-table-column>
+                    <el-table-column prop="userAddress" label="配送地址"
+>
+                    </el-table-column>
+                    <el-table-column prop="merchantId" label="商户ID"
+>
+                    </el-table-column>
+                    <el-table-column prop="goodsId" label="商品ID"
+>
+                    </el-table-column>
+                    <el-table-column prop="merchantStatus" label="商家状态"
+>
+                    </el-table-column>
+                    <el-table-column prop="merchantAddress" label="商家地址"
+>
+                    </el-table-column>
+                    <el-table-column prop="jobNumber" label="骑手工号"
+>
+                    </el-table-column>
+                    <el-table-column prop="riderStatus" label="骑手状态"
+                            :formatter="riderStatusFormatter"
+                        >
+                    </el-table-column>
+                    <el-table-column prop="totalAmount" label="总价"
+>
+                    </el-table-column>
+                    <el-table-column prop="goodsAmount" label="商品总价"
+>
+                    </el-table-column>
+                    <el-table-column prop="deliveryAmount" label="配送费"
+>
+                    </el-table-column>
+                    <el-table-column prop="realAmount" label="实付金额"
+>
+                    </el-table-column>
+                    <el-table-column prop="payMethod" label="支付方式"
+                            :formatter="payMethodFormatter"
+                        >
+                    </el-table-column>
+                    <el-table-column prop="cancel" label="取消订单"
+>
+                            <template slot-scope="{row}">
+                                <el-tag :type="row.cancel?'':'info'">{{row.cancel}}</el-tag>
+                            </template>
+                    </el-table-column>
+                    <el-table-column prop="rated" label="已评价"
+>
+                            <template slot-scope="{row}">
+                                <el-tag :type="row.rated?'':'info'">{{row.rated}}</el-tag>
+                            </template>
+                    </el-table-column>
+                    <el-table-column prop="orderTime" label="下单时间"
+                            :formatter="datetimeFormatter"
+>
+                    </el-table-column>
+                    <el-table-column prop="merchantOrderTime" label="商家接单时间"
+                            :formatter="datetimeFormatter"
+>
+                    </el-table-column>
+                    <el-table-column prop="riderOrderTime" label="骑手接单时间"
+                            :formatter="datetimeFormatter"
+>
+                    </el-table-column>
+                    <el-table-column prop="userReceivedTime" label="用户收到时间"
+                            :formatter="datetimeFormatter"
+>
+                    </el-table-column>
+                    <el-table-column prop="isCoupon" label="使用优惠券"
+>
+                            <template slot-scope="{row}">
+                                <el-tag :type="row.isCoupon?'':'info'">{{row.isCoupon}}</el-tag>
+                            </template>
+                    </el-table-column>
+            <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    min-width="150">
+                <template slot-scope="{row}">
+                    <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <!-- <div class="multiple-mode-wrapper">
+                <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button @click="operation1">批量操作1</el-button>
+                    <el-button @click="operation2">批量操作2</el-button>
+                    <el-button @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div> -->
+            <el-pagination background @size-change="onSizeChange"
+                           @current-change="onCurrentChange" :current-page="page"
+                           :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize"
+                           layout="total, sizes, prev, pager, next, jumper"
+                           :total="totalElements">
+            </el-pagination>
+        </div>
+
+    </div>
+</template>
+<script>
+    import { mapState } from "vuex";
+    import pageableTable from "@/mixins/pageableTable";
+
+    export default {
+        name: 'OrderInfoList',
+        mixins: [pageableTable],
+        created() {
+            this.getData();
+        },
+        data() {
+            return {
+                multipleMode: false,
+                search: "",
+                url: "/orderInfo/all",
+                downloading: false,
+                        riderStatusOptions:[{"label":"JIEDAN","value":"JIEDAN"},{"label":"QUCAN","value":"QUCAN"},{"label":"SONGCAN","value":"SONGCAN"},{"label":"WANCHENG","value":"WANCHENG"}],
+                        payMethodOptions:[{"label":"支付宝","value":"ALI_PAY"},{"label":"货到付款","value":"CASH_DELIVERY"},{"label":"信用卡","value":"CREDIT_CARD"}],
+            }
+        },
+        computed: {
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+                    riderStatusFormatter(row, column, cellValue, index) {
+                        let selectedOption = this.riderStatusOptions.find(i => i.value === cellValue);
+                        if (selectedOption) {
+                            return selectedOption.label;
+                        }
+                        return '';
+                    },
+                    payMethodFormatter(row, column, cellValue, index) {
+                        let selectedOption = this.payMethodOptions.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: "/orderInfoEdit",
+                    query: {
+                    ...this.$route.query
+                    }
+                });
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: "/orderInfoEdit",
+                    query: {
+                    id: row.id
+                    }
+                });
+            },
+            download() {
+                this.downloading = true;
+                this.$axios
+                    .get("/orderInfo/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(`/orderInfo/del/${row.id}`)
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

Неке датотеке нису приказане због велике количине промена