Merge branch 'dev' of http://139.159.177.244:3000/hurui/hai-server into dev
commit
82350b04fc
@ -1,7 +1,21 @@ |
||||
package com.hai.dao; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighActivityAwardUserMapperExt { |
||||
|
||||
@Select(" select insert(b.phone, 4, 4, '****') phone,a.name awardName,a.create_time receiveTime from \n" + |
||||
" (select a.create_time, b.name,a.user_id " + |
||||
" from high_activity_award_user a,high_activity_award b " + |
||||
" where a.activity_award_id = b.id and a.activity_info_id = #{activityId} " + |
||||
" ORDER BY a.create_time desc LIMIT 50) a" + |
||||
" LEFT JOIN high_user b on b.id = a.user_id") |
||||
List<Map<String, Object>> selectWinLotteryList(@Param("activityId") Long activityId); |
||||
} |
@ -0,0 +1,23 @@ |
||||
package com.hai.service; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author hurui |
||||
*/ |
||||
public interface HighActivityAwardUserService { |
||||
|
||||
/** |
||||
* 增加用户中奖记录 |
||||
*/ |
||||
void insertAwardUser(Long serialNumId,Long userId); |
||||
|
||||
/** |
||||
* 此方法请勿随意调用与修改,因为这个是专门对外开放的 |
||||
* 根据活动查询中奖记录 |
||||
* @param activityId |
||||
* @return |
||||
*/ |
||||
List<Map<String, Object>> getWinLotteryList(Long activityId); |
||||
} |
@ -0,0 +1,43 @@ |
||||
package com.hai.service.impl; |
||||
|
||||
import com.hai.dao.HighActivityAwardUserMapper; |
||||
import com.hai.entity.HighActivityAwardSerialNum; |
||||
import com.hai.entity.HighActivityAwardUser; |
||||
import com.hai.service.HighActivityAwardSerialNumService; |
||||
import com.hai.service.HighActivityAwardUserService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
@Service("highActivityAwardUserService") |
||||
public class HighActivityAwardUserServiceImpl implements HighActivityAwardUserService { |
||||
|
||||
@Resource |
||||
private HighActivityAwardUserMapper highActivityAwardUserMapper; |
||||
|
||||
@Resource |
||||
private HighActivityAwardSerialNumService highActivityAwardSerialNumService; |
||||
|
||||
@Override |
||||
public void insertAwardUser(Long serialNumId,Long userId) { |
||||
// 查询中奖号码
|
||||
HighActivityAwardSerialNum detail = highActivityAwardSerialNumService.getDetail(serialNumId); |
||||
if (detail != null) { |
||||
HighActivityAwardUser awardUser = new HighActivityAwardUser(); |
||||
awardUser.setCreateTime(new Date()); |
||||
awardUser.setActivityAwardSerialNumId(serialNumId); |
||||
awardUser.setUserId(userId); |
||||
awardUser.setActivityInfoId(detail.getActivityInfoId()); |
||||
awardUser.setActivityAwardId(detail.getActivityAwardId()); |
||||
highActivityAwardUserMapper.insert(awardUser); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public List<Map<String, Object>> getWinLotteryList(Long activityId) { |
||||
return highActivityAwardUserMapper.selectWinLotteryList(activityId); |
||||
} |
||||
} |
Loading…
Reference in new issue