From e1a62ec62e7331d97af9302e90e1ce44af8235eb Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 27 一月 2021 15:26:55 +0800
Subject: [PATCH] 拼多多授权绑定

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
index 97dfdc7..a8ee6c4 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
@@ -252,8 +252,8 @@
         HongBaoV2 oldHongBao = hongBaoV2Mapper.selectByPrimaryKeyForUpdate(hongBaoOrder.getHongBaoV2().getId());
         if (oldHongBao == null)
             throw new HongBaoException(10, "绾㈠寘瀵硅薄涓嶅瓨鍦�");
-        // 宸茬粡澶辨晥锛屽凡缁忛鍙栵紝鏂拌�佺姸鎬佷竴鑷寸殑绾㈠寘涓嶅仛澶勭悊
-        if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO || oldHongBao.getState() == HongBaoV2.STATE_YILINGQU)
+        // 宸茬粡澶辨晥锛屽凡缁忛鍙栵紝棰嗗彇涓紝鏂拌�佺姸鎬佷竴鑷寸殑绾㈠寘涓嶅仛澶勭悊
+        if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO || oldHongBao.getState() == HongBaoV2.STATE_YILINGQU|| oldHongBao.getState() == HongBaoV2.STATE_LINGQUING)
             return false;
 
         SystemEnum system = userInfoService.getUserSystem(commonOrder.getUserInfo().getId());
@@ -342,7 +342,7 @@
             List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId());
             if (children != null && children.size() > 0)
                 for (HongBaoV2 child : children) {
-                    if (child.getState() == HongBaoV2.STATE_YILINGQU)
+                    if (child.getState() == HongBaoV2.STATE_YILINGQU||child.getState() == HongBaoV2.STATE_LINGQUING)
                         continue;
 
                     HongBaoV2 childUpdate = new HongBaoV2(child.getId());
@@ -567,7 +567,7 @@
             List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId());
             if (children != null)
                 for (HongBaoV2 child : children) {
-                    if (child.getState() == HongBaoV2.STATE_YILINGQU)
+                    if (child.getState() == HongBaoV2.STATE_YILINGQU||child.getState() == HongBaoV2.STATE_LINGQUING)
                         continue;
 
                     HongBaoV2 childUpdate = new HongBaoV2(child.getId());
@@ -739,7 +739,7 @@
 
                 // 鎻掑叆涓�绾у瓙绾㈠寘
                 BigDecimal firstRate = hongBaoManageService
-                        .getFirstInviteRate(boss.getRank() == null ? 0 : boss.getRank(),system);
+                        .getFirstInviteRate(boss.getRank() == null ? 0 : boss.getRank(), system);
                 if (firstRate.compareTo(new BigDecimal(0)) <= 0)
                     return mianDanMoney != null;
                 HongBaoV2 firstHongbao = new HongBaoV2();
@@ -792,7 +792,7 @@
                 boss = threeSaleSerivce.getBoss(boss.getId());
                 if (boss != null) {// 浜岀骇BOSS瀛樺湪
                     BigDecimal secondRate = hongBaoManageService
-                            .getSecondInviteRate(boss.getRank() == null ? 0 : boss.getRank(),system);
+                            .getSecondInviteRate(boss.getRank() == null ? 0 : boss.getRank(), system);
                     if (secondRate.compareTo(new BigDecimal(0)) <= 0)
                         return mianDanMoney != null;
                     HongBaoV2 secondHongbao = new HongBaoV2();
@@ -853,10 +853,10 @@
             BigDecimal shareRate = null;
             if (commonOrder.getSourceType() == Constant.SOURCE_TYPE_TAOBAO
                     && commonOrder.getSourcePosition().equalsIgnoreCase(TaoBaoConstant.TAOBAO_TLJ_RELATION_PID_DEFAULT))// 鏉ヨ嚜浜庢窐绀奸噾鐨勫垎浜�
-                shareRate = hongBaoManageService.getTLJShareRate(commonOrder.getCreateTime().getTime(),system);
+                shareRate = hongBaoManageService.getTLJShareRate(commonOrder.getCreateTime().getTime(), system);
             else
                 shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,
-                        commonOrder.getCreateTime().getTime(),system);
+                        commonOrder.getCreateTime().getTime(), system);
 
             UserInfo user = userInfoService.getUserById(commonOrder.getUserInfo().getId());
 
@@ -873,7 +873,7 @@
                     if (taoBaoOrderList != null && taoBaoOrderList.size() > 0
                             && !StringUtil.isNullOrEmpty(taoBaoOrderList.get(0).getRelationId())) {
                         if (shareGoodsActivityOrderService.listByUid(commonOrder.getUserInfo().getId()).size() < 1) {
-                            shareRate = new BigDecimal(hongBaoManageService.get("share_activity_proportion",system));
+                            shareRate = new BigDecimal(hongBaoManageService.get("share_activity_proportion", system));
                             try {
                                 shareGoodsActivityOrderService.addShareGoodsActivityOrder(
                                         commonOrder.getUserInfo().getId(), shareRate, commonOrder.getOrderNo());
@@ -944,7 +944,7 @@
                 UserInfo boss = threeSaleSerivce.getBoss(hongBao.getUserInfo().getId());
                 if (boss != null) {
                     BigDecimal firstLevelRate = hongBaoManageService.getFirstShareRate(1,
-                            commonOrder.getThirdCreateTime().getTime(),system);
+                            commonOrder.getThirdCreateTime().getTime(), system);
                     HongBaoV2 child = new HongBaoV2();
                     child.setParent(hongBao);
                     child.setType(HongBaoV2.TYPE_SHARE_YIJI);
@@ -1143,6 +1143,7 @@
         List<Integer> stateList = new ArrayList<>();
         stateList.add(HongBaoV2.STATE_BUKELINGQU);
         stateList.add(HongBaoV2.STATE_KELINGQU);
+        stateList.add(HongBaoV2.STATE_LINGQUING);
         stateList.add(HongBaoV2.STATE_YILINGQU);
         List<HongBaoV2> hongBaoV2List = hongBaoV2Mapper.listByStateAndTypeAndUid(stateList, typeList, uid, 0, 1);
         if (hongBaoV2List != null && hongBaoV2List.size() > 0)
@@ -1165,5 +1166,11 @@
         return hongBaoV2Mapper.getDirectBossUrankByPid(pid);
     }
 
+    @Transactional
+    @Override
+    public void setHongBaoRecieved(Long uid, List<Integer> typeList, Date preGetTime) {
+        hongBaoV2Mapper.setHongBaoRecieved(uid, typeList, preGetTime);
+    }
+
 
 }

--
Gitblit v1.8.0