101captain
2021-10-18 98e41183cce52bd6e614c9dce6d5c512b214a188
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -798,11 +798,15 @@
            return R.fail("不在活动时间范围内");
        }
        int signCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>()
        int signDayCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>()
                .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getCodeId,comActActRegistVO.getCodeId()));
        int signAllCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>()
                .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId));
        if (signCount >= comActActivityDO.getLimit()) {
            return R.fail("请勿重复签到");
        if (signDayCount >= 0) {
            return R.fail("请扫描新的签到码");
        }
        if(signAllCount>=comActActivityDO.getLimit()){
            return R.fail("签到次数上限");
        }
//        String activitySignInKey = String.join(DELIMITER, ACTIVITY_SIGN_IN, userId.toString(), activityId.toString());
@@ -814,6 +818,10 @@
        comActActRegistDO.setUserId(userId);
        comActActRegistDO.setIsVolunteer(comActActRegistVO.getIsVolunteer());
        comActActRegistDO.setCreateAt(nowDate);
        comActActRegistDO.setCodeId(comActActRegistVO.getCodeId());
        comActActRegistDO.setAward(comActActivityDO.getRewardIntegral());
        comActActRegistDO.setPosition(comActActRegistVO.getPosition());
        comActActRegistDO.setTimes(signAllCount+1);
        int result = comActActRegistDAO.insert(comActActRegistDO);
        if (result > 0) {
//            ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue();