From 272188e47087a8ef92eb0a48b122fa1c73ea94d3 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期二, 24 九月 2024 00:15:25 +0800
Subject: [PATCH] Merge remote-tracking branch 'remote-v2/master-v2' into master-v2

---
 src/main/java/com/mzl/flower/dto/response/point/CustomerPointDetailDTO.java         |    5 
 src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplatePointDTO.java   |    8 
 src/main/java/com/mzl/flower/mapper/flower/FlowerCategoryMapper.java                |    2 
 src/main/java/com/mzl/flower/service/payment/OrderService.java                      |   76 +++++
 src/main/java/com/mzl/flower/dto/request/partner/ChangePartnerAreaDTO.java          |    4 
 src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateVipController.java         |   14 
 src/main/java/com/mzl/flower/dto/request/partner/UpdatePartnerBaseDTO.java          |   24 +
 src/main/java/com/mzl/flower/dto/request/menber/UserGrowthRecordDTO.java            |    3 
 src/main/java/com/mzl/flower/entity/partner/Partner.java                            |    4 
 src/main/java/com/mzl/flower/service/coupon/CouponTemplateService2.java             |    1 
 src/main/resources/mapper/flower/FlowerMapper.xml                                   |    6 
 src/main/java/com/mzl/flower/service/impl/coupon/CouponRecordServiceImpl.java       |   28 +
 src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java      |   34 ++
 src/main/java/com/mzl/flower/service/payment/DeliveryOrderService.java              |   27 +
 src/main/java/com/mzl/flower/web/flower/FlowerCategoryController.java               |    6 
 src/main/java/com/mzl/flower/service/menber/impl/MemberGrowthRecordServiceImpl.java |    2 
 src/main/java/com/mzl/flower/dto/request/menber/MemberDTO.java                      |    5 
 src/main/java/com/mzl/flower/web/partner/PartnerController.java                     |    8 
 src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateVipDTO.java     |    3 
 src/main/java/com/mzl/flower/dto/response/payment/OrderSettlementDetailDTO.java     |    2 
 src/main/java/com/mzl/flower/service/point/CustomerPointService.java                |    8 
 src/main/resources/mapper/payment/OrderSettlementMapper.xml                         |    2 
 src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java       |   14 
 src/main/java/com/mzl/flower/dto/request/point/QueryPointDetailDTO.java             |   14 +
 src/main/java/com/mzl/flower/dto/response/payment/OrderItemSalesNewDTO.java         |    9 
 src/main/java/com/mzl/flower/dto/response/member/MemberVO.java                      |    4 
 src/main/java/com/mzl/flower/web/supplier/DeliverySupplierController.java           |    7 
 src/main/java/com/mzl/flower/dto/request/payment/OrderQueryDTO.java                 |    6 
 src/main/java/com/mzl/flower/dto/response/payment/OrderItemListDTO.java             |    6 
 src/main/java/com/mzl/flower/mapper/coupon/CouponRecordMapperCustom.java            |    2 
 src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateUserController.java        |   36 +-
 src/main/java/com/mzl/flower/dto/response/flower/FlowerSupplierDTO.java             |    3 
 src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java    |   16 +
 src/main/java/com/mzl/flower/entity/menber/Member.java                              |    6 
 src/main/java/com/mzl/flower/mapper/payment/OrderMapper.java                        |    3 
 src/main/java/com/mzl/flower/dto/response/payment/OrderDTO.java                     |    8 
 src/main/java/com/mzl/flower/dto/request/flower/FlowerQueryDTO.java                 |    3 
 src/main/java/com/mzl/flower/dto/response/flower/FlowerCategoryTreeDTO.java         |    2 
 src/main/java/com/mzl/flower/service/flower/FlowerService.java                      |   25 +
 src/main/java/com/mzl/flower/web/login/SupplierLoginController.java                 |    5 
 src/main/java/com/mzl/flower/service/payment/OrderItemSalesService.java             |   57 +++
 src/main/java/com/mzl/flower/web/customer/CustomerSignInController.java             |    4 
 src/main/resources/mapper/point/CustomerPointMapper.xml                             |   12 
 src/main/resources/mapper/payment/OrderItemSalesMapper.xml                          |    2 
 src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml                     |    3 
 src/main/java/com/mzl/flower/dto/request/menber/TargetMemberDTO.java                |    3 
 src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java                |    1 
 src/main/java/com/mzl/flower/service/flower/FlowerCategoryService.java              |    4 
 src/main/java/com/mzl/flower/dto/response/partner/PartnerDTO.java                   |    4 
 src/main/java/com/mzl/flower/schedule/ScheduleService.java                          |   26 ++
 src/main/java/com/mzl/flower/service/menber/impl/MemberServiceImpl.java             |    4 
 src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateActivyDTO.java  |    9 
 src/main/java/com/mzl/flower/service/partner/PartnerService.java                    |   77 +++++
 src/main/java/com/mzl/flower/service/point/PointGoodsService.java                   |    4 
 src/main/resources/mapper/payment/OrderMapper.xml                                   |   14 
 src/main/resources/mapper/flower/FlowerCategoryMapper.xml                           |   29 ++
 src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateUserDTO.java    |    8 
 src/main/resources/mapper/payment/OrderSettlementDetailMapper.xml                   |    2 
 src/main/java/com/mzl/flower/dto/response/coupon/CouponTemplatePointVO.java         |   14 +
 src/main/java/com/mzl/flower/dto/response/payment/OrderItemSalesNewListDTO.java     |    6 
 src/main/java/com/mzl/flower/service/payment/UserPaymentV3Service.java              |   20 +
 src/main/java/com/mzl/flower/web/point/CustomerPointController.java                 |    6 
 src/main/java/com/mzl/flower/mapper/coupon/CouponTemplateMapperCustom.java          |    2 
 src/main/java/com/mzl/flower/dto/request/payment/DeliveryOrderQueryDTO.java         |    3 
 src/main/resources/mapper/coupon/CouponRecordMapperCustom.xml                       |    3 
 65 files changed, 664 insertions(+), 94 deletions(-)

diff --git a/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateActivyDTO.java b/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateActivyDTO.java
index fd49d0e..6e2b34e 100644
--- a/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateActivyDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateActivyDTO.java
@@ -6,10 +6,7 @@
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
+import javax.validation.constraints.*;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
@@ -113,6 +110,8 @@
      */
     @ApiModelProperty(value = "使用条件,满多少钱")
     @NotNull(message = "使用条件不能为空")
+    @Max(value = 99999999,message = "使用条件不能超过99999999")
+//    @DecimalMin(value = "0.01", inclusive = true,message = "使用条件大于0")
     private BigDecimal minOrderAmount;
 
     /**
@@ -120,6 +119,8 @@
      */
     @ApiModelProperty(value = "优惠券面值")
     @NotNull(message = "优惠券面值不能为空")
+    @DecimalMin(value = "0.01", inclusive = true,message = "优惠券面值大于0")
+    @Max(value = 99999999,message = "优惠券面值不能超过99999999")
     private BigDecimal couponDiscountValue;
 
 
diff --git a/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplatePointDTO.java b/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplatePointDTO.java
index 436ce5c..4c42fa6 100644
--- a/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplatePointDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplatePointDTO.java
@@ -4,10 +4,7 @@
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
+import javax.validation.constraints.*;
 import java.math.BigDecimal;
 
 /**
@@ -64,6 +61,7 @@
     @ApiModelProperty(value = "使用条件")
     @NotNull(message = "使用条件不能为空")
     @Max(value = 99999999,message = "使用条件不能超过99999999")
+//    @DecimalMin(value = "0.01", inclusive = true,message = "使用条件大于0")
     private BigDecimal minOrderAmount;
 
     /**
@@ -71,7 +69,7 @@
      */
     @ApiModelProperty(value = "优惠券面值")
     @NotNull(message = "优惠券面值不能为空")
-    @Min(value = 1,message = "优惠券面值大于0")
+    @DecimalMin(value = "0.01", inclusive = true,message = "优惠券面值大于0")
     @Max(value = 99999999,message = "优惠券面值不能超过99999999")
     private BigDecimal couponDiscountValue;
 
diff --git a/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateUserDTO.java b/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateUserDTO.java
index 1af6f04..bee84cf 100644
--- a/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateUserDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateUserDTO.java
@@ -4,10 +4,7 @@
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
+import javax.validation.constraints.*;
 import java.math.BigDecimal;
 import java.util.List;
 
@@ -62,6 +59,7 @@
     @ApiModelProperty(value = "使用条件")
     @NotNull(message = "使用条件不能为空")
     @Max(value = 99999999,message = "使用条件不能超过99999999")
+//    @DecimalMin(value = "0.01", inclusive = true,message = "使用条件大于0")
     private BigDecimal minOrderAmount;
 
     /**
@@ -69,7 +67,7 @@
      */
     @ApiModelProperty(value = "优惠券面值")
     @NotNull(message = "优惠券面值不能为空")
-    @Min(value = 1,message = "优惠券面值大于0")
+    @DecimalMin(value = "0.01", inclusive = true,message = "优惠券面值大于0")
     @Max(value = 99999999,message = "优惠券面值不能超过99999999")
     private BigDecimal couponDiscountValue;
 
diff --git a/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateVipDTO.java b/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateVipDTO.java
index c06c539..96a9138 100644
--- a/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateVipDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateVipDTO.java
@@ -4,6 +4,7 @@
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import javax.validation.constraints.DecimalMin;
 import javax.validation.constraints.Max;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
@@ -43,6 +44,7 @@
     @ApiModelProperty(value = "优惠券面值")
     @NotNull(message = "优惠券面值不能为空")
     @Max(value = 99999999,message = "优惠券面值不能超过99999999")
+    @DecimalMin(value = "0.01", inclusive = true,message = "优惠券面值大于0")
     private BigDecimal couponDiscountValue;
 
     /**
@@ -51,6 +53,7 @@
     @ApiModelProperty(value = "使用条件")
     @NotNull(message = "使用条件不能为空")
     @Max(value = 99999999,message = "使用条件不能超过99999999")
+//    @DecimalMin(value = "0.01", inclusive = true,message = "使用条件大于0")
     private BigDecimal minOrderAmount;
 
 
diff --git a/src/main/java/com/mzl/flower/dto/request/flower/FlowerQueryDTO.java b/src/main/java/com/mzl/flower/dto/request/flower/FlowerQueryDTO.java
index 6fb8dd4..3e78500 100644
--- a/src/main/java/com/mzl/flower/dto/request/flower/FlowerQueryDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/flower/FlowerQueryDTO.java
@@ -36,4 +36,7 @@
 
     @ApiModelProperty(hidden = true)
     private List<String> statusList;
+
+    @ApiModelProperty(value = "是否限购")
+    private Boolean isLimited;
 }
diff --git a/src/main/java/com/mzl/flower/dto/request/menber/MemberDTO.java b/src/main/java/com/mzl/flower/dto/request/menber/MemberDTO.java
index bd069ad..8bad763 100644
--- a/src/main/java/com/mzl/flower/dto/request/menber/MemberDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/menber/MemberDTO.java
@@ -1,6 +1,5 @@
 package com.mzl.flower.dto.request.menber;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -56,4 +55,8 @@
     @NotNull
     private String pictures;
 
+    @ApiModelProperty(value = "会员成长值获取规则")
+    @NotNull
+    private String growthValueDesc;
+
 }
diff --git a/src/main/java/com/mzl/flower/dto/request/menber/TargetMemberDTO.java b/src/main/java/com/mzl/flower/dto/request/menber/TargetMemberDTO.java
index 4ba60c8..7052bc4 100644
--- a/src/main/java/com/mzl/flower/dto/request/menber/TargetMemberDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/menber/TargetMemberDTO.java
@@ -29,5 +29,8 @@
     @ApiModelProperty("会员折扣百分比")
     private BigDecimal targetDiscountRatio;
 
+    @ApiModelProperty("折扣类型Str")
+    private String targetGrowthValueDesc;
+
 
 }
diff --git a/src/main/java/com/mzl/flower/dto/request/menber/UserGrowthRecordDTO.java b/src/main/java/com/mzl/flower/dto/request/menber/UserGrowthRecordDTO.java
index 4281ed3..dd26e4a 100644
--- a/src/main/java/com/mzl/flower/dto/request/menber/UserGrowthRecordDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/menber/UserGrowthRecordDTO.java
@@ -26,6 +26,9 @@
     @ApiModelProperty("会员折扣百分比")
     private BigDecimal currentDiscountRatio;
 
+    @ApiModelProperty("会员成长值获取规则")
+    private String currentGrowthValueDesc;
+
     List<TargetMemberDTO> targetMemberInfos;
 
 }
diff --git a/src/main/java/com/mzl/flower/dto/request/partner/ChangePartnerAreaDTO.java b/src/main/java/com/mzl/flower/dto/request/partner/ChangePartnerAreaDTO.java
index f0d0f09..74ddf4e 100644
--- a/src/main/java/com/mzl/flower/dto/request/partner/ChangePartnerAreaDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/partner/ChangePartnerAreaDTO.java
@@ -20,4 +20,8 @@
 
     @ApiModelProperty("服务区域-区")
     private String region;
+
+    private String name;
+
+    private String contactTel;
 }
diff --git a/src/main/java/com/mzl/flower/dto/request/partner/UpdatePartnerBaseDTO.java b/src/main/java/com/mzl/flower/dto/request/partner/UpdatePartnerBaseDTO.java
new file mode 100644
index 0000000..0e13eec
--- /dev/null
+++ b/src/main/java/com/mzl/flower/dto/request/partner/UpdatePartnerBaseDTO.java
@@ -0,0 +1,24 @@
+package com.mzl.flower.dto.request.partner;
+
+import com.mzl.flower.dto.AttachmentDTO;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class UpdatePartnerBaseDTO {
+
+    private Long id;
+
+    @ApiModelProperty("名称")
+    private String name;
+
+//    @ApiModelProperty("联系方式")
+//    private String contactTel;
+
+    @ApiModelProperty("头像")
+    private String cover;
+
+
+}
diff --git a/src/main/java/com/mzl/flower/dto/request/payment/DeliveryOrderQueryDTO.java b/src/main/java/com/mzl/flower/dto/request/payment/DeliveryOrderQueryDTO.java
index 19cd596..52d189e 100644
--- a/src/main/java/com/mzl/flower/dto/request/payment/DeliveryOrderQueryDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/payment/DeliveryOrderQueryDTO.java
@@ -15,6 +15,9 @@
     @ApiModelProperty(value = "配送单状态; DELIVERY_ORDER_STATUS")
     private String status;
 
+    @ApiModelProperty(value = "日期")
+    private String date;
+
     @ApiModelProperty(hidden = true)
     private LocalDateTime startDate;
 
diff --git a/src/main/java/com/mzl/flower/dto/request/payment/OrderQueryDTO.java b/src/main/java/com/mzl/flower/dto/request/payment/OrderQueryDTO.java
index ca40541..4086af8 100644
--- a/src/main/java/com/mzl/flower/dto/request/payment/OrderQueryDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/payment/OrderQueryDTO.java
@@ -73,4 +73,10 @@
 
     @ApiModelProperty(value = "收货地址详细地址(拼接省市区地址)")
     private String address;
+
+    @ApiModelProperty(hidden = true)
+    private boolean customerQuery = false;
+
+    @ApiModelProperty(value = "库位")
+    private String warehouseLocationCode;
 }
diff --git a/src/main/java/com/mzl/flower/dto/request/point/QueryPointDetailDTO.java b/src/main/java/com/mzl/flower/dto/request/point/QueryPointDetailDTO.java
index f236ea1..1d27807 100644
--- a/src/main/java/com/mzl/flower/dto/request/point/QueryPointDetailDTO.java
+++ b/src/main/java/com/mzl/flower/dto/request/point/QueryPointDetailDTO.java
@@ -4,6 +4,7 @@
 import lombok.Data;
 
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 
 @Data
 public class QueryPointDetailDTO {
@@ -25,4 +26,17 @@
 
     @ApiModelProperty(hidden = true)
     private String userId;
+
+    @ApiModelProperty("yyyy-MM-dd HH:mm:ss")
+    private String createTimeStartStr;
+
+    @ApiModelProperty("yyyy-MM-dd HH:mm:ss")
+    private String createTimeEndStr;
+
+
+    @ApiModelProperty(hidden = true)
+    private LocalDateTime createTimeStart;
+
+    @ApiModelProperty(hidden = true)
+    private LocalDateTime createTimeEnd;
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/coupon/CouponTemplatePointVO.java b/src/main/java/com/mzl/flower/dto/response/coupon/CouponTemplatePointVO.java
index 1e25aea..340e8ff 100644
--- a/src/main/java/com/mzl/flower/dto/response/coupon/CouponTemplatePointVO.java
+++ b/src/main/java/com/mzl/flower/dto/response/coupon/CouponTemplatePointVO.java
@@ -132,4 +132,18 @@
     private LocalDateTime createTime;
 
 
+    /**
+     * 已经领取数
+     */
+    @ApiModelProperty(value = "已经领取数")
+    private Integer getNum;
+
+    /**
+     * 未领取数
+     */
+    @ApiModelProperty(value = "未领取数")
+    private Integer unGetNum;
+
+
+
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/flower/FlowerCategoryTreeDTO.java b/src/main/java/com/mzl/flower/dto/response/flower/FlowerCategoryTreeDTO.java
index 93ababc..d9f9c08 100644
--- a/src/main/java/com/mzl/flower/dto/response/flower/FlowerCategoryTreeDTO.java
+++ b/src/main/java/com/mzl/flower/dto/response/flower/FlowerCategoryTreeDTO.java
@@ -67,4 +67,6 @@
 
     @ApiModelProperty(value = "级别限制")
     private String levelLimit;
+
+    private Integer childrenCount;
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/flower/FlowerSupplierDTO.java b/src/main/java/com/mzl/flower/dto/response/flower/FlowerSupplierDTO.java
index a7b3869..fd49473 100644
--- a/src/main/java/com/mzl/flower/dto/response/flower/FlowerSupplierDTO.java
+++ b/src/main/java/com/mzl/flower/dto/response/flower/FlowerSupplierDTO.java
@@ -59,4 +59,7 @@
     @ApiModelProperty(value = "描述")
     private String description;
 
+    @ApiModelProperty(value = "库存")
+    private Integer limited;
+
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/member/MemberVO.java b/src/main/java/com/mzl/flower/dto/response/member/MemberVO.java
index 30aa7ca..8e197f1 100644
--- a/src/main/java/com/mzl/flower/dto/response/member/MemberVO.java
+++ b/src/main/java/com/mzl/flower/dto/response/member/MemberVO.java
@@ -5,7 +5,6 @@
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
@@ -57,4 +56,7 @@
 
     @ApiModelProperty("图片")
     private String pictures;
+
+    @ApiModelProperty(value = "会员成长值获取规则")
+    private String growthValueDesc;
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/partner/PartnerDTO.java b/src/main/java/com/mzl/flower/dto/response/partner/PartnerDTO.java
index f57ed7c..b71392a 100644
--- a/src/main/java/com/mzl/flower/dto/response/partner/PartnerDTO.java
+++ b/src/main/java/com/mzl/flower/dto/response/partner/PartnerDTO.java
@@ -67,4 +67,8 @@
 
     @ApiModelProperty("启用/禁用")
     private Boolean isEnabled;
+
+    @ApiModelProperty("头像")
+    private String cover;
+
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/payment/OrderDTO.java b/src/main/java/com/mzl/flower/dto/response/payment/OrderDTO.java
index 7ae63c5..b2a330e 100644
--- a/src/main/java/com/mzl/flower/dto/response/payment/OrderDTO.java
+++ b/src/main/java/com/mzl/flower/dto/response/payment/OrderDTO.java
@@ -164,4 +164,12 @@
     private BigDecimal memberDiscountAmount;
 
     private List<OrderItemListDTO> items;
+
+    @ApiModelProperty(value = "优惠券类型(discount_type)")
+    @DictTrans(target = "couponDiscountTypeName",codeType = "COUPON_TYPE")
+    private String couponDiscountType;
+    private String couponDiscountTypeName;
+
+    @ApiModelProperty(value = " 使用条件(满多少钱)")
+    private String minOrderAmount;
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/payment/OrderItemListDTO.java b/src/main/java/com/mzl/flower/dto/response/payment/OrderItemListDTO.java
index 4a08e76..131ee9a 100644
--- a/src/main/java/com/mzl/flower/dto/response/payment/OrderItemListDTO.java
+++ b/src/main/java/com/mzl/flower/dto/response/payment/OrderItemListDTO.java
@@ -68,4 +68,10 @@
 
     @ApiModelProperty(value = "缺货数量")
     private Integer lackNum;
+
+    @ApiModelProperty(value = "优惠券总金额")
+    private BigDecimal couponAmountTotal;
+
+    @ApiModelProperty(value = "真实成交总价格")
+    private BigDecimal realTotal;
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/payment/OrderItemSalesNewDTO.java b/src/main/java/com/mzl/flower/dto/response/payment/OrderItemSalesNewDTO.java
index f55e432..a91666f 100644
--- a/src/main/java/com/mzl/flower/dto/response/payment/OrderItemSalesNewDTO.java
+++ b/src/main/java/com/mzl/flower/dto/response/payment/OrderItemSalesNewDTO.java
@@ -37,4 +37,13 @@
     @ApiModelProperty(value = "下单时间")
     private LocalDateTime orderTime;
 
+    @ApiModelProperty(value = "降级数量")
+    private Integer reduceNum;
+
+    @ApiModelProperty(value = "降级金额")
+    private BigDecimal reduceAmount;
+
+    @ApiModelProperty(value = "补货数量")
+    private Integer replaceNum;
+
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/payment/OrderItemSalesNewListDTO.java b/src/main/java/com/mzl/flower/dto/response/payment/OrderItemSalesNewListDTO.java
index 0a30d16..406528e 100644
--- a/src/main/java/com/mzl/flower/dto/response/payment/OrderItemSalesNewListDTO.java
+++ b/src/main/java/com/mzl/flower/dto/response/payment/OrderItemSalesNewListDTO.java
@@ -101,4 +101,10 @@
     @DictTrans(target = "salesTypeStr", codeType = "after_sale_type")
     private String salesType;
     private String salesTypeStr;
+
+    @ApiModelProperty(value = "真实成交价格/每扎")
+    private BigDecimal realPrice;
+
+    @ApiModelProperty(value = "真实成交总价格")
+    private BigDecimal realTotal;
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/payment/OrderSettlementDetailDTO.java b/src/main/java/com/mzl/flower/dto/response/payment/OrderSettlementDetailDTO.java
index dc86c02..75794f2 100644
--- a/src/main/java/com/mzl/flower/dto/response/payment/OrderSettlementDetailDTO.java
+++ b/src/main/java/com/mzl/flower/dto/response/payment/OrderSettlementDetailDTO.java
@@ -55,4 +55,6 @@
 
     @ApiModelProperty(value = "订单号")
     private String orderNo;
+
+    private String orderId;
 }
diff --git a/src/main/java/com/mzl/flower/dto/response/point/CustomerPointDetailDTO.java b/src/main/java/com/mzl/flower/dto/response/point/CustomerPointDetailDTO.java
index 1ab3855..ae402ff 100644
--- a/src/main/java/com/mzl/flower/dto/response/point/CustomerPointDetailDTO.java
+++ b/src/main/java/com/mzl/flower/dto/response/point/CustomerPointDetailDTO.java
@@ -6,9 +6,12 @@
 import lombok.Data;
 
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 
 @Data
 public class CustomerPointDetailDTO extends AbstractTransDTO {
+
+    private Long id;
 
     @ApiModelProperty("记录日期")
     private LocalDate recordDate;
@@ -39,4 +42,6 @@
     @ApiModelProperty("积分备注")
     private String remarks;
 
+    @ApiModelProperty("创建时间")
+    private LocalDateTime createTime;
 }
diff --git a/src/main/java/com/mzl/flower/entity/menber/Member.java b/src/main/java/com/mzl/flower/entity/menber/Member.java
index b23f218..29afe94 100644
--- a/src/main/java/com/mzl/flower/entity/menber/Member.java
+++ b/src/main/java/com/mzl/flower/entity/menber/Member.java
@@ -1,12 +1,10 @@
 package com.mzl.flower.entity.menber;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.mzl.flower.base.BaseAutoEntity;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 
 /**
@@ -52,4 +50,8 @@
 
     @ApiModelProperty("图片")
     private String pictures;
+
+    @ApiModelProperty(value = "会员成长值获取规则")
+    private String growthValueDesc;
+
 }
diff --git a/src/main/java/com/mzl/flower/entity/partner/Partner.java b/src/main/java/com/mzl/flower/entity/partner/Partner.java
index 805f960..7857853 100644
--- a/src/main/java/com/mzl/flower/entity/partner/Partner.java
+++ b/src/main/java/com/mzl/flower/entity/partner/Partner.java
@@ -55,4 +55,8 @@
 
     @ApiModelProperty("启用/禁用")
     private Boolean isEnabled;
+
+    @ApiModelProperty("头像")
+    private String cover;
+
 }
diff --git a/src/main/java/com/mzl/flower/mapper/coupon/CouponRecordMapperCustom.java b/src/main/java/com/mzl/flower/mapper/coupon/CouponRecordMapperCustom.java
index 2cc46fa..b841917 100644
--- a/src/main/java/com/mzl/flower/mapper/coupon/CouponRecordMapperCustom.java
+++ b/src/main/java/com/mzl/flower/mapper/coupon/CouponRecordMapperCustom.java
@@ -34,4 +34,6 @@
     List<CouponRecordVO> getMineCouponRecordList(@Param("param") QueryMineCouponRecordDTO dto);
 
     void checkCouponExpired(@Param("param") QueryMineCouponRecordDTO dto);
+
+    boolean expireCouponRecordAll();
 }
diff --git a/src/main/java/com/mzl/flower/mapper/coupon/CouponTemplateMapperCustom.java b/src/main/java/com/mzl/flower/mapper/coupon/CouponTemplateMapperCustom.java
index f8b8327..66fe43f 100644
--- a/src/main/java/com/mzl/flower/mapper/coupon/CouponTemplateMapperCustom.java
+++ b/src/main/java/com/mzl/flower/mapper/coupon/CouponTemplateMapperCustom.java
@@ -65,4 +65,6 @@
     CouponTemplateVO getHomeActivityEffectAlert(@Param("param") QueryActivityEffectCouponDTO dto);
 
     void expireHomeActivityCouponTemplate();
+
+    int expireActivityCouponTemplateAll();
 }
diff --git a/src/main/java/com/mzl/flower/mapper/flower/FlowerCategoryMapper.java b/src/main/java/com/mzl/flower/mapper/flower/FlowerCategoryMapper.java
index f8f58c9..ec0137a 100644
--- a/src/main/java/com/mzl/flower/mapper/flower/FlowerCategoryMapper.java
+++ b/src/main/java/com/mzl/flower/mapper/flower/FlowerCategoryMapper.java
@@ -14,6 +14,8 @@
 
 @Repository
 public interface FlowerCategoryMapper extends BaseMapper<FlowerCategory> {
+    List<FlowerCategoryTreeDTO> selectCategoryList(@Param("condition") FlowerCategoryQueryDTO dto);
+
     List<FlowerCategoryTreeDTO> selectTreeList(@Param("condition") FlowerCategoryQueryDTO dto);
 
     void clearParamByParamId(@Param("paramId") Long paramId);
diff --git a/src/main/java/com/mzl/flower/mapper/payment/OrderMapper.java b/src/main/java/com/mzl/flower/mapper/payment/OrderMapper.java
index a893c08..6dd5dc4 100644
--- a/src/main/java/com/mzl/flower/mapper/payment/OrderMapper.java
+++ b/src/main/java/com/mzl/flower/mapper/payment/OrderMapper.java
@@ -50,5 +50,6 @@
             "LEFT JOIN t_customer_info c ON t1.create_by = c.user_id ")
     List<Order> getOrderInfoByReceiveTime();
 
-    Integer getFlowerCompleteNumToday(@Param("userId") String userId,@Param("flowerId") Long flowerId);
+    int getFlowerCompleteNumWithinTimeRange(@Param("userId") String userId ,@Param("flowerId") Long flowerId,
+                                            @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
 }
diff --git a/src/main/java/com/mzl/flower/schedule/ScheduleService.java b/src/main/java/com/mzl/flower/schedule/ScheduleService.java
index 6130515..109e14c 100644
--- a/src/main/java/com/mzl/flower/schedule/ScheduleService.java
+++ b/src/main/java/com/mzl/flower/schedule/ScheduleService.java
@@ -12,6 +12,7 @@
 import com.mzl.flower.mapper.partner.PartnerMapper;
 import com.mzl.flower.mapper.payment.OrderMapper;
 import com.mzl.flower.service.coupon.CouponRecordService;
+import com.mzl.flower.service.coupon.CouponTemplateService2;
 import com.mzl.flower.service.flower.FlowerCategoryService;
 import com.mzl.flower.service.flower.FlowerService;
 import com.mzl.flower.service.menber.impl.GrowthValueDealService;
@@ -70,6 +71,9 @@
 
     @Autowired
     private MemberGrowthRecordMapper memberGrowthRecordMapper;
+
+    @Autowired
+    private CouponTemplateService2 couponTemplateService2;
 
     @Scheduled(cron = "1 0/30 * * * ?")
     public void calculateAvePrice() {
@@ -240,4 +244,26 @@
     }
 
 
+    @Scheduled(cron = "0 0/5 * * * ?")
+    public void expireActivityCouponTemplateAll() {
+        log.info("优惠券模版过期下架开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
+
+        // 下架有所的过期的优惠券
+        couponTemplateService2.expireActivityCouponTemplateAll();
+
+        log.info("优惠券模版过期下架开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
+    }
+
+    @Scheduled(cron = "0 0/5 * * * ?")
+    public void expireCouponRecordAll() {
+        log.info("优惠券记录过期开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
+
+        // 下架有所的过期的优惠券
+        couponRecordService.expireCouponRecordAll();
+
+        log.info("优惠券记录过期开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
+    }
+
+
+
 }
diff --git a/src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java b/src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java
index a416242..8298870 100644
--- a/src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java
+++ b/src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java
@@ -120,4 +120,5 @@
     boolean checkUserCouponExists(String couponId, Long customId);
 
 
+    boolean expireCouponRecordAll();
 }
diff --git a/src/main/java/com/mzl/flower/service/coupon/CouponTemplateService2.java b/src/main/java/com/mzl/flower/service/coupon/CouponTemplateService2.java
index b33de57..766eda0 100644
--- a/src/main/java/com/mzl/flower/service/coupon/CouponTemplateService2.java
+++ b/src/main/java/com/mzl/flower/service/coupon/CouponTemplateService2.java
@@ -100,4 +100,5 @@
      */
     CouponTemplateVO getHomeActivityEffectAlert(QueryActivityEffectCouponDTO dto);
 
+    boolean expireActivityCouponTemplateAll();
 }
diff --git a/src/main/java/com/mzl/flower/service/flower/FlowerCategoryService.java b/src/main/java/com/mzl/flower/service/flower/FlowerCategoryService.java
index 41f590e..b90f6c8 100644
--- a/src/main/java/com/mzl/flower/service/flower/FlowerCategoryService.java
+++ b/src/main/java/com/mzl/flower/service/flower/FlowerCategoryService.java
@@ -122,6 +122,10 @@
         return dto;
     }
 
+    public List<FlowerCategoryTreeDTO> selectCategoryList(FlowerCategoryQueryDTO dto){
+        return categoryMapper.selectCategoryList(dto);
+    }
+
     public List<FlowerCategoryTreeDTO> selectCategoryTree(FlowerCategoryQueryDTO dto) {
         List<FlowerCategoryTreeDTO> treeList = categoryMapper.selectTreeList(dto);
         treeList = (List<FlowerCategoryTreeDTO>) TreeBuilderUtil.buildListToTree(treeList);
diff --git a/src/main/java/com/mzl/flower/service/flower/FlowerService.java b/src/main/java/com/mzl/flower/service/flower/FlowerService.java
index d89cd66..9cc9169 100644
--- a/src/main/java/com/mzl/flower/service/flower/FlowerService.java
+++ b/src/main/java/com/mzl/flower/service/flower/FlowerService.java
@@ -215,6 +215,7 @@
         } else {
             g.setPrice(dto.getPrice());
             g.setStock(dto.getStock());
+            g.setLimited(dto.getLimited());
         }
 
         g.update(SecurityUtils.getUserId());
@@ -246,7 +247,17 @@
     public Long editFlowerAdmin(FlowerUpdateAdminDTO dto){
         Flower g = flowerMapper.selectById(dto.getId());
         g.setSales(dto.getSales());
-        g.setLimited(dto.getLimited());
+        if (!org.springframework.util.StringUtils.isEmpty(dto.getLimited())) {
+            if (g.getStock() == 0 || org.springframework.util.StringUtils.isEmpty(g.getStock())) {
+                throw new ValidationException("库存为0或者空时不能修改限购数量");
+            }
+            if(g.getStock()<dto.getLimited()){
+                throw new ValidationException("限购数量不能大于库存");
+            }
+            g.setLimited(dto.getLimited());
+        }else{
+            g.setLimited(null);
+        }
         g.update(SecurityUtils.getUserId());
         flowerMapper.updateById(g);
 
@@ -883,7 +894,17 @@
         }
         for (Long id : ids) {
             Flower f = flowerMapper.selectById(id);
-            f.setLimited(dto.getLimited());
+            if (!org.springframework.util.StringUtils.isEmpty(dto.getLimited())) {
+                if (f.getStock() == 0 || org.springframework.util.StringUtils.isEmpty(f.getStock())) {
+                    throw new ValidationException("商品" + f.getName() + "库存为0或者空时不能修改限购数量");
+                }
+                if(f.getStock()<dto.getLimited()){
+                    throw new ValidationException("商品" + f.getName() + "限购数量不能大于库存");
+                }
+                f.setLimited(dto.getLimited());
+            }else{
+                f.setLimited(null);
+            }
             flowerMapper.updateById(f);
         }
     }
diff --git a/src/main/java/com/mzl/flower/service/impl/coupon/CouponRecordServiceImpl.java b/src/main/java/com/mzl/flower/service/impl/coupon/CouponRecordServiceImpl.java
index 573ebaf..aef2357 100644
--- a/src/main/java/com/mzl/flower/service/impl/coupon/CouponRecordServiceImpl.java
+++ b/src/main/java/com/mzl/flower/service/impl/coupon/CouponRecordServiceImpl.java
@@ -95,15 +95,29 @@
             // 获取锁,最多等待 10 秒,锁自动释放时间 30 秒
             if (lock.tryLock(10, 30, TimeUnit.SECONDS)) {
                 try {
-                    // 活动优惠券和积分优惠券需要根据库存来控制- 根据优惠券的发放数量来控制有没有超发
-                    if(StringUtils.isNotBlank(couponTemplateDO.getCategory()) && (
-                            couponTemplateDO.getCategory().equals(CouponCategoryEnum.ACTIVITY.getStatus()) || couponTemplateDO.getCategory().equals(CouponCategoryEnum.POINT.getStatus())
-                    )){
+                    // 活动优惠券 根据优惠券的发放数量来控制有没有超发
+                    if(StringUtils.isNotBlank(couponTemplateDO.getCategory()) &&
+                            couponTemplateDO.getCategory().equals(CouponCategoryEnum.ACTIVITY.getStatus())
+                    ){
                         // 获取当前优惠券已经领取的数量
                         final Integer gainTotal = getExistGainCouponRecordAmountById(couponTemplateDO.getId());
                         if(couponTemplateDO.getCouponAmount().compareTo(gainTotal)<=0){
                             throw new ValidationException("当前优惠券已经领完!");
                         }
+                    }
+                    if(StringUtils.isNotBlank(couponTemplateDO.getCategory())
+                            && couponTemplateDO.getCategory().equals(CouponCategoryEnum.POINT.getStatus()
+                    )){
+                        // 获取当前优惠券已经领取的数量
+
+                        if(couponTemplateDO.getCouponAmount()<=0){
+                            throw new ValidationException("当前优惠券已经领完!");
+                        }else{
+                            couponTemplateDO.setCouponAmount(couponTemplateDO.getCouponAmount()-1);
+                            // 更新库存
+                            couponTemplateService.updateById(couponTemplateDO);
+                        }
+
                     }
 
                     // 根据用户领取设置的getLimit 查看当前用户是否已经超领优惠券
@@ -549,4 +563,10 @@
         ;
         return baseMapper.selectCount(queryWrapper)>0;
     }
+
+    @Override
+    public boolean expireCouponRecordAll() {
+
+        return couponRecordMapperCustom.expireCouponRecordAll();
+    }
 }
diff --git a/src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java b/src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java
index b33c44a..6e46180 100644
--- a/src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java
+++ b/src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java
@@ -421,7 +421,9 @@
             if(couponTemplateDO==null){
                 throw new ValidationException("优惠券不存在");
             }
-
+            if(couponTemplateDO.getCouponAmount()<=0 ){
+               throw new ValidationException("优惠券已兑换完");
+            }
             CustomerPoint cp = customerPointMapper.selectOne(new LambdaQueryWrapper<CustomerPoint>()
                     .eq(CustomerPoint::getUserId, SecurityUtils.getUserId()));
             if(cp == null || (cp.getTotalPoint()-cp.getUsedPoint()-cp.getExpiredPoint()- cp.getExpiredPoint()) < couponTemplateDO.getPoint() * dto.getNum()){
@@ -439,6 +441,10 @@
             recordDTO.setCustomerId(customer.getId());
             couponRecordService.createCouponRecord(recordDTO);
 
+//            //更新优惠券数量
+//            couponTemplateDO.setCouponAmount(couponTemplateDO.getCouponAmount()-dto.getNum());
+//            couponTemplateService.updateById(couponTemplateDO);
+
             //更新积分汇总
             cp.setUsedPoint(cp.getUsedPoint()+couponTemplateDO.getPoint());
             customerPointMapper.updateById(cp);
@@ -454,8 +460,6 @@
             detail.setRemarks(couponTemplateDO.getCouponName());
             detail.create(SecurityUtils.getUserId());
             customerPointDetailMapper.insert(detail);
-        }catch (Exception e){
-            throw new ValidationException("兑换失败");
         }finally {
             lockService.releaseObjectLock(key,"");
         }
@@ -485,6 +489,12 @@
     }
 
     @Override
+    public boolean expireActivityCouponTemplateAll() {
+
+        return couponTemplateMapperCustom.expireActivityCouponTemplateAll()>0;
+    }
+
+    @Override
     public List<CouponTemplateVO> getActivityEffectList(QueryActivityEffectCouponDTO dto) {
 
         return couponTemplateMapperCustom.getActivityEffectList(dto);
diff --git a/src/main/java/com/mzl/flower/service/menber/impl/MemberGrowthRecordServiceImpl.java b/src/main/java/com/mzl/flower/service/menber/impl/MemberGrowthRecordServiceImpl.java
index 34b83f9..defb2a4 100644
--- a/src/main/java/com/mzl/flower/service/menber/impl/MemberGrowthRecordServiceImpl.java
+++ b/src/main/java/com/mzl/flower/service/menber/impl/MemberGrowthRecordServiceImpl.java
@@ -160,6 +160,7 @@
         }
         userGrowthRecordDTO.setCurrentDiscountRatio(StringUtils.isEmpty(member.getDiscountRatio()) ? BigDecimal.valueOf(100) : member.getDiscountRatio());
         userGrowthRecordDTO.setCurrentDiscountAmount(StringUtils.isEmpty(member.getDiscountAmount()) ? BigDecimal.ZERO  : member.getDiscountAmount());
+        userGrowthRecordDTO.setCurrentGrowthValueDesc(member.getGrowthValueDesc());
         //查询比当前等级高的会员等级信息
         List<Member> memberList = memberMapper.getgtMembersByGrowthValue(sumGrowth);
         if (!CollectionUtils.isEmpty(memberList)) {
@@ -179,6 +180,7 @@
                         break;
                 }
                 targetMemberDTO.setTargetDiscountRatio(StringUtils.isEmpty(m.getDiscountRatio()) ? BigDecimal.valueOf(100) : m.getDiscountRatio());
+                targetMemberDTO.setTargetGrowthValueDesc(m.getGrowthValueDesc());
                 targetMemberDTOList.add(targetMemberDTO);
             });
         }
diff --git a/src/main/java/com/mzl/flower/service/menber/impl/MemberServiceImpl.java b/src/main/java/com/mzl/flower/service/menber/impl/MemberServiceImpl.java
index fef0691..9cf0d44 100644
--- a/src/main/java/com/mzl/flower/service/menber/impl/MemberServiceImpl.java
+++ b/src/main/java/com/mzl/flower/service/menber/impl/MemberServiceImpl.java
@@ -101,7 +101,7 @@
         member.create(SecurityUtils.getUserId());
         memberMapper.insert(member);
         //更新会员等级
-        customerMapper.updateMemberLevelByPoint(member.getId(), member.getStartPoint(), member.getEndPoint());
+        customerMapper.updateMemberLevelByPoint(member.getId(), memberDTO.getStartPoint(), memberDTO.getEndPoint());
 
     }
 
@@ -182,7 +182,7 @@
 
         //更新会员等级
         if (memberInfo.getStartPoint() != memberDTO.getStartPoint() || memberInfo.getEndPoint() != memberDTO.getEndPoint()) {
-            customerMapper.updateMemberLevelByPoint(memberInfo.getId(), memberInfo.getStartPoint(), memberInfo.getEndPoint());
+            customerMapper.updateMemberLevelByPoint(memberInfo.getId(), memberDTO.getStartPoint(), memberDTO.getEndPoint());
         }
 
         BeanUtils.copyProperties(memberDTO,memberInfo);
diff --git a/src/main/java/com/mzl/flower/service/partner/PartnerService.java b/src/main/java/com/mzl/flower/service/partner/PartnerService.java
index f0f110e..69a2141 100644
--- a/src/main/java/com/mzl/flower/service/partner/PartnerService.java
+++ b/src/main/java/com/mzl/flower/service/partner/PartnerService.java
@@ -10,10 +10,12 @@
 import com.mzl.flower.dto.request.partner.*;
 import com.mzl.flower.dto.response.partner.PartnerDTO;
 import com.mzl.flower.entity.partner.Partner;
-import com.mzl.flower.entity.supplier.Supplier;
+import com.mzl.flower.entity.system.User;
 import com.mzl.flower.mapper.partner.PartnerMapper;
+import com.mzl.flower.mapper.system.UserMapper;
 import com.mzl.flower.service.BaseService;
 import com.mzl.flower.service.UploadService;
+import com.mzl.flower.service.system.UserService;
 import com.mzl.flower.utils.DateUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -39,6 +41,8 @@
 
     private final PartnerMapper partnerMapper;
 
+    private final UserMapper userMapper;
+
 
     private final WxMaService maService;
 
@@ -48,8 +52,9 @@
     @Resource
     private BaseService baseService;
 
-    public PartnerService(PartnerMapper partnerMapper, WxMaService maService, UploadService uploadService) {
+    public PartnerService(PartnerMapper partnerMapper, UserMapper userMapper, WxMaService maService, UploadService uploadService) {
         this.partnerMapper = partnerMapper;
+        this.userMapper = userMapper;
         this.maService = maService;
         this.uploadService = uploadService;
     }
@@ -59,6 +64,22 @@
         if(dto.getId()==null){ //注册
             if(checkExist(dto.getUserId())){
                 throw new ValidationException("合伙人信息已登记");
+            }
+            if(StringUtils.isNotBlank(dto.getContactTel()) && StringUtils.isNotBlank(dto.getUserId())){
+                //验证手机号
+                User user = userMapper.selectById(dto.getUserId());
+                if(user==null){
+                    throw new ValidationException("合伙人账号信息不存在");
+                }
+                if(userMapper.selectCount(new LambdaQueryWrapper<User>().eq(User::getTel, dto.getContactTel())
+                        .eq(User::getType, Constants.USER_TYPE.partner.name())
+                        .ne(User::getId, dto.getUserId())
+                        .eq(User::getDeleted, 0)
+                )>0){
+                    throw new ValidationException("手机号已被注册使用");
+                }
+                user.setTel(dto.getContactTel());
+                userMapper.updateById(user);
             }
             partner = new Partner();
             BeanUtils.copyProperties(dto, partner,"id");
@@ -71,6 +92,23 @@
             partner = partnerMapper.selectById(dto.getId());
             if(partner==null){
                 throw new ValidationException("合伙人信息未登记");
+            }
+            if(StringUtils.isNotBlank(dto.getContactTel()) && !partner.getContactTel().equals(dto.getContactTel())){
+                //验证手机号
+                User user = userMapper.selectById(partner.getUserId());
+                if(user==null){
+                    throw new ValidationException("合伙人账号信息不存在");
+                }
+                if(userMapper.selectCount(new LambdaQueryWrapper<User>().eq(User::getTel, dto.getContactTel())
+                        .eq(User::getType, Constants.USER_TYPE.partner.name())
+                        .ne(User::getId, partner.getUserId())
+                        .eq(User::getDeleted, 0)
+                )>0){
+                    throw new ValidationException("手机号已被注册使用");
+                }
+                user.setTel(dto.getContactTel());
+                partner.setContactTel(dto.getContactTel());
+                userMapper.updateById(user);
             }
             BeanUtils.copyProperties(dto, partner,"id");
             partner.setIdCards(JSON.toJSONString(dto.getIdCards()));
@@ -135,8 +173,32 @@
         partner.setProvince(dto.getProvince());
         partner.setCity(dto.getCity());
         partner.setRegion(dto.getRegion());
+        if(StringUtils.isNotBlank(dto.getName())){
+            partner.setName(dto.getName());
+        }
+        if(StringUtils.isNotBlank(dto.getContactTel()) && !partner.getContactTel().equals(dto.getContactTel())){
+            //验证手机号
+            User user = userMapper.selectById(partner.getUserId());
+            if(user==null){
+                throw new ValidationException("合伙人账号信息不存在");
+            }
+            if(userMapper.selectCount(new LambdaQueryWrapper<User>().eq(User::getTel, dto.getContactTel())
+                    .eq(User::getType, Constants.USER_TYPE.partner.name())
+                    .ne(User::getId, partner.getUserId())
+                    .eq(User::getDeleted, 0)
+            )>0){
+                throw new ValidationException("手机号已被注册使用");
+            }
+            user.setTel(dto.getContactTel());
+            partner.setContactTel(dto.getContactTel());
+            userMapper.updateById(user);
+        }
         partner.update(SecurityUtils.getUserId());
         partnerMapper.updateById(partner);
+
+
+
+
     }
     public String generateCodeDTO(GenerateCodeDTO dto) {
         try {
@@ -184,4 +246,15 @@
         partner.update(SecurityUtils.getUserId());
         partnerMapper.updateById(partner);
     }
+
+    public void baseUpdate(UpdatePartnerBaseDTO dto) {
+        Partner partner = partnerMapper.selectById(dto.getId());
+        if(partner==null){
+            throw new ValidationException("合伙人信息未登记");
+        }
+        BeanUtils.copyProperties(dto, partner,"id");
+        partner.update(SecurityUtils.getUserId());
+        partnerMapper.updateById(partner);
+    }
+
 }
diff --git a/src/main/java/com/mzl/flower/service/payment/DeliveryOrderService.java b/src/main/java/com/mzl/flower/service/payment/DeliveryOrderService.java
index f7466d1..b7727a5 100644
--- a/src/main/java/com/mzl/flower/service/payment/DeliveryOrderService.java
+++ b/src/main/java/com/mzl/flower/service/payment/DeliveryOrderService.java
@@ -120,7 +120,14 @@
 
     public Page<DeliveryOrderListDTO> selectDeliveryOrderList(Page page, DeliveryOrderQueryDTO dto) {
         Supplier s = getCurrentSupplier();
-        dto.setStatusList(splitParam(dto.getStatus()));
+        if(Constants.DELIVERY_ORDER_STATUS.ARRIVED.name().equals(dto.getStatus())){
+            List<String> statusLs = new ArrayList<>();
+            statusLs.add(Constants.DELIVERY_ORDER_STATUS.ARRIVED.name());
+            statusLs.add(Constants.DELIVERY_ORDER_STATUS.CHECKED.name());
+            dto.setStatusList(statusLs);
+        } else {
+            dto.setStatusList(splitParam(dto.getStatus()));
+        }
         List<DeliveryOrderListDTO> ls = deliveryOrderMapper.selectDoList(page, s.getId(), dto);
         if (ls != null && ls.size() > 0) {
             List<String> dIds = new ArrayList<>();
@@ -573,7 +580,7 @@
         orderItemSettlementService.saveItemSettlementInfo(oi, SecurityUtils.getUserId(), Constants.S_TYPE.CHECK);
     }
 
-    private BigDecimal calculateOrderItemDeduct(String id){
+    public BigDecimal calculateOrderItemDeduct(String id){
         List<OrderItemCheck> cLs = orderItemCheckMapper.selectList(new QueryWrapper<OrderItemCheck>()
                 .eq("order_item_id", id)
                 .eq("audit_status", Constants.CHECK_AUDIT_STATUS.AGREED.name())
@@ -650,6 +657,16 @@
             throw new ValidationException("处理数量不能大于商品数量");
         }
 
+        Order o = orderMapper.selectById(oi.getOrderId());
+        if(StringUtils.isNotEmpty(o.getTransferId())){
+            throw new ValidationException("已质检退款,不可提交质检记录");
+        }
+
+        if(!Constants.ORDER_STATUS_BACKEND.COLLECTION.name().equals(o.getStatusBackend())
+            && !Constants.ORDER_STATUS_BACKEND.SEND.name().equals(o.getStatusBackend())){
+            throw new ValidationException("订单状态异常,不可提交质检记录");
+        }
+
         List<OrderItemCheck> cLs = orderItemCheckMapper.selectList(new QueryWrapper<OrderItemCheck>()
                 .ne("type", dto.getType())
                 .eq("order_item_id", dto.getOrderItemId())
@@ -686,7 +703,11 @@
             BigDecimal dt = realPrice.multiply(new BigDecimal(dto.getNum()));
             if(deduct.doubleValue() > dt.doubleValue()
                     || (oi.getRealTotal() != null && deduct.doubleValue() > oi.getRealTotal().doubleValue())){
-                throw new ValidationException("降级金额不能大于商品处理数量金额");
+                throw new ValidationException("降级金额不能大于商品处理数量的支付的金额");
+            }
+            BigDecimal st = oi.getSupplierPrice().multiply(new BigDecimal(dto.getNum()));
+            if(deduct.doubleValue() > st.doubleValue()){
+                throw new ValidationException("降级金额不能大于商品处理数量的供应商的金额");
             }
         }
 
diff --git a/src/main/java/com/mzl/flower/service/payment/OrderItemSalesService.java b/src/main/java/com/mzl/flower/service/payment/OrderItemSalesService.java
index a11cdf9..fe2bdb3 100644
--- a/src/main/java/com/mzl/flower/service/payment/OrderItemSalesService.java
+++ b/src/main/java/com/mzl/flower/service/payment/OrderItemSalesService.java
@@ -67,6 +67,9 @@
     @Autowired
     private OrderItemCheckMapper orderItemCheckMapper;
 
+    @Autowired
+    private DeliveryOrderService deliveryOrderService;
+
     public String createSales(OrderItemSalesCreateDTO dto){
         Integer num = dto.getNum();
         if(num == null || num == 0){
@@ -158,10 +161,10 @@
     }
 
     public List<OrderStatusCountDTO> getSalesStatusCount(OrderItemSalesQueryDTO dto) {
-        dto.setOrderStartDate(parseLocalDateTime(dto.getOrderStartDateStr()));
-        dto.setOrderEndDate(parseLocalDateTime(dto.getOrderEndDateStr()));
-        dto.setSalesStartDate(parseLocalDateTime(dto.getSalesStartDateStr()));
-        dto.setSalesEndDate(parseLocalDateTime(dto.getSalesEndDateStr()));
+        dto.setOrderStartDate(parseLocalDateTime(dto.getOrderStartDateStr(), true));
+        dto.setOrderEndDate(parseLocalDateTime(dto.getOrderEndDateStr(), false));
+        dto.setSalesStartDate(parseLocalDateTime(dto.getSalesStartDateStr(), true));
+        dto.setSalesEndDate(parseLocalDateTime(dto.getSalesEndDateStr(), false));
 
         List<CodeValueDTO> ls = codeService.searchValue("ORDER_SALES_STATUS");
         List<OrderStatusCountDTO> ll = orderItemSalesMapper.getSalesStatusCount(dto);
@@ -207,15 +210,17 @@
         List<OrderItemSalesNewListDTO> ls = orderItemSalesMapper.selectItemSalesList(null, dto);
         codeDecorator.decorate(ls);
 
-        String[] rowsName = new String[]{"集货站", "商品名称", "商品单位", "商品颜色", "商品等级"
+        String[] rowsName = new String[]{"序号", "集货站", "商品名称", "商品单位", "商品颜色", "商品等级"
                 , "商品分类", "收货人", "收货人手机号码", "收货地址", "商品数量", "供应商名称", "商品售价"
                 , "总金额", "订单号", "售后单号", "标题", "申请数量", "理由", "实际退款", "审核结果"
                 , "申请时间", "平台回复"};
         List<Object[]> dataList = new ArrayList<>();
 
+        int sn = 1;
         for (OrderItemSalesNewListDTO d : ls) {
             Object[] objs = new Object[rowsName.length];
             int a = 0;
+            objs[a++] = sn;
             objs[a++] = d.getStationName();
             objs[a++] = d.getFlowerName();
             objs[a++] = d.getFlowerUnit();
@@ -224,7 +229,7 @@
             objs[a++] = d.getFlowerCategory();
             objs[a++] = d.getCustomer();
             objs[a++] = d.getCustomerTel();
-            objs[a++] = d.getCustomerAddress();
+            objs[a++] = d.getCustomerProvince() + d.getCustomerCity() + d.getCustomerRegion() + d.getCustomerAddress();
             objs[a++] = d.getFlowerNum();
             objs[a++] = d.getSupplierName();
             objs[a++] = d.getPrice();
@@ -240,6 +245,8 @@
             objs[a++] = d.getRemarks();
 
             dataList.add(objs);
+
+            sn++;
         }
 
         ExcelExportUtil excelExportUtil = new ExcelExportUtil("售后申请列表", rowsName, dataList, response);
@@ -286,12 +293,35 @@
         rr.setTotal(oi.getTotal());
         rr.setSupplierPrice(oi.getSupplierPrice());
         rr.setMarkupPartner(oi.getMarkupPartner());
+        rr.setRealPrice(oi.getRealPrice());
+        rr.setRealTotal(oi.getRealTotal());
 
         Long stationId = oi.getStationId();
         if(stationId != null) {
             Station s = stationMapper.selectById(oi.getStationId());
             rr.setStationName(s.getName());
         }
+
+        List<OrderItemCheck> cLs = orderItemCheckMapper.selectList(new QueryWrapper<OrderItemCheck>()
+                .eq("order_item_id", oi.getId())
+                .eq("audit_status", Constants.CHECK_AUDIT_STATUS.AGREED.name())
+        );
+        int reduceNum = 0;
+        BigDecimal reduceAmount = new BigDecimal(0);
+        int replaceNum = 0;
+        if(cLs != null && cLs.size() > 0){
+            for(OrderItemCheck c : cLs){
+                if(Constants.CHECK_TYPE.reduce.name().equals(c.getType())){
+                    reduceNum += c.getNum();
+                    reduceAmount = reduceAmount.add(c.getDeductAmount());
+                } else if(Constants.CHECK_TYPE.replace.name().equals(c.getType())){
+                    replaceNum += c.getNum();
+                }
+            }
+        }
+        rr.setReduceNum(reduceNum);
+        rr.setReduceAmount(reduceAmount);
+        rr.setReplaceNum(replaceNum);
 
         return rr;
     }
@@ -311,6 +341,11 @@
         }
 
         BigDecimal feeSupplier = getAmount(dto.getFeeSupplier());
+        BigDecimal supplierTotal = oi.getSupplierPrice().multiply(new BigDecimal(sl.getNum()));
+        if(feeSupplier.doubleValue() > supplierTotal.doubleValue()){
+            throw new ValidationException("供应商扣款金额不能大于商品申请数量的供应商售价");
+        }
+
         BigDecimal feePartner = getAmount(dto.getFeePartner());
         BigDecimal feePlatform = getAmount(dto.getFeePlatform());
         BigDecimal feePlatformPack = getAmount(dto.getFeePlatformPack());
@@ -320,7 +355,7 @@
         BigDecimal totalFee = feeSupplier.add(feePartner).add(feePlatform).add(feePlatformPack)
                 .add(feePlatformCheck).add(feePlatformTransport);
 
-        BigDecimal st = oi.getPrice().multiply(new BigDecimal(sl.getNum()));//申请售后的花的金额
+        BigDecimal st = oi.getRealPrice().multiply(new BigDecimal(sl.getNum()));//申请售后的花的金额,使用券后的单价
         if(totalFee.doubleValue() > st.doubleValue()){
             throw new ValidationException("退款金额不能大于商品申请数量的售价");
         }
@@ -336,10 +371,16 @@
             }
         }
         preFee = preFee.add(totalFee);
-        if(preFee.doubleValue() > oi.getTotal().doubleValue()){
+        if(preFee.doubleValue() > oi.getRealTotal().doubleValue()){//使用券后的总价
             throw new ValidationException("退款总金额不能大于商品总价");
         }
 
+        BigDecimal deduct = deliveryOrderService.calculateOrderItemDeduct(sl.getOrderItemId());//质检已扣款金额
+        preFee = preFee.add(deduct);
+        if(preFee.doubleValue() > oi.getRealTotal().doubleValue()){
+            throw new ValidationException("退款总金额(包含质检退款)不能大于商品总价");
+        }
+
         sl.setRemarks(dto.getRemarks());
         sl.setFeeSupplier(feeSupplier);
         sl.setFeePartner(feePartner);
diff --git a/src/main/java/com/mzl/flower/service/payment/OrderService.java b/src/main/java/com/mzl/flower/service/payment/OrderService.java
index 0efa99d..34d6b5b 100644
--- a/src/main/java/com/mzl/flower/service/payment/OrderService.java
+++ b/src/main/java/com/mzl/flower/service/payment/OrderService.java
@@ -14,6 +14,7 @@
 import com.mzl.flower.dto.PriceDTO;
 import com.mzl.flower.dto.request.menber.MemberGrowthRecordDTO;
 import com.mzl.flower.dto.request.payment.*;
+import com.mzl.flower.dto.response.coupon.CouponRecordVO;
 import com.mzl.flower.dto.response.flower.FlowerCartListDTO;
 import com.mzl.flower.dto.response.flower.FlowerCartListWrapDTO;
 import com.mzl.flower.dto.response.flower.FlowerDTO;
@@ -60,11 +61,13 @@
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.LocalTime;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -181,6 +184,21 @@
                 c.setNum(dto.getNum());
                 c.create(userId);
 
+                // 限购  1.首先查看购物车中的数量是否已经超过限售数量
+                final FlowerDTO flowerDetail = flowerService.getFlowerDetail(c.getFlowerId());
+                if(null!=c.getNum() && null!=flowerDetail.getLimited()
+                        && c.getNum().compareTo(flowerDetail.getLimited())>0){
+                    throw new ValidationException("数量不能超过限售数量!");
+                }
+
+                // 限购  2.查看已结单的订单的当前花朵已经购买的数量,加当前购物车的加入的数量是否超过限购的数量,查看当前5点前到昨天五点前
+                Integer completeNumToday=getFlowerCompleteNumToday(userId,c.getFlowerId());
+                Integer tmp=completeNumToday+c.getNum();
+                if(null!=tmp && null!=flowerDetail.getLimited()
+                      &&  tmp.compareTo(flowerDetail.getLimited())>0){
+                    throw new ValidationException("当天的订单的花数量加上购物车的数量不能超过限售数量!");
+                }
+
                 cartMapper.insert(c);
             } else {
                 // 查看是否已经超过当前商品的限购数量
@@ -196,7 +214,8 @@
                 // 限购  2.查看已结单的订单的当前花朵已经购买的数量,加当前购物车的加入的数量是否超过限购的数量,查看当前5点前到昨天五点前
                 Integer completeNumToday=getFlowerCompleteNumToday(userId,c.getFlowerId());
                 Integer tmp=completeNumToday+c.getNum();
-                if(tmp.compareTo(flowerDetail.getLimited())>0){
+                if(null!=tmp && null!=flowerDetail.getLimited()
+                       && tmp.compareTo(flowerDetail.getLimited())>0){
                     throw new ValidationException("当天的订单的花数量加上购物车的数量不能超过限售数量!");
                 }
 
@@ -341,7 +360,7 @@
             Integer completeNumToday=getFlowerCompleteNumToday(userId,cartSaveDTO.getId());
             Integer tmp=completeNumToday+cartSaveDTO.getNum();
             Flower flower=flowerMapper.selectById(cartSaveDTO.getId());
-            if(tmp.compareTo(flower.getLimited())>0){
+            if(null!=flower.getLimited() && tmp.compareTo(flower.getLimited())>0){
                 throw new ValidationException("商品:'"+flower.getName()+"' 昨天17:00到今天17:00 超过限售数量:"+flower.getLimited()+"!");
             }
         });
@@ -433,7 +452,8 @@
             // 限购数量 鲜花数量校验
             Integer completeNumToday=getFlowerCompleteNumToday(userId,flower.getId());
             Integer tmp=completeNumToday+flower.getNum();
-            if(tmp.compareTo(flower.getLimited())>0){
+            if(null!=tmp && null!=flower.getLimited()
+                    && tmp.compareTo(flower.getLimited())>0){
                 throw new ValidationException("商品:'"+flower.getName()+"' 昨天17:00到今天17:00 超过限售数量:"+flower.getLimited()+"!");
             }
         });
@@ -524,7 +544,7 @@
         List<FlowerCartListDTO> flowers = p.getFlowers();
         Map<Long, List<ParamItemDTO>> paramMap = new HashMap<>();
         final BigDecimal flowerAmount = order.getFlowerAmount();//订单商品总价
-        final BigDecimal memberCouponAmount = order.getMemberCouponAmount();//使用优惠券面值
+        final BigDecimal memberCouponAmount = getAmount(order.getMemberCouponAmount());//使用优惠券面值
         BigDecimal usedCouponAmount = new BigDecimal(0);
         for (int i = 0; i < flowers.size(); i++) {
             FlowerCartListDTO f = flowers.get(i);
@@ -620,7 +640,7 @@
     private BigDecimal calculateCoupon(BigDecimal couponAmount, BigDecimal itemTotalAmount
             , BigDecimal totalAmount, Integer num, BigDecimal price
             , boolean isLastOne, BigDecimal usedCouponAmount){
-        if(couponAmount == null){
+        if(couponAmount == null || couponAmount.doubleValue() == 0){
             return new BigDecimal(0);
         }
 
@@ -851,9 +871,11 @@
         List<OrderListDTO> ls = getOrderListBase(page, dto);
         if (ls != null && ls.size() > 0) {
             List<String> orderIds = new ArrayList<>();
+            Map<String, OrderListDTO> orderMap = new HashMap<>();
             for (OrderListDTO o : ls) {
                 o.setCouldRefund(couldRefund(o.getStatusBackend(), o.getPaymentTime()));
                 orderIds.add(o.getId());
+                orderMap.put(o.getId(), o);
             }
 
             List<OrderItemListDTO> itemList = orderItemMapper.getOrderItems(orderIds);
@@ -863,6 +885,14 @@
                 List<OrderItemListDTO> ll = map.computeIfAbsent(orderId, k -> new ArrayList<>());
                 OrderItemListDTO d = new OrderItemListDTO();
                 BeanUtils.copyProperties(oi, d);
+
+                OrderListDTO o = orderMap.get(orderId);
+                if(dto.isCustomerQuery() && o != null && StringUtils.isEmpty(o.getTransferId())){
+                    d.setReduceNum(0);
+                    d.setLackNum(0);
+                    d.setReplaceNum(0);
+                }
+
                 ll.add(d);
             }
 
@@ -1041,6 +1071,7 @@
 
     public Page<OrderListDTO> selectCustomerOrderList(Page page, OrderQueryDTO dto) {
         dto.setCreateBy(SecurityUtils.getUserId());
+        dto.setCustomerQuery(true);
 
         return selectOrderList(page, dto);
     }
@@ -1069,6 +1100,15 @@
 
         List<OrderPointGoodsListDTO> pointGoodsList = orderMapper.getPointGoodsList(id);
         dto.setPointGoodsList(pointGoodsList);
+
+        //判断优惠券ID是否为空 用户优惠券id
+        if(StringUtils.isNotBlank(o.getMemberCouponId())){
+            CouponRecordVO couponRecordVO = couponRecordService.getCouponRecordById(o.getMemberCouponId());
+            if(!ObjectUtils.isEmpty(couponRecordVO)){
+                dto.setCouponDiscountType(couponRecordVO.getCouponDiscountType());
+                dto.setMinOrderAmount("满"+couponRecordVO.getMinOrderAmount());
+            }
+        }
 
         return dto;
     }
@@ -1547,7 +1587,31 @@
     }
 
     public Integer getFlowerCompleteNumToday(String userId,Long flowerId){
-        Integer completeNum= orderMapper.getFlowerCompleteNumToday(userId,flowerId);
+
+        int completeNum = 0;
+        // 获取当前时间
+        LocalDateTime now = LocalDateTime.now();
+        // 构造今天的17:00
+        LocalDateTime todayAtFivePM = LocalDateTime.of(LocalDate.now(), LocalTime.of(17, 0));
+        // 定义时间区间的开始和结束时间
+        LocalDateTime startTime;
+        LocalDateTime endTime;
+
+        if (now.isAfter(todayAtFivePM)) {
+            // 当前时间大于今天的17:00,取今天17:00到明天17:00的区间
+            startTime = todayAtFivePM;
+            endTime = todayAtFivePM.plusDays(1);  // 明天的17:00
+        } else {
+            // 当前时间小于今天的17:00,取昨天17:00到今天17:00的区间
+            startTime = todayAtFivePM.minusDays(1);  // 昨天的17:00
+            endTime = todayAtFivePM;  // 今天的17:00
+        }
+
+        // 调用Mapper方法,传递开始时间和结束时间
+        completeNum = orderMapper.getFlowerCompleteNumWithinTimeRange(userId, flowerId, startTime, endTime);
+
         return completeNum;
+
+
     }
 }
diff --git a/src/main/java/com/mzl/flower/service/payment/UserPaymentV3Service.java b/src/main/java/com/mzl/flower/service/payment/UserPaymentV3Service.java
index 3640a32..e93b82a 100644
--- a/src/main/java/com/mzl/flower/service/payment/UserPaymentV3Service.java
+++ b/src/main/java/com/mzl/flower/service/payment/UserPaymentV3Service.java
@@ -9,6 +9,7 @@
 import com.mzl.flower.dto.request.payment.TransferDetailReqDTO;
 import com.mzl.flower.dto.request.payment.TransferReqDTO;
 import com.mzl.flower.dto.request.payment.UserPaymentDTO;
+import com.mzl.flower.entity.flower.Flower;
 import com.mzl.flower.entity.payment.*;
 import com.mzl.flower.entity.system.UserWechat;
 import com.mzl.flower.mapper.flower.FlowerMapper;
@@ -114,6 +115,9 @@
 
     @Autowired
     private CouponRecordService couponRecordService;
+
+    @Autowired
+    private OrderService orderService;
 
     /**
      * 微信预支付
@@ -474,6 +478,22 @@
     }
 
     public Map payAgain(String orderId){
+        // 获取订单里面的商品是否有限购的,如果有则判断是否已经超过限购数量
+        List<OrderItem> orderItemList = orderItemMapper.selectList(new QueryWrapper<OrderItem>()
+                .eq("order_id", orderId));
+
+        orderItemList.forEach(orderItem -> {
+            // 限购数量 鲜花数量校验
+            Integer completeNumToday=orderService.getFlowerCompleteNumToday(orderItem.getCreateBy(),orderItem.getFlowerId());
+            Integer tmp=completeNumToday+orderItem.getNum();
+            Flower flower=flowerMapper.selectById(orderItem.getFlowerId());
+            if(null!=flower.getLimited() && tmp.compareTo(flower.getLimited())>0){
+                throw new ValidationException("商品:'"+flower.getName()+"' 昨天17:00到今天17:00 超过限售数量:"+flower.getLimited()+"!");
+            }
+
+        });
+
+
         UserPayment up = userPaymentMapper.selectOne(
                 new QueryWrapper<UserPayment>().eq("order_id", orderId));
         if(StringUtils.isNotEmpty(up.getStatus())){
diff --git a/src/main/java/com/mzl/flower/service/point/CustomerPointService.java b/src/main/java/com/mzl/flower/service/point/CustomerPointService.java
index 8223dd0..9950f12 100644
--- a/src/main/java/com/mzl/flower/service/point/CustomerPointService.java
+++ b/src/main/java/com/mzl/flower/service/point/CustomerPointService.java
@@ -15,6 +15,8 @@
 import com.mzl.flower.mapper.point.CustomerPointDetailMapper;
 import com.mzl.flower.mapper.point.CustomerPointMapper;
 import com.mzl.flower.service.BaseService;
+import com.mzl.flower.utils.DateUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -47,6 +49,12 @@
     }
 
     public  Page<CustomerPointDetailDTO> queryCustomerDetails(QueryPointDetailDTO dto, Page page) {
+        if(StringUtils.isNotBlank(dto.getCreateTimeStartStr())){
+            dto.setCreateTimeStart(DateUtils.dateTimeStringToLocalDateTime(dto.getCreateTimeStartStr()));
+        }
+        if(StringUtils.isNotBlank(dto.getCreateTimeEndStr())){
+            dto.setCreateTimeEnd(DateUtils.dateTimeStringToLocalDateTime(dto.getCreateTimeEndStr()));
+        }
         List<CustomerPointDetailDTO> list = customerPointMapper.queryCustomerDetails(dto, page);
         page.setRecords(list);
 
diff --git a/src/main/java/com/mzl/flower/service/point/PointGoodsService.java b/src/main/java/com/mzl/flower/service/point/PointGoodsService.java
index 69c144b..e56ab9f 100644
--- a/src/main/java/com/mzl/flower/service/point/PointGoodsService.java
+++ b/src/main/java/com/mzl/flower/service/point/PointGoodsService.java
@@ -143,7 +143,7 @@
             if(!Constants.POINT_GOODS_STATUS.A.name().equals(p.getStatus())){
                 throw new ValidationException("商品未上架");
             }
-            if(p.getStock()< dto.getNum()){
+            if(p.getStock() <=0 || p.getStock()< dto.getNum()){
                 throw new ValidationException("商品库存不足");
             }
             CustomerPoint cp = customerPointMapper.selectOne(new LambdaQueryWrapper<CustomerPoint>()
@@ -190,8 +190,6 @@
             //更新库存
             p.setStock(p.getStock()- dto.getNum());
             pointGoodsMapper.updateById(p);
-        }catch (Exception e){
-            throw new ValidationException("兑换失败");
         }finally {
             lockService.releaseObjectLock(key,"");
         }
diff --git a/src/main/java/com/mzl/flower/web/customer/CustomerSignInController.java b/src/main/java/com/mzl/flower/web/customer/CustomerSignInController.java
index 5254160..96d4cda 100644
--- a/src/main/java/com/mzl/flower/web/customer/CustomerSignInController.java
+++ b/src/main/java/com/mzl/flower/web/customer/CustomerSignInController.java
@@ -39,8 +39,8 @@
     @GetMapping("/list")
     @ApiOperation(value = "签到历史")
     public ResponseEntity<ReturnDataDTO<List<CustomerPointDetailDTO>>> signList(String startDateStr, String endDateStr)  {
-        LocalDate startDate = LocalDate.parse(startDateStr);
-        LocalDate endDate = LocalDate.parse(endDateStr);
+        LocalDate startDate = customerPointService.parseLocalDate(startDateStr);
+        LocalDate endDate = customerPointService.parseLocalDate(endDateStr);
 
         return returnData(R.SUCCESS.getCode(), customerPointService.signList(startDate, endDate));
     }
diff --git a/src/main/java/com/mzl/flower/web/flower/FlowerCategoryController.java b/src/main/java/com/mzl/flower/web/flower/FlowerCategoryController.java
index 772fdbb..e40416e 100644
--- a/src/main/java/com/mzl/flower/web/flower/FlowerCategoryController.java
+++ b/src/main/java/com/mzl/flower/web/flower/FlowerCategoryController.java
@@ -66,6 +66,12 @@
         return returnData(R.SUCCESS.getCode(), categoryService.selectCategoryTree(dto));
     }
 
+    @GetMapping("/list")
+    @ApiOperation(value = "获取商品分类列表")
+    public ResponseEntity<ReturnDataDTO<List<FlowerCategoryTreeDTO>>> selectCategoryList(FlowerCategoryQueryDTO dto){
+        return returnData(R.SUCCESS.getCode(), categoryService.selectCategoryList(dto));
+    }
+
     @GetMapping("/tree/delete")
     @ApiOperation(value = "删除商品分类")
     @ApiImplicitParams({
diff --git a/src/main/java/com/mzl/flower/web/login/SupplierLoginController.java b/src/main/java/com/mzl/flower/web/login/SupplierLoginController.java
index 78f19de..2384912 100644
--- a/src/main/java/com/mzl/flower/web/login/SupplierLoginController.java
+++ b/src/main/java/com/mzl/flower/web/login/SupplierLoginController.java
@@ -88,10 +88,7 @@
             throw new ValidationException("用户不存在");
         }
         SupplierDTO supplierDTO = supplierMapper.getCurrentSupplier(user.getId());
-        if (ObjectUtils.isEmpty(supplierDTO)) {
-            throw new ValidationException("用户不存在");
-        }
-        if (supplierDTO.getIsEnabled() == false) {
+        if (supplierDTO != null && supplierDTO.getIsEnabled() == false) {
             throw new ValidationException("用户已禁用,请联系管理员");
         }
         String tokenCache = stringCacheClient.get(TOKEN_KEY + SEPARATOR + user.getId());
diff --git a/src/main/java/com/mzl/flower/web/partner/PartnerController.java b/src/main/java/com/mzl/flower/web/partner/PartnerController.java
index 3a3a2c8..5e0fce5 100644
--- a/src/main/java/com/mzl/flower/web/partner/PartnerController.java
+++ b/src/main/java/com/mzl/flower/web/partner/PartnerController.java
@@ -30,6 +30,14 @@
     }
 
 
+    @PostMapping("/base/update")
+    @ApiOperation(value = "合伙人基本信息修改", notes = "合伙人基本信息修改")
+    public ResponseEntity<ReturnDataDTO> baseUpdate(@Validated @RequestBody UpdatePartnerBaseDTO dto) {
+        partnerService.baseUpdate(dto);
+        return returnData(R.SUCCESS.getCode(),null);
+    }
+
+
     @PostMapping("/addOrUpdate")
     @ApiOperation(value = "合伙人信息登记、修改", notes = "合伙人信息登记、修改")
     public ResponseEntity<ReturnDataDTO> addOrUpdatePartner(@Validated @RequestBody UpdatePartnerDTO dto) {
diff --git a/src/main/java/com/mzl/flower/web/point/CustomerPointController.java b/src/main/java/com/mzl/flower/web/point/CustomerPointController.java
index 342d05d..3a214a1 100644
--- a/src/main/java/com/mzl/flower/web/point/CustomerPointController.java
+++ b/src/main/java/com/mzl/flower/web/point/CustomerPointController.java
@@ -59,6 +59,9 @@
     @PostMapping("/giveaway")
     @ApiOperation(value = "管理端-积分赠送", notes = "管理端-积分赠送")
     public ResponseEntity<ReturnDataDTO> giveawayPoint(@Validated @RequestBody ChangePointDTO dto) {
+        if(dto.getPoint()<=0){
+            throw new ValidationException("赠送积分必须大于0");
+        }
         customerPointService.giveawayPoint(dto);
         return returnData(R.SUCCESS.getCode(),null);
     }
@@ -66,6 +69,9 @@
     @PostMapping("/deduction")
     @ApiOperation(value = "管理端-积分扣除", notes = "管理端-积分扣除")
     public ResponseEntity<ReturnDataDTO> deductionPoint(@Validated @RequestBody ChangePointDTO dto) {
+        if(dto.getPoint()<=0){
+            throw new ValidationException("扣除积分必须大于0");
+        }
         customerPointService.deductionPoint(dto);
         return returnData(R.SUCCESS.getCode(),null);
     }
diff --git a/src/main/java/com/mzl/flower/web/supplier/DeliverySupplierController.java b/src/main/java/com/mzl/flower/web/supplier/DeliverySupplierController.java
index 8aca450..b305f77 100644
--- a/src/main/java/com/mzl/flower/web/supplier/DeliverySupplierController.java
+++ b/src/main/java/com/mzl/flower/web/supplier/DeliverySupplierController.java
@@ -39,6 +39,13 @@
     @ApiOperation(value = "获取配送单列表")
     public ResponseEntity<ReturnDataDTO<Page<DeliveryOrderListDTO>>> selectOrderList(Page page
             , DeliveryOrderQueryDTO dto){
+        LocalDate localDate = deliveryOrderService.parseLocalDate(dto.getDate());
+        if(localDate != null){
+            LocalDateTime endDate = localDate.atTime(17, 0, 0);
+            LocalDateTime startDate = endDate.plusDays(-1);
+            dto.setStartDate(startDate);
+            dto.setEndDate(endDate);
+        }
         return returnData(R.SUCCESS.getCode(), deliveryOrderService.selectDeliveryOrderList(page, dto));
     }
 
diff --git a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java
index 7905c5f..08026a8 100644
--- a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java
+++ b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateActivyController.java
@@ -177,11 +177,22 @@
 
     private void valid(CreateCouponTemplateActivyDTO dto){
 
-        if (StringUtils.isNotBlank(dto.getCouponDiscountType())
-                && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
-                && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) {
-            throw new ValidationException("订单金额不能小于折扣金额");
+//        if (StringUtils.isNotBlank(dto.getCouponDiscountType())
+//                && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
+//                && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) {
+//            throw new ValidationException("优惠券使用条件不能小于面值金额");
+//        }
+        if (StringUtils.isNotBlank(dto.getCouponDiscountType()) && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())) {
+
+            if(dto.getMinOrderAmount().compareTo(BigDecimal.ZERO)<=0){
+                throw new ValidationException("优惠券使用条件不能小于0");
+            }
+            if(dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0){
+                throw new ValidationException("优惠券使用条件不能小于面值金额");
+            }
+
         }
+
         if (StringUtils.isNotBlank(dto.getCouponDiscountType())
                 && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
                 && dto.getCouponDiscountValue().compareTo(BigDecimal.ZERO) <= 0) {
@@ -203,6 +214,19 @@
             if(dto.getUsageEndDate()==null){
                 throw new ValidationException("固定时间结束日期不能为空");
             }
+
+            if(dto.getUsageStartDate().isAfter(dto.getUsageEndDate())){
+                throw new ValidationException("固定时间开始时间不能大于结束日期");
+            }
+
+
+            // 固定时间的使用开始时间必须大于领取的结束时间
+
+            if(null!=dto.getGetEndDate() && null!=dto.getUsageStartDate() && dto.getGetEndDate().isAfter(dto.getUsageStartDate())){
+                throw new ValidationException("使用开始时间必须大于领取结束时间!");
+            }
+
+
         }
 
         // 领取后 有效时间
@@ -229,6 +253,8 @@
             }
         }
 
+        //
+
     }
 
 }
diff --git a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java
index 50a553a..b9dddbe 100644
--- a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java
+++ b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplatePointController.java
@@ -216,11 +216,17 @@
 
     private void valid(CreateCouponTemplatePointDTO dto){
 
-        if (StringUtils.isNotBlank(dto.getCouponDiscountType())
-                && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
-                && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) {
-            throw new ValidationException("订单金额不能小于折扣金额");
+        if (StringUtils.isNotBlank(dto.getCouponDiscountType()) && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())) {
+
+            if(dto.getMinOrderAmount().compareTo(BigDecimal.ZERO)<=0){
+                throw new ValidationException("优惠券使用条件不能小于0");
+            }
+            if(dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0){
+                throw new ValidationException("优惠券使用条件不能小于面值金额");
+            }
+
         }
+
         if (StringUtils.isNotBlank(dto.getCouponDiscountType())
                 && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
                 && dto.getCouponDiscountValue().compareTo(BigDecimal.ZERO) <= 0) {
diff --git a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateUserController.java b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateUserController.java
index 7939f58..344ce2f 100644
--- a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateUserController.java
+++ b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateUserController.java
@@ -6,6 +6,7 @@
 import com.mzl.flower.base.R;
 import com.mzl.flower.base.ReturnDataDTO;
 import com.mzl.flower.config.exception.ValidationException;
+import com.mzl.flower.dto.request.coupon.CreateCouponTemplateActivyDTO;
 import com.mzl.flower.dto.request.coupon.CreateCouponTemplateBO;
 import com.mzl.flower.dto.request.coupon.CreateCouponTemplateUserDTO;
 import com.mzl.flower.dto.request.coupon.QueryCouponDTO;
@@ -45,14 +46,8 @@
     @ApiOperation(value = "新增", notes = "新增")
     public ResponseEntity<ReturnDataDTO> create(@Validated @RequestBody CreateCouponTemplateUserDTO dto) {
 
-        if (dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType()) && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) {
-            throw new ValidationException("订单金额不能小于折扣金额");
-        }
 
-        if (dto.getCouponDiscountType().equals(CouponTypeEnum.ZERO.getType()) && dto.getMinOrderAmount().compareTo(BigDecimal.ZERO) != 0) {
-            throw new ValidationException("无门槛的订单金额必须为0");
-        }
-
+        valid(dto);
 
         CreateCouponTemplateBO couponTemplateBO = new CreateCouponTemplateBO();
         BeanUtils.copyProperties(dto, couponTemplateBO);
@@ -77,14 +72,7 @@
 
         dto.setId(id);
 
-        if (dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType()) && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) {
-            throw new ValidationException("订单金额不能小于折扣金额");
-        }
-
-        if (dto.getCouponDiscountType().equals(CouponTypeEnum.ZERO.getType()) && dto.getMinOrderAmount().compareTo(BigDecimal.ZERO) != 0) {
-            throw new ValidationException("无门槛的订单金额必须为0");
-        }
-
+        valid(dto);
 
         CouponTemplateDO couponTemplateDO = couponTemplateService.getById(dto.getId());
         if (null == couponTemplateDO) {
@@ -187,4 +175,22 @@
     }
 
 
+    private void valid(CreateCouponTemplateUserDTO dto){
+        if (StringUtils.isNotBlank(dto.getCouponDiscountType()) && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())) {
+
+            if(dto.getMinOrderAmount().compareTo(BigDecimal.ZERO)<=0){
+                throw new ValidationException("优惠券使用条件不能小于0");
+            }
+            if(dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0){
+                throw new ValidationException("优惠券使用条件不能小于面值金额");
+            }
+
+        }
+
+        if (dto.getCouponDiscountType().equals(CouponTypeEnum.ZERO.getType()) && dto.getMinOrderAmount().compareTo(BigDecimal.ZERO) != 0) {
+            throw new ValidationException("无门槛的订单金额必须为0");
+        }
+    }
+
+
 }
diff --git a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateVipController.java b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateVipController.java
index fe543b1..1af24f4 100644
--- a/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateVipController.java
+++ b/src/main/java/com/mzl/flower/web/v2/coupon/CouponTemplateVipController.java
@@ -162,11 +162,17 @@
             throw new ValidationException("会员等级不存在");
         }
 
-        if (StringUtils.isNotBlank(dto.getCouponDiscountType())
-                && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
-                && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) {
-            throw new ValidationException("订单金额不能小于折扣金额");
+        if (StringUtils.isNotBlank(dto.getCouponDiscountType()) && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())) {
+
+            if(dto.getMinOrderAmount().compareTo(BigDecimal.ZERO)<=0){
+                throw new ValidationException("优惠券使用条件不能小于0");
+            }
+            if(dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0){
+                throw new ValidationException("优惠券使用条件不能小于面值金额");
+            }
+
         }
+
         if (StringUtils.isNotBlank(dto.getCouponDiscountType())
                 && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType())
                 && dto.getCouponDiscountValue().compareTo(BigDecimal.ZERO) <= 0) {
diff --git a/src/main/resources/mapper/coupon/CouponRecordMapperCustom.xml b/src/main/resources/mapper/coupon/CouponRecordMapperCustom.xml
index 7970cda..67159fc 100644
--- a/src/main/resources/mapper/coupon/CouponRecordMapperCustom.xml
+++ b/src/main/resources/mapper/coupon/CouponRecordMapperCustom.xml
@@ -39,6 +39,9 @@
             AND customer_id =  #{param.customerId}
         </if>
     </update>
+    <update id="expireCouponRecordAll">
+        update t_coupon_record  set `status`='expired' where `status`='unused' and effective_end &lt; NOW()
+    </update>
 
     <select id="statisCouponTemplateCount" resultType="java.lang.Integer">
         select IFNULL(count(1),0) as cnt from t_coupon_record where deleted=false and category=#{param.category}
diff --git a/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml b/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml
index 7ce2dbb..cf3918e 100644
--- a/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml
+++ b/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml
@@ -59,6 +59,9 @@
     <update id="expireHomeActivityCouponTemplate">
         update t_coupon_template set status='expired'  where  category='activity' and get_type='home' and status='active'
     </update>
+    <update id="expireActivityCouponTemplateAll">
+        update t_coupon_template set status='expired'  where category='activity' and  get_end_date &lt; NOW()
+    </update>
 
     <select id="getCouponTemplatePage" resultType="com.mzl.flower.dto.response.coupon.CouponTemplateVO">
         <include refid="QuerySql2"/>
diff --git a/src/main/resources/mapper/flower/FlowerCategoryMapper.xml b/src/main/resources/mapper/flower/FlowerCategoryMapper.xml
index 0051a46..7cd07ee 100644
--- a/src/main/resources/mapper/flower/FlowerCategoryMapper.xml
+++ b/src/main/resources/mapper/flower/FlowerCategoryMapper.xml
@@ -2,6 +2,35 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.mzl.flower.mapper.flower.FlowerCategoryMapper">
 
+    <select id="selectCategoryList" resultType="com.mzl.flower.dto.response.flower.FlowerCategoryTreeDTO">
+        SELECT q.*
+        , (select count(1) from t_flower_category f where f.parent_id = q.id) childrenCount
+        FROM t_flower_category q
+        WHERE q.deleted = 0
+        <if test="condition.name != null and condition.name != ''">
+            AND (q.name LIKE concat('%', #{condition.name},'%')
+                or exists (
+                    select 1 from t_flower_category sq where sq.parent_id = q.id and sq.name LIKE concat('%', #{condition.name},'%')
+                )
+            )
+        </if>
+        <choose>
+            <when test="condition.parentId != null">
+                AND q.parent_id = #{condition.parentId}
+            </when>
+            <otherwise>
+                AND q.parent_id is null
+            </otherwise>
+        </choose>
+        <if test="condition.shown != null and condition.shown">
+            AND (q.shown = 1 or q.shown is null)
+        </if>
+        <if test="condition.shown != null and !condition.shown">
+            AND q.shown = 0
+        </if>
+        ORDER BY q.sort_by, q.create_time Desc
+    </select>
+
     <select id="selectTreeList" resultType="com.mzl.flower.dto.response.flower.FlowerCategoryTreeDTO">
         SELECT q.*
         , (select min(f.price) from t_flower f where f.category = q.id and f.status = 'UP' and f.deleted = 0) priceLow
diff --git a/src/main/resources/mapper/flower/FlowerMapper.xml b/src/main/resources/mapper/flower/FlowerMapper.xml
index 308869c..1da83a9 100644
--- a/src/main/resources/mapper/flower/FlowerMapper.xml
+++ b/src/main/resources/mapper/flower/FlowerMapper.xml
@@ -45,6 +45,12 @@
         <if test="condition.recommend != null and !condition.recommend">
             AND (f.recommend = 0 or f.recommend is null)
         </if>
+        <if test="condition.isLimited != null and condition.isLimited">
+            AND f.limited > 0
+        </if>
+        <if test="condition.isLimited != null and !condition.isLimited">
+            AND (f.limited = 0 or f.limited is null)
+        </if>
         <if test="condition.statusList != null and condition.statusList.size > 0">
             and f.status in
             <foreach collection="condition.statusList" item="item" open="(" separator="," close=")">
diff --git a/src/main/resources/mapper/payment/OrderItemSalesMapper.xml b/src/main/resources/mapper/payment/OrderItemSalesMapper.xml
index eef9518..6abf279 100644
--- a/src/main/resources/mapper/payment/OrderItemSalesMapper.xml
+++ b/src/main/resources/mapper/payment/OrderItemSalesMapper.xml
@@ -71,7 +71,7 @@
             , oi.flower_level, oi.flower_category, o.customer, o.customer_tel, o.customer_province, o.customer_city
             , o.customer_region, o.customer_address, oi.num flowerNum, oi.supplier_name, oi.price, oi.total
             , o.order_no, si.sales_no, si.title, si.num, si.reason, si.total_fee, si.status, si.create_time
-            , si.remarks, oi.supplier_price, oi.markup_partner, si.audit_time,si.sales_type
+            , si.remarks, oi.supplier_price, oi.markup_partner, si.audit_time,si.sales_type, oi.real_price, oi.real_total
         FROM t_order_item_sales si
         join t_order_item oi on oi.id = si.order_item_id
         join t_order o on si.order_id = o.id
diff --git a/src/main/resources/mapper/payment/OrderMapper.xml b/src/main/resources/mapper/payment/OrderMapper.xml
index 6639b8c..4d7d43a 100644
--- a/src/main/resources/mapper/payment/OrderMapper.xml
+++ b/src/main/resources/mapper/payment/OrderMapper.xml
@@ -133,6 +133,7 @@
                 and (oi.status = 'reduce' or oi.status = 'abnormal')
             )
             and q.transfer_id is null
+            and q.status in ('COLLECTION', 'SEND')
         </if>
         <if test="condition.billId != null and condition.billId != ''">
             AND q.bill_id = #{condition.billId}
@@ -143,6 +144,9 @@
                 where oi.order_id = q.id
                 and oi.flower_name LIKE concat('%', #{condition.flowerName},'%')
             )
+        </if>
+        <if test="condition.warehouseLocationCode != null and condition.warehouseLocationCode != ''">
+            AND q.warehouse_location_code LIKE concat('%', #{condition.warehouseLocationCode},'%')
         </if>
 
         ORDER BY q.create_time desc, q.payment_time desc
@@ -260,15 +264,15 @@
         join t_order_point_goods opg on opg.goods_record_id = gr.id
         where opg.order_id = #{orderId}
     </select>
-    <select id="getFlowerCompleteNumToday" resultType="java.lang.Integer">
+    <select id="getFlowerCompleteNumWithinTimeRange" resultType="java.lang.Integer">
         select IFNULL(sum(oi.num),0) as complete_num
         from t_order o
         left join t_order_item oi
         on o.id=oi.order_id
         where o.DELETEd=0 and oi.DELETEd=0
-        and o.status_backend not in ('PENDING','CANCEL','REFUND')
-        and o.create_by=#{userId}
-        AND oi.flower_id=#{flowerId}
-        AND o.complete_time BETWEEN  DATE_SUB(CURDATE(), INTERVAL 1 DAY) + INTERVAL 17 HOUR  AND CURDATE() + INTERVAL 17 HOUR
+          and o.status_backend not in ('PENDING','CANCEL','REFUND')
+          and o.create_by=#{userId}
+          AND oi.flower_id=#{flowerId}
+          AND o.payment_time BETWEEN  #{startTime}  AND #{endTime}
     </select>
 </mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/payment/OrderSettlementDetailMapper.xml b/src/main/resources/mapper/payment/OrderSettlementDetailMapper.xml
index 4521617..6c199d5 100644
--- a/src/main/resources/mapper/payment/OrderSettlementDetailMapper.xml
+++ b/src/main/resources/mapper/payment/OrderSettlementDetailMapper.xml
@@ -3,7 +3,7 @@
 <mapper namespace="com.mzl.flower.mapper.payment.OrderSettlementDetailMapper">
 
     <select id="selectSettlementDetailList" resultType="com.mzl.flower.dto.response.payment.OrderSettlementDetailDTO">
-        SELECT s.*, oi.flower_name, oi.flower_level, o.receive_time, oi.check_time, o.order_no
+        SELECT s.*, oi.flower_name, oi.flower_level, o.receive_time, oi.check_time, o.order_no, s.order_id
         FROM t_order_settlement_detail s
         join t_order_item oi on oi.id = s.order_item_id
         join t_order o on o.id = s.order_id
diff --git a/src/main/resources/mapper/payment/OrderSettlementMapper.xml b/src/main/resources/mapper/payment/OrderSettlementMapper.xml
index 5a75e50..05ec5ba 100644
--- a/src/main/resources/mapper/payment/OrderSettlementMapper.xml
+++ b/src/main/resources/mapper/payment/OrderSettlementMapper.xml
@@ -26,7 +26,7 @@
         <if test="condition.userName != null and condition.userName != ''">
             AND (si.name LIKE CONCAT('%', #{condition.userName}, '%') OR pi.name LIKE CONCAT('%', #{condition.userName}, '%'))
         </if>
-        ORDER BY s.create_time desc
+        ORDER BY s.create_time desc, userName
     </select>
 
     <select id="getUserIncome" resultType="java.math.BigDecimal">
diff --git a/src/main/resources/mapper/point/CustomerPointMapper.xml b/src/main/resources/mapper/point/CustomerPointMapper.xml
index 004ba1c..b6bcd4e 100644
--- a/src/main/resources/mapper/point/CustomerPointMapper.xml
+++ b/src/main/resources/mapper/point/CustomerPointMapper.xml
@@ -45,12 +45,22 @@
                AND t.record_date <= #{dto.recordDateEnd}
             ]]>
         </if>
-        <if test="dto.type!=null and dto.type != null">
+        <if test="dto.type!=null and dto.type != ''">
             and t.type = #{dto.type}
         </if>
         <if test="dto.remarks!=null and dto.remarks != null">
             and t.remarks like CONCAT('%',#{dto.remarks},'%')
         </if>
+        <if test="dto.createTimeStart!=null">
+            <![CDATA[
+               AND t.create_time >= #{dto.createTimeStart}
+            ]]>
+        </if>
+        <if test="dto.createTimeEnd!=null ">
+            <![CDATA[
+               AND t.create_time <= #{dto.createTimeEnd}
+            ]]>
+        </if>
         order by t.create_time desc
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3