| | |
| | | */ |
| | | @Override |
| | | public R addActivity(ComActActivityVO comActActivityVO) { |
| | | if (comActActivityVO.getHaveIntegralReward().intValue() == 2) { |
| | | comActActivityVO.setRewardWay(null); |
| | | } |
| | | ComActActivityDO comActActivityDO = new ComActActivityDO(); |
| | | BeanUtils.copyProperties(comActActivityVO, comActActivityDO); |
| | | Integer status = comActActivityVO.getStatus(); |
| | |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | if (comActActivityVO.getHaveIntegralReward().intValue() == 2) { |
| | | comActActivityVO.setRewardWay(null); |
| | | } |
| | | BeanUtils.copyProperties(comActActivityVO, comActActivityDO); |
| | | |
| | |
| | | num = comActActSignDAO.insert(comActActSignDO); |
| | | } |
| | | } else { |
| | | Integer canCancel = actActivityDO.getCanCancel(); |
| | | if (nonNull(canCancel) && canCancel.equals(2)) { |
| | | return R.fail("该活动暂不支持取消"); |
| | | } |
| | | if (isNull(signactivityVO.getReason())) { |
| | | return R.fail("缺少取消原因"); |
| | | } |
| | |
| | | comActActSignDO.setStatus(0); |
| | | comActActSignDO.setReason(signactivityVO.getReason()); |
| | | num = comActActSignDAO.updateById(comActActSignDO); |
| | | if (num > 0) { |
| | | AddComActIntegralUserDTO addComActIntegralUserDTO = new AddComActIntegralUserDTO(); |
| | | addComActIntegralUserDTO.setUserId(userId); |
| | | addComActIntegralUserDTO.setIntegralType(9); |
| | | addComActIntegralUserDTO.setActivityType(1); |
| | | addComActIntegralUserDTO.setCommunityId(actActivityDO.getCommunityId()); |
| | | addComActIntegralUserDTO.setServiceId(activityId); |
| | | comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); |
| | | } |
| | | } |
| | | if (num > 0) { |
| | | return R.ok(isVolunteer); |
| | |
| | | } |
| | | comActActivityVO.setSingDate(createAt); |
| | | comActActivityVO.setTimes(activitySignVO.getTimes()); |
| | | comActActivityVO.setAward(activitySignVO.getAward()); |
| | | Integer totalAward = comActActRegistDAO.selectTotalAwardWithRegist(activitySignVO.getActivityId(), userId); |
| | | comActActivityVO.setAward(totalAward); |
| | | comActActivityVOS.add(comActActivityVO); |
| | | }); |
| | | } |
| | |
| | | // if (stringRedisTemplate.hasKey(activitySignInKey)) { |
| | | // return R.fail("你已签到,如要再次签到请三十分钟后尝试!"); |
| | | // } |
| | | Integer haveIntegralReward = comActActivityDO.getHaveIntegralReward(); |
| | | boolean isHave = nonNull(haveIntegralReward) && haveIntegralReward.equals(1); |
| | | ComActActRegistDO comActActRegistDO = new ComActActRegistDO(); |
| | | comActActRegistDO.setActivityId(activityId); |
| | | comActActRegistDO.setType(1); |
| | |
| | | comActActRegistDO.setIsVolunteer(comActActRegistVO.getIsVolunteer()); |
| | | comActActRegistDO.setCreateAt(nowDate); |
| | | comActActRegistDO.setCodeId(comActActRegistVO.getCodeId()); |
| | | comActActRegistDO.setAward(comActActivityDO.getRewardIntegral()); |
| | | comActActRegistDO.setAward(isHave ? comActActivityDO.getRewardIntegral() : 0); |
| | | comActActRegistDO.setPosition(comActActRegistVO.getPosition()); |
| | | comActActRegistDO.setTimes(signAllCount+1); |
| | | int result = comActActRegistDAO.insert(comActActRegistDO); |
| | | if (result > 0) { |
| | | if (isHave && result > 0) { |
| | | AddComActIntegralUserDTO addComActIntegralUserDTO=new AddComActIntegralUserDTO(); |
| | | addComActIntegralUserDTO.setUserId(userId); |
| | | addComActIntegralUserDTO.setIntegralType(8); |