From 408f7f23e18650d50c59bf72f272b115c5af217a Mon Sep 17 00:00:00 2001 From: jyy <935090232@qq.com> Date: Mon, 08 Mar 2021 17:38:53 +0800 Subject: [PATCH] 修改优惠券bug --- zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java | 6 +++--- zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java | 12 ++++++------ zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java | 4 ++-- zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java | 2 +- zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java | 4 ++-- zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java index 54ca9f5..ed0c492 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java @@ -117,7 +117,7 @@ } } //获取当前购物车产品可用的优惠券 - List<CouponReceiveInfoVO> usefulCoupon = wxShopCouponService.getCartVoCouponList(addShopOrderPOJO.getShopId(),notCouponuyCart); + List<CouponReceiveInfoVO> usefulCoupon = wxShopCouponService.getCartVoCouponList(HostInterceptor.getCompanyId(),notCouponuyCart); //获取用户使用的优惠券 CouponReceiveInfoVO shopCoupon = new CouponReceiveInfoVO(); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java index e0211b2..b57dc41 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java @@ -58,11 +58,11 @@ * * @return */ - @RequestMapping(value = "getMyCouponInfoByStatus/{shopId}/{status}") + @RequestMapping(value = "getMyCouponInfoByStatus/{status}") @ResponseBody - public AjaxResult getMyCouponInfo(@PathVariable("shopId") Long shopId,@PathVariable("status") Integer status, @RequestBody PaginationVO pageVo) { + public AjaxResult getMyCouponInfo(@PathVariable("status") Integer status, @RequestBody PaginationVO pageVo) { - return shopCouponService.getMyCouponInfoByStatus(shopId,status, pageVo); + return shopCouponService.getMyCouponInfoByStatus(HostInterceptor.getCompanyId(),status, pageVo); } /** diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java index e6cde48..93bea5c 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java @@ -42,12 +42,12 @@ * 根据状态获取我的优惠券 * * - * @param shopId + * @param companyId * @param status * @param pageVo * @return */ - AjaxResult getMyCouponInfoByStatus(Long shopId, Integer status, PaginationVO pageVo); + AjaxResult getMyCouponInfoByStatus(Long companyId, Integer status, PaginationVO pageVo); /** * 根据产品ID获取优惠券列表 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 bd88673..3f4f488 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 @@ -57,7 +57,7 @@ * * @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 +65,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 +215,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); } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java index 6d46836..55c2850 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java @@ -43,9 +43,9 @@ CouponReceiveInfoVO selectMyCouponByReceiveId(@Param("receiveId") Integer receiveId); - List<CouponReceiveInfoVO> selectMyCouponByStatus(@Param("shopId") Long shopId, @Param("userId") String userId, @Param("status") Integer status, + List<CouponReceiveInfoVO> selectMyCouponByStatus(@Param("companyId") Long shopId, @Param("userId") String userId, @Param("status") Integer status, @Param("pageVo") PaginationVO pageVo); - List<CouponReceiveInfoVO> selectMyPastCoupon(@Param("shopId")Long shopId, @Param("userId") String userId, @Param("pageVo") PaginationVO pageVo); + List<CouponReceiveInfoVO> selectMyPastCoupon(@Param("companyId")Long shopId, @Param("userId") String userId, @Param("pageVo") PaginationVO pageVo); } \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml index 808f1a7..cbb939b 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml @@ -270,7 +270,7 @@ sc.min_amount minAmount, sc.offset_amount offsetAmount, sc.is_all isAll, sc.product_ids productIds, sc.attr_ids attrIds, scr.is_using isUsing from shop_coupon sc, shop_coupon_record scr - where sc.shop_id=#{shopId} and sc.id = scr.c_id and scr.user_id = #{userId} and is_using = #{status} + where sc.company_id=#{companyId} and sc.id = scr.c_id and scr.user_id = #{userId} and is_using = #{status} and is_open = 1 <if test="status == 2"> and now() >= begin_time and end_time >= now() @@ -296,7 +296,7 @@ sc.min_amount minAmount, sc.offset_amount offsetAmount, sc.is_all isAll, sc.product_ids productIds, sc.attr_ids attrIds, scr.is_using isUsing from shop_coupon sc, shop_coupon_record scr - where sc.shop_id=#{shopId} and sc.id = scr.c_id and scr.user_id = #{userId} + where sc.company_id=#{companyId} and sc.id = scr.c_id and scr.user_id = #{userId} and (isnull(order_id) or order_id = 0) and now() > end_time and is_open = 1 <if test="pageVo != null"><!-- 判断pageVo对象是否为空 --> -- Gitblit v1.9.1