fix: 当前流量统计/扣费账单/上网记录类型等
This commit is contained in:
@@ -13,6 +13,6 @@ ADD COLUMN `package_reminder` tinyint(4) NULL COMMENT '套餐提醒' AFTER `up_l
|
|||||||
ADD COLUMN `balance_reminder` tinyint(4) NULL COMMENT '余额提醒' AFTER `package_reminder`;
|
ADD COLUMN `balance_reminder` tinyint(4) NULL COMMENT '余额提醒' AFTER `package_reminder`;
|
||||||
|
|
||||||
|
|
||||||
INSERT IGNORE INTO `wfc_system_db`.`sys_job` (`job_id`, `job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3, 'Reminder Task', 'DEFAULT', 'reminderTask.reminderJob', '0/60 * * * * ?', '3', '1', '0', 'admin', '2025-06-16 11:26:10', '', NULL, '');
|
INSERT IGNORE INTO `wfc_system_db`.`sys_job` (`job_id`, `job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3, 'Reminder Task', 'DEFAULT', 'reminderTask.reminderJob', '0 * * * * ?', '3', '1', '0', 'admin', '2025-06-16 11:26:10', '', NULL, '');
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ CREATE TABLE `u_bill_rule` (
|
|||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of u_bill_rule
|
-- Records of u_bill_rule
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `u_bill_rule` VALUES (1, 1.0000, 1, 2, 1, 0, NULL, NULL, 2, '2025-01-07 17:11:30');
|
INSERT INTO `u_bill_rule` VALUES (1, 1.0000, 1, 2, 0, 0, NULL, NULL, 2, '2025-01-07 17:11:30');
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for u_cdr
|
-- Table structure for u_cdr
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ import lombok.Getter;
|
|||||||
public enum OrderTypeEnum {
|
public enum OrderTypeEnum {
|
||||||
|
|
||||||
PACKAGE(0, "Package"),
|
PACKAGE(0, "Package"),
|
||||||
RECHARGE(1, "Recharge");
|
RECHARGE(1, "Recharge"),
|
||||||
|
BALANCE_DEDUCTION(2, "balance deduction"),;
|
||||||
|
|
||||||
private final Integer code;
|
private final Integer code;
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|||||||
@@ -18,4 +18,5 @@ public class UCdrHistoryUserVo {
|
|||||||
private Long duration;
|
private Long duration;
|
||||||
private Long trafficDown;
|
private Long trafficDown;
|
||||||
private Long trafficUp;
|
private Long trafficUp;
|
||||||
|
private Integer useType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -309,14 +309,15 @@ public class UAccountServiceImpl extends ServiceImpl<UAccountMapper, UAccount> i
|
|||||||
bill.setAmount(account.getBalanceUsed());
|
bill.setAmount(account.getBalanceUsed());
|
||||||
bill.setUserId(userId);
|
bill.setUserId(userId);
|
||||||
bill.setCdrHistoryId(cdrHistoryId);
|
bill.setCdrHistoryId(cdrHistoryId);
|
||||||
bill.setType(OrderTypeEnum.RECHARGE.getCode());
|
bill.setType(OrderTypeEnum.BALANCE_DEDUCTION.getCode());
|
||||||
bill.setStatus(OrderStatusEnum.PAID.getCode());
|
bill.setStatus(OrderStatusEnum.PAID.getCode());
|
||||||
// billMapper.insert(bill);
|
billMapper.insert(bill);
|
||||||
|
|
||||||
account.setBalanceUsed(BigDecimal.ZERO);
|
account.setBalanceUsed(BigDecimal.ZERO);
|
||||||
this.updateById(account);
|
this.updateById(account);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public boolean sendReminderEMail() {
|
public boolean sendReminderEMail() {
|
||||||
Date current = new Date();
|
Date current = new Date();
|
||||||
List<UAccount> accounts = this.list(Wrappers.<UAccount>lambdaQuery()
|
List<UAccount> accounts = this.list(Wrappers.<UAccount>lambdaQuery()
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ public class UBillServiceImpl extends ServiceImpl<UBillMapper, UBill> implements
|
|||||||
try {
|
try {
|
||||||
String subject = mailProperties.getSubject();
|
String subject = mailProperties.getSubject();
|
||||||
if (StrUtil.isBlank(subject)) {
|
if (StrUtil.isBlank(subject)) {
|
||||||
subject = "Your WANFI Billing";
|
subject = "Your Billing";
|
||||||
}
|
}
|
||||||
MailUtils.sendHtml(invoiceBo.getEmail(), subject, htmlStr, uploadFile);
|
MailUtils.sendHtml(invoiceBo.getEmail(), subject, htmlStr, uploadFile);
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
FROM
|
FROM
|
||||||
u_bill b
|
u_bill b
|
||||||
WHERE b.del_flag = 0
|
WHERE b.del_flag = 0
|
||||||
|
AND b.type in (1, 2)
|
||||||
|
AND b.invoice_number is not null
|
||||||
AND b.user_id = #{userId}
|
AND b.user_id = #{userId}
|
||||||
order by b.create_time desc
|
order by b.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -114,6 +114,7 @@
|
|||||||
c.client_device_type,
|
c.client_device_type,
|
||||||
ch.start_time,
|
ch.start_time,
|
||||||
ch.end_time,
|
ch.end_time,
|
||||||
|
ch.use_type,
|
||||||
ifnull( ch.duration, 0 ) duration,
|
ifnull( ch.duration, 0 ) duration,
|
||||||
ifnull( ch.traffic_down, 0 ) traffic_down,
|
ifnull( ch.traffic_down, 0 ) traffic_down,
|
||||||
ifnull( ch.traffic_up, 0 ) traffic_up
|
ifnull( ch.traffic_up, 0 ) traffic_up
|
||||||
@@ -126,6 +127,7 @@
|
|||||||
WHERE
|
WHERE
|
||||||
cdr.del_flag = 0
|
cdr.del_flag = 0
|
||||||
AND ch.id is not null
|
AND ch.id is not null
|
||||||
|
AND ch.use_type is not null
|
||||||
<if test="item.userId != null and item.userId != ''">
|
<if test="item.userId != null and item.userId != ''">
|
||||||
AND cdr.user_id = #{item.userId}
|
AND cdr.user_id = #{item.userId}
|
||||||
</if>
|
</if>
|
||||||
@@ -172,7 +174,7 @@
|
|||||||
sum(ifnull( cdr.traffic_up, 0 )) traffic
|
sum(ifnull( cdr.traffic_up, 0 )) traffic
|
||||||
FROM
|
FROM
|
||||||
u_client c
|
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
|
AND cdr.del_flag = 0
|
||||||
WHERE
|
WHERE
|
||||||
c.del_flag = 0
|
c.del_flag = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user