|
|
@@ -2,12 +2,14 @@ package org.dromara.business.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import org.dromara.business.domain.UserCheckRecord;
|
|
|
+import org.dromara.business.domain.bo.ItemsUserBo;
|
|
|
import org.dromara.business.domain.bo.UserCheckRecordBo;
|
|
|
import org.dromara.business.domain.vo.PlayerItemsVo;
|
|
|
import org.dromara.business.domain.vo.UserCheckRecordVo;
|
|
|
import org.dromara.business.mapper.PlayerItemsMapper;
|
|
|
import org.dromara.business.mapper.UserCheckRecordMapper;
|
|
|
import org.dromara.business.service.IUserCheckRecordService;
|
|
|
+import org.dromara.business.service.IUserService;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
@@ -37,6 +39,8 @@ public class UserCheckRecordServiceImpl implements IUserCheckRecordService {
|
|
|
|
|
|
private final PlayerItemsMapper playerItemsMapper;
|
|
|
|
|
|
+ private final IUserService userService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询用户核销记录
|
|
|
*
|
|
|
@@ -140,7 +144,7 @@ public class UserCheckRecordServiceImpl implements IUserCheckRecordService {
|
|
|
Long userId = bo.getUserId();
|
|
|
Long num = bo.getNum();
|
|
|
|
|
|
- PlayerItemsVo playerItemsVo = playerItemsMapper.selectPlayerItemsInfo(userId, 1001L);
|
|
|
+ PlayerItemsVo playerItemsVo = playerItemsMapper.selectPlayerItemsInfo(userId, bo.getItemId());
|
|
|
if(playerItemsVo.getQuantity()<0 || playerItemsVo.getQuantity()<num){
|
|
|
throw new RuntimeException("数量不足!!!");
|
|
|
}
|
|
|
@@ -151,8 +155,12 @@ public class UserCheckRecordServiceImpl implements IUserCheckRecordService {
|
|
|
boolean flag = baseMapper.insertCheckRecord(add) > 0;
|
|
|
if (flag) {
|
|
|
//核销完成之后 记录道具流水日志 扣减用户道具表数量
|
|
|
-
|
|
|
-
|
|
|
+ ItemsUserBo itemsUserBo=new ItemsUserBo();
|
|
|
+ itemsUserBo.setItemId(bo.getItemId());
|
|
|
+ itemsUserBo.setQuantity(Integer.valueOf(num.toString()));
|
|
|
+ itemsUserBo.setType(2);
|
|
|
+ itemsUserBo.setUserId(userId);
|
|
|
+ userService.sendRewardToos(itemsUserBo);
|
|
|
bo.setId(add.getId());
|
|
|
}
|
|
|
return flag;
|