|
|
@@ -14,6 +14,7 @@ import com.tuoheng.common.common.BaseServiceImpl; |
|
|
|
import com.tuoheng.common.utils.CommonUtils; |
|
|
|
import com.tuoheng.common.utils.JsonResult; |
|
|
|
import com.tuoheng.common.utils.StringUtils; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@@ -27,6 +28,7 @@ import java.util.Date; |
|
|
|
* @author WangHaoran |
|
|
|
* @since 2023-06-07 |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
public class WestreamVideoServiceImpl extends BaseServiceImpl<WestreamVideoMapper, WestreamVideo> implements IWestreamVideoService { |
|
|
|
|
|
|
@@ -110,7 +112,7 @@ public class WestreamVideoServiceImpl extends BaseServiceImpl<WestreamVideoMappe |
|
|
|
westreamVideoUserMapper.updateById(westreamVideoUser); |
|
|
|
//视频学习完成,开始计算积分 |
|
|
|
if(2 == query.getStatus()){ |
|
|
|
|
|
|
|
log.info("视频学习完成,开始计算积分【" + query.getTenantId() +"】"+ query.getOpenid()); |
|
|
|
//查询学习视频 积分设置 |
|
|
|
ThDict thDict = thDictMapper.selectOne(new LambdaQueryWrapper<ThDict>() |
|
|
|
.eq(ThDict::getTenantId, query.getTenantId()) |
|
|
@@ -122,11 +124,14 @@ public class WestreamVideoServiceImpl extends BaseServiceImpl<WestreamVideoMappe |
|
|
|
.eq(ThDictData::getName, DictConstants.VIDEO)); |
|
|
|
if(ObjectUtils.isNotNull(thDictData)){ |
|
|
|
if(StringUtils.isNotEmpty(thDictData.getValue())){ |
|
|
|
log.info("视频学习积分规则查询完成"); |
|
|
|
//查询用户昵称 |
|
|
|
WestreamUser westreamUser = westreamUserMapper.selectOne(new LambdaQueryWrapper<WestreamUser>() |
|
|
|
.eq(WestreamUser::getTenantId, query.getTenantId()) |
|
|
|
.eq(WestreamUser::getOpenid, query.getOpenid()) |
|
|
|
.eq(WestreamUser::getMark, 1)); |
|
|
|
log.info("查询用户昵称完成,tenantId:" + query.getTenantId()); |
|
|
|
log.info("查询用户昵称完成,openid:" + query.getOpenid()); |
|
|
|
|
|
|
|
|
|
|
|
//积分明细表入库 |
|
|
@@ -139,10 +144,12 @@ public class WestreamVideoServiceImpl extends BaseServiceImpl<WestreamVideoMappe |
|
|
|
userPointsDetail.setType(1); |
|
|
|
userPointsDetail.setCreateTime(new Date()); |
|
|
|
userPointsDetailMapper.insert(userPointsDetail); |
|
|
|
log.info("积分明细表入库完成"); |
|
|
|
|
|
|
|
//用户积分更新 |
|
|
|
westreamUser.setMallPoints(westreamUser.getMallPoints() + userPointsDetail.getPointsChange()); |
|
|
|
westreamUserMapper.updateById(westreamUser); |
|
|
|
log.info("用户积分更新完成"); |
|
|
|
|
|
|
|
//TODO 对接商城 |
|
|
|
} |