59eb34976a
iotlcm-admin-svr:管理后台服务。 - Go module:iotlcm → git.5iot.com/iotlcm-public/iotlcm-admin-svr(729 文件) - 凭据与地址脱敏:JWT signingKey(含代码里的 MustGet 默认值)、 MySQL DSN、Redis 口令、告警邮件发件人邮箱全部改为占位; 私网 IP → 文档地址段;库名 xiujie_admin → iotlcm - 真实手机号/邮箱 → 合法 11 位编造号 / example.com - 移除内部资产:CI 触发器、过时 DDL(sql/db_iotlcm.sql)、 私有依赖 go get 行、明文 registry 登录口令 - 启动 banner 统一 IOTLCM 方块字 + 社区惯例署名 - Dockerfile 改用公共基础镜像 - 拼错的 RADEME.md → README.md,README 重写 - 需要真实数据库的用例改为可用 IOTLCM_TEST_WITH_DB=1 显式启用 - 补 Apache-2.0 LICENSE,LF 行尾 + .gitattributes 数据库 schema 不随本仓发布(生产 DDL 已过时),README 已说明。
247 lines
18 KiB
Go
247 lines
18 KiB
Go
// Package genin
|
|
// @Link https://github.com/xiujiecn/xiu-admin
|
|
// @Copyright Copyright (c) 2026 LiXiujie
|
|
// @Author Lxj <li@xiujie.cn>
|
|
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
|
// @AutoGenerate Version
|
|
package model
|
|
|
|
import (
|
|
"context"
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/library/xgorm/hook"
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model/entity"
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model/request"
|
|
"time"
|
|
|
|
"github.com/gogf/gf/v2/os/gtime"
|
|
)
|
|
|
|
// TConsumeAccountMonthBillUpdateFields 修改消费账户月账单表字段过滤
|
|
type TConsumeAccountMonthBillUpdateFields struct {
|
|
DeptId int64 `json:"deptId" dc:"机构ID"`
|
|
AccountPeriod string `json:"accountPeriod" dc:"账期YYYY-MM"`
|
|
OpeningBalance float64 `json:"openingBalance" dc:"月初余额"`
|
|
RechargeIncome float64 `json:"rechargeIncome" dc:"充值收入"`
|
|
WithdrawableTransferInIncome float64 `json:"withdrawableTransferInIncome" dc:"可提现转入收入"`
|
|
ManualAdjustIncome float64 `json:"manualAdjustIncome" dc:"人工调账收入"`
|
|
RefundIncome float64 `json:"refundIncome" dc:"退款收入"`
|
|
ConsumeExpense float64 `json:"consumeExpense" dc:"平台消费支出"`
|
|
BalanceTransferOutExpense float64 `json:"balanceTransferOutExpense" dc:"转可提现支出"`
|
|
ManualAdjustExpense float64 `json:"manualAdjustExpense" dc:"人工调账支出"`
|
|
ConsumeCreditRepayExpense float64 `json:"consumeCreditRepayExpense" dc:"消费账户还款支出"`
|
|
TotalIncome float64 `json:"totalIncome" dc:"本月收入总额"`
|
|
TotalExpense float64 `json:"totalExpense" dc:"本月支出总额"`
|
|
ClosingBalance float64 `json:"closingBalance" dc:"月末余额(月初余额+本月收入-本月支出)"`
|
|
IncomeCount int `json:"incomeCount" dc:"收入笔数"`
|
|
ExpenseCount int `json:"expenseCount" dc:"支出笔数"`
|
|
CreditUsed float64 `json:"creditUsed" dc:"本月使用信用额度"`
|
|
CreditRepaid float64 `json:"creditRepaid" dc:"本月还款信用额度"`
|
|
BillStatus int `json:"billStatus" dc:"账单状态:1正常,2已调整,3已作废"`
|
|
SettleTime *gtime.Time `json:"settleTime" dc:"结算时间"`
|
|
Remark string `json:"remark" dc:"备注"`
|
|
TenantId string `json:"tenantId" dc:"租户ID"`
|
|
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
|
|
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
|
}
|
|
|
|
// TConsumeAccountMonthBillInsertFields 新增消费账户月账单表字段过滤
|
|
type TConsumeAccountMonthBillInsertFields struct {
|
|
DeptId int64 `json:"deptId" dc:"机构ID"`
|
|
AccountPeriod string `json:"accountPeriod" dc:"账期YYYY-MM"`
|
|
OpeningBalance float64 `json:"openingBalance" dc:"月初余额"`
|
|
RechargeIncome float64 `json:"rechargeIncome" dc:"充值收入"`
|
|
WithdrawableTransferInIncome float64 `json:"withdrawableTransferInIncome" dc:"可提现转入收入"`
|
|
ManualAdjustIncome float64 `json:"manualAdjustIncome" dc:"人工调账收入"`
|
|
RefundIncome float64 `json:"refundIncome" dc:"退款收入"`
|
|
ConsumeExpense float64 `json:"consumeExpense" dc:"平台消费支出"`
|
|
BalanceTransferOutExpense float64 `json:"balanceTransferOutExpense" dc:"转可提现支出"`
|
|
ManualAdjustExpense float64 `json:"manualAdjustExpense" dc:"人工调账支出"`
|
|
ConsumeCreditRepayExpense float64 `json:"consumeCreditRepayExpense" dc:"消费账户还款支出"`
|
|
TotalIncome float64 `json:"totalIncome" dc:"本月收入总额"`
|
|
TotalExpense float64 `json:"totalExpense" dc:"本月支出总额"`
|
|
ClosingBalance float64 `json:"closingBalance" dc:"月末余额(月初余额+本月收入-本月支出)"`
|
|
IncomeCount int `json:"incomeCount" dc:"收入笔数"`
|
|
ExpenseCount int `json:"expenseCount" dc:"支出笔数"`
|
|
CreditUsed float64 `json:"creditUsed" dc:"本月使用信用额度"`
|
|
CreditRepaid float64 `json:"creditRepaid" dc:"本月还款信用额度"`
|
|
BillStatus int `json:"billStatus" dc:"账单状态:1正常,2已调整,3已作废"`
|
|
SettleTime *gtime.Time `json:"settleTime" dc:"结算时间"`
|
|
Remark string `json:"remark" dc:"备注"`
|
|
TenantId string `json:"tenantId" dc:"租户ID"`
|
|
CreatedDept int64 `json:"createdDept" dc:"创建部门"`
|
|
CreatedBy int64 `json:"createdBy" dc:"创建者"`
|
|
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
|
}
|
|
|
|
// TConsumeAccountMonthBillEditParam 修改/新增消费账户月账单表
|
|
type TConsumeAccountMonthBillEditParam struct {
|
|
//entity.TConsumeAccountMonthBill
|
|
Id int64 `json:"id" dc:"账单ID"`
|
|
DeptId *int64 `json:"deptId" dc:"机构ID"`
|
|
AccountPeriod *string `json:"accountPeriod" dc:"账期YYYY-MM"`
|
|
OpeningBalance *float64 `json:"openingBalance" dc:"月初余额"`
|
|
RechargeIncome *float64 `json:"rechargeIncome" dc:"充值收入"`
|
|
WithdrawableTransferInIncome *float64 `json:"withdrawableTransferInIncome" dc:"可提现转入收入"`
|
|
ManualAdjustIncome *float64 `json:"manualAdjustIncome" dc:"人工调账收入"`
|
|
RefundIncome *float64 `json:"refundIncome" dc:"退款收入"`
|
|
ConsumeExpense *float64 `json:"consumeExpense" dc:"平台消费支出"`
|
|
BalanceTransferOutExpense *float64 `json:"balanceTransferOutExpense" dc:"转可提现支出"`
|
|
ManualAdjustExpense *float64 `json:"manualAdjustExpense" dc:"人工调账支出"`
|
|
ConsumeCreditRepayExpense *float64 `json:"consumeCreditRepayExpense" dc:"消费账户还款支出"`
|
|
TotalIncome *float64 `json:"totalIncome" dc:"本月收入总额"`
|
|
TotalExpense *float64 `json:"totalExpense" dc:"本月支出总额"`
|
|
ClosingBalance *float64 `json:"closingBalance" dc:"月末余额(月初余额+本月收入-本月支出)"`
|
|
IncomeCount *int `json:"incomeCount" dc:"收入笔数"`
|
|
ExpenseCount *int `json:"expenseCount" dc:"支出笔数"`
|
|
CreditUsed *float64 `json:"creditUsed" dc:"本月使用信用额度"`
|
|
CreditRepaid *float64 `json:"creditRepaid" dc:"本月还款信用额度"`
|
|
BillStatus *int `json:"billStatus" dc:"账单状态:1正常,2已调整,3已作废"`
|
|
SettleTime *gtime.Time `json:"settleTime" dc:"结算时间"`
|
|
Remark *string `json:"remark" dc:"备注"`
|
|
TenantId *string `json:"tenantId" dc:"租户ID"`
|
|
CreatedDept *int64 `json:"createdDept" dc:"创建部门"`
|
|
CreatedBy *int64 `json:"createdBy" dc:"创建者"`
|
|
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
|
UpdatedBy *int64 `json:"updatedBy" dc:"更新者"`
|
|
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
|
}
|
|
|
|
func (in *TConsumeAccountMonthBillEditParam) Filter(ctx context.Context) (err error) {
|
|
|
|
return
|
|
}
|
|
|
|
type TConsumeAccountMonthBillEditModel struct{}
|
|
|
|
// TConsumeAccountMonthBillDeleteParam 删除消费账户月账单表
|
|
type TConsumeAccountMonthBillDeleteParam struct {
|
|
Id interface{} `json:"id" v:"required#账单ID不能为空" dc:"账单ID"`
|
|
}
|
|
|
|
func (in *TConsumeAccountMonthBillDeleteParam) Filter(ctx context.Context) (err error) {
|
|
return
|
|
}
|
|
|
|
type TConsumeAccountMonthBillDeleteModel struct{}
|
|
|
|
// TConsumeAccountMonthBillViewParam 获取指定消费账户月账单表信息
|
|
type TConsumeAccountMonthBillViewParam struct {
|
|
Id int64 `json:"id" v:"required#账单ID不能为空" dc:"账单ID"`
|
|
}
|
|
|
|
func (in *TConsumeAccountMonthBillViewParam) Filter(ctx context.Context) (err error) {
|
|
return
|
|
}
|
|
|
|
type TConsumeAccountMonthBillViewModel struct {
|
|
entity.TConsumeAccountMonthBill
|
|
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
|
|
UpdatedBySumma *hook.MemberSumma `json:"updatedBySumma" dc:"更新者摘要信息"`
|
|
}
|
|
|
|
// TConsumeAccountMonthBillListParam 获取消费账户月账单表列表
|
|
type TConsumeAccountMonthBillListParam struct {
|
|
request.PageInfo
|
|
Id int64 `json:"id" dc:"账单ID"`
|
|
BillStatus int `json:"billStatus" dc:"账单状态:1正常,2已调整,3已作废"`
|
|
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
|
}
|
|
|
|
func (in *TConsumeAccountMonthBillListParam) Filter(ctx context.Context) (err error) {
|
|
return
|
|
}
|
|
|
|
// TConsumeAccountMonthBillSettleParam 按账期统计消费账户月账单参数
|
|
type TConsumeAccountMonthBillSettleParam struct {
|
|
AccountPeriod string `json:"accountPeriod" dc:"账期YYYY-MM,不传默认上个月"`
|
|
}
|
|
|
|
func (in *TConsumeAccountMonthBillSettleParam) Filter(ctx context.Context) (err error) {
|
|
if in.AccountPeriod == "" {
|
|
in.AccountPeriod = time.Now().AddDate(0, -1, 0).Format("2006-01")
|
|
}
|
|
if _, err = time.Parse("2006-01", in.AccountPeriod); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// TConsumeAccountMonthBillSettleResult 消费账户月账单统计结果
|
|
type TConsumeAccountMonthBillSettleResult struct {
|
|
AccountPeriod string `json:"accountPeriod" dc:"账期YYYY-MM"`
|
|
DeptCount int `json:"deptCount" dc:"处理机构数"`
|
|
InsertCount int `json:"insertCount" dc:"新增账单数"`
|
|
UpdateCount int `json:"updateCount" dc:"更新账单数"`
|
|
DetailCount int `json:"detailCount" dc:"参与统计明细数"`
|
|
TotalIncome float64 `json:"totalIncome" dc:"本月收入总额"`
|
|
TotalExpense float64 `json:"totalExpense" dc:"本月支出总额"`
|
|
}
|
|
|
|
type TConsumeAccountMonthBillListModel struct {
|
|
Id int64 `json:"id" dc:"账单ID"`
|
|
DeptId int64 `json:"deptId" dc:"机构ID"`
|
|
AccountPeriod string `json:"accountPeriod" dc:"账期YYYY-MM"`
|
|
OpeningBalance float64 `json:"openingBalance" dc:"月初余额"`
|
|
RechargeIncome float64 `json:"rechargeIncome" dc:"充值收入"`
|
|
WithdrawableTransferInIncome float64 `json:"withdrawableTransferInIncome" dc:"可提现转入收入"`
|
|
ManualAdjustIncome float64 `json:"manualAdjustIncome" dc:"人工调账收入"`
|
|
RefundIncome float64 `json:"refundIncome" dc:"退款收入"`
|
|
ConsumeExpense float64 `json:"consumeExpense" dc:"平台消费支出"`
|
|
BalanceTransferOutExpense float64 `json:"balanceTransferOutExpense" dc:"转可提现支出"`
|
|
ManualAdjustExpense float64 `json:"manualAdjustExpense" dc:"人工调账支出"`
|
|
ConsumeCreditRepayExpense float64 `json:"consumeCreditRepayExpense" dc:"消费账户还款支出"`
|
|
TotalIncome float64 `json:"totalIncome" dc:"本月收入总额"`
|
|
TotalExpense float64 `json:"totalExpense" dc:"本月支出总额"`
|
|
ClosingBalance float64 `json:"closingBalance" dc:"月末余额(月初余额+本月收入-本月支出)"`
|
|
IncomeCount int `json:"incomeCount" dc:"收入笔数"`
|
|
ExpenseCount int `json:"expenseCount" dc:"支出笔数"`
|
|
CreditUsed float64 `json:"creditUsed" dc:"本月使用信用额度"`
|
|
CreditRepaid float64 `json:"creditRepaid" dc:"本月还款信用额度"`
|
|
BillStatus int `json:"billStatus" dc:"账单状态:1正常,2已调整,3已作废"`
|
|
SettleTime *gtime.Time `json:"settleTime" dc:"结算时间"`
|
|
TenantId string `json:"tenantId" dc:"租户ID"`
|
|
CreatedDept int64 `json:"createdDept" dc:"创建部门"`
|
|
CreatedBy int64 `json:"createdBy" dc:"创建者"`
|
|
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
|
|
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
|
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
|
|
UpdatedBySumma *hook.MemberSumma `json:"updatedBySumma" dc:"更新者摘要信息"`
|
|
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
|
}
|
|
|
|
// TConsumeAccountMonthBillExportModel 导出消费账户月账单表
|
|
type TConsumeAccountMonthBillExportModel struct {
|
|
Id int64 `json:"id" dc:"账单ID"`
|
|
DeptId int64 `json:"deptId" dc:"机构ID"`
|
|
AccountPeriod string `json:"accountPeriod" dc:"账期YYYY-MM"`
|
|
OpeningBalance float64 `json:"openingBalance" dc:"月初余额"`
|
|
RechargeIncome float64 `json:"rechargeIncome" dc:"充值收入"`
|
|
WithdrawableTransferInIncome float64 `json:"withdrawableTransferInIncome" dc:"可提现转入收入"`
|
|
ManualAdjustIncome float64 `json:"manualAdjustIncome" dc:"人工调账收入"`
|
|
RefundIncome float64 `json:"refundIncome" dc:"退款收入"`
|
|
ConsumeExpense float64 `json:"consumeExpense" dc:"平台消费支出"`
|
|
BalanceTransferOutExpense float64 `json:"balanceTransferOutExpense" dc:"转可提现支出"`
|
|
ManualAdjustExpense float64 `json:"manualAdjustExpense" dc:"人工调账支出"`
|
|
ConsumeCreditRepayExpense float64 `json:"consumeCreditRepayExpense" dc:"消费账户还款支出"`
|
|
TotalIncome float64 `json:"totalIncome" dc:"本月收入总额"`
|
|
TotalExpense float64 `json:"totalExpense" dc:"本月支出总额"`
|
|
ClosingBalance float64 `json:"closingBalance" dc:"月末余额(月初余额+本月收入-本月支出)"`
|
|
IncomeCount int `json:"incomeCount" dc:"收入笔数"`
|
|
ExpenseCount int `json:"expenseCount" dc:"支出笔数"`
|
|
CreditUsed float64 `json:"creditUsed" dc:"本月使用信用额度"`
|
|
CreditRepaid float64 `json:"creditRepaid" dc:"本月还款信用额度"`
|
|
BillStatus int `json:"billStatus" dc:"账单状态:1正常,2已调整,3已作废"`
|
|
SettleTime *gtime.Time `json:"settleTime" dc:"结算时间"`
|
|
TenantId string `json:"tenantId" dc:"租户ID"`
|
|
CreatedDept int64 `json:"createdDept" dc:"创建部门"`
|
|
CreatedBy int64 `json:"createdBy" dc:"创建者"`
|
|
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
|
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
|
|
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
|
}
|
|
|
|
type TConsumptionBillSummaryModel struct {
|
|
TotalIncome float64 `json:"totalIncome" dc:"本月收入总额"`
|
|
TotalExpense float64 `json:"totalExpense" dc:"本月支出总额"`
|
|
}
|