From 087cd794187727bf9a34fcef3027cd56f6dec436 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 10 Mar 2021 15:20:54 +0800
Subject: [PATCH] Merge branch 'api' of http://120.27.238.55:7000/r/beauty-erp into api

---
 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java |   32 +++++++++++++++-----------------
 1 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java
index e9fd5af..bf87285 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java
@@ -8,14 +8,8 @@
 import com.matrix.component.redis.RedisUserLoginUtils;
 import com.matrix.system.common.constance.AppConstance;
 
-import com.matrix.system.shopXcx.bean.ShopCoupon;
-import com.matrix.system.shopXcx.bean.ShopCouponRecord;
-import com.matrix.system.shopXcx.bean.ShopProductAttrRef;
-import com.matrix.system.shopXcx.bean.ShopShoppingCart;
-import com.matrix.system.shopXcx.dao.ShopCouponDao;
-import com.matrix.system.shopXcx.dao.ShopCouponRecordDao;
-import com.matrix.system.shopXcx.dao.ShopProductAttrRefDao;
-import com.matrix.system.shopXcx.dao.ShopReceiveAddressDao;
+import com.matrix.system.shopXcx.bean.*;
+import com.matrix.system.shopXcx.dao.*;
 import com.matrix.system.shopXcx.api.service.WxShopCouponService;
 import com.matrix.system.shopXcx.api.tools.WxShopCouponUtil;
 import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil;
@@ -51,13 +45,16 @@
     @Autowired
     private WxShopCouponUtil wxShopCouponUtil;
 
+    @Autowired
+    private ShopProductDao productDao;
+
 
     /**
      * 根据购物车选中的产品,计算合适的优惠券
      *
      * @return
      */
-    public List<CouponReceiveInfoVO> getCartVoCouponList(Long shopId,List<ShopShoppingCart> shopShoppingCarts) {
+    public List<CouponReceiveInfoVO> getCartVoCouponList(Long companyId,List<ShopShoppingCart> shopShoppingCarts) {
 
         //可用优惠券列表
         List<CouponReceiveInfoVO> shopCoupons = new ArrayList<>();
@@ -65,7 +62,7 @@
 
         BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
         //1.找到用户所有的优惠券
-        List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(shopId, bizUser.getOpenId(), AppConstance.MY_COUPON_NOT_USE,
+        List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(companyId, bizUser.getOpenId(), AppConstance.MY_COUPON_NOT_USE,
                 null);
         if (CollectionUtils.isNotEmpty(userAllCoupon)) {
             //根据优惠力度排序,优惠力度大的先参与计算
@@ -215,20 +212,20 @@
      * 根据订单状态查询优惠券列表
      *
      *
-     * @param shopId
+     * @param companyId
      * @param status 1=已使用;2=未使用;3=过期
      * @return
      */
     @Override
-    public AjaxResult getMyCouponInfoByStatus(Long shopId, Integer status, PaginationVO pageVo) {
+    public AjaxResult getMyCouponInfoByStatus(Long companyId, Integer status, PaginationVO pageVo) {
         BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
         // 如果查询使用或未使用状态的优惠券列表
         if (AppConstance.MY_COUPON_USE.equals(status) || AppConstance.MY_COUPON_NOT_USE.equals(status)) {
-            List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(shopId,bizUser.getOpenId(), status,
+            List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(companyId,bizUser.getOpenId(), status,
                     pageVo);
             return new AjaxResult(AjaxResult.STATUS_SUCCESS, list);
         }
-        List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyPastCoupon(shopId,bizUser.getOpenId(), pageVo);
+        List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyPastCoupon(companyId,bizUser.getOpenId(), pageVo);
         return new AjaxResult(AjaxResult.STATUS_SUCCESS, list);
     }
 
@@ -290,7 +287,8 @@
                 attrIds.addAll(ids);
             }
         }
-        List<ShopCoupon> list = shopCouponDao.selectHdListByProductId(productId, attrIds);
+        ShopProduct shopProduct = productDao.selectById(productId);
+        List<ShopCoupon> list = shopCouponDao.selectHdListByProductId(productId, attrIds,shopProduct.getCompanyId());
         return list;
     }
 
@@ -305,10 +303,10 @@
      * @return
      */
     @Override
-    public AjaxResult getCouponListByTag(String tag, Long shopId) {
+    public AjaxResult getCouponListByTag(String tag, Long companyId) {
         BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
         boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(bizUser.getOpenId());
-        List<ShopCoupon> couponList = shopCouponDao.selectCouponListByTag(newPeople, bizUser.getOpenId(), tag,shopId);
+        List<ShopCoupon> couponList = shopCouponDao.selectCouponListByTag(newPeople, bizUser.getOpenId(), tag,companyId);
         AjaxResult res = new AjaxResult(AjaxResult.STATUS_SUCCESS, couponList);
         res.putInMap("isNewPeople", newPeople);
         return res;

--
Gitblit v1.9.1