package com.yeshi.fanli.service.impl.user;
|
|
import java.util.Date;
|
|
import javax.annotation.Resource;
|
|
import org.springframework.stereotype.Service;
|
|
import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponGiveRecordMapper;
|
import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
|
import com.yeshi.fanli.service.inter.user.UserSystemCouponGiveRecordService;
|
|
@Service
|
public class UserSystemCouponGiveRecordServiceImpl implements UserSystemCouponGiveRecordService{
|
|
@Resource
|
private UserSystemCouponGiveRecordMapper userSystemCouponGiveRecordMapper;
|
|
|
@Override
|
public void insertSelective(UserSystemCouponGiveRecord record) {
|
userSystemCouponGiveRecordMapper.insertSelective(record);
|
}
|
|
@Override
|
public void updateRecord(Long receiveUid, Long giveUid, Long couponId) {
|
UserSystemCouponGiveRecord record = userSystemCouponGiveRecordMapper.getRecordByUidAndCouponId(giveUid, couponId);
|
if (record != null) {
|
UserSystemCouponGiveRecord giveRecord = new UserSystemCouponGiveRecord();
|
giveRecord.setId(record.getId());
|
giveRecord.setReceiveUid(receiveUid);
|
giveRecord.setReceiveTime(new Date());
|
userSystemCouponGiveRecordMapper.updateByPrimaryKeySelective(giveRecord);
|
}
|
}
|
}
|