From 856d99bb5adf7f8670206b01750bc0260b8666d2 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 01 二月 2023 15:36:55 +0800
Subject: [PATCH] 修复客户端特价首页商品列表无数据的问题

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 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 3f70534..7c114ad 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
@@ -14,6 +14,7 @@
 import javax.annotation.Resource;
 
 import com.yeshi.fanli.entity.SystemEnum;
+import com.yeshi.fanli.util.taobao.TaoBaoUtil;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -253,7 +254,7 @@
         if (oldHongBao == null)
             throw new HongBaoException(10, "绾㈠寘瀵硅薄涓嶅瓨鍦�");
         // 宸茬粡澶辨晥锛屽凡缁忛鍙栵紝棰嗗彇涓紝鏂拌�佺姸鎬佷竴鑷寸殑绾㈠寘涓嶅仛澶勭悊
-        if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO || oldHongBao.getState() == HongBaoV2.STATE_YILINGQU|| oldHongBao.getState() == HongBaoV2.STATE_LINGQUING)
+        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 +343,7 @@
             List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId());
             if (children != null && children.size() > 0)
                 for (HongBaoV2 child : children) {
-                    if (child.getState() == HongBaoV2.STATE_YILINGQU||child.getState() == HongBaoV2.STATE_LINGQUING)
+                    if (child.getState() == HongBaoV2.STATE_YILINGQU || child.getState() == HongBaoV2.STATE_LINGQUING)
                         continue;
 
                     HongBaoV2 childUpdate = new HongBaoV2(child.getId());
@@ -567,7 +568,7 @@
             List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId());
             if (children != null)
                 for (HongBaoV2 child : children) {
-                    if (child.getState() == HongBaoV2.STATE_YILINGQU||child.getState() == HongBaoV2.STATE_LINGQUING)
+                    if (child.getState() == HongBaoV2.STATE_YILINGQU || child.getState() == HongBaoV2.STATE_LINGQUING)
                         continue;
 
                     HongBaoV2 childUpdate = new HongBaoV2(child.getId());
@@ -656,7 +657,7 @@
                     if (goods != null) {
                         try {
                             if (userSystemCouponService.updateCouponRecordUsed(commonOrder.getUserInfo().getId(),
-                                    commonOrder.getOrderNo(), payMent, Long.parseLong(goods.getGoodsId()), commonOrder.getSourceType()))
+                                    commonOrder.getOrderNo(), payMent, goods.getGoodsId(), commonOrder.getSourceType()))
                                 mianDanMoney = payMent;
                         } catch (NumberFormatException e) {
                             throw new HongBaoException(10, "鍏嶅崟鍟嗗搧澶勭悊鍑洪敊");
@@ -698,7 +699,7 @@
                 hongBao.setState(HongBaoV2.STATE_SHIXIAO);
                 hongBao.setMoney(new BigDecimal(0));
             } else {
-                throw new HongBaoException(3, "缁存潈璁㈠崟涓嶈兘鍒涘缓绾㈠寘");
+                throw new HongBaoException(HongBaoException.CODE_ORDER_WEIQUAN, "缁存潈璁㈠崟涓嶈兘鍒涘缓绾㈠寘");
             }
 
             if (mianDanMoney != null)
@@ -1001,7 +1002,7 @@
 
             HongBao hb = new HongBao();
             if (goods != null)
-                hb.setAuctionId(Long.parseLong(goods.getGoodsId()));
+                hb.setAuctionId(TaoBaoUtil.getAuctionId(goods.getGoodsId()));
             hb.setUserInfo(hongBao.getUserInfo());
             hb.setMoney(hongBao.getMoney());
 
@@ -1169,7 +1170,10 @@
     @Transactional
     @Override
     public void setHongBaoRecieved(Long uid, List<Integer> typeList, Date preGetTime) {
-        hongBaoV2Mapper.setHongBaoRecieved(uid, typeList, preGetTime);
+
+        String getMonth = TimeUtil.getGernalTime(preGetTime.getTime(), "yyyy-MM");
+        //鍓嶉潰鍑犱釜鏈堢殑鍙兘鏈夋湭缁撶畻鐨勶紝缁熶竴鍔犲叆鍒版湰鏈堢粨绠�
+        hongBaoV2Mapper.setHongBaoRecieved(uid, typeList, preGetTime, getMonth);
     }
 
 

--
Gitblit v1.8.0