This commit is contained in:
huchuansai
2024-06-05 22:45:17 +08:00
parent 5e538a1b1e
commit def02c6fb8
3 changed files with 19 additions and 3 deletions

View File

@@ -120,4 +120,6 @@ public interface IPlayCustomUserInfoService extends IService<PlayCustomUserInfoE
int deletePlayCustomUserInfoById(String id);
List<PlayCustomUserInfoEntity> simpleList();
void saveOrderTime(String id);
}

View File

@@ -2,6 +2,7 @@ package com.starry.admin.modules.custom.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -25,9 +26,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -283,4 +282,14 @@ public class PlayCustomUserInfoServiceImpl extends ServiceImpl<PlayCustomUserInf
wrapper.orderByDesc(PlayCustomUserInfoEntity::getId).eq(PlayCustomUserInfoEntity::getDeleted, 0).select(PlayCustomUserInfoEntity::getAvatar, PlayCustomUserInfoEntity::getId, PlayCustomUserInfoEntity::getNickname, PlayCustomUserInfoEntity::getAvatar);
return baseMapper.selectList(wrapper);
}
@Override
public void saveOrderTime(String id) {
LambdaUpdateWrapper<PlayCustomUserInfoEntity> wrapper = Wrappers.lambdaUpdate(PlayCustomUserInfoEntity.class).eq(PlayCustomUserInfoEntity::getId, id).set(PlayCustomUserInfoEntity::getLastPurchaseTime, new Date());
PlayCustomUserInfoEntity userInfoEntity = selectById(id);
if(Objects.isNull(userInfoEntity.getFirstPurchaseTime())){
wrapper.set(PlayCustomUserInfoEntity::getFirstPurchaseTime,new Date());
}
this.update(wrapper);
}
}

View File

@@ -12,6 +12,7 @@ import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
import com.starry.admin.modules.clerk.service.IPlayClerkUserInfoService;
import com.starry.admin.modules.custom.module.entity.PlayCustomLevelInfoEntity;
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
import com.starry.admin.modules.order.mapper.PlayOrderInfoMapper;
import com.starry.admin.modules.order.module.constant.OrderConstant;
import com.starry.admin.modules.order.module.entity.PlayOrderEvaluateInfoEntity;
@@ -59,6 +60,9 @@ public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, P
@Resource
private IPlayClerkUserInfoService playClerkUserInfoService;
@Resource
private IPlayCustomUserInfoService userInfoService;
@Resource
private IPlayOrderRefundInfoService playOrderRefundInfoService;
@@ -104,6 +108,7 @@ public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, P
entity.setOrderStartTime(LocalDateTime.now());
entity.setOrderEndTime(LocalDateTime.now());
}
userInfoService.saveOrderTime(purchaserBy);
this.baseMapper.insert(entity);
}