2
0

fix: stat traffic

This commit is contained in:
caiyuchao
2024-12-24 18:04:45 +08:00
parent 3087685644
commit 8f086f8d7e
2 changed files with 2 additions and 3 deletions

View File

@@ -8,7 +8,6 @@ import org.wfc.user.domain.vo.UCdrClientVo;
import org.wfc.user.domain.vo.UCdrHistoryUserVo; import org.wfc.user.domain.vo.UCdrHistoryUserVo;
import org.wfc.user.domain.vo.UCdrUserVo; import org.wfc.user.domain.vo.UCdrUserVo;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -21,7 +20,7 @@ import java.util.List;
*/ */
public interface UCdrMapper extends BaseMapper<UCdr> { public interface UCdrMapper extends BaseMapper<UCdr> {
List<UCdrUserVo> getByUser(@Param("userId") Long userId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); List<UCdrUserVo> getByUser(@Param("userId") Long userId, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
List<UCdrClientVo> getByClient(@Param("client") UCdrClientBo client); List<UCdrClientVo> getByClient(@Param("client") UCdrClientBo client);

View File

@@ -56,7 +56,7 @@ public class UAccountServiceImpl extends ServiceImpl<UAccountMapper, UAccount> i
DateTime endTime = DateUtil.offsetSecond(current, -30); DateTime endTime = DateUtil.offsetSecond(current, -30);
List<UAccount> accounts = this.list(Wrappers.<UAccount>lambdaQuery().gt(UAccount::getEndTime, endTime)); List<UAccount> accounts = this.list(Wrappers.<UAccount>lambdaQuery().gt(UAccount::getEndTime, endTime));
// 更新账户已使用流量,已使用时长 // 更新账户已使用流量,已使用时长
List<UCdrUserVo> statCdr = ucdrMapper.getByUser(null, current, endTime); List<UCdrUserVo> statCdr = ucdrMapper.getByUser(null, current.getTime(), endTime.getTime());
for (UAccount account : accounts) { for (UAccount account : accounts) {
for (UCdrUserVo stat : statCdr) { for (UCdrUserVo stat : statCdr) {
if (Objects.equals(account.getUserId(), stat.getId())) { if (Objects.equals(account.getUserId(), stat.getId())) {