2
0

fix: 当前流量统计/扣费账单/上网记录类型等

This commit is contained in:
caiyuchao
2025-06-20 17:26:47 +08:00
parent 3b6f05d2c7
commit 35cf811689
8 changed files with 14 additions and 7 deletions

View File

@@ -13,7 +13,8 @@ import lombok.Getter;
public enum OrderTypeEnum {
PACKAGE(0, "Package"),
RECHARGE(1, "Recharge");
RECHARGE(1, "Recharge"),
BALANCE_DEDUCTION(2, "balance deduction"),;
private final Integer code;
private final String desc;

View File

@@ -18,4 +18,5 @@ public class UCdrHistoryUserVo {
private Long duration;
private Long trafficDown;
private Long trafficUp;
private Integer useType;
}

View File

@@ -309,14 +309,15 @@ public class UAccountServiceImpl extends ServiceImpl<UAccountMapper, UAccount> i
bill.setAmount(account.getBalanceUsed());
bill.setUserId(userId);
bill.setCdrHistoryId(cdrHistoryId);
bill.setType(OrderTypeEnum.RECHARGE.getCode());
bill.setType(OrderTypeEnum.BALANCE_DEDUCTION.getCode());
bill.setStatus(OrderStatusEnum.PAID.getCode());
// billMapper.insert(bill);
billMapper.insert(bill);
account.setBalanceUsed(BigDecimal.ZERO);
this.updateById(account);
}
@Transactional
public boolean sendReminderEMail() {
Date current = new Date();
List<UAccount> accounts = this.list(Wrappers.<UAccount>lambdaQuery()

View File

@@ -234,7 +234,7 @@ public class UBillServiceImpl extends ServiceImpl<UBillMapper, UBill> implements
try {
String subject = mailProperties.getSubject();
if (StrUtil.isBlank(subject)) {
subject = "Your WANFI Billing";
subject = "Your Billing";
}
MailUtils.sendHtml(invoiceBo.getEmail(), subject, htmlStr, uploadFile);

View File

@@ -30,6 +30,8 @@
FROM
u_bill b
WHERE b.del_flag = 0
AND b.type in (1, 2)
AND b.invoice_number is not null
AND b.user_id = #{userId}
order by b.create_time desc
</select>

View File

@@ -114,6 +114,7 @@
c.client_device_type,
ch.start_time,
ch.end_time,
ch.use_type,
ifnull( ch.duration, 0 ) duration,
ifnull( ch.traffic_down, 0 ) traffic_down,
ifnull( ch.traffic_up, 0 ) traffic_up
@@ -126,6 +127,7 @@
WHERE
cdr.del_flag = 0
AND ch.id is not null
AND ch.use_type is not null
<if test="item.userId != null and item.userId != ''">
AND cdr.user_id = #{item.userId}
</if>
@@ -172,7 +174,7 @@
sum(ifnull( cdr.traffic_up, 0 )) traffic
FROM
u_client c
LEFT JOIN u_cdr cdr ON c.id = cdr.client_id
LEFT JOIN u_cdr cdr ON c.id = cdr.client_id AND cdr.user_id = #{userId}
AND cdr.del_flag = 0
WHERE
c.del_flag = 0