幸运24-后台-个人-用户充值等级-查询

This commit is contained in:
khalil
2025-07-04 18:37:52 +08:00
parent 8d06823be0
commit ecba61bb1e
6 changed files with 30 additions and 22 deletions

View File

@@ -142,7 +142,7 @@ public class Lucky24RecordAdminService {
}
@SneakyThrows
public Lucky24PersonalStatVo getPersonal(Integer partitionId, Long erbanNo, String date, Integer poolType,
public Lucky24PersonalStatVo getPersonal(Integer partitionId, Long erbanNo, String date, String userRechargeLevel, Integer poolType,
int pageNo, int pageSize) {
Page<Lucky24PersonalStat> page = new Page<>(pageNo, pageSize);
@@ -158,8 +158,8 @@ public class Lucky24RecordAdminService {
PartitionInfo partitionInfo = partitionInfoService.getById(partitionId);
String zonedDateStr = DateTimeUtil.getZonedTodayStr(partitionInfo.getZoneId());
if (StringUtils.hasText(date)){
List<Lucky24PersonalStat> list = zonedDateStr.equals(date)? listPersonal(partitionId, partitionInfo.getZoneId(), uid, date, poolType):
statMapper.listPersonalStat(partitionId, uid, poolType, date, date);
List<Lucky24PersonalStat> list = zonedDateStr.equals(date)? listPersonal(partitionId, partitionInfo.getZoneId(), uid, date, userRechargeLevel, poolType):
statMapper.listPersonalStat(partitionId, uid, userRechargeLevel, poolType, date, date);
if (CollectionUtils.isEmpty(list)) {
return new Lucky24PersonalStatVo(new PageResult<>(page));
@@ -205,14 +205,14 @@ public class Lucky24RecordAdminService {
List<String> dateStrList = DateTimeUtil.getDateListBetweenTwoDates(startDate, endDate, endDate);
Map<String, Lucky24PersonalStat> statMap = new HashMap<>(dateStrList.size());
String userRechargeLevel = userRechargeLevelService.getLevelByUid(uid);
String uRechargeLevel = userRechargeLevelService.getLevelByUid(uid);
CountDownLatch cdl = new CountDownLatch(2);
Long finalUid = uid;
bizExecutor.execute(()->{
try {
List<Lucky24PersonalStat> list = listPersonal(partitionId, partitionInfo.getZoneId(), finalUid, zonedDateStr, poolType);
List<Lucky24PersonalStat> list = listPersonal(partitionId, partitionInfo.getZoneId(), finalUid, zonedDateStr, userRechargeLevel, poolType);
for (Lucky24PersonalStat stat: list) {
statMap.put(stat.getDate(), stat);
@@ -234,7 +234,7 @@ public class Lucky24RecordAdminService {
try {
String historyStartDate = dateStrList.get(0);
String historyEndDate = dateStrList.get(dateStrList.size() - 1);
List<Lucky24PersonalStat> statList = statMapper.listPersonalStat(partitionId, finalUid, poolType, historyStartDate, historyEndDate);
List<Lucky24PersonalStat> statList = statMapper.listPersonalStat(partitionId, finalUid, userRechargeLevel, poolType, historyStartDate, historyEndDate);
if (!CollectionUtils.isEmpty(statList)) {
for (Lucky24PersonalStat stat: statList) {
statMap.put(stat.getDate(), stat);
@@ -272,10 +272,10 @@ public class Lucky24RecordAdminService {
page.setRecords(subDateStrList.parallelStream().map(dateStr->{
Lucky24PersonalStat stat = statMap.get(dateStr);
if (null == stat) {
stat = new Lucky24PersonalStat(dateStr, partitionId, finalUid, erbanNo, userRechargeLevel);
stat = new Lucky24PersonalStat(dateStr, partitionId, finalUid, erbanNo, uRechargeLevel);
} else {
stat.setErbanNo(erbanNo);
stat.setUserRechargeLevel(userRechargeLevel);
stat.setUserRechargeLevel(uRechargeLevel);
}
return stat;
}).collect(Collectors.toList()));
@@ -283,7 +283,7 @@ public class Lucky24RecordAdminService {
return new Lucky24PersonalStatVo(totalInput, totalOutput, totalProductionRatio, new PageResult<>(page));
}
private List<Lucky24PersonalStat> listPersonal(int partitionId, String zonedId, Long uid, String date, Integer poolType) {
private List<Lucky24PersonalStat> listPersonal(int partitionId, String zonedId, Long uid, String date, String userRechargeLevel, Integer poolType) {
ZoneId zoneId = ZoneId.of(zonedId);
Date startTime = DateTimeUtil.getBeginTimeOfDay(DateTimeUtil.convertStrToDate(date, DateTimeUtil.DEFAULT_DATE_PATTERN));
ZonedDateTime zonedStartTime = startTime.toInstant().atZone(ZoneId.systemDefault());
@@ -293,8 +293,8 @@ public class Lucky24RecordAdminService {
ZonedDateTime zonedEndTime = endTime.toInstant().atZone(ZoneId.systemDefault());
Date systemEndTime = Date.from(zonedEndTime.withZoneSameLocal(zoneId).toInstant());
return null == poolType?
recordMapper.listPersonal(partitionId, uid, systemStartTime, systemEndTime, zoneIdHour):
recordMapper.listPersonalByPoolType(partitionId, uid, poolType, systemStartTime, systemEndTime, zoneIdHour);
recordMapper.listPersonal(partitionId, uid, userRechargeLevel, systemStartTime, systemEndTime, zoneIdHour):
recordMapper.listPersonalByPoolType(partitionId, uid, userRechargeLevel, poolType, systemStartTime, systemEndTime, zoneIdHour);
}
public Page<Lucky24RecordAdminVo> pageRecord(Long uid, String date, Integer poolType, int pageNo, int pageSize) {

View File

@@ -58,12 +58,12 @@ public class Lucky24RecordAdminController {
@ApiImplicitParam(value = "pageSize", name = "页长", required = true),
})
@GetMapping("/personal")
public BusiResult<Lucky24PersonalStatVo> personal(Integer partitionId, Long erbanNo, String date, Integer poolType,
public BusiResult<Lucky24PersonalStatVo> personal(Integer partitionId, Long erbanNo, String date, String userRechargeLevel, Integer poolType,
int pageNo, int pageSize) {
if (null == partitionId || (null == erbanNo && !StringUtils.hasText(date))) {
throw new ServiceException(BusiStatus.PARAMERROR);
}
Lucky24PersonalStatVo vo = service.getPersonal(partitionId, erbanNo, date, poolType, pageNo, pageSize);
Lucky24PersonalStatVo vo = service.getPersonal(partitionId, erbanNo, date, userRechargeLevel, poolType, pageNo, pageSize);
return BusiResult.success(vo);
}