parent
c47be8cbd7
commit
5b24fb1060
@ -0,0 +1,12 @@ |
|||||||
|
package com.hai.service; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author hurui |
||||||
|
*/ |
||||||
|
public interface HighActivityAwardUserService { |
||||||
|
|
||||||
|
/** |
||||||
|
* 增加用户中奖记录 |
||||||
|
*/ |
||||||
|
void insertAwardUser(Long serialNumId,Long userId); |
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
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; |
||||||
|
|
||||||
|
@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); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue