| | |
| | | import com.ks.lucky.service.impl.LuckyActivityManager; |
| | | import com.ks.lucky.service.impl.LuckyActivityOpenInfoManager; |
| | | import com.ks.lucky.service.impl.LuckyActivityUserWeightRecordManager; |
| | | import com.ks.lucky.util.LoggerUtil; |
| | | import com.ks.lucky.util.factory.LuckyActivityUserWeightRecordFactory; |
| | | import com.ks.lucky.util.mq.CMQManager; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Validated |
| | | @Override |
| | | public void join(Long activityId, Long appId, String uid, Integer weight, JoinInfo joinInfo,int userType) throws LuckyActivityException, LuckyActivityJoinException { |
| | | public void join(Long activityId, Long appId, String uid, Integer weight, JoinInfo joinInfo, int userType) throws LuckyActivityException, LuckyActivityJoinException { |
| | | luckyActivityManager.canJoin(activityId); |
| | | LuckyActivityJoinRecord record = luckyActivityJoinManager.getRecord(activityId, appId, uid); |
| | | if (record != null) { |
| | |
| | | } catch (ParamsException e) { |
| | | throw new LuckyActivityJoinException(1, "添加记录出错"); |
| | | } |
| | | |
| | | LoggerUtil.activityLogger.info("参加活动成功", activityId, uid); |
| | | |
| | | CMQManager.getInstance().publishActivityJoinMsg(ActivityJoinMsgDTO.create(record)); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ActivitySimpleUser> getJoinerList(Long activityId,Integer userType, int page, int count) { |
| | | public List<ActivitySimpleUser> getJoinerList(Long activityId, Integer userType, int page, int count) { |
| | | ActivityJoinRecordQuery query = new ActivityJoinRecordQuery(); |
| | | query.activityId = activityId; |
| | | query.sortList = Arrays.asList(new String[]{"id asc"}); |
| | | query.userType=userType; |
| | | query.userType = userType; |
| | | query.count = count; |
| | | query.start = (page - 1) * count; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public long countJoiner(Long activityId,Integer userType) { |
| | | public long countJoiner(Long activityId, Integer userType) { |
| | | ActivityJoinRecordQuery query = new ActivityJoinRecordQuery(); |
| | | query.activityId = activityId; |
| | | query.userType=userType; |
| | | query.userType = userType; |
| | | return luckyActivityJoinRecordMapper.count(query); |
| | | } |
| | | |