Browse Source

打日志

tags/V1.8.0^2
wanghaoran 1 year ago
parent
commit
369ab73579
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamVideoServiceImpl.java

+ 8
- 1
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamVideoServiceImpl.java View File

import com.tuoheng.common.utils.CommonUtils; import com.tuoheng.common.utils.CommonUtils;
import com.tuoheng.common.utils.JsonResult; import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils; import com.tuoheng.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
* @author WangHaoran * @author WangHaoran
* @since 2023-06-07 * @since 2023-06-07
*/ */
@Slf4j
@Service @Service
public class WestreamVideoServiceImpl extends BaseServiceImpl<WestreamVideoMapper, WestreamVideo> implements IWestreamVideoService { public class WestreamVideoServiceImpl extends BaseServiceImpl<WestreamVideoMapper, WestreamVideo> implements IWestreamVideoService {


westreamVideoUserMapper.updateById(westreamVideoUser); westreamVideoUserMapper.updateById(westreamVideoUser);
//视频学习完成,开始计算积分 //视频学习完成,开始计算积分
if(2 == query.getStatus()){ if(2 == query.getStatus()){
log.info("视频学习完成,开始计算积分【" + query.getTenantId() +"】"+ query.getOpenid());
//查询学习视频 积分设置 //查询学习视频 积分设置
ThDict thDict = thDictMapper.selectOne(new LambdaQueryWrapper<ThDict>() ThDict thDict = thDictMapper.selectOne(new LambdaQueryWrapper<ThDict>()
.eq(ThDict::getTenantId, query.getTenantId()) .eq(ThDict::getTenantId, query.getTenantId())
.eq(ThDictData::getName, DictConstants.VIDEO)); .eq(ThDictData::getName, DictConstants.VIDEO));
if(ObjectUtils.isNotNull(thDictData)){ if(ObjectUtils.isNotNull(thDictData)){
if(StringUtils.isNotEmpty(thDictData.getValue())){ if(StringUtils.isNotEmpty(thDictData.getValue())){
log.info("视频学习积分规则查询完成");
//查询用户昵称 //查询用户昵称
WestreamUser westreamUser = westreamUserMapper.selectOne(new LambdaQueryWrapper<WestreamUser>() WestreamUser westreamUser = westreamUserMapper.selectOne(new LambdaQueryWrapper<WestreamUser>()
.eq(WestreamUser::getTenantId, query.getTenantId()) .eq(WestreamUser::getTenantId, query.getTenantId())
.eq(WestreamUser::getOpenid, query.getOpenid()) .eq(WestreamUser::getOpenid, query.getOpenid())
.eq(WestreamUser::getMark, 1)); .eq(WestreamUser::getMark, 1));
log.info("查询用户昵称完成,tenantId:" + query.getTenantId());
log.info("查询用户昵称完成,openid:" + query.getOpenid());




//积分明细表入库 //积分明细表入库
userPointsDetail.setType(1); userPointsDetail.setType(1);
userPointsDetail.setCreateTime(new Date()); userPointsDetail.setCreateTime(new Date());
userPointsDetailMapper.insert(userPointsDetail); userPointsDetailMapper.insert(userPointsDetail);
log.info("积分明细表入库完成");


//用户积分更新 //用户积分更新
westreamUser.setMallPoints(westreamUser.getMallPoints() + userPointsDetail.getPointsChange()); westreamUser.setMallPoints(westreamUser.getMallPoints() + userPointsDetail.getPointsChange());
westreamUserMapper.updateById(westreamUser); westreamUserMapper.updateById(westreamUser);
log.info("用户积分更新完成");


//TODO 对接商城 //TODO 对接商城
} }

Loading…
Cancel
Save