姜永辉 1 год назад
Родитель
Сommit
5c0e42d3b3

+ 3 - 0
src/main/java/com/dk/oauth/mapper/integral/CouponReceiveMapper.xml

@@ -106,6 +106,9 @@
             <if test="assistFlag != null and assistFlag ">
                 AND tmcr.assist_date >= NOW() - INTERVAL '7 DAY'
             </if>
+            <if test="sendId != null and sendId != ''">
+                AND tmcr.send_id = #{sendId}::uuid
+            </if>
         </where>
 
     </select>

+ 4 - 3
src/main/java/com/dk/oauth/service/integral/CouponReceiveService.java

@@ -98,9 +98,10 @@ public class CouponReceiveService extends BaseService<CouponReceive> {
 //            //近期己助力过
 //            throw new BaseBusinessException(ErrorCodeEnum.I_HAVE_RECENTLY_PROVIDED_ASSISTANCE.getCode(), ErrorCodeEnum.I_HAVE_RECENTLY_PROVIDED_ASSISTANCE.getMessage());
 //        }
-        // todo.......... 正式的发版要改成大于000000000000000000000000
-        Long cpCount = couponReceiveMapper.countByCondNoExistCpId(new CouponReceiveQuery().setUserWxid(couponReceiveVO.getUserWxid()).setAssistFlag(true));
-        if (cpCount < 0) {
+        // todo.......... 正式的发版要将sendid取出 xml也相应的去除。。。。。
+//        Long cpCount = couponReceiveMapper.countByCondNoExistCpId(new CouponReceiveQuery().setUserWxid(couponReceiveVO.getUserWxid()).setAssistFlag(true));
+        Long cpCount = couponReceiveMapper.countByCondNoExistCpId(new CouponReceiveQuery().setUserWxid(couponReceiveVO.getUserWxid()).setAssistFlag(true).setSendId(couponReceiveVO.getSendId()));
+        if (cpCount > 0) {
             //近期己助力过
             throw new BaseBusinessException(ErrorCodeEnum.I_HAVE_RECENTLY_PROVIDED_ASSISTANCE.getCode(), ErrorCodeEnum.I_HAVE_RECENTLY_PROVIDED_ASSISTANCE.getMessage());
         }