| | |
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponGiveRecordMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponGiveRecordService;
|
| | |
|
| | | @Service
|
| | |
| | | @Resource
|
| | | private UserSystemCouponGiveRecordMapper userSystemCouponGiveRecordMapper;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Override
|
| | | public void insertSelective(UserSystemCouponGiveRecord record) {
|
| | |
| | | public UserSystemCouponGiveRecord getByReceiveId(Long receiveId) {
|
| | | return userSystemCouponGiveRecordMapper.getByReceiveId(receiveId);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<UserSystemCouponGiveRecord> listGiveRecord(long start, int count, String type, Integer state) {
|
| | | List<UserSystemCouponGiveRecord> list = userSystemCouponGiveRecordMapper.listGiveRecord(start, count, type, state);
|
| | | if (list == null || list.size() == 0) |
| | | return list;
|
| | | |
| | | for (UserSystemCouponGiveRecord giveRecord: list) {
|
| | | UserInfo giveUser = userInfoService.selectByPKey(giveRecord.getGiveUid());
|
| | | if (giveUser != null) |
| | | giveRecord.setGiveName(giveUser.getNickName());
|
| | | |
| | | Long receiveUid = giveRecord.getReceiveUid();
|
| | | if (receiveUid == null)
|
| | | continue;
|
| | | |
| | | UserInfo receiveUser = userInfoService.selectByPKey(receiveUid);
|
| | | if (receiveUser != null) |
| | | giveRecord.setReceiveName(receiveUser.getNickName());
|
| | | }
|
| | | return list;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public long countGiveRecord(String type, Integer state) {
|
| | | return userSystemCouponGiveRecordMapper.countGiveRecord(type, state);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserSystemCouponGiveRecord getByCouponId(Long couponId) {
|
| | | return userSystemCouponGiveRecordMapper.getByCouponId(couponId);
|
| | | }
|
| | | }
|