From ead1649e86e946126137ef523c508bb4c7dfff90 Mon Sep 17 00:00:00 2001
From: fwq <582742538@qq.com>
Date: 星期一, 22 五月 2023 10:34:26 +0800
Subject: [PATCH] Merge branch 'master-prod-new-优惠券校验' into master-prod-new

---
 phis-feign/src/main/java/com/hz/his/dto/coupon/CouponCheckItemDto.java     |   51 ++++++++++++
 phis-feign/src/main/java/com/hz/his/dto/coupon/CouponCheckDto.java         |   28 +++++++
 phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckDt.java          |   18 ++++
 phis-feign/src/main/java/com/hz/his/dto/order/PayDto.java                  |    3 
 phis-feign/src/main/java/com/hz/his/feign/service/phis/SCouponService.java |   26 +++++-
 phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckMoneyDt.java     |   25 ++++++
 phis-feign/src/main/java/com/hz/his/dto/coupon/CouponListDto.java          |   31 +++++++
 7 files changed, 177 insertions(+), 5 deletions(-)

diff --git a/phis-feign/src/main/java/com/hz/his/dto/coupon/CouponCheckDto.java b/phis-feign/src/main/java/com/hz/his/dto/coupon/CouponCheckDto.java
new file mode 100644
index 0000000..64111b7
--- /dev/null
+++ b/phis-feign/src/main/java/com/hz/his/dto/coupon/CouponCheckDto.java
@@ -0,0 +1,28 @@
+package com.hz.his.dto.coupon;
+
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 浼樻儬鍒告牎楠屾墿灞�
+ * @author fwq
+ */
+@Data
+public class CouponCheckDto {
+
+    /**鐢ㄦ埛浼樻儬鍒哥爜鏍囪瘑闆嗗悎*/
+    private List<String> couponNumberIdList;
+    /**鍟嗗搧淇℃伅*/
+    private List<CouponCheckItemDto> goodsList;
+    /**鏀粯鏂瑰紡缂栧彿闆嗗悎*/
+    private List<String> payMethodList;
+
+
+    /**鍟嗗搧鎬婚噾棰�(鏆傛棤鐢�-涓嶄紶)*/
+    private BigDecimal total;
+    /**鍟嗗搧鎬讳欢鏁�(鏆傛棤鐢�-涓嶄紶)*/
+    private Integer itemNum;
+}
diff --git a/phis-feign/src/main/java/com/hz/his/dto/coupon/CouponCheckItemDto.java b/phis-feign/src/main/java/com/hz/his/dto/coupon/CouponCheckItemDto.java
new file mode 100644
index 0000000..31b7b0c
--- /dev/null
+++ b/phis-feign/src/main/java/com/hz/his/dto/coupon/CouponCheckItemDto.java
@@ -0,0 +1,51 @@
+package com.hz.his.dto.coupon;
+
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 浼樻儬鍒告牎楠�-鍟嗗搧淇℃伅
+ */
+@Data
+public class CouponCheckItemDto{
+    /**鍟嗗搧sku鏍囪瘑*/
+    private String skuId;
+    /**鍟嗗搧绫诲瀷*/
+    private Integer goodsType;
+    /**鍟嗗搧鎵�灞炲垎绫绘爣璇嗛泦鍚�*/
+    private List<String> typeIdList;
+    /**鍟嗗搧phis鏍囪瘑*/
+    private String hisId;
+    /**鍟嗗搧phis绫诲瀷*/
+    private String hisType;
+    /**鍟嗗搧鎵�灞瀙his鍒嗙被鏍囪瘑闆嗗悎*/
+    private List<String> hisTypeIdList;
+    /**鍗曚釜鍟嗗搧閲戦*/
+    private BigDecimal price;
+    /**璐拱鏁伴噺*/
+    private Integer buyNum;
+
+
+    /**绫诲瀷-椤圭洰*/
+    public static final String TYPE_PROJECT = "project";
+    /**绫诲瀷-鍟嗗搧/鑽搧*/
+    public static final String TYPE_RETAIL = "retail";
+    /**绫诲瀷-鍗¢」*/
+    public static final String TYPE_CARD = "card";
+    /**绫诲瀷-淇冮攢*/
+    public static final String TYPE_PROMOTION = "promotion";
+    /**绫诲瀷-澧炲�奸噾*/
+    public static final String TYPE_INCREMENT = "increment";
+    /**绫诲瀷-鍌ㄥ�奸噾*/
+    public static final String TYPE_STORED = "stored";
+    /**绫诲瀷-绉垎*/
+    public static final String TYPE_INTEGRAL = "integral";
+    /**绫诲瀷-鍥㈣喘鍟嗗搧*/
+    public static final String TYPE_COMMODITY = "commodity";
+    /**绫诲瀷-绉垎鍟嗗搧*/
+    public static final String TYPE_GOODS_INTEGRAL = "goods_integral";
+
+}
diff --git a/phis-feign/src/main/java/com/hz/his/dto/coupon/CouponListDto.java b/phis-feign/src/main/java/com/hz/his/dto/coupon/CouponListDto.java
new file mode 100644
index 0000000..8390d10
--- /dev/null
+++ b/phis-feign/src/main/java/com/hz/his/dto/coupon/CouponListDto.java
@@ -0,0 +1,31 @@
+package com.hz.his.dto.coupon;
+
+
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 鍙敤浼樻儬鍒稿垪琛ㄥ弬鏁�
+ * @author fwq
+ */
+@Data
+public class CouponListDto{
+    /**鐢ㄦ埛鏍囪瘑*/
+    private String userId;
+    /**鐢ㄦ埛浼樻儬鍒哥爜鏍囪瘑闆嗗悎*/
+    private List<String> couponNumberIdList;
+    /**鍟嗗搧淇℃伅*/
+    private List<CouponCheckItemDto> goodsList;
+    /**鏄惁鐢熸棩鍒�*/
+    private Integer isBirthday;
+    /**鏄惁绾夸笅鍒�*/
+    private Integer isOffline = 0;
+    /**鎼滅储,绾夸笅浼樻儬鍒哥爜/绾夸笂鍚嶇О*/
+    private String searchData;
+    /**鏀粯鏂瑰紡缂栧彿闆嗗悎*/
+    private List<String> payMethodList;
+    /**浼樻儬鍒稿钩鍙�*/
+    private String platform;
+}
diff --git a/phis-feign/src/main/java/com/hz/his/dto/order/PayDto.java b/phis-feign/src/main/java/com/hz/his/dto/order/PayDto.java
index 3610f04..7d5e7c7 100644
--- a/phis-feign/src/main/java/com/hz/his/dto/order/PayDto.java
+++ b/phis-feign/src/main/java/com/hz/his/dto/order/PayDto.java
@@ -37,7 +37,8 @@
 
     /**闈炲繀濉� 鏀堕摱鍛橀棬搴�*/
     private String cashierShopId;
-
+    /**浼樻儬鍒告牎楠岀増鏈紙榛樿0锛夌涓�鐗堜负0,闂ㄥ簵鍔╂墜涓婄嚎鐗堟湰涓�1*/
+    private Integer couponCheckVersion = 0;
     /**闈炲繀濉� 浼樻儬鍒竔d闆嗗悎*/
     private List<String> userCouponIds;
 }
diff --git a/phis-feign/src/main/java/com/hz/his/feign/service/phis/SCouponService.java b/phis-feign/src/main/java/com/hz/his/feign/service/phis/SCouponService.java
index 03821bd..7841ad8 100644
--- a/phis-feign/src/main/java/com/hz/his/feign/service/phis/SCouponService.java
+++ b/phis-feign/src/main/java/com/hz/his/feign/service/phis/SCouponService.java
@@ -2,11 +2,9 @@
 
 
 import com.hx.resultTool.Result;
-import com.hz.his.dto.coupon.CouponDetailDto;
-import com.hz.his.dto.coupon.CouponDto;
-import com.hz.his.dto.coupon.CouponGoodsDto;
-import com.hz.his.dto.coupon.CouponListDetailDto;
+import com.hz.his.dto.coupon.*;
 import com.hz.his.dto.dictionaries.DictionariesDto;
+import com.hz.his.dto.user.coupon.GoodsUsedCouponDto;
 import com.hz.phis.dt.marketingCoupon.MarketingCouponDto;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -102,4 +100,24 @@
      */
     @PostMapping(value = "/marketing/data")
     Result marketingData(@RequestBody(required = false) MarketingCouponDto marketingCouponDto);
+
+
+    /**
+     * 浼樻儬鍒哥粺涓�鏍¢獙鎺ュ彛
+     */
+    @PostMapping(value = "/coupon/unify/check")
+    Result unifyCheck(@RequestBody(required = false) CouponCheckDto couponCheckDto);
+
+    /**
+     * 鐢ㄦ埛-鍙敤浼樻儬鍒稿垪琛�-缁熶竴鏍¢獙鐗堟湰
+     * @return canUseCouponList鍙敤鍒稿垪琛� canUseCount鍙敤鍒告暟閲�
+     * */
+    @PostMapping(value = "/coupon/user/unify/check/list")
+    Result userCouponCheckList(@RequestBody(required = false) CouponListDto couponListDto);
+
+    /**
+     * 浼樻儬鍒哥粺涓�鏍¢獙鎺ュ彛
+     */
+    @PostMapping(value = "/coupon/find/skuId")
+    Result findGoodsSkuIdCoupon(@RequestBody(required = false) GoodsUsedCouponDto dto);
 }
diff --git a/phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckDt.java b/phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckDt.java
new file mode 100644
index 0000000..5a1bb61
--- /dev/null
+++ b/phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckDt.java
@@ -0,0 +1,18 @@
+package com.hz.phis.dt.coupon;
+
+
+import lombok.Data;
+/**
+ * 浼樻儬鍒告楠岃繑鍥炲疄浣�
+ */
+@Data
+public class CouponCheckDt {
+    /**鏄惁鍙敤*/
+    private Boolean isCanUse;
+    /**涓嶅彲鐢ㄦ彁绀�*/
+    private String unavailableMsg;
+    /**鏄惁寮傚父*/
+    private Boolean isErr;
+    /**寮傚父鎻愮ず*/
+    private String errMsg;
+}
diff --git a/phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckMoneyDt.java b/phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckMoneyDt.java
new file mode 100644
index 0000000..bee990a
--- /dev/null
+++ b/phis-feign/src/main/java/com/hz/phis/dt/coupon/CouponCheckMoneyDt.java
@@ -0,0 +1,25 @@
+package com.hz.phis.dt.coupon;
+
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+
+/**
+ * 浼樻儬鍒告楠岄噾棰濊繑鍥炲疄浣�
+ */
+@Data
+public class CouponCheckMoneyDt {
+    /**閲戦*/
+    BigDecimal goodsMoney = BigDecimal.ZERO;
+
+    /**閲戦鍙犲姞*/
+    public void goodsMoneyAdd(BigDecimal money) {
+        if (money == null){
+            money = BigDecimal.ZERO;
+        }
+        this.goodsMoney = this.goodsMoney.add(money).setScale(2, RoundingMode.HALF_UP);
+    }
+
+}

--
Gitblit v1.8.0