From cb49d77f0b0a1a066790c65088864200f10e9462 Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期五, 28 七月 2023 19:55:39 +0800
Subject: [PATCH] bug

---
 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/coupon/CouponServiceImpl.java |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/coupon/CouponServiceImpl.java b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/coupon/CouponServiceImpl.java
index b224026..b0da398 100644
--- a/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/coupon/CouponServiceImpl.java
+++ b/ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/coupon/CouponServiceImpl.java
@@ -305,7 +305,7 @@
         }
         //判断是否指定用户
         List<Long> relUserIdList = null;
-        if(coupon.getSendTarget()==2&&coupon.getSendTarget()==5&&coupon.getRelationType()==1&&!mgtCouponEditDto.getRelUserIdList().isEmpty()){
+        if(coupon.getSendTarget()==5&&coupon.getRelationType()==1&&!mgtCouponEditDto.getRelUserIdList().isEmpty()){
             relUserIdList = mgtCouponEditDto.getRelUserIdList();
             List<CouponRelUser> couponRelUserList = new ArrayList<>();
             CouponRelUser couponRelUser;
@@ -322,7 +322,7 @@
             coupon.setRelUserIds(userIdSj.toString());
         }
         //处理优惠券发放
-        if(coupon.getSendTimeType()==1){
+        if(coupon.getSendType()==2&&coupon.getSendTimeType()==1){
             sendCoupon(coupon,relUserIdList);
             coupon.setSendFlag(1);
             this.saveOrUpdate(coupon);
@@ -1151,4 +1151,32 @@
         memberCouponRecordService.updateMemberCouponRecord(coupon,userId,1);
     }
 
+    /**
+     * @description  获取商户优惠券审核统计
+     * @author  jqs
+     * @date    2023/7/28 11:30
+     * @param shopId
+     * @return  MetAuditCouponTotalVo
+     */
+    @Override
+    public MetAuditCouponTotalVo getMetAuditCouponTotal(Long shopId){
+        MetAuditCouponTotalVo metAuditCouponTotalVo = new MetAuditCouponTotalVo();
+        LambdaQueryWrapper<Coupon> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(Coupon::getDelFlag,0);
+        queryWrapper.eq(Coupon::getCouponFrom,2);
+        queryWrapper.eq(Coupon::getShopId,shopId);
+        queryWrapper.eq(Coupon::getCouponStatus,1);
+        queryWrapper.eq(Coupon::getAuditStatus,1);
+        Integer unAuditTotal = this.count(queryWrapper);
+        queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(Coupon::getDelFlag,0);
+        queryWrapper.eq(Coupon::getCouponFrom,2);
+        queryWrapper.eq(Coupon::getShopId,shopId);
+        queryWrapper.eq(Coupon::getCouponStatus,1);
+        queryWrapper.eq(Coupon::getAuditStatus,3);
+        Integer refuseTotal = this.count(queryWrapper);
+        metAuditCouponTotalVo.setUnAuditTotal(unAuditTotal);
+        metAuditCouponTotalVo.setRefuseTotal(refuseTotal);
+        return metAuditCouponTotalVo;
+    }
 }

--
Gitblit v1.7.1