| | |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComActActivityDAO; |
| | | import com.panzhihua.service_community.dao.ComActDiscussOptionUserDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActActSignDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import com.panzhihua.service_community.service.ComActActivityService; |
| | |
| | | private ComActActivityDAO comActActivityDAO; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | | * @param comActActivityVO 新增信息 |
| | |
| | | comActActSignDO.setActivityId(activityId); |
| | | comActActSignDO.setUserId(userId); |
| | | comActActSignDO.setIsVolunteer(isVolunteer); |
| | | num = comActActSignDAO.insert(comActActSignDO); |
| | | try { |
| | | num = comActActSignDAO.insert(comActActSignDO); |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains("unique_activity_id_user_id")) { |
| | | return R.fail("已经报名过了,请勿重复提交"); |
| | | } |
| | | log.error(e.getMessage()); |
| | | } |
| | | } else { |
| | | num = comActActSignDAO.delete(new QueryWrapper<ComActActSignDO>().lambda().eq(ComActActSignDO::getUserId, userId).eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, isVolunteer)); |
| | | } |