Compare commits
33 Commits
jng-contra
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0bfd322a8 | ||
|
|
e9bef82968 | ||
|
|
aae7aa077b | ||
|
|
61e5a69484 | ||
|
|
0524d503f3 | ||
|
|
36a751b8ac | ||
|
|
7f5384c935 | ||
|
|
137e752c1b | ||
| 8b85aeee28 | |||
| bbe0c0390c | |||
|
|
7ac61c197c | ||
|
|
e5baa91e9d | ||
| 3584a9f948 | |||
| fc25533193 | |||
| 71f7be5716 | |||
| 55a5ba3152 | |||
| 185e5da57a | |||
|
|
7c4c7b0faa | ||
|
|
8f5c21e3f2 | ||
| d730106309 | |||
| 0bf1f34bba | |||
|
|
32a9bb8283 | ||
|
|
0e64d40489 | ||
| d11a7a5c6a | |||
| edc85ae53e | |||
| bfaac2fd95 | |||
|
|
5dd3eb98c4 | ||
|
|
24980bd23f | ||
|
|
296e6a3eff | ||
|
|
31093ace3f | ||
|
|
a0f54358b7 | ||
|
|
6b61b43464 | ||
| 1b2e5f8fd1 |
@ -51,3 +51,6 @@ func (b *BundleProvider) BatchGetValueAddServiceLang(ctx context.Context, req *b
|
|||||||
func (b *BundleProvider) BundleListH5V2(_ context.Context, req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
|
func (b *BundleProvider) BundleListH5V2(_ context.Context, req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
|
||||||
return logic.BundleListH5V2(req)
|
return logic.BundleListH5V2(req)
|
||||||
}
|
}
|
||||||
|
func (b *BundleProvider) QueryTheOrderSnapshotInformation(_ context.Context, req *bundle.QueryTheOrderSnapshotInformationReq) (res *bundle.QueryTheOrderSnapshotInformationResp, err error) {
|
||||||
|
return logic.QueryTheOrderSnapshotInformation(req)
|
||||||
|
}
|
||||||
|
|||||||
@ -590,3 +590,35 @@ func (b *BundleProvider) AddHiddenTaskAssignee(_ context.Context, req *bundle.Ad
|
|||||||
}
|
}
|
||||||
return &bundle.ComResponse{Msg: "删除该指派人成功"}, nil
|
return &bundle.ComResponse{Msg: "删除该指派人成功"}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateTaskWorkLog 创建任务日志记录
|
||||||
|
func (b *BundleProvider) CreateTaskWorkLog(_ context.Context, req *bundle.CreateTaskWorkLogRequest) (*bundle.CommonResponse, error) {
|
||||||
|
// 转换请求参数
|
||||||
|
daoReq := &dao.CreateTaskWorkLogRequest{
|
||||||
|
AssignRecordsUUID: req.AssignRecordsUUID,
|
||||||
|
WorkUUID: req.WorkUUID,
|
||||||
|
Title: req.Title,
|
||||||
|
ArtistUUID: req.ArtistUUID,
|
||||||
|
SubNum: req.SubNum,
|
||||||
|
TelNum: req.TelNum,
|
||||||
|
ArtistName: req.ArtistName,
|
||||||
|
OperationType: int(req.OperationType),
|
||||||
|
TaskType: int(req.TaskType),
|
||||||
|
TaskCount: int(req.TaskCount),
|
||||||
|
Remark: req.Remark,
|
||||||
|
OperatorName: req.OperatorName,
|
||||||
|
OperatorNum: req.OperatorNum,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用logic层
|
||||||
|
err := logic.CreateTaskWorkLog(daoReq)
|
||||||
|
if err != nil {
|
||||||
|
return &bundle.CommonResponse{
|
||||||
|
Msg: err.Error(),
|
||||||
|
}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &bundle.CommonResponse{
|
||||||
|
Msg: "任务日志创建成功",
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package dao
|
package dao
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
"micro-bundle/pb/bundle"
|
||||||
"micro-bundle/pkg/app"
|
"micro-bundle/pkg/app"
|
||||||
@ -464,7 +465,40 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUnconfirmed() (data []model.CastWork,err error) {
|
func GetUnconfirmed() (data []model.CastWork, err error) {
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.CastWork{}).Where("status = ? and update_time < ?", 4, time.Now().Add(-time.Hour*24)).Find(&data).Error
|
err = app.ModuleClients.BundleDB.Model(&model.CastWork{}).Where("status = ? and update_time < ?", 4, time.Now().Add(-time.Hour*24)).Find(&data).Error
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
func QueryTheOrderSnapshotInformation(req *bundle.QueryTheOrderSnapshotInformationReq) (res *bundle.QueryTheOrderSnapshotInformationResp, err error) {
|
||||||
|
res = new(bundle.QueryTheOrderSnapshotInformationResp)
|
||||||
|
var record model.BundleOrderRecords
|
||||||
|
err = app.ModuleClients.BundleDB.
|
||||||
|
Preload("BundleOrderValueAdd").
|
||||||
|
Where("order_no = ?", req.OrderNo).
|
||||||
|
First(&record).Error
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var temp struct {
|
||||||
|
Content string `json:"content"`
|
||||||
|
}
|
||||||
|
if len(record.BundleCommonJson) > 0 {
|
||||||
|
_ = json.Unmarshal(record.BundleCommonJson, &temp) // 失败也不会影响
|
||||||
|
}
|
||||||
|
res.BundleContent = temp.Content // 如果失败,这里就是空字符串
|
||||||
|
res.BundleOrder = make([]*bundle.ServiceInformation, 0)
|
||||||
|
res.AddBundleOrder = make([]*bundle.ServiceInformation, 0)
|
||||||
|
for _, v := range record.BundleOrderValueAdd {
|
||||||
|
info := &bundle.ServiceInformation{
|
||||||
|
ServiceType: uint64(v.ServiceType),
|
||||||
|
Num: uint64(v.Num),
|
||||||
|
Unit: v.Unit,
|
||||||
|
}
|
||||||
|
if v.EquityType == 1 {
|
||||||
|
res.BundleOrder = append(res.BundleOrder, info)
|
||||||
|
} else if v.EquityType == 2 {
|
||||||
|
res.AddBundleOrder = append(res.AddBundleOrder, info)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@ -135,11 +135,11 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if req.Month == "" {
|
if len(req.Month) == 0 {
|
||||||
newestMonthQuery := app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).Select("max(month) as month,user_id").Group("user_id")
|
newestMonthQuery := app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).Select("max(month) as month,user_id").Group("user_id")
|
||||||
session.Joins("LEFT JOIN (?) as newest_month on newest_month.user_id = bb.user_id", newestMonthQuery).Where("")
|
session.Joins("LEFT JOIN (?) as newest_month on newest_month.user_id = bb.user_id", newestMonthQuery).Where("")
|
||||||
} else {
|
} else {
|
||||||
session = session.Where("bb.month = ?", req.Month)
|
session = session.Where("bb.month in (?)", req.Month)
|
||||||
}
|
}
|
||||||
err = session.Count(&total).Error
|
err = session.Count(&total).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -694,9 +694,9 @@ inner join (
|
|||||||
// 当月增值限制类会过期型数据分析可使用额度
|
// 当月增值限制类会过期型数据分析可使用额度
|
||||||
v.MonthlyIncreaseLimitExpiredDataAnalysisNumber = cal(v.IncreaseLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
v.MonthlyIncreaseLimitExpiredDataAnalysisNumber = cal(v.IncreaseLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
||||||
// 当月套餐限制类型数据分析可使用额度
|
// 当月套餐限制类型数据分析可使用额度
|
||||||
v.MonthlyBundleLimitDataAnalysisNumber = v.MonthlyBundleLimitDataAnalysisNumber - v.MonthlyBundleLimitDataAnalysisConsumptionNumber + cal(v.BundleLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
v.MonthlyBundleLimitDataAnalysisNumber = v.MonthlyBundleLimitDataAnalysisNumber - v.MonthlyBundleLimitDataAnalysisConsumptionNumber + cal(v.BundleLimitDataAnalysisNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
||||||
// 当月增值限制类型数据分析可使用额度
|
// 当月增值限制类型数据分析可使用额度
|
||||||
v.MonthlyIncreaseLimitDataAnalysisNumber = v.MonthlyIncreaseLimitDataAnalysisNumber - v.MonthlyIncreaseLimitDataAnalysisConsumptionNumber + cal(v.IncreaseLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
v.MonthlyIncreaseLimitDataAnalysisNumber = v.MonthlyIncreaseLimitDataAnalysisNumber - v.MonthlyIncreaseLimitDataAnalysisConsumptionNumber + cal(v.IncreaseLimitDataAnalysisNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
||||||
|
|
||||||
// 重置单月消耗数量
|
// 重置单月消耗数量
|
||||||
v.MonthlyBundleVideoConsumptionNumber = 0
|
v.MonthlyBundleVideoConsumptionNumber = 0
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
"micro-bundle/pb/bundle"
|
||||||
"micro-bundle/pkg/app"
|
"micro-bundle/pkg/app"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/duke-git/lancet/v2/datetime"
|
"github.com/duke-git/lancet/v2/datetime"
|
||||||
@ -38,7 +39,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
// }
|
// }
|
||||||
err = query.First(result).Error
|
err = query.First(result).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return nil, fmt.Errorf("总金额统计失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将字符串转换为数值进行计算
|
// 将字符串转换为数值进行计算
|
||||||
@ -72,7 +73,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
|
|
||||||
subQuery = app.ModuleClients.BundleDB.Model(&model.Reconciliation{}).
|
subQuery = app.ModuleClients.BundleDB.Model(&model.Reconciliation{}).
|
||||||
Select("SUM(handling_fee) as new_fee_payment_amount, SUM(pay_amount) as new_payment_amount").
|
Select("SUM(handling_fee) as new_fee_payment_amount, SUM(pay_amount) as new_payment_amount").
|
||||||
Joins("LEFT JOIN bundle_order_records bor ON bor.order_no = bundle_order_on").
|
Joins("LEFT JOIN bundle_order_records bor ON bor.order_no COLLATE utf8mb4_general_ci = reconciliation.bundle_order_on COLLATE utf8mb4_general_ci").
|
||||||
Where("`reconciliation`.pay_time >= ?", req.Start+" 00:00:00").
|
Where("`reconciliation`.pay_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("`reconciliation`.pay_time <= ?", req.End+" 23:59:59").
|
Where("`reconciliation`.pay_time <= ?", req.End+" 23:59:59").
|
||||||
Where("`reconciliation`.deleted_at is null and reconciliation.pay_status = 2 and bor.status=2 and bor.deleted_at is null")
|
Where("`reconciliation`.deleted_at is null and reconciliation.pay_status = 2 and bor.status=2 and bor.deleted_at is null")
|
||||||
@ -191,6 +192,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cwe.cost_type = 1").
|
Where("cwe.cost_type = 1").
|
||||||
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
|
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cwl.update_time <= ?", req.End+" 23:59:59").
|
Where("cwl.update_time <= ?", req.End+" 23:59:59").
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and ccl.deleted_at = 0 and cwe.deleted_at = 0")
|
Where("cast_work.deleted_at = 0 and ccl.deleted_at = 0 and cwe.deleted_at = 0")
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
query = query.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
query = query.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
||||||
@ -209,6 +211,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cwe.cost_type != 1").
|
Where("cwe.cost_type != 1").
|
||||||
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
|
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cwl.update_time <= ?", req.End+" 23:59:59").
|
Where("cwl.update_time <= ?", req.End+" 23:59:59").
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and ccl.deleted_at = 0 and cwe.deleted_at = 0")
|
Where("cast_work.deleted_at = 0 and ccl.deleted_at = 0 and cwe.deleted_at = 0")
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
query = query.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
query = query.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
||||||
@ -240,6 +243,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cw.status in ?", []int{7, 6, 9}).
|
Where("cw.status in ?", []int{7, 6, 9}).
|
||||||
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
|
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cwl.update_time <= ?", req.End+" 23:59:59").
|
Where("cwl.update_time <= ?", req.End+" 23:59:59").
|
||||||
|
Where("cw.origin_uuid = ''").
|
||||||
Where("cw.deleted_at = 0 and cwl.deleted_at = 0 and cwe.deleted_at = 0").
|
Where("cw.deleted_at = 0 and cwl.deleted_at = 0 and cwe.deleted_at = 0").
|
||||||
Group("cw.artist_uuid")
|
Group("cw.artist_uuid")
|
||||||
|
|
||||||
@ -302,6 +306,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cast_work.work_category = 2").
|
Where("cast_work.work_category = 2").
|
||||||
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0")
|
Where("cast_work.deleted_at = 0")
|
||||||
|
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
@ -322,6 +327,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cast_work.work_category = 2").
|
Where("cast_work.work_category = 2").
|
||||||
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and bor.deleted_at IS NULL and bb.deleted_at IS NULL").
|
Where("cast_work.deleted_at = 0 and bor.deleted_at IS NULL and bb.deleted_at IS NULL").
|
||||||
Where("bor.bundle_uuid = ?", req.BundleUuid)
|
Where("bor.bundle_uuid = ?", req.BundleUuid)
|
||||||
err = query.Count(&newVideoUsed).Error
|
err = query.Count(&newVideoUsed).Error
|
||||||
@ -337,6 +343,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.work_category = 2"). // 视频类型
|
Where("cast_work.work_category = 2"). // 视频类型
|
||||||
Where("cwe.cost_type = 1"). // 套餐类型
|
Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0")
|
Where("cast_work.deleted_at = 0")
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
queryBundleVideo = queryBundleVideo.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
queryBundleVideo = queryBundleVideo.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
||||||
@ -353,6 +360,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.work_category = 2"). // 视频类型
|
Where("cast_work.work_category = 2"). // 视频类型
|
||||||
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0")
|
Where("cast_work.deleted_at = 0")
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
queryIncreaseVideo = queryIncreaseVideo.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
queryIncreaseVideo = queryIncreaseVideo.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
||||||
@ -436,6 +444,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cast_work.work_category = 1").
|
Where("cast_work.work_category = 1").
|
||||||
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0")
|
Where("cast_work.deleted_at = 0")
|
||||||
|
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
@ -455,6 +464,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cast_work.work_category = 1").
|
Where("cast_work.work_category = 1").
|
||||||
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and bor.deleted_at IS NULL and bb.deleted_at IS NULL").
|
Where("cast_work.deleted_at = 0 and bor.deleted_at IS NULL and bb.deleted_at IS NULL").
|
||||||
Where("bor.bundle_uuid = ?", req.BundleUuid)
|
Where("bor.bundle_uuid = ?", req.BundleUuid)
|
||||||
err = query.Count(&newImageUsed).Error
|
err = query.Count(&newImageUsed).Error
|
||||||
@ -470,6 +480,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.work_category = 1"). // 图文类型
|
Where("cast_work.work_category = 1"). // 图文类型
|
||||||
Where("cwe.cost_type = 1 "). // 套餐类型
|
Where("cwe.cost_type = 1 "). // 套餐类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0")
|
Where("cast_work.deleted_at = 0")
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
queryBundleImage = queryBundleImage.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
queryBundleImage = queryBundleImage.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
||||||
@ -486,6 +497,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.work_category = 1"). // 图文类型
|
Where("cast_work.work_category = 1"). // 图文类型
|
||||||
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0")
|
Where("cast_work.deleted_at = 0")
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
queryIncreaseImage = queryIncreaseImage.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
queryIncreaseImage = queryIncreaseImage.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
||||||
@ -502,16 +514,15 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
UnUsedDataAnalysis int64 `gorm:"column:un_used_data_analysis"`
|
UnUsedDataAnalysis int64 `gorm:"column:un_used_data_analysis"`
|
||||||
}
|
}
|
||||||
var dataAnalysisCountInfo DataAnalysisCountResult
|
var dataAnalysisCountInfo DataAnalysisCountResult
|
||||||
query = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
query = app.ModuleClients.BundleDB.Table("cast_work_analysis as cwa").
|
||||||
Select(`
|
Select(`
|
||||||
SUM(CASE WHEN ccl.uuid IS NOT NULL AND ccl.deleted_at = 0 THEN 1 ELSE 0 END) AS data_analysis_used,
|
SUM(CASE WHEN ccal.uuid IS NOT NULL AND ccal.deleted_at = 0 THEN 1 ELSE 0 END) AS data_analysis_used,
|
||||||
SUM(CASE WHEN ccl.uuid IS NULL THEN 1 ELSE 0 END) AS un_used_data_analysis
|
SUM(CASE WHEN ccal.uuid IS NULL THEN 1 ELSE 0 END) AS un_used_data_analysis
|
||||||
`).
|
`).
|
||||||
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
|
Joins("left join cast_cost_analysis_log ccal on ccal.analysis_uuid = cwa.uuid").
|
||||||
Where("cast_work.work_category = 3").
|
Where("cwa.submit_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
Where("cwa.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cwa.deleted_at = 0")
|
||||||
Where("cast_work.deleted_at = 0")
|
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
query = query.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
query = query.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
||||||
}
|
}
|
||||||
@ -523,46 +534,43 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
if req.BundleUuid == "" {
|
if req.BundleUuid == "" {
|
||||||
newDataAnalysisUsed = dataAnalysisCountInfo.DataAnalysisUsed + dataAnalysisCountInfo.UnUsedDataAnalysis
|
newDataAnalysisUsed = dataAnalysisCountInfo.DataAnalysisUsed + dataAnalysisCountInfo.UnUsedDataAnalysis
|
||||||
} else {
|
} else {
|
||||||
query = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
query = app.ModuleClients.BundleDB.Table("cast_work_analysis as cwa").
|
||||||
Joins("left join bundle_balance bb ON CAST(bb.user_id AS CHAR) COLLATE utf8mb4_general_ci = cast_work.artist_uuid COLLATE utf8mb4_general_ci AND cast_work.submit_time >= bb.start_at AND cast_work.submit_time <= bb.expired_at and bb.month = DATE_FORMAT(cast_work.submit_time, '%Y-%m')").
|
Joins("left join bundle_balance bb ON CAST(bb.user_id AS CHAR) COLLATE utf8mb4_general_ci = cwa.artist_id COLLATE utf8mb4_general_ci AND cwa.submit_time >= bb.start_at AND cwa.submit_time <= bb.expired_at and bb.month = DATE_FORMAT(cwa.submit_time, '%Y-%m')").
|
||||||
Joins("left join bundle_order_records bor ON bor.uuid = bb.order_uuid").
|
Joins("left join bundle_order_records bor ON bor.uuid = bb.order_uuid").
|
||||||
Where("cast_work.work_category = 3").
|
Where("cwa.submit_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
Where("cwa.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cwa.deleted_at = 0 and bor.deleted_at IS NULL and bb.deleted_at IS NULL").
|
||||||
Where("cast_work.deleted_at = 0 and bor.deleted_at IS NULL and bb.deleted_at IS NULL").
|
|
||||||
Where("bor.bundle_uuid = ?", req.BundleUuid)
|
Where("bor.bundle_uuid = ?", req.BundleUuid)
|
||||||
err = query.Count(&newDataAnalysisUsed).Error
|
err = query.Count(&newDataAnalysisUsed).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//数据分析套餐总已上传数
|
||||||
var totalUploadedBundleDataAnalysisCount int64
|
var totalUploadedBundleDataAnalysisCount int64
|
||||||
queryBundleDataAnalysis := app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
queryBundleDataAnalysis := app.ModuleClients.BundleDB.Table("cast_work_analysis as cwa").
|
||||||
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
|
Joins("left join cast_work_analysis_extra cwae on cwae.analysis_uuid = cwa.uuid AND cwae.deleted_at = 0").
|
||||||
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid AND ccl.deleted_at = 0").
|
Joins("left join cast_cost_analysis_log ccal on ccal.analysis_uuid = cwa.uuid AND ccal.deleted_at = 0").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cwa.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.work_category = 3"). // 数据分析类型
|
Where("cwae.cost_type = 1"). // 套餐类型
|
||||||
Where("cwe.cost_type = 1"). // 套餐类型
|
Where("cwa.deleted_at = 0")
|
||||||
Where("cast_work.deleted_at = 0")
|
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
queryBundleDataAnalysis = queryBundleDataAnalysis.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
queryBundleDataAnalysis = queryBundleDataAnalysis.Where("ccal.bundle_uuid = ?", req.BundleUuid)
|
||||||
}
|
}
|
||||||
err = queryBundleDataAnalysis.Count(&totalUploadedBundleDataAnalysisCount).Error
|
err = queryBundleDataAnalysis.Count(&totalUploadedBundleDataAnalysisCount).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
//数据分析增值总已上传数
|
||||||
var totalUploadedIncreaseDataAnalysisCount int64
|
var totalUploadedIncreaseDataAnalysisCount int64
|
||||||
queryIncreaseDataAnalysis := app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
queryIncreaseDataAnalysis := app.ModuleClients.BundleDB.Table("cast_work_analysis as cwa").
|
||||||
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid AND cwe.deleted_at = 0").
|
Joins("left join cast_work_analysis_extra cwae on cwae.analysis_uuid = cwa.uuid AND cwae.deleted_at = 0").
|
||||||
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid AND ccl.deleted_at = 0").
|
Joins("left join cast_cost_analysis_log ccal on ccal.analysis_uuid = cwa.uuid AND ccal.deleted_at = 0").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cwa.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.work_category = 3"). // 数据分析类型
|
Where("cwae.cost_type in ?", []int{2, 3}). // 增值类型
|
||||||
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
Where("cwa.deleted_at = 0")
|
||||||
Where("cast_work.deleted_at = 0")
|
|
||||||
if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
queryIncreaseDataAnalysis = queryIncreaseDataAnalysis.Where("ccl.bundle_uuid = ?", req.BundleUuid)
|
queryIncreaseDataAnalysis = queryIncreaseDataAnalysis.Where("ccal.bundle_uuid = ?", req.BundleUuid)
|
||||||
}
|
}
|
||||||
err = queryIncreaseDataAnalysis.Count(&totalUploadedIncreaseDataAnalysisCount).Error
|
err = queryIncreaseDataAnalysis.Count(&totalUploadedIncreaseDataAnalysisCount).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -645,6 +653,7 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 2"). // 视频类型
|
Where("work_category = 2"). // 视频类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
// Where("cwe.cost_type = 1"). // 套餐类型
|
// Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
Where("deleted_at = 0").
|
Where("deleted_at = 0").
|
||||||
Count(&newUploadedBundleVideoCount)
|
Count(&newUploadedBundleVideoCount)
|
||||||
@ -665,6 +674,7 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
// Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
|
// Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 2"). // 视频类型
|
Where("work_category = 2"). // 视频类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
// Where("cwe.cost_type = 1"). // 套餐类型
|
// Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
Where("deleted_at = 0").
|
Where("deleted_at = 0").
|
||||||
Count(&totalUploadedVideoCount)
|
Count(&totalUploadedVideoCount)
|
||||||
@ -676,6 +686,7 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 2"). // 视频类型
|
Where("work_category = 2"). // 视频类型
|
||||||
Where("cwe.cost_type = 1"). // 套餐类型
|
Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
||||||
Count(&totalUploadedBundleVideoCount)
|
Count(&totalUploadedBundleVideoCount)
|
||||||
|
|
||||||
@ -685,6 +696,7 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 2"). // 视频类型
|
Where("work_category = 2"). // 视频类型
|
||||||
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型或扩展类型
|
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型或扩展类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
||||||
Count(&totalUploadedIncreaseVideoCount)
|
Count(&totalUploadedIncreaseVideoCount)
|
||||||
|
|
||||||
@ -711,6 +723,7 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 1"). // 图文类型
|
Where("work_category = 1"). // 图文类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
// Where("cwe.cost_type = 1"). // 套餐类型
|
// Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
Where("deleted_at = 0").
|
Where("deleted_at = 0").
|
||||||
Count(&newUploadedBundleImageCount)
|
Count(&newUploadedBundleImageCount)
|
||||||
@ -731,6 +744,7 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
// Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
|
// Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 1"). // 图文类型
|
Where("work_category = 1"). // 图文类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
// Where("cwe.cost_type = 2"). // 套餐类型
|
// Where("cwe.cost_type = 2"). // 套餐类型
|
||||||
Where("deleted_at = 0").
|
Where("deleted_at = 0").
|
||||||
Count(&totalUploadedImageCount)
|
Count(&totalUploadedImageCount)
|
||||||
@ -742,6 +756,7 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 1"). // 图文类型
|
Where("work_category = 1"). // 图文类型
|
||||||
Where("cwe.cost_type = 1"). // 套餐类型
|
Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
||||||
Count(&totalUploadedBundleImageCount)
|
Count(&totalUploadedBundleImageCount)
|
||||||
|
|
||||||
@ -751,43 +766,40 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 1"). // 图文类型
|
Where("work_category = 1"). // 图文类型
|
||||||
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
||||||
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
||||||
Count(&totalUploadedIncreaseImageCount)
|
Count(&totalUploadedIncreaseImageCount)
|
||||||
|
|
||||||
//====================数据分析=======================
|
//====================数据分析=======================
|
||||||
var newUploadedBundleDataAnalysisCount int64
|
var newUploadedBundleDataAnalysisCount int64
|
||||||
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
app.ModuleClients.BundleDB.Table("cast_work_analysis as cwa").
|
||||||
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
|
Where("cwa.submit_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cwa.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 3"). // 数据分析类型
|
Where("cwa.deleted_at = 0").
|
||||||
Where("deleted_at = 0").
|
|
||||||
Count(&newUploadedBundleDataAnalysisCount)
|
Count(&newUploadedBundleDataAnalysisCount)
|
||||||
result.NewUploadedBundleDataAnalysisCount = newUploadedBundleDataAnalysisCount
|
result.NewUploadedBundleDataAnalysisCount = newUploadedBundleDataAnalysisCount
|
||||||
|
|
||||||
var totalUploadedDataAnalysisCount int64
|
var totalUploadedDataAnalysisCount int64
|
||||||
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
app.ModuleClients.BundleDB.Table("cast_work_analysis as cwa").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cwa.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 3"). // 数据分析类型
|
Where("cwa.deleted_at = 0").
|
||||||
Where("deleted_at = 0").
|
|
||||||
Count(&totalUploadedDataAnalysisCount)
|
Count(&totalUploadedDataAnalysisCount)
|
||||||
result.TotalUploadedBundleDataAnalysisCount = totalUploadedDataAnalysisCount
|
result.TotalUploadedBundleDataAnalysisCount = totalUploadedDataAnalysisCount
|
||||||
|
|
||||||
var totalUploadedBundleDataAnalysisCount int64
|
var totalUploadedBundleDataAnalysisCount int64
|
||||||
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
app.ModuleClients.BundleDB.Table("cast_work_analysis as cwa").
|
||||||
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
|
Joins("left join cast_work_analysis_extra cwae on cwae.analysis_uuid = cwa.uuid AND cwae.deleted_at = 0").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cwa.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 3"). // 数据分析类型
|
Where("cwae.cost_type = 1"). // 套餐类型
|
||||||
Where("cwe.cost_type = 1"). // 套餐类型
|
Where("cwa.deleted_at = 0 and cwae.deleted_at = 0").
|
||||||
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
|
||||||
Count(&totalUploadedBundleDataAnalysisCount)
|
Count(&totalUploadedBundleDataAnalysisCount)
|
||||||
|
|
||||||
var totalUploadedIncreaseDataAnalysisCount int64
|
var totalUploadedIncreaseDataAnalysisCount int64
|
||||||
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
app.ModuleClients.BundleDB.Table("cast_work_analysis as cwa").
|
||||||
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid AND cwe.deleted_at = 0").
|
Joins("left join cast_work_analysis_extra cwae on cwae.analysis_uuid = cwa.uuid AND cwae.deleted_at = 0").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cwa.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 3"). // 数据分析类型
|
Where("cwae.cost_type in ?", []int{2, 3}). // 增值类型
|
||||||
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
Where("cwa.deleted_at = 0 and cwe.deleted_at = 0").
|
||||||
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
|
||||||
Count(&totalUploadedIncreaseDataAnalysisCount)
|
Count(&totalUploadedIncreaseDataAnalysisCount)
|
||||||
|
|
||||||
endMonth := timeParse(req.End + " 23:59:59").Format("2006-01")
|
endMonth := timeParse(req.End + " 23:59:59").Format("2006-01")
|
||||||
@ -1148,7 +1160,7 @@ func MetricsOperatingStatus(req *bundle.MetricsOperatingStatusReq) (data *bundle
|
|||||||
app.ModuleClients.BundleDB.Model(model.CastWork{}).
|
app.ModuleClients.BundleDB.Model(model.CastWork{}).
|
||||||
Joins("left join cast_work_log cwl on cwl.work_uuid = cast_work.uuid").
|
Joins("left join cast_work_log cwl on cwl.work_uuid = cast_work.uuid").
|
||||||
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
|
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
|
||||||
Where("cast_work.status = 9 and cwl.work_category = 2 and cwl.work_status = 9 and ccl.operator_name != '系统自动确定' and ccl.operator_id != ? ", "0").
|
Where("cast_work.status = 9 and cwl.work_category = 2 and cwl.work_status = 9 and ccl.operator_name != '系统自动确定'").
|
||||||
Where("cast_work.submit_time <= ?", req.Date+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.Date+" 23:59:59").
|
||||||
Where("cwl.deleted_at = 0 and ccl.deleted_at = 0 and cast_work.deleted_at = 0").
|
Where("cwl.deleted_at = 0 and ccl.deleted_at = 0 and cast_work.deleted_at = 0").
|
||||||
Count(&data.ArtistConfirmVideoCount)
|
Count(&data.ArtistConfirmVideoCount)
|
||||||
@ -1173,7 +1185,7 @@ func MetricsOperatingStatus(req *bundle.MetricsOperatingStatusReq) (data *bundle
|
|||||||
app.ModuleClients.BundleDB.Model(model.CastWork{}).
|
app.ModuleClients.BundleDB.Model(model.CastWork{}).
|
||||||
Joins("left join cast_work_log cwl on cwl.work_uuid = cast_work.uuid").
|
Joins("left join cast_work_log cwl on cwl.work_uuid = cast_work.uuid").
|
||||||
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
|
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
|
||||||
Where("cast_work.status = 9 and cwl.work_category = 1 and cwl.work_status = 9 and ccl.operator_name != '系统自动确定' and ccl.operator_id != ?", "0").
|
Where("cast_work.status = 9 and cwl.work_category = 1 and cwl.work_status = 9 and ccl.operator_name != '系统自动确定'").
|
||||||
Where("cast_work.submit_time <= ?", req.Date+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.Date+" 23:59:59").
|
||||||
Where("cwl.deleted_at = 0 and ccl.deleted_at = 0 and cast_work.deleted_at = 0").
|
Where("cwl.deleted_at = 0 and ccl.deleted_at = 0 and cast_work.deleted_at = 0").
|
||||||
Count(&data.ArtistConfirmImageCount)
|
Count(&data.ArtistConfirmImageCount)
|
||||||
@ -1184,7 +1196,33 @@ func MetricsOperatingStatus(req *bundle.MetricsOperatingStatusReq) (data *bundle
|
|||||||
Where("cast_work.submit_time <= ?", req.Date+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.Date+" 23:59:59").
|
||||||
Where("cwl.deleted_at = 0 and ccl.deleted_at = 0 and cast_work.deleted_at = 0").
|
Where("cwl.deleted_at = 0 and ccl.deleted_at = 0 and cast_work.deleted_at = 0").
|
||||||
Count(&data.AutoConfirmImageCount)
|
Count(&data.AutoConfirmImageCount)
|
||||||
//======================数据分析暂时未做======================
|
//======================数据分析======================
|
||||||
|
var analysisStatistic = func(status int8) (i int64) {
|
||||||
|
app.ModuleClients.BundleDB.Table("cast_work_analysis").Where("work_analysis_status = ?", status).Where("deleted_at = 0 and submit_time <= ?", req.Date+" 23:59:59").Count(&i)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
data.ReviewingDataAnalysisCount = analysisStatistic(2)
|
||||||
|
data.RejectDataAnalysisCount = analysisStatistic(3)
|
||||||
|
data.WaitConfirmDataAnalysisCount = analysisStatistic(4)
|
||||||
|
data.PendingUploadDataAnalysisCount = analysisStatistic(6)
|
||||||
|
data.UploadSuccessDataAnalysisCount = analysisStatistic(7)
|
||||||
|
data.UploadFailedDataAnalysisCount = analysisStatistic(5)
|
||||||
|
|
||||||
|
app.ModuleClients.BundleDB.Table("cast_work_analysis").
|
||||||
|
Joins("left join cast_cost_analysis_log ccal on ccal.analysis_uuid = cast_work_analysis.uuid AND ccal.deleted_at = 0").
|
||||||
|
Where("cast_work_analysis.work_analysis_status in ?", []int{6, 7}).
|
||||||
|
Where("cast_work_analysis.deleted_at = 0").
|
||||||
|
Where("ccal.operator_name != '系统自动确定'").
|
||||||
|
Where("cast_work_analysis.submit_time <= ?", req.Date+" 23:59:59").
|
||||||
|
Count(&data.ArtistConfirmDataAnalysisCount)
|
||||||
|
app.ModuleClients.BundleDB.Table("cast_work_analysis").
|
||||||
|
Joins("left join cast_cost_analysis_log ccal on ccal.analysis_uuid = cast_work_analysis.uuid AND ccal.deleted_at = 0").
|
||||||
|
Where("cast_work_analysis.work_analysis_status in ?", []int{6, 7}).
|
||||||
|
Where("cast_work_analysis.deleted_at = 0").
|
||||||
|
Where("ccal.operator_name = '系统自动确定'").
|
||||||
|
Where("cast_work_analysis.submit_time <= ?", req.Date+" 23:59:59").
|
||||||
|
Count(&data.AutoConfirmDataAnalysisCount)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1279,40 +1317,69 @@ func MetricsArtistAccountExport(req *bundle.MetricsArtistAccountExportReq) (*bun
|
|||||||
var start time.Time
|
var start time.Time
|
||||||
var end time.Time
|
var end time.Time
|
||||||
var err error
|
var err error
|
||||||
if req.Month != "" {
|
|
||||||
t, err := time.Parse("2006-01", req.Month)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
start = datetime.BeginOfMonth(t)
|
|
||||||
end = datetime.EndOfMonth(t)
|
|
||||||
} else {
|
|
||||||
start = time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC) // Unix 时间戳起始时间
|
|
||||||
end = time.Date(2099, 12, 31, 23, 59, 59, 0, time.UTC) // 设置一个很远的未来日期
|
|
||||||
}
|
|
||||||
subQuery := app.ModuleClients.BundleDB.Table("cast_media_account").
|
subQuery := app.ModuleClients.BundleDB.Table("cast_media_account").
|
||||||
Select("artist_uuid,any_value(artist_name) as artist_name,any_value(created_at) as created_at").
|
Select("artist_uuid,any_value(artist_name) as artist_name,any_value(created_at) as created_at").
|
||||||
Group("artist_uuid").
|
Group("artist_uuid").
|
||||||
Where("created_at >= ?", start.Unix()).Where("created_at <= ?", end.Unix()).
|
Where("deleted_at = 0 and expired != 2")
|
||||||
Where("deleted_at = 0")
|
//如果选择了月份
|
||||||
|
if len(req.Month) > 0 {
|
||||||
|
// 构建多个月份的时间范围条件(使用 OR 连接)
|
||||||
|
var conditions []string
|
||||||
|
var args []interface{}
|
||||||
|
for _, month := range req.Month {
|
||||||
|
t, err := time.Parse("2006-01", month)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
start = datetime.BeginOfMonth(t)
|
||||||
|
end = datetime.EndOfMonth(t)
|
||||||
|
// 为每个月添加时间范围条件
|
||||||
|
conditions = append(conditions, "(created_at >= ? AND created_at <= ?)")
|
||||||
|
args = append(args, start.Unix(), end.Unix())
|
||||||
|
}
|
||||||
|
// 使用 OR 连接所有月份条件
|
||||||
|
if len(conditions) > 0 {
|
||||||
|
subQuery = subQuery.Where(strings.Join(conditions, " OR "), args...)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
start = time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC) // Unix 时间戳起始时间
|
||||||
|
end = time.Date(2099, 12, 31, 23, 59, 59, 0, time.UTC) // 设置一个很远的未来日期
|
||||||
|
subQuery = subQuery.Where("created_at >= ?", start.Unix()).
|
||||||
|
Where("created_at <= ?", end.Unix())
|
||||||
|
}
|
||||||
|
|
||||||
query := app.ModuleClients.BundleDB.Table("( ? ) cma", subQuery).
|
query := app.ModuleClients.BundleDB.Table("( ? ) cma", subQuery).
|
||||||
Select(`tiktok.platform_user_id as tiktok_account,
|
Select(`tiktok.platform_user_id as tiktok_account,
|
||||||
tiktok.platform_user_name as tiktok_nickname,
|
tiktok.platform_user_name as tiktok_nickname,
|
||||||
|
tiktok_auth.auth_status as tiktok_auth_status,
|
||||||
dm.platform_user_id as dm_account,
|
dm.platform_user_id as dm_account,
|
||||||
dm.platform_user_name as dm_nickname,
|
dm.platform_user_name as dm_nickname,
|
||||||
|
dm_auth.auth_status as dm_auth_status,
|
||||||
ins.platform_user_id as instagram_account,
|
ins.platform_user_id as instagram_account,
|
||||||
ins.platform_user_name as instagram_nickname,
|
ins.platform_user_name as instagram_nickname,
|
||||||
|
ins_auth.auth_status as ins_auth_status,
|
||||||
|
youtube.platform_user_id as youtube_account,
|
||||||
|
youtube.platform_user_name as youtube_nickname,
|
||||||
|
youtube_auth.auth_status as youtube_auth_status,
|
||||||
|
bluesky.platform_user_id as bluesky_account,
|
||||||
|
bluesky.platform_user_name as bluesky_nickname,
|
||||||
|
bluesky_auth.auth_status as bluesky_auth_status,
|
||||||
cma.artist_name,
|
cma.artist_name,
|
||||||
bor.customer_num as user_num
|
bor.customer_num as user_num
|
||||||
`).
|
`).
|
||||||
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 1 and deleted_at = 0) tiktok on tiktok.artist_uuid = cma.artist_uuid`).
|
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 1 and deleted_at = 0 and expired != 2) tiktok on tiktok.artist_uuid = cma.artist_uuid`).
|
||||||
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 4 and deleted_at = 0) dm on dm.artist_uuid = cma.artist_uuid`).
|
Joins(`left join (Select * from cast_media_auth where platform_id = 1 and deleted_at = 0 ) tiktok_auth on tiktok_auth.user_id = tiktok.user_id`).
|
||||||
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 3 and deleted_at = 0) ins on ins.artist_uuid = cma.artist_uuid`).
|
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 4 and deleted_at = 0 and expired != 2) dm on dm.artist_uuid = cma.artist_uuid`).
|
||||||
|
Joins(`left join (Select * from cast_media_auth where platform_id = 4 and deleted_at = 0) dm_auth on dm_auth.user_id = dm.user_id`).
|
||||||
|
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 3 and deleted_at = 0 and expired != 2) ins on ins.artist_uuid = cma.artist_uuid`).
|
||||||
|
Joins(`left join (Select * from cast_media_auth where platform_id = 3 and deleted_at = 0) ins_auth on ins_auth.user_id = ins.user_id`).
|
||||||
|
Joins(`left join (Select * from cast_media_account where platform_id = 2 and deleted_at = 0 and expired != 2) youtube on youtube.artist_uuid = cma.artist_uuid`).
|
||||||
|
Joins(`left join (Select * from cast_media_auth where platform_id = 2 and deleted_at = 0) youtube_auth on youtube_auth.user_id = youtube.user_id`).
|
||||||
|
Joins(`left join (Select * from cast_media_account where platform_id = 5 and deleted_at = 0 and expired != 2) bluesky on bluesky.artist_uuid = cma.artist_uuid`).
|
||||||
|
Joins(`left join (Select * from cast_media_auth where platform_id = 5 and deleted_at = 0) bluesky_auth on bluesky_auth.user_id = bluesky.user_id`).
|
||||||
Joins(`left join bundle_order_records bor on bor.customer_id COLLATE utf8mb4_general_ci= cma.artist_uuid COLLATE utf8mb4_general_ci`).
|
Joins(`left join bundle_order_records bor on bor.customer_id COLLATE utf8mb4_general_ci= cma.artist_uuid COLLATE utf8mb4_general_ci`).
|
||||||
Where("bor.deleted_at is null")
|
Where("bor.deleted_at is null")
|
||||||
if req.Month != "" {
|
|
||||||
query = query.Where("cma.created_at >= ?", start.Unix()).Where("cma.created_at <= ?", end.Unix())
|
|
||||||
}
|
|
||||||
err = query.Find(&data.Data).Error
|
err = query.Find(&data.Data).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -1323,7 +1390,7 @@ func MetricsArtistAccountExport(req *bundle.MetricsArtistAccountExportReq) (*bun
|
|||||||
func MetricsVideoSubmitExport(req *bundle.MetricsVideoSubmitExportReq) (result *bundle.MetricsVideoSubmitExportResp, err error) {
|
func MetricsVideoSubmitExport(req *bundle.MetricsVideoSubmitExportReq) (result *bundle.MetricsVideoSubmitExportResp, err error) {
|
||||||
result = &bundle.MetricsVideoSubmitExportResp{}
|
result = &bundle.MetricsVideoSubmitExportResp{}
|
||||||
var query *gorm.DB
|
var query *gorm.DB
|
||||||
if req.Month == "" {
|
if len(req.Month) == 0 {
|
||||||
query = app.ModuleClients.BundleDB.Table("cast_work AS cw").
|
query = app.ModuleClients.BundleDB.Table("cast_work AS cw").
|
||||||
Select(`cw.artist_name ,
|
Select(`cw.artist_name ,
|
||||||
cw.title as video_title,
|
cw.title as video_title,
|
||||||
@ -1335,25 +1402,64 @@ func MetricsVideoSubmitExport(req *bundle.MetricsVideoSubmitExportReq) (result *
|
|||||||
Joins("left join (select created_at,work_uuid from cast_work_platform_info cwi where cwi.platform_id = 4) dm on dm.work_uuid = cw.uuid").
|
Joins("left join (select created_at,work_uuid from cast_work_platform_info cwi where cwi.platform_id = 4) dm on dm.work_uuid = cw.uuid").
|
||||||
Joins("left join (select created_at,work_uuid from cast_work_platform_info cwi where cwi.platform_id = 3) ins on ins.work_uuid = cw.uuid").
|
Joins("left join (select created_at,work_uuid from cast_work_platform_info cwi where cwi.platform_id = 3) ins on ins.work_uuid = cw.uuid").
|
||||||
Joins("left join bundle_order_records bor on bor.customer_id COLLATE utf8mb4_general_ci = cw.artist_uuid COLLATE utf8mb4_general_ci").
|
Joins("left join bundle_order_records bor on bor.customer_id COLLATE utf8mb4_general_ci = cw.artist_uuid COLLATE utf8mb4_general_ci").
|
||||||
Where("(tiktok.created_at is not null or dm.created_at is not null or ins.created_at is not null) and cw.deleted_at = 0 and bor.deleted_at is null").
|
Where("(tiktok.created_at is not null or dm.created_at is not null or ins.created_at is not null) and cw.deleted_at = 0 and bor.deleted_at is null and cw.origin_uuid = ''").
|
||||||
Order("cw.artist_name")
|
Order("cw.artist_name")
|
||||||
} else {
|
} else {
|
||||||
|
// 构建多个月份的时间范围参数
|
||||||
t, err := time.Parse("2006-01", req.Month)
|
var timeRanges []struct {
|
||||||
if err != nil {
|
Start int64
|
||||||
return nil, err
|
End int64
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, month := range req.Month {
|
||||||
|
t, err := time.Parse("2006-01", month)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
start := datetime.BeginOfMonth(t)
|
||||||
|
end := datetime.EndOfMonth(t)
|
||||||
|
timeRanges = append(timeRanges, struct {
|
||||||
|
Start int64
|
||||||
|
End int64
|
||||||
|
}{Start: start.Unix(), End: end.Unix()})
|
||||||
|
}
|
||||||
|
// 构建时间筛选 SQL 条件的辅助函数
|
||||||
|
buildTimeFilterSQL := func(tableAlias string) (string, []interface{}) {
|
||||||
|
if len(timeRanges) == 0 {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
var conditions []string
|
||||||
|
var args []interface{}
|
||||||
|
for _, tr := range timeRanges {
|
||||||
|
// 明确指定表别名,避免字段歧义
|
||||||
|
conditions = append(conditions, fmt.Sprintf("(%s.created_at >= ? AND %s.created_at <= ?)", tableAlias, tableAlias))
|
||||||
|
args = append(args, tr.Start, tr.End)
|
||||||
|
}
|
||||||
|
return "(" + strings.Join(conditions, " OR ") + ")", args
|
||||||
}
|
}
|
||||||
start := datetime.BeginOfMonth(t)
|
|
||||||
end := datetime.EndOfMonth(t)
|
|
||||||
query = app.ModuleClients.BundleDB.Table("cast_work AS cw").
|
query = app.ModuleClients.BundleDB.Table("cast_work AS cw").
|
||||||
Select(`cw.artist_name, cw.title AS video_title, tiktok.created_at AS tiktok_upload_time, dm.created_at AS dm_upload_time, ins.created_at AS instagram_upload_time, bor.customer_num AS user_num`).
|
Select(`cw.artist_name, cw.title AS video_title, tiktok.created_at AS tiktok_upload_time, dm.created_at AS dm_upload_time, ins.created_at AS instagram_upload_time, bor.customer_num AS user_num`)
|
||||||
Joins(`LEFT JOIN cast_work_platform_info tiktok ON tiktok.work_uuid = cw.uuid AND tiktok.platform_id = 1 AND tiktok.created_at >= ? AND tiktok.created_at <= ?`, start.Unix(), end.Unix()).
|
|
||||||
Joins(`LEFT JOIN cast_work_platform_info dm ON dm.work_uuid = cw.uuid AND dm.platform_id = 4 AND dm.created_at >= ? AND dm.created_at <= ?`, start.Unix(), end.Unix()).
|
// 为每个平台添加时间筛选条件
|
||||||
Joins(`LEFT JOIN cast_work_platform_info ins ON ins.work_uuid = cw.uuid AND ins.platform_id = 3 AND ins.created_at >= ? AND ins.created_at <= ?`, start.Unix(), end.Unix()).
|
if len(timeRanges) > 0 {
|
||||||
Joins(`LEFT JOIN bundle_order_records bor ON bor.customer_id COLLATE utf8mb4_general_ci = cw.artist_uuid COLLATE utf8mb4_general_ci AND bor.deleted_at IS NULL`).
|
// TikTok JOIN
|
||||||
|
tiktokTimeSQL, tiktokArgs := buildTimeFilterSQL("tiktok")
|
||||||
|
joinSQL := `LEFT JOIN cast_work_platform_info tiktok ON tiktok.work_uuid = cw.uuid AND tiktok.platform_id = 1 AND ` + tiktokTimeSQL
|
||||||
|
query = query.Joins(joinSQL, tiktokArgs...)
|
||||||
|
|
||||||
|
// DM JOIN
|
||||||
|
dmTimeSQL, dmArgs := buildTimeFilterSQL("dm")
|
||||||
|
joinSQL = `LEFT JOIN cast_work_platform_info dm ON dm.work_uuid = cw.uuid AND dm.platform_id = 4 AND ` + dmTimeSQL
|
||||||
|
query = query.Joins(joinSQL, dmArgs...)
|
||||||
|
|
||||||
|
// Instagram JOIN
|
||||||
|
insTimeSQL, insArgs := buildTimeFilterSQL("ins")
|
||||||
|
joinSQL = `LEFT JOIN cast_work_platform_info ins ON ins.work_uuid = cw.uuid AND ins.platform_id = 3 AND ` + insTimeSQL
|
||||||
|
query = query.Joins(joinSQL, insArgs...)
|
||||||
|
}
|
||||||
|
query = query.Joins(`LEFT JOIN bundle_order_records bor ON bor.customer_id COLLATE utf8mb4_general_ci = cw.artist_uuid COLLATE utf8mb4_general_ci AND bor.deleted_at IS NULL`).
|
||||||
Where(`cw.deleted_at = 0 AND (tiktok.created_at IS NOT NULL OR dm.created_at IS NOT NULL OR ins.created_at IS NOT NULL)`).
|
Where(`cw.deleted_at = 0 AND (tiktok.created_at IS NOT NULL OR dm.created_at IS NOT NULL OR ins.created_at IS NOT NULL)`).
|
||||||
Order("cw.artist_name")
|
Order("cw.artist_name")
|
||||||
|
|
||||||
}
|
}
|
||||||
err = query.Find(&result.Data).Error
|
err = query.Find(&result.Data).Error
|
||||||
return
|
return
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/shopspring/decimal"
|
||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
"micro-bundle/pb/bundle"
|
||||||
"micro-bundle/pkg/app"
|
"micro-bundle/pkg/app"
|
||||||
@ -127,6 +128,26 @@ func UpdateOrderRecordByOrderNO(orderRecord *model.BundleOrderRecords) (res *bun
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tempRecord := new(model.BundleOrderRecords)
|
||||||
|
if err := app.ModuleClients.BundleDB.Where("deleted_at is null and order_no = ?", orderRecord.OrderNo).First(&tempRecord).Error; err != nil {
|
||||||
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
return nil, errors.New("订单记录不存在")
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("查询订单失败: %v", err)
|
||||||
|
}
|
||||||
|
if orderRecord.Status == 2 && tempRecord.AmountType == 2 && tempRecord.TotalAmount > 0 {
|
||||||
|
// 当回调支付成功,币种是美元,且订单金额大于0,计算美元手续费:订单金额*0.019(四舍五入保留两位小数字)+0.1
|
||||||
|
amount := decimal.NewFromFloat32(tempRecord.TotalAmount)
|
||||||
|
rate, _ := decimal.NewFromString("0.019")
|
||||||
|
fee := amount.Mul(rate)
|
||||||
|
// 4. 四舍五入保留两位小数
|
||||||
|
feeRounded := fee.Round(2)
|
||||||
|
addition, _ := decimal.NewFromString("0.1")
|
||||||
|
result := feeRounded.Add(addition)
|
||||||
|
valueAdd.HandlingFee = result.String()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
||||||
@ -518,6 +539,7 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
|
|||||||
Amount: record.Amount,
|
Amount: record.Amount,
|
||||||
CustomerId: customerID,
|
CustomerId: customerID,
|
||||||
PayTime: record.PayTime,
|
PayTime: record.PayTime,
|
||||||
|
InviterId: record.InviterID,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 聚合子订单
|
// 聚合子订单
|
||||||
@ -807,6 +829,19 @@ func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTime
|
|||||||
PayStatus: int(req.PaymentStatus),
|
PayStatus: int(req.PaymentStatus),
|
||||||
SerialNumber: req.SerialNumber,
|
SerialNumber: req.SerialNumber,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.PaymentStatus == 2 && existing.CurrencyType == 2 && existing.PayAmount > 0 {
|
||||||
|
// 当回调支付成功,币种是美元,且订单金额大于0,计算美元手续费:订单金额*0.019(四舍五入保留两位小数字)+0.1
|
||||||
|
amount := decimal.NewFromFloat32(existing.PayAmount)
|
||||||
|
rate, _ := decimal.NewFromString("0.019")
|
||||||
|
fee := amount.Mul(rate)
|
||||||
|
// 4. 四舍五入保留两位小数
|
||||||
|
feeRounded := fee.Round(2)
|
||||||
|
addition, _ := decimal.NewFromString("0.1")
|
||||||
|
result := feeRounded.Add(addition)
|
||||||
|
updates.HandlingFee = result.String()
|
||||||
|
}
|
||||||
|
|
||||||
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
|
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
|
||||||
return nil, fmt.Errorf("更新对账单失败: %v", err)
|
return nil, fmt.Errorf("更新对账单失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,7 +125,7 @@ func RunIncrementalTaskBalanceSync() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(validArtists) == 0 {
|
if len(validArtists) == 0 {
|
||||||
fmt.Println("增量同步:无有效艺人数据")
|
fmt.Println("增量同步:无有效艺人数据")
|
||||||
return nil
|
return nil
|
||||||
@ -134,7 +134,7 @@ func RunIncrementalTaskBalanceSync() error {
|
|||||||
// 构造待插入的 TaskBalance 列表(仅包含不存在的记录)
|
// 构造待插入的 TaskBalance 列表(仅包含不存在的记录)
|
||||||
tasks := make([]model.TaskBalance, 0)
|
tasks := make([]model.TaskBalance, 0)
|
||||||
skippedCount := 0
|
skippedCount := 0
|
||||||
|
|
||||||
for _, a := range validArtists {
|
for _, a := range validArtists {
|
||||||
// 根据 user_id + order_uuid 获取 BundleBalance 明细
|
// 根据 user_id + order_uuid 获取 BundleBalance 明细
|
||||||
var bb model.BundleBalance
|
var bb model.BundleBalance
|
||||||
@ -159,7 +159,7 @@ func RunIncrementalTaskBalanceSync() error {
|
|||||||
Count(&existingCount).Error; err != nil {
|
Count(&existingCount).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if existingCount > 0 {
|
if existingCount > 0 {
|
||||||
// 记录已存在,跳过
|
// 记录已存在,跳过
|
||||||
skippedCount++
|
skippedCount++
|
||||||
@ -334,8 +334,8 @@ inner join (
|
|||||||
v.MonthlyIncreaseLimitImageNumber = v.MonthlyIncreaseLimitImageNumber - v.MonthlyIncreaseLimitImageConsumptionNumber + cal(v.IncreaseLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
v.MonthlyIncreaseLimitImageNumber = v.MonthlyIncreaseLimitImageNumber - v.MonthlyIncreaseLimitImageConsumptionNumber + cal(v.IncreaseLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
||||||
v.MonthlyBundleLimitExpiredDataAnalysisNumber = cal(v.BundleLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
v.MonthlyBundleLimitExpiredDataAnalysisNumber = cal(v.BundleLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
||||||
v.MonthlyIncreaseLimitExpiredDataAnalysisNumber = cal(v.IncreaseLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
v.MonthlyIncreaseLimitExpiredDataAnalysisNumber = cal(v.IncreaseLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
||||||
v.MonthlyBundleLimitDataAnalysisNumber = v.MonthlyBundleLimitDataAnalysisNumber - v.MonthlyBundleLimitDataAnalysisConsumptionNumber + cal(v.BundleLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
v.MonthlyBundleLimitDataAnalysisNumber = v.MonthlyBundleLimitDataAnalysisNumber - v.MonthlyBundleLimitDataAnalysisConsumptionNumber + cal(v.BundleLimitDataAnalysisNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
||||||
v.MonthlyIncreaseLimitDataAnalysisNumber = v.MonthlyIncreaseLimitDataAnalysisNumber - v.MonthlyIncreaseLimitDataAnalysisConsumptionNumber + cal(v.IncreaseLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
v.MonthlyIncreaseLimitDataAnalysisNumber = v.MonthlyIncreaseLimitDataAnalysisNumber - v.MonthlyIncreaseLimitDataAnalysisConsumptionNumber + cal(v.IncreaseLimitDataAnalysisNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
||||||
// 重置单月消耗数量
|
// 重置单月消耗数量
|
||||||
v.MonthlyBundleVideoConsumptionNumber = 0
|
v.MonthlyBundleVideoConsumptionNumber = 0
|
||||||
v.MonthlyIncreaseVideoConsumptionNumber = 0
|
v.MonthlyIncreaseVideoConsumptionNumber = 0
|
||||||
|
|||||||
@ -464,9 +464,9 @@ active_windows AS (
|
|||||||
bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number,
|
bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number,
|
||||||
rn.name AS user_name
|
rn.name AS user_name
|
||||||
FROM ` + "`micro-account`.`user`" + ` u
|
FROM ` + "`micro-account`.`user`" + ` u
|
||||||
INNER JOIN ` + "`micro-account`.real_name" + ` rn ON rn.id = u.real_name_id AND rn.name IS NOT NULL
|
INNER JOIN ` + "`micro-account`.real_name" + ` rn ON rn.id = u.real_name_id AND rn.name IS NOT NULL AND rn.deleted_at = 0
|
||||||
INNER JOIN bundle_activate bc ON bc.user_id = u.id AND bc.activate = 2
|
INNER JOIN bundle_activate bc ON bc.user_id = u.id AND bc.activate = 2
|
||||||
INNER JOIN latest_bor bor ON bor.customer_id = u.id
|
INNER JOIN latest_bor bor ON bor.customer_id = u.id AND u.deleted_at = 0
|
||||||
INNER JOIN newest_month nm ON nm.user_id = u.id
|
INNER JOIN newest_month nm ON nm.user_id = u.id
|
||||||
INNER JOIN bundle_balance bb ON bb.user_id = u.id AND bb.order_uuid = bor.uuid AND bb.month = nm.month AND bb.deleted_at IS NULL
|
INNER JOIN bundle_balance bb ON bb.user_id = u.id AND bb.order_uuid = bor.uuid AND bb.month = nm.month AND bb.deleted_at IS NULL
|
||||||
WHERE u.deleted_at = 0
|
WHERE u.deleted_at = 0
|
||||||
@ -527,25 +527,25 @@ balance_sum AS (
|
|||||||
GROUP BY bb2.user_id
|
GROUP BY bb2.user_id
|
||||||
),
|
),
|
||||||
|
|
||||||
-- 6. 作品统计
|
-- 6. 作品统计(只统计 origin_uuid 为空的作品)
|
||||||
cw_agg AS (
|
cw_agg AS (
|
||||||
SELECT
|
SELECT
|
||||||
aw.user_id,
|
aw.user_id,
|
||||||
COUNT(CASE WHEN cw.work_category = 2 AND cw.deleted_at = 0 AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS uploaded_video_count,
|
COUNT(CASE WHEN cw.work_category = 2 AND cw.deleted_at = 0 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS uploaded_video_count,
|
||||||
COUNT(CASE WHEN cw.work_category = 1 AND cw.deleted_at = 0 AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS uploaded_post_count,
|
COUNT(CASE WHEN cw.work_category = 1 AND cw.deleted_at = 0 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS uploaded_post_count,
|
||||||
COUNT(CASE WHEN cw.work_category = 2 AND cw.cost = 1 AND cw.deleted_at = 0 AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS released_video_consumed,
|
COUNT(CASE WHEN cw.work_category = 2 AND cw.cost = 1 AND cw.deleted_at = 0 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS released_video_consumed,
|
||||||
COUNT(CASE WHEN cw.work_category = 1 AND cw.cost = 1 AND cw.deleted_at = 0 AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS released_post_consumed
|
COUNT(CASE WHEN cw.work_category = 1 AND cw.cost = 1 AND cw.deleted_at = 0 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS released_post_consumed
|
||||||
FROM active_windows aw
|
FROM active_windows aw
|
||||||
LEFT JOIN cast_work cw ON cw.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
|
LEFT JOIN cast_work cw ON cw.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
|
||||||
GROUP BY aw.user_id
|
GROUP BY aw.user_id
|
||||||
),
|
),
|
||||||
|
|
||||||
-- 7. 数据分析作品统计
|
-- 7. 数据分析作品统计(排除 work_analysis_status = 1 的数据分析)
|
||||||
cwa_agg AS (
|
cwa_agg AS (
|
||||||
SELECT
|
SELECT
|
||||||
aw.user_id,
|
aw.user_id,
|
||||||
COUNT(CASE WHEN cwa.deleted_at = 0 AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(aw.start_at) AND UNIX_TIMESTAMP(aw.expired_at) THEN 1 END) AS uploaded_data_count,
|
COUNT(CASE WHEN cwa.deleted_at = 0 AND (cwa.work_analysis_status IS NULL OR cwa.work_analysis_status != 1) AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(aw.start_at) AND UNIX_TIMESTAMP(aw.expired_at) THEN 1 END) AS uploaded_data_count,
|
||||||
COUNT(CASE WHEN cwa.cost = 1 AND cwa.deleted_at = 0 AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(aw.start_at) AND UNIX_TIMESTAMP(aw.expired_at) THEN 1 END) AS released_data_consumed
|
COUNT(CASE WHEN cwa.cost = 1 AND cwa.deleted_at = 0 AND (cwa.work_analysis_status IS NULL OR cwa.work_analysis_status != 1) AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(aw.start_at) AND UNIX_TIMESTAMP(aw.expired_at) THEN 1 END) AS released_data_consumed
|
||||||
FROM active_windows aw
|
FROM active_windows aw
|
||||||
LEFT JOIN cast_work_analysis cwa ON cwa.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
|
LEFT JOIN cast_work_analysis cwa ON cwa.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
|
||||||
GROUP BY aw.user_id
|
GROUP BY aw.user_id
|
||||||
@ -810,49 +810,49 @@ func GetPendingUploadBreakdownBySubNums(subNums []string, page int, pageSize int
|
|||||||
" FROM cast_work cwv\n" +
|
" FROM cast_work cwv\n" +
|
||||||
" JOIN cast_work_extra cwev ON cwev.work_uuid = cwv.uuid AND cwev.deleted_at = 0\n" +
|
" JOIN cast_work_extra cwev ON cwev.work_uuid = cwv.uuid AND cwev.deleted_at = 0\n" +
|
||||||
" WHERE cwv.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
" WHERE cwv.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||||
" AND cwv.deleted_at = 0 AND cwv.work_category = 2 AND cwv.cost = 1 AND cwv.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwev.cost_type = 1\n" +
|
" AND cwv.deleted_at = 0 AND cwv.work_category = 2 AND cwv.cost = 1 AND (cwv.origin_uuid = '' OR cwv.origin_uuid IS NULL) AND cwv.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwev.cost_type = 1\n" +
|
||||||
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 2 AND cwe.cost_type = 1 THEN cw.uuid END), 0) AS pending_bundle_video_count,\n" +
|
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 2 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cwe.cost_type = 1 THEN cw.uuid END), 0) AS pending_bundle_video_count,\n" +
|
||||||
" ((COALESCE(lbb.total_increase_video, 0) + bb.manual_video_number - bb.manual_video_consumption_number) -\n" +
|
" ((COALESCE(lbb.total_increase_video, 0) + bb.manual_video_number - bb.manual_video_consumption_number) -\n" +
|
||||||
" COALESCE((\n" +
|
" COALESCE((\n" +
|
||||||
" SELECT COUNT(DISTINCT cwv.uuid)\n" +
|
" SELECT COUNT(DISTINCT cwv.uuid)\n" +
|
||||||
" FROM cast_work cwv\n" +
|
" FROM cast_work cwv\n" +
|
||||||
" JOIN cast_work_extra cwev ON cwev.work_uuid = cwv.uuid AND cwev.deleted_at = 0\n" +
|
" JOIN cast_work_extra cwev ON cwev.work_uuid = cwv.uuid AND cwev.deleted_at = 0\n" +
|
||||||
" WHERE cwv.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
" WHERE cwv.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||||
" AND cwv.deleted_at = 0 AND cwv.work_category = 2 AND cwv.cost = 1 AND cwv.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwev.cost_type = 2\n" +
|
" AND cwv.deleted_at = 0 AND cwv.work_category = 2 AND cwv.cost = 1 AND (cwv.origin_uuid = '' OR cwv.origin_uuid IS NULL) AND cwv.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwev.cost_type = 2\n" +
|
||||||
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 2 AND cwe.cost_type = 2 THEN cw.uuid END), 0)) AS pending_increase_video_count,\n" +
|
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 2 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cwe.cost_type = 2 THEN cw.uuid END), 0)) AS pending_increase_video_count,\n" +
|
||||||
" (COALESCE(lbb.total_bundle_image, 0) - COALESCE((\n" +
|
" (COALESCE(lbb.total_bundle_image, 0) - COALESCE((\n" +
|
||||||
" SELECT COUNT(DISTINCT cwp.uuid)\n" +
|
" SELECT COUNT(DISTINCT cwp.uuid)\n" +
|
||||||
" FROM cast_work cwp\n" +
|
" FROM cast_work cwp\n" +
|
||||||
" JOIN cast_work_extra cwep ON cwep.work_uuid = cwp.uuid AND cwep.deleted_at = 0\n" +
|
" JOIN cast_work_extra cwep ON cwep.work_uuid = cwp.uuid AND cwep.deleted_at = 0\n" +
|
||||||
" WHERE cwp.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
" WHERE cwp.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||||
" AND cwp.deleted_at = 0 AND cwp.work_category = 1 AND cwp.cost = 1 AND cwp.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwep.cost_type = 1\n" +
|
" AND cwp.deleted_at = 0 AND cwp.work_category = 1 AND cwp.cost = 1 AND (cwp.origin_uuid = '' OR cwp.origin_uuid IS NULL) AND cwp.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwep.cost_type = 1\n" +
|
||||||
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 1 AND cwe.cost_type = 1 THEN cw.uuid END), 0) AS pending_bundle_post_count,\n" +
|
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 1 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cwe.cost_type = 1 THEN cw.uuid END), 0) AS pending_bundle_post_count,\n" +
|
||||||
" ((COALESCE(lbb.total_increase_image, 0) + bb.manual_image_number - bb.manual_image_consumption_number) -\n" +
|
" ((COALESCE(lbb.total_increase_image, 0) + bb.manual_image_number - bb.manual_image_consumption_number) -\n" +
|
||||||
" COALESCE((\n" +
|
" COALESCE((\n" +
|
||||||
" SELECT COUNT(DISTINCT cwp.uuid)\n" +
|
" SELECT COUNT(DISTINCT cwp.uuid)\n" +
|
||||||
" FROM cast_work cwp\n" +
|
" FROM cast_work cwp\n" +
|
||||||
" JOIN cast_work_extra cwep ON cwep.work_uuid = cwp.uuid AND cwep.deleted_at = 0\n" +
|
" JOIN cast_work_extra cwep ON cwep.work_uuid = cwp.uuid AND cwep.deleted_at = 0\n" +
|
||||||
" WHERE cwp.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
" WHERE cwp.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||||
" AND cwp.deleted_at = 0 AND cwp.work_category = 1 AND cwp.cost = 1 AND cwp.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwep.cost_type = 2\n" +
|
" AND cwp.deleted_at = 0 AND cwp.work_category = 1 AND cwp.cost = 1 AND (cwp.origin_uuid = '' OR cwp.origin_uuid IS NULL) AND cwp.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwep.cost_type = 2\n" +
|
||||||
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 1 AND cwe.cost_type = 2 THEN cw.uuid END), 0)) AS pending_increase_post_count,\n" +
|
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 1 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cwe.cost_type = 2 THEN cw.uuid END), 0)) AS pending_increase_post_count,\n" +
|
||||||
" (COALESCE(lbb.total_bundle_data, 0) - COALESCE((\n" +
|
" (COALESCE(lbb.total_bundle_data, 0) - COALESCE((\n" +
|
||||||
" SELECT COUNT(DISTINCT ca.uuid)\n" +
|
" SELECT COUNT(DISTINCT ca.uuid)\n" +
|
||||||
" FROM cast_work_analysis ca\n" +
|
" FROM cast_work_analysis ca\n" +
|
||||||
" JOIN cast_work_analysis_extra cae ON cae.analysis_uuid = ca.uuid AND cae.deleted_at = 0\n" +
|
" JOIN cast_work_analysis_extra cae ON cae.analysis_uuid = ca.uuid AND cae.deleted_at = 0\n" +
|
||||||
" WHERE ca.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
" WHERE ca.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||||
" AND ca.deleted_at = 0 AND ca.cost = 1 AND ca.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at) AND cae.cost_type = 1\n" +
|
" AND ca.deleted_at = 0 AND ca.cost = 1 AND (ca.work_analysis_status IS NULL OR ca.work_analysis_status != 1) AND ca.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at) AND cae.cost_type = 1\n" +
|
||||||
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN cwae.cost_type = 1 THEN cwa.uuid END), 0) AS pending_bundle_data_count,\n" +
|
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN (cwa.work_analysis_status IS NULL OR cwa.work_analysis_status != 1) AND cwae.cost_type = 1 THEN cwa.uuid END), 0) AS pending_bundle_data_count,\n" +
|
||||||
" ((COALESCE(lbb.total_increase_data, 0) + bb.manual_data_analysis_number - bb.manual_data_analysis_consumption_number) -\n" +
|
" ((COALESCE(lbb.total_increase_data, 0) + bb.manual_data_analysis_number - bb.manual_data_analysis_consumption_number) -\n" +
|
||||||
" COALESCE((\n" +
|
" COALESCE((\n" +
|
||||||
" SELECT COUNT(DISTINCT ca.uuid)\n" +
|
" SELECT COUNT(DISTINCT ca.uuid)\n" +
|
||||||
" FROM cast_work_analysis ca\n" +
|
" FROM cast_work_analysis ca\n" +
|
||||||
" JOIN cast_work_analysis_extra cae ON cae.analysis_uuid = ca.uuid AND cae.deleted_at = 0\n" +
|
" JOIN cast_work_analysis_extra cae ON cae.analysis_uuid = ca.uuid AND cae.deleted_at = 0\n" +
|
||||||
" WHERE ca.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
" WHERE ca.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||||
" AND ca.deleted_at = 0 AND ca.cost = 1 AND ca.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at) AND cae.cost_type = 2\n" +
|
" AND ca.deleted_at = 0 AND ca.cost = 1 AND (ca.work_analysis_status IS NULL OR ca.work_analysis_status != 1) AND ca.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at) AND cae.cost_type = 2\n" +
|
||||||
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cwae.cost_type = 2 THEN cwa.uuid END), 0)) AS pending_increase_data_count,\n" +
|
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN (cwa.work_analysis_status IS NULL OR cwa.work_analysis_status != 1) AND cwae.cost_type = 2 THEN cwa.uuid END), 0)) AS pending_increase_data_count,\n" +
|
||||||
" GREATEST(\n" +
|
" GREATEST(\n" +
|
||||||
" (COALESCE(lbb.total_bundle_video, 0) + COALESCE(lbb.total_increase_video, 0) + bb.manual_video_number - bb.manual_video_consumption_number) -\n" +
|
" (COALESCE(lbb.total_bundle_video, 0) + COALESCE(lbb.total_increase_video, 0) + bb.manual_video_number - bb.manual_video_consumption_number) -\n" +
|
||||||
" COALESCE((SELECT COUNT(1) FROM cast_work cw2 WHERE cw2.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cw2.deleted_at = 0 AND cw2.work_category = 2 AND cw2.cost = 1 AND cw2.submit_time BETWEEN bb.start_at AND bb.expired_at), 0),\n" +
|
" COALESCE((SELECT COUNT(1) FROM cast_work cw2 WHERE cw2.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cw2.deleted_at = 0 AND cw2.work_category = 2 AND cw2.cost = 1 AND (cw2.origin_uuid = '' OR cw2.origin_uuid IS NULL) AND cw2.submit_time BETWEEN bb.start_at AND bb.expired_at), 0),\n" +
|
||||||
" 0) -\n" +
|
" 0) -\n" +
|
||||||
" (SELECT COUNT(1) FROM cast_video_script cvs WHERE CAST(u.id AS CHAR) COLLATE utf8mb4_general_ci = cvs.artist_uuid COLLATE utf8mb4_general_ci AND cvs.deleted_at = 0 AND cvs.created_at BETWEEN UNIX_TIMESTAMP(CONVERT_TZ(bb.start_at, '+00:00', '+00:00')) AND UNIX_TIMESTAMP(CONVERT_TZ(bb.expired_at, '+00:00', '+00:00'))) AS pending_video_script_count\n" +
|
" (SELECT COUNT(1) FROM cast_video_script cvs WHERE CAST(u.id AS CHAR) COLLATE utf8mb4_general_ci = cvs.artist_uuid COLLATE utf8mb4_general_ci AND cvs.deleted_at = 0 AND cvs.created_at BETWEEN UNIX_TIMESTAMP(CONVERT_TZ(bb.start_at, '+00:00', '+00:00')) AND UNIX_TIMESTAMP(CONVERT_TZ(bb.expired_at, '+00:00', '+00:00'))) AS pending_video_script_count\n" +
|
||||||
"FROM\n" +
|
"FROM\n" +
|
||||||
@ -861,16 +861,16 @@ func GetPendingUploadBreakdownBySubNums(subNums []string, page int, pageSize int
|
|||||||
" (SELECT customer_id, MAX(created_at) AS max_created_time FROM bundle_order_records WHERE status = 2 AND deleted_at IS NULL GROUP BY customer_id) AS bor2\n" +
|
" (SELECT customer_id, MAX(created_at) AS max_created_time FROM bundle_order_records WHERE status = 2 AND deleted_at IS NULL GROUP BY customer_id) AS bor2\n" +
|
||||||
" ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time\n" +
|
" ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time\n" +
|
||||||
"JOIN `micro-account`.user u ON u.id = bor1.customer_id AND u.deleted_at = 0\n" +
|
"JOIN `micro-account`.user u ON u.id = bor1.customer_id AND u.deleted_at = 0\n" +
|
||||||
"JOIN `micro-account`.real_name rn ON rn.id = u.real_name_id\n" +
|
"JOIN `micro-account`.real_name rn ON rn.id = u.real_name_id AND rn.deleted_at = 0\n" +
|
||||||
"JOIN bundle_activate bc ON bc.user_id = u.id AND bc.activate = 2\n" +
|
"JOIN bundle_activate bc ON bc.user_id = u.id AND bc.activate = 2\n" +
|
||||||
"JOIN bundle_balance bb ON bb.order_uuid COLLATE utf8mb4_general_ci = bor1.uuid COLLATE utf8mb4_general_ci AND bb.user_id = u.id\n" +
|
"JOIN bundle_balance bb ON bb.order_uuid COLLATE utf8mb4_general_ci = bor1.uuid COLLATE utf8mb4_general_ci AND bb.user_id = u.id AND u.deleted_at = 0\n" +
|
||||||
"JOIN\n" +
|
"JOIN\n" +
|
||||||
" (SELECT user_id, MAX(month) AS month FROM bundle_balance WHERE deleted_at IS NULL GROUP BY user_id) AS newest_month\n" +
|
" (SELECT user_id, MAX(month) AS month FROM bundle_balance WHERE deleted_at IS NULL GROUP BY user_id) AS newest_month\n" +
|
||||||
" ON bb.user_id = newest_month.user_id AND CAST(bb.month AS CHAR) COLLATE utf8mb4_general_ci = CAST(newest_month.month AS CHAR) COLLATE utf8mb4_general_ci\n" +
|
" ON bb.user_id = newest_month.user_id AND CAST(bb.month AS CHAR) COLLATE utf8mb4_general_ci = CAST(newest_month.month AS CHAR) COLLATE utf8mb4_general_ci\n" +
|
||||||
"LEFT JOIN latest_bundle_balance lbb ON lbb.user_id = u.id\n" +
|
"LEFT JOIN latest_bundle_balance lbb ON lbb.user_id = u.id AND u.deleted_at = 0\n" +
|
||||||
"LEFT JOIN cast_work cw ON cw.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cw.deleted_at = 0 AND cw.submit_time BETWEEN bb.start_at AND bb.expired_at\n" +
|
"LEFT JOIN cast_work cw ON cw.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cw.deleted_at = 0 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cw.submit_time BETWEEN bb.start_at AND bb.expired_at\n" +
|
||||||
"LEFT JOIN cast_work_extra cwe ON cwe.work_uuid = cw.uuid AND cwe.deleted_at = 0\n" +
|
"LEFT JOIN cast_work_extra cwe ON cwe.work_uuid = cw.uuid AND cwe.deleted_at = 0\n" +
|
||||||
"LEFT JOIN cast_work_analysis cwa ON cwa.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cwa.deleted_at = 0 AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at)\n" +
|
"LEFT JOIN cast_work_analysis cwa ON cwa.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cwa.deleted_at = 0 AND (cwa.work_analysis_status IS NULL OR cwa.work_analysis_status != 1) AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at)\n" +
|
||||||
"LEFT JOIN cast_work_analysis_extra cwae ON cwae.analysis_uuid = cwa.uuid AND cwae.deleted_at = 0\n" +
|
"LEFT JOIN cast_work_analysis_extra cwae ON cwae.analysis_uuid = cwa.uuid AND cwae.deleted_at = 0\n" +
|
||||||
"WHERE bor1.deleted_at IS NULL AND bor1.status = 2 AND DATE_ADD(UTC_TIMESTAMP(), INTERVAL 8 HOUR) BETWEEN bb.start_at AND bb.expired_at AND bor1.customer_num IN ?\n" +
|
"WHERE bor1.deleted_at IS NULL AND bor1.status = 2 AND DATE_ADD(UTC_TIMESTAMP(), INTERVAL 8 HOUR) BETWEEN bb.start_at AND bb.expired_at AND bor1.customer_num IN ?\n" +
|
||||||
"GROUP BY u.id, rn.name, u.tel_num, bor1.customer_num, bb.start_at, bb.expired_at, bb.manual_video_number, bb.manual_video_consumption_number, bb.manual_image_number, bb.manual_image_consumption_number, bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number, lbb.total_bundle_video, lbb.total_increase_video, lbb.total_bundle_image, lbb.total_increase_image, lbb.total_bundle_data, lbb.total_increase_data\n"
|
"GROUP BY u.id, rn.name, u.tel_num, bor1.customer_num, bb.start_at, bb.expired_at, bb.manual_video_number, bb.manual_video_consumption_number, bb.manual_image_number, bb.manual_image_consumption_number, bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number, lbb.total_bundle_video, lbb.total_increase_video, lbb.total_bundle_image, lbb.total_increase_image, lbb.total_bundle_data, lbb.total_increase_data\n"
|
||||||
@ -3271,3 +3271,67 @@ func CreateMissingTaskManagementRecords(validArtist []ValidArtistInfo) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateTaskWorkLogRequest 创建任务日志请求参数
|
||||||
|
type CreateTaskWorkLogRequest struct {
|
||||||
|
AssignRecordsUUID string `json:"assignRecordsUUID"` // 任务指派记录UUID(必填)
|
||||||
|
WorkUUID string `json:"workUUID"` // 任务作品UUID(必填)
|
||||||
|
Title string `json:"title"` // 任务作品标题
|
||||||
|
|
||||||
|
ArtistUUID string `json:"artistUUID"` // 任务艺人UUID
|
||||||
|
SubNum string `json:"subNum"` // 任务用户编号(必填)
|
||||||
|
TelNum string `json:"telNum"` // 任务用户手机号(必填)
|
||||||
|
ArtistName string `json:"artistName"` // 任务艺人名称
|
||||||
|
|
||||||
|
// 操作信息
|
||||||
|
OperationType int `json:"operationType"` // 任务操作类型 1:加任务 2:消耗任务 3:完成任务 4:任务过期(必填)
|
||||||
|
TaskType int `json:"taskType"` // 任务类型 1:视频 2:图片 3:数据分析(必填)
|
||||||
|
TaskCount int `json:"taskCount"` // 任务数量(必填)
|
||||||
|
Remark string `json:"remark"` // 任务备注
|
||||||
|
|
||||||
|
// 操作人信息
|
||||||
|
OperatorName string `json:"operatorName"` // 任务操作人姓名
|
||||||
|
OperatorNum string `json:"operatorNum"` // 任务操作人账号
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateTaskWorkLog 创建任务日志记录
|
||||||
|
func CreateTaskWorkLog(req *CreateTaskWorkLogRequest) error {
|
||||||
|
// 参数校验
|
||||||
|
if req == nil {
|
||||||
|
return commonErr.ReturnError(nil, "参数错误", "请求参数不能为空")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成日志UUID
|
||||||
|
workLogUUID := uuid.New().String()
|
||||||
|
|
||||||
|
// 获取当前时间戳(Unix时间戳,秒级)
|
||||||
|
now := int(time.Now().Unix())
|
||||||
|
|
||||||
|
// 构建日志记录
|
||||||
|
workLog := &model.TaskWorkLog{
|
||||||
|
WorkLogUUID: workLogUUID,
|
||||||
|
AssignRecordsUUID: req.AssignRecordsUUID,
|
||||||
|
WorkUUID: req.WorkUUID,
|
||||||
|
Title: req.Title,
|
||||||
|
ArtistUUID: req.ArtistUUID,
|
||||||
|
SubNum: req.SubNum,
|
||||||
|
TelNum: req.TelNum,
|
||||||
|
ArtistName: req.ArtistName,
|
||||||
|
OperationType: req.OperationType,
|
||||||
|
TaskType: req.TaskType,
|
||||||
|
TaskCount: req.TaskCount,
|
||||||
|
Remark: req.Remark,
|
||||||
|
OperatorName: req.OperatorName,
|
||||||
|
OperatorNum: req.OperatorNum,
|
||||||
|
OperationTime: now,
|
||||||
|
CreatedAt: now,
|
||||||
|
UpdatedAt: now,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 插入数据库
|
||||||
|
if err := app.ModuleClients.TaskBenchDB.Create(workLog).Error; err != nil {
|
||||||
|
return commonErr.ReturnError(err, "创建任务日志失败", "创建任务日志失败: ")
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@ -11,9 +11,12 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"micro-bundle/pkg/msg"
|
||||||
|
|
||||||
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
||||||
"github.com/jinzhu/copier"
|
"github.com/jinzhu/copier"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
|
"github.com/shopspring/decimal"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BundleExtend(req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse, error) {
|
func BundleExtend(req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse, error) {
|
||||||
@ -194,9 +197,16 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (*bundle.
|
|||||||
if data.Activate != 2 {
|
if data.Activate != 2 {
|
||||||
return nil, errors.New("套餐未激活")
|
return nil, errors.New("套餐未激活")
|
||||||
}
|
}
|
||||||
|
var IsExpired int32
|
||||||
|
if data.ExpiredAt.Before(time.Now()) {
|
||||||
|
IsExpired = msg.IsExpired //已过期
|
||||||
|
} else {
|
||||||
|
IsExpired = msg.NotExpired //未过期
|
||||||
|
}
|
||||||
result := &bundle.GetBundleBalanceByUserIdResp{
|
result := &bundle.GetBundleBalanceByUserIdResp{
|
||||||
OrderUUID: data.OrderUUID,
|
OrderUUID: data.OrderUUID,
|
||||||
BundleName: data.BundleName,
|
BundleName: data.BundleName,
|
||||||
|
BundleStatus: IsExpired,
|
||||||
PayTime: data.StartAt.UnixMilli(),
|
PayTime: data.StartAt.UnixMilli(),
|
||||||
ExpiredTime: data.ExpiredAt.UnixMilli(),
|
ExpiredTime: data.ExpiredAt.UnixMilli(),
|
||||||
PaymentAmount: data.PaymentAmount,
|
PaymentAmount: data.PaymentAmount,
|
||||||
@ -273,7 +283,7 @@ func CreateBundleBalance(req *bundle.CreateBundleBalanceReq) (*bundle.CreateBund
|
|||||||
data.ExpiredAt = time.Now()
|
data.ExpiredAt = time.Now()
|
||||||
userId, err := strconv.Atoi(addValues[0].CustomerID)
|
userId, err := strconv.Atoi(addValues[0].CustomerID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, errors.New("获取用户ID失败")
|
||||||
}
|
}
|
||||||
data.Month = time.Now().Format("2006-01")
|
data.Month = time.Now().Format("2006-01")
|
||||||
data.UserId = userId
|
data.UserId = userId
|
||||||
@ -492,11 +502,11 @@ func BundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.BundleBala
|
|||||||
PageSize: 99999,
|
PageSize: 99999,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, errors.New("余量列表数据失败")
|
||||||
}
|
}
|
||||||
prefixData, err := dao.BalanceExportPrefix()
|
prefixData, err := dao.BalanceExportPrefix()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, errors.New("获取前缀数据失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
var prefixMap = map[int32]model.BundleExportDto{}
|
var prefixMap = map[int32]model.BundleExportDto{}
|
||||||
@ -535,6 +545,14 @@ func BundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.BundleBala
|
|||||||
} else {
|
} else {
|
||||||
item.IncreaseVideoUnitPrice = float32(math.Round(float64(item.IncreaseAmount/float32(v.IncreaseVideoNumber))*100) / 100)
|
item.IncreaseVideoUnitPrice = float32(math.Round(float64(item.IncreaseAmount/float32(v.IncreaseVideoNumber))*100) / 100)
|
||||||
}
|
}
|
||||||
|
bundleUnitPrice := decimal.NewFromFloat32(item.BundleVideoUnitPrice)
|
||||||
|
increaseUnitPrice := decimal.NewFromFloat32(item.IncreaseVideoUnitPrice)
|
||||||
|
|
||||||
|
bundlePriceTotal := bundleUnitPrice.Mul(decimal.NewFromInt32(v.MonthBundleVideoConsumptionNumber))
|
||||||
|
increasePriceTotal := increaseUnitPrice.Mul(decimal.NewFromInt32(v.MonthIncreaseVideoConsumptionNumber))
|
||||||
|
|
||||||
|
item.MonthlyBundleVideoConsumptionPrice = bundlePriceTotal.StringFixed(2)
|
||||||
|
item.MonthlyIncreaseVideoConsumptionPrice = increasePriceTotal.StringFixed(2)
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
return &bundle.BundleBalanceExportResp{Total: int64(len(items)), Data: items}, nil
|
return &bundle.BundleBalanceExportResp{Total: int64(len(items)), Data: items}, nil
|
||||||
|
|||||||
@ -698,3 +698,13 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
|
|||||||
}
|
}
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 增加h5套餐列表
|
||||||
|
func QueryTheOrderSnapshotInformation(req *bundle.QueryTheOrderSnapshotInformationReq) (res *bundle.QueryTheOrderSnapshotInformationResp, err error) {
|
||||||
|
res = new(bundle.QueryTheOrderSnapshotInformationResp)
|
||||||
|
res, err = dao.QueryTheOrderSnapshotInformation(req)
|
||||||
|
if err != nil {
|
||||||
|
return res, errors.New("获取套餐列表失败")
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|||||||
@ -68,6 +68,8 @@ func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonRespons
|
|||||||
ExpirationTime: req.ExpirationTime,
|
ExpirationTime: req.ExpirationTime,
|
||||||
Language: req.Language,
|
Language: req.Language,
|
||||||
BundleOrderValueAdd: addRecords,
|
BundleOrderValueAdd: addRecords,
|
||||||
|
PlatformIds: req.PlatformIds,
|
||||||
|
InviterID: req.InviterId,
|
||||||
}
|
}
|
||||||
res, err = dao.CreateOrderRecord(orderRecord)
|
res, err = dao.CreateOrderRecord(orderRecord)
|
||||||
return
|
return
|
||||||
|
|||||||
@ -546,3 +546,22 @@ func AddHiddenTaskAssignee(taskAssignee string, taskAssigneeNum string) error {
|
|||||||
}
|
}
|
||||||
return dao.AddHiddenTaskAssignee(taskAssignee, taskAssigneeNum)
|
return dao.AddHiddenTaskAssignee(taskAssignee, taskAssigneeNum)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateTaskWorkLog 创建任务日志记录
|
||||||
|
// 用于记录任务操作日志,包括加任务、消耗任务、完成任务、任务过期等操作
|
||||||
|
func CreateTaskWorkLog(req *dao.CreateTaskWorkLogRequest) error {
|
||||||
|
// 参数校验已在 DAO 层完成,这里可以添加额外的业务逻辑校验
|
||||||
|
// 例如:校验操作类型是否合法、任务类型是否合法等
|
||||||
|
if req.OperationType < 1 || req.OperationType > 4 {
|
||||||
|
return commonErr.ReturnError(nil, "参数错误", "操作类型必须在1-4之间")
|
||||||
|
}
|
||||||
|
if req.TaskType < 1 || req.TaskType > 3 {
|
||||||
|
return commonErr.ReturnError(nil, "参数错误", "任务类型必须在1-3之间")
|
||||||
|
}
|
||||||
|
if req.TaskCount < 0 {
|
||||||
|
return commonErr.ReturnError(nil, "参数错误", "任务数量不能为负数")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用 DAO 层创建日志
|
||||||
|
return dao.CreateTaskWorkLog(req)
|
||||||
|
}
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"database/sql/driver"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
@ -42,6 +44,8 @@ type BundleOrderRecords struct {
|
|||||||
Language string `gorm:"column:language;comment:语言" json:"language"`
|
Language string `gorm:"column:language;comment:语言" json:"language"`
|
||||||
BundleOrderValueAdd []BundleOrderValueAdd `gorm:"foreignKey:OrderUUID;references:UUID" json:"bundleOrderValueAdd"`
|
BundleOrderValueAdd []BundleOrderValueAdd `gorm:"foreignKey:OrderUUID;references:UUID" json:"bundleOrderValueAdd"`
|
||||||
ReSignature int `json:"reSignature" gorm:"column:re_signature;default:2;type:int;comment:是否重新签 1:是 2:否"`
|
ReSignature int `json:"reSignature" gorm:"column:re_signature;default:2;type:int;comment:是否重新签 1:是 2:否"`
|
||||||
|
PlatformIds PlatformIDs `gorm:"column:platform_ids;type:json;NOT NULL;comment:发布平台ID集合 TIKTOK= 1, YOUTUBE = 2, INS = 3 , DM = 4, BL = 5;" json:"platformIDs"`
|
||||||
|
InviterID uint64 `gorm:"column:inviter_id;type:bigint;comment:邀请人ID" json:"inviterID"`
|
||||||
}
|
}
|
||||||
type BundleOrderValueAdd struct {
|
type BundleOrderValueAdd struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
@ -73,6 +77,30 @@ type BundleOrderValueAdd struct {
|
|||||||
QuotaValue int32 `json:"quotaValue" gorm:"column:quota_value;type:int;comment:额度值"`
|
QuotaValue int32 `json:"quotaValue" gorm:"column:quota_value;type:int;comment:额度值"`
|
||||||
IsExpired bool `json:"isExpired" gorm:"column:is_expired;default:false;comment:是否过期作废 false:不作废 true:作废"`
|
IsExpired bool `json:"isExpired" gorm:"column:is_expired;default:false;comment:是否过期作废 false:不作废 true:作废"`
|
||||||
}
|
}
|
||||||
|
type PlatformIDs []uint32
|
||||||
|
|
||||||
|
// 实现 Scanner 接口
|
||||||
|
func (p *PlatformIDs) Scan(value interface{}) error {
|
||||||
|
if value == nil {
|
||||||
|
*p = []uint32{}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
bytes, ok := value.([]byte)
|
||||||
|
if !ok {
|
||||||
|
return errors.New("type assertion to []byte failed")
|
||||||
|
}
|
||||||
|
|
||||||
|
return json.Unmarshal(bytes, p)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 实现 Valuer 接口
|
||||||
|
func (p PlatformIDs) Value() (driver.Value, error) {
|
||||||
|
if len(p) == 0 {
|
||||||
|
return "[]", nil
|
||||||
|
}
|
||||||
|
return json.Marshal(p)
|
||||||
|
}
|
||||||
|
|
||||||
// 财务确认状态
|
// 财务确认状态
|
||||||
const (
|
const (
|
||||||
|
|||||||
@ -241,41 +241,6 @@ func (TaskSyncStatus) TableName() string { return "task_sync_status" }
|
|||||||
// InitialSyncKey 一次性同步的唯一标识键
|
// InitialSyncKey 一次性同步的唯一标识键
|
||||||
const InitialSyncKey = "bundle_to_task_balance_initial_sync"
|
const InitialSyncKey = "bundle_to_task_balance_initial_sync"
|
||||||
|
|
||||||
// 任务日志表
|
|
||||||
type TaskLog struct {
|
|
||||||
LogUUID string `gorm:"column:log_uuid;type:varchar(50);comment:任务日志UUID;not null" json:"taskLogUUID"`
|
|
||||||
SubNum string `gorm:"column:sub_num;comment:任务用户编号;index:idx_task_log_sub_num;not null" json:"taskSubNum"`
|
|
||||||
TelNum string `gorm:"column:tel_num;comment:任务用户手机号;index:idx_task_log_tel_num;not null" json:"taskTelNum"`
|
|
||||||
ArtistName string `gorm:"column:artist_name;comment:任务艺人名称;index:idx_task_log_artist_name" json:"taskArtistName"`
|
|
||||||
|
|
||||||
// ===== 操作信息 =====
|
|
||||||
OperationType int `gorm:"column:operation_type;type:int(11);comment:任务操作类型 1:加任务 2:消耗任务 3:完成任务;4:任务过期;index:idx_task_operation_type;not null" json:"taskOperationType"`
|
|
||||||
TaskType int `gorm:"column:task_type;type:int(11);comment:任务类型 1:视频 2:图片 3:数据分析;index:idx_task_type;not null" json:"taskType"`
|
|
||||||
TaskCount int `gorm:"column:task_count;type:int(11);comment:任务数量;not null" json:"taskCount"`
|
|
||||||
Remark string `gorm:"column:remark;type:varchar(500);comment:任务备注" json:"taskRemark"`
|
|
||||||
|
|
||||||
// ===== 操作人信息 =====
|
|
||||||
OperatorName string `gorm:"column:operator_name;comment:任务操作人姓名;index:idx_task_operator_name" json:"taskOperatorName"`
|
|
||||||
OperatorNum string `gorm:"column:operator_num;comment:任务操作人账号;index:idx_task_operator_num" json:"taskOperatorNum"`
|
|
||||||
CompletorName string `gorm:"column:completor_name;comment:任务完成人姓名;index:idx_task_completor_name" json:"taskCompletorName"`
|
|
||||||
CompletorNum string `gorm:"column:completor_num;comment:任务完成人账号;index:idx_task_completor_num" json:"taskCompletorNum"`
|
|
||||||
|
|
||||||
// ===== 关联ID字段 =====
|
|
||||||
VideoPublishUUID string `gorm:"column:video_publish_id;type:varchar(50);comment:任务关联的发布视频UUID;index:idx_task_video_publish_id" json:"taskVideoPublishID"`
|
|
||||||
PostPublishUUID string `gorm:"column:post_publish_id;type:varchar(50);comment:任务关联的图文发布UUID;index:idx_task_post_publish_id" json:"taskPostPublishID"`
|
|
||||||
DataAnalysisUUID string `gorm:"column:data_analysis_id;type:varchar(50);comment:任务关联的数据分析UUID;index:idx_task_data_analysis_id" json:"taskDataAnalysisID"`
|
|
||||||
|
|
||||||
// ===== 时间字段 =====
|
|
||||||
OperationTime int `gorm:"column:operation_time;type:int(11);comment:任务操作时间;index:idx_task_operation_time;not null" json:"taskOperationTime"`
|
|
||||||
CreatedAt int `gorm:"column:created_at;type:int(11);comment:任务日志创建时间" json:"taskCreatedAt"`
|
|
||||||
UpdatedAt int `gorm:"column:updated_at;type:int(11);comment:任务日志更新时间" json:"taskUpdatedAt"`
|
|
||||||
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_task_log_deleted_at" json:"taskDeletedAt"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *TaskLog) TableName() string {
|
|
||||||
return "task_log"
|
|
||||||
}
|
|
||||||
|
|
||||||
// 隐藏指派人表
|
// 隐藏指派人表
|
||||||
type TaskAssigneeHidden struct {
|
type TaskAssigneeHidden struct {
|
||||||
// 让id自增
|
// 让id自增
|
||||||
@ -291,3 +256,36 @@ type TaskAssigneeHidden struct {
|
|||||||
func (TaskAssigneeHidden) TableName() string {
|
func (TaskAssigneeHidden) TableName() string {
|
||||||
return "task_assignee_hidden"
|
return "task_assignee_hidden"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 任务日志表
|
||||||
|
type TaskWorkLog struct {
|
||||||
|
WorkLogUUID string `gorm:"column:work_log_uuid;type:varchar(50);comment:任务作品日志UUID;primarykey;not null" json:"taskWorkLogUUID"`
|
||||||
|
AssignRecordsUUID string `gorm:"column:assign_records_uuid;type:varchar(50);comment:任务指派记录UUID;index:idx_assign_records_uuid;not null" json:"assignRecordsUUID"`
|
||||||
|
WorkUUID string `gorm:"column:work_uuid;type:varchar(50);comment:任务作品UUID;index:idx_work_uuid;not null" json:"workUUID"`
|
||||||
|
Title string `gorm:"column:title;type:varchar(50);comment:任务作品标题;not null" default:"" json:"title"`
|
||||||
|
|
||||||
|
ArtistUUID string `gorm:"column:artist_uuid;type:varchar(50);comment:任务艺人UUID;index:idx_artist_uuid;not null" default:"" json:"artistUUID"`
|
||||||
|
SubNum string `gorm:"column:sub_num;comment:任务用户编号;index:idx_sub_num;not null" default:"" json:"subNum"`
|
||||||
|
TelNum string `gorm:"column:tel_num;comment:任务用户手机号;index:idx_tel_num;not null" default:"" json:"telNum"`
|
||||||
|
ArtistName string `gorm:"column:artist_name;comment:任务艺人名称;index:idx_artist_name" default:"" json:"artistName"`
|
||||||
|
|
||||||
|
// ===== 操作信息 =====
|
||||||
|
OperationType int `gorm:"column:operation_type;type:int(11);comment:任务操作类型 1:加任务 2:消耗任务 3:完成任务;4:任务过期;index:idx_operation_type;not null" default:"0" json:"operationType"`
|
||||||
|
TaskType int `gorm:"column:task_type;type:int(11);comment:任务类型 1:视频 2:图片 3:数据分析;index:idx_task_type;not null" default:"0" json:"taskType"`
|
||||||
|
TaskCount int `gorm:"column:task_count;type:int(11);comment:任务数量;not null" default:"0" json:"taskCount"`
|
||||||
|
Remark string `gorm:"column:remark;type:varchar(500);comment:任务备注" default:"" json:"remark"`
|
||||||
|
|
||||||
|
// ===== 操作人信息 =====
|
||||||
|
OperatorName string `gorm:"column:operator_name;comment:任务操作人姓名;index:idx_operator_name" json:"taskOperatorName"`
|
||||||
|
OperatorNum string `gorm:"column:operator_num;comment:任务操作人账号;index:idx_operator_num" json:"taskOperatorNum"`
|
||||||
|
|
||||||
|
// ===== 时间字段 =====
|
||||||
|
OperationTime int `gorm:"column:operation_time;type:int(11);comment:任务操作时间;index:idx_operation_time;not null" json:"taskOperationTime"`
|
||||||
|
CreatedAt int `gorm:"column:created_at;type:int(11);comment:任务日志创建时间" json:"taskCreatedAt"`
|
||||||
|
UpdatedAt int `gorm:"column:updated_at;type:int(11);comment:任务日志更新时间" json:"taskUpdatedAt"`
|
||||||
|
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_work_log_deleted_at" json:"taskDeletedAt"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *TaskWorkLog) TableName() string {
|
||||||
|
return "task_work_log"
|
||||||
|
}
|
||||||
|
|||||||
@ -106,6 +106,7 @@ service Bundle {
|
|||||||
rpc GetPendingAssign(PendingAssignRequest) returns (PendingAssignResponse) {} // 查询艺人可指派数量
|
rpc GetPendingAssign(PendingAssignRequest) returns (PendingAssignResponse) {} // 查询艺人可指派数量
|
||||||
rpc RevertTaskCompletionByUUIDItem(RevertTaskCompletionByUUIDItemRequest) returns (ComResponse) {}
|
rpc RevertTaskCompletionByUUIDItem(RevertTaskCompletionByUUIDItemRequest) returns (ComResponse) {}
|
||||||
rpc AddHiddenTaskAssignee(AddHiddenTaskAssigneeRequest) returns (ComResponse) {}
|
rpc AddHiddenTaskAssignee(AddHiddenTaskAssigneeRequest) returns (ComResponse) {}
|
||||||
|
rpc CreateTaskWorkLog(CreateTaskWorkLogRequest) returns (CommonResponse) {} // 创建任务日志记录
|
||||||
|
|
||||||
//数据指标
|
//数据指标
|
||||||
rpc MetricsBusiness(MetricsBusinessReq) returns (MetricsBusinessResp) {}
|
rpc MetricsBusiness(MetricsBusinessReq) returns (MetricsBusinessResp) {}
|
||||||
@ -114,7 +115,20 @@ service Bundle {
|
|||||||
rpc MetricsBundlePurchaseExport(MetricsBundlePurchaseExportReq) returns (MetricsBundlePurchaseExportResp) {}
|
rpc MetricsBundlePurchaseExport(MetricsBundlePurchaseExportReq) returns (MetricsBundlePurchaseExportResp) {}
|
||||||
rpc MetricsArtistAccountExport(MetricsArtistAccountExportReq) returns (MetricsArtistAccountExportResp) {}
|
rpc MetricsArtistAccountExport(MetricsArtistAccountExportReq) returns (MetricsArtistAccountExportResp) {}
|
||||||
rpc MetricsVideoSubmitExport(MetricsVideoSubmitExportReq) returns (MetricsVideoSubmitExportResp) {}
|
rpc MetricsVideoSubmitExport(MetricsVideoSubmitExportReq) returns (MetricsVideoSubmitExportResp) {}
|
||||||
|
rpc QueryTheOrderSnapshotInformation(QueryTheOrderSnapshotInformationReq) returns (QueryTheOrderSnapshotInformationResp) {}
|
||||||
|
}
|
||||||
|
message QueryTheOrderSnapshotInformationReq{
|
||||||
|
string orderNo = 1;
|
||||||
|
}
|
||||||
|
message QueryTheOrderSnapshotInformationResp{
|
||||||
|
repeated ServiceInformation bundleOrder = 1;
|
||||||
|
repeated ServiceInformation addBundleOrder = 2;
|
||||||
|
string bundleContent = 3;
|
||||||
|
}
|
||||||
|
message ServiceInformation{
|
||||||
|
uint64 serviceType = 1;
|
||||||
|
uint64 num = 2;
|
||||||
|
string unit = 3;
|
||||||
}
|
}
|
||||||
message ReSignTheContractRequest{
|
message ReSignTheContractRequest{
|
||||||
string orderNo = 1;
|
string orderNo = 1;
|
||||||
@ -203,6 +217,8 @@ message OrderCreateRecord{
|
|||||||
int32 payType = 19 [json_name = "payType"];
|
int32 payType = 19 [json_name = "payType"];
|
||||||
repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; //增值服务
|
repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; //增值服务
|
||||||
string orderNo = 21 [json_name = "orderNo"];
|
string orderNo = 21 [json_name = "orderNo"];
|
||||||
|
repeated uint32 platformIds = 22; // 发布平台ID集合 (json 格式字符串)
|
||||||
|
uint64 inviterId = 23; // 邀请人ID
|
||||||
}
|
}
|
||||||
message OrderCreateAddRecord{
|
message OrderCreateAddRecord{
|
||||||
int32 serviceType = 1 [json_name = "serviceType"];
|
int32 serviceType = 1 [json_name = "serviceType"];
|
||||||
@ -255,6 +271,9 @@ message OrderBundleRecordInfo{
|
|||||||
int64 customerId = 9;
|
int64 customerId = 9;
|
||||||
string payTime = 10;
|
string payTime = 10;
|
||||||
string subNum = 11;
|
string subNum = 11;
|
||||||
|
uint64 inviterId = 12;
|
||||||
|
string inviterCode = 13;
|
||||||
|
string inviterName = 14;
|
||||||
}
|
}
|
||||||
message OrderAddBundleRecordInfo{
|
message OrderAddBundleRecordInfo{
|
||||||
string orderAddNo = 1;
|
string orderAddNo = 1;
|
||||||
@ -712,7 +731,7 @@ message GetBundleBalanceListReq{
|
|||||||
int64 expiredTimeEnd = 8;
|
int64 expiredTimeEnd = 8;
|
||||||
int32 page = 9;
|
int32 page = 9;
|
||||||
int32 pageSize = 10;
|
int32 pageSize = 10;
|
||||||
string month = 11;
|
repeated string month = 11;
|
||||||
int32 statusType = 12;
|
int32 statusType = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -896,11 +915,15 @@ message BundleBalanceExportItem {
|
|||||||
int32 monthlyManualVideoConsumptionNumber = 65; // 当月手动扩展视频使用数
|
int32 monthlyManualVideoConsumptionNumber = 65; // 当月手动扩展视频使用数
|
||||||
int32 monthlyManualImageConsumptionNumber = 66; // 当月手动扩展图文使用数
|
int32 monthlyManualImageConsumptionNumber = 66; // 当月手动扩展图文使用数
|
||||||
int32 monthlyManualDataAnalysisConsumptionNumber = 67; // 当月手动扩展数据分析使用数
|
int32 monthlyManualDataAnalysisConsumptionNumber = 67; // 当月手动扩展数据分析使用数
|
||||||
|
|
||||||
|
//视频当月消耗金额
|
||||||
|
string monthlyBundleVideoConsumptionPrice = 68;//当月套餐消耗总金额
|
||||||
|
string monthlyIncreaseVideoConsumptionPrice = 69;//当月增值消耗总金额
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
message BundleBalanceExportReq{
|
message BundleBalanceExportReq{
|
||||||
string month = 1;
|
repeated string month = 1;
|
||||||
string userName = 2;
|
string userName = 2;
|
||||||
uint64 expiredTimeStart = 3;
|
uint64 expiredTimeStart = 3;
|
||||||
uint64 expiredTimeEnd = 4;
|
uint64 expiredTimeEnd = 4;
|
||||||
@ -1053,7 +1076,7 @@ message GetBundleBalanceByUserIdResp{
|
|||||||
string orderUUID = 1;
|
string orderUUID = 1;
|
||||||
string bundleUuid = 2; // 套餐ID uuid
|
string bundleUuid = 2; // 套餐ID uuid
|
||||||
string bundleName = 3; // 套餐名称
|
string bundleName = 3; // 套餐名称
|
||||||
string bundleStatus = 4; // 套餐名称
|
int32 bundleStatus = 4; // 套餐状态是否过期 1 是 0 否
|
||||||
int64 payTime = 5;
|
int64 payTime = 5;
|
||||||
int64 expiredTime = 6;
|
int64 expiredTime = 6;
|
||||||
string paymentAmount = 7;
|
string paymentAmount = 7;
|
||||||
@ -1565,6 +1588,23 @@ message GetPendingTaskLayoutResp{ string data = 1; }
|
|||||||
message SetPendingTaskLayoutReq{ string data = 1; }
|
message SetPendingTaskLayoutReq{ string data = 1; }
|
||||||
message SetPendingTaskLayoutResp{}
|
message SetPendingTaskLayoutResp{}
|
||||||
|
|
||||||
|
// 创建任务日志请求
|
||||||
|
message CreateTaskWorkLogRequest {
|
||||||
|
string assignRecordsUUID = 1 [json_name = "assignRecordsUUID"]; // 任务指派记录UUID(必填)
|
||||||
|
string workUUID = 2 [json_name = "workUUID"]; // 任务作品UUID(必填)
|
||||||
|
string title = 3 [json_name = "title"]; // 任务作品标题
|
||||||
|
string artistUUID = 4 [json_name = "artistUUID"]; // 任务艺人UUID
|
||||||
|
string subNum = 5 [json_name = "subNum"]; // 任务用户编号(必填)
|
||||||
|
string telNum = 6 [json_name = "telNum"]; // 任务用户手机号(必填)
|
||||||
|
string artistName = 7 [json_name = "artistName"]; // 任务艺人名称
|
||||||
|
int32 operationType = 8 [json_name = "operationType"]; // 任务操作类型 1:加任务 2:消耗任务 3:完成任务 4:任务过期(必填)
|
||||||
|
int32 taskType = 9 [json_name = "taskType"]; // 任务类型 1:视频 2:图片 3:数据分析(必填)
|
||||||
|
int32 taskCount = 10 [json_name = "taskCount"]; // 任务数量(必填)
|
||||||
|
string remark = 11 [json_name = "remark"]; // 任务备注
|
||||||
|
string operatorName = 12 [json_name = "operatorName"]; // 任务操作人姓名
|
||||||
|
string operatorNum = 13 [json_name = "operatorNum"]; // 任务操作人账号
|
||||||
|
}
|
||||||
|
|
||||||
message MetricsBusinessReq{
|
message MetricsBusinessReq{
|
||||||
string bundleUuid = 1;
|
string bundleUuid = 1;
|
||||||
string start = 2;
|
string start = 2;
|
||||||
@ -1699,8 +1739,9 @@ message MetricsOperatingStatusResp {
|
|||||||
int64 autoConfirmDataAnalysisCount = 23;// 系统已自动确认数据数
|
int64 autoConfirmDataAnalysisCount = 23;// 系统已自动确认数据数
|
||||||
int64 pendingUploadDataAnalysisCount = 24;// 待发布数据数
|
int64 pendingUploadDataAnalysisCount = 24;// 待发布数据数
|
||||||
int64 uploadSuccessDataAnalysisCount = 25;// 发布成功数据数
|
int64 uploadSuccessDataAnalysisCount = 25;// 发布成功数据数
|
||||||
|
int64 uploadFailedDataAnalysisCount = 26;// 发布异常数据数
|
||||||
int64 abnormalAccountAcount = 26; // 触发预警的账号数
|
|
||||||
|
int64 abnormalAccountAcount = 27; // 触发预警的账号数
|
||||||
}
|
}
|
||||||
|
|
||||||
message MetricsBundlePurchaseExportReq{
|
message MetricsBundlePurchaseExportReq{
|
||||||
@ -1729,7 +1770,7 @@ message MetricsBundlePurchaseItem{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message MetricsArtistAccountExportReq{
|
message MetricsArtistAccountExportReq{
|
||||||
string month = 1;
|
repeated string month = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MetricsArtistAccountExportResp{
|
message MetricsArtistAccountExportResp{
|
||||||
@ -1741,18 +1782,25 @@ message MetricsArtistAccountExportItem{
|
|||||||
string userNum = 2;
|
string userNum = 2;
|
||||||
string dmAccount = 3;
|
string dmAccount = 3;
|
||||||
string dmNickname = 4;
|
string dmNickname = 4;
|
||||||
// string youtubeAccount = 3; 现在没有YouTube了
|
int32 dmAuthStatus = 5;
|
||||||
// string youtubeNickname = 4;
|
string instagramAccount = 6;
|
||||||
string instagramAccount = 5;
|
string instagramNickname = 7;
|
||||||
string instagramNickname = 6;
|
int32 insAuthStatus = 8;
|
||||||
string tiktokAccount = 7;
|
string tiktokAccount = 9;
|
||||||
string tiktokNickname = 8;
|
string tiktokNickname = 10;
|
||||||
|
int32 tiktokAuthStatus = 11;
|
||||||
|
string youtubeAccount = 12;
|
||||||
|
string youtubeNickname = 13;
|
||||||
|
int32 youtubeAuthStatus = 14;
|
||||||
|
string blueskyAccount = 15;
|
||||||
|
string blueskyNickname = 16;
|
||||||
|
int32 blueskyAuthStatus = 17;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
message MetricsVideoSubmitExportReq{
|
message MetricsVideoSubmitExportReq{
|
||||||
string month = 1;
|
repeated string month = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MetricsVideoSubmitExportResp{
|
message MetricsVideoSubmitExportResp{
|
||||||
|
|||||||
12938
pb/bundle/bundle.pb.go
12938
pb/bundle/bundle.pb.go
File diff suppressed because it is too large
Load Diff
@ -17,6 +17,29 @@ var _ = proto.Marshal
|
|||||||
var _ = fmt.Errorf
|
var _ = fmt.Errorf
|
||||||
var _ = math.Inf
|
var _ = math.Inf
|
||||||
|
|
||||||
|
func (this *QueryTheOrderSnapshotInformationReq) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *QueryTheOrderSnapshotInformationResp) Validate() error {
|
||||||
|
for _, item := range this.BundleOrder {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("BundleOrder", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, item := range this.AddBundleOrder {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("AddBundleOrder", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ServiceInformation) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *ReSignTheContractRequest) Validate() error {
|
func (this *ReSignTheContractRequest) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -717,6 +740,9 @@ func (this *SetPendingTaskLayoutReq) Validate() error {
|
|||||||
func (this *SetPendingTaskLayoutResp) Validate() error {
|
func (this *SetPendingTaskLayoutResp) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *CreateTaskWorkLogRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *MetricsBusinessReq) Validate() error {
|
func (this *MetricsBusinessReq) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-triple v1.0.5
|
// - protoc-gen-go-triple v1.0.5
|
||||||
// - protoc v6.32.0
|
// - protoc v5.26.0
|
||||||
// source: pb/bundle.proto
|
// source: pb/bundle.proto
|
||||||
|
|
||||||
package bundle
|
package bundle
|
||||||
@ -110,6 +110,7 @@ type BundleClient interface {
|
|||||||
GetPendingAssign(ctx context.Context, in *PendingAssignRequest, opts ...grpc_go.CallOption) (*PendingAssignResponse, common.ErrorWithAttachment)
|
GetPendingAssign(ctx context.Context, in *PendingAssignRequest, opts ...grpc_go.CallOption) (*PendingAssignResponse, common.ErrorWithAttachment)
|
||||||
RevertTaskCompletionByUUIDItem(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
RevertTaskCompletionByUUIDItem(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
||||||
AddHiddenTaskAssignee(ctx context.Context, in *AddHiddenTaskAssigneeRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
AddHiddenTaskAssignee(ctx context.Context, in *AddHiddenTaskAssigneeRequest, opts ...grpc_go.CallOption) (*ComResponse, common.ErrorWithAttachment)
|
||||||
|
CreateTaskWorkLog(ctx context.Context, in *CreateTaskWorkLogRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
// 数据指标
|
// 数据指标
|
||||||
MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment)
|
MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment)
|
||||||
MetricsOperatingCreate(ctx context.Context, in *MetricsOperatingCreateReq, opts ...grpc_go.CallOption) (*MetricsOperatingCreateResp, common.ErrorWithAttachment)
|
MetricsOperatingCreate(ctx context.Context, in *MetricsOperatingCreateReq, opts ...grpc_go.CallOption) (*MetricsOperatingCreateResp, common.ErrorWithAttachment)
|
||||||
@ -117,6 +118,7 @@ type BundleClient interface {
|
|||||||
MetricsBundlePurchaseExport(ctx context.Context, in *MetricsBundlePurchaseExportReq, opts ...grpc_go.CallOption) (*MetricsBundlePurchaseExportResp, common.ErrorWithAttachment)
|
MetricsBundlePurchaseExport(ctx context.Context, in *MetricsBundlePurchaseExportReq, opts ...grpc_go.CallOption) (*MetricsBundlePurchaseExportResp, common.ErrorWithAttachment)
|
||||||
MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment)
|
MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment)
|
||||||
MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment)
|
MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment)
|
||||||
|
QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
type bundleClient struct {
|
type bundleClient struct {
|
||||||
@ -199,12 +201,14 @@ type BundleClientImpl struct {
|
|||||||
GetPendingAssign func(ctx context.Context, in *PendingAssignRequest) (*PendingAssignResponse, error)
|
GetPendingAssign func(ctx context.Context, in *PendingAssignRequest) (*PendingAssignResponse, error)
|
||||||
RevertTaskCompletionByUUIDItem func(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
RevertTaskCompletionByUUIDItem func(ctx context.Context, in *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
||||||
AddHiddenTaskAssignee func(ctx context.Context, in *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
AddHiddenTaskAssignee func(ctx context.Context, in *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
||||||
|
CreateTaskWorkLog func(ctx context.Context, in *CreateTaskWorkLogRequest) (*CommonResponse, error)
|
||||||
MetricsBusiness func(ctx context.Context, in *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
MetricsBusiness func(ctx context.Context, in *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
||||||
MetricsOperatingCreate func(ctx context.Context, in *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
MetricsOperatingCreate func(ctx context.Context, in *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
||||||
MetricsOperatingStatus func(ctx context.Context, in *MetricsOperatingStatusReq) (*MetricsOperatingStatusResp, error)
|
MetricsOperatingStatus func(ctx context.Context, in *MetricsOperatingStatusReq) (*MetricsOperatingStatusResp, error)
|
||||||
MetricsBundlePurchaseExport func(ctx context.Context, in *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
MetricsBundlePurchaseExport func(ctx context.Context, in *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
||||||
MetricsArtistAccountExport func(ctx context.Context, in *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
MetricsArtistAccountExport func(ctx context.Context, in *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
||||||
MetricsVideoSubmitExport func(ctx context.Context, in *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
MetricsVideoSubmitExport func(ctx context.Context, in *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
||||||
|
QueryTheOrderSnapshotInformation func(ctx context.Context, in *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||||
@ -669,6 +673,12 @@ func (c *bundleClient) AddHiddenTaskAssignee(ctx context.Context, in *AddHiddenT
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddHiddenTaskAssignee", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddHiddenTaskAssignee", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) CreateTaskWorkLog(ctx context.Context, in *CreateTaskWorkLogRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateTaskWorkLog", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *bundleClient) MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment) {
|
func (c *bundleClient) MetricsBusiness(ctx context.Context, in *MetricsBusinessReq, opts ...grpc_go.CallOption) (*MetricsBusinessResp, common.ErrorWithAttachment) {
|
||||||
out := new(MetricsBusinessResp)
|
out := new(MetricsBusinessResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -705,6 +715,12 @@ func (c *bundleClient) MetricsVideoSubmitExport(ctx context.Context, in *Metrics
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsVideoSubmitExport", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsVideoSubmitExport", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(QueryTheOrderSnapshotInformationResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/QueryTheOrderSnapshotInformation", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
// BundleServer is the server API for Bundle service.
|
// BundleServer is the server API for Bundle service.
|
||||||
// All implementations must embed UnimplementedBundleServer
|
// All implementations must embed UnimplementedBundleServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@ -791,6 +807,7 @@ type BundleServer interface {
|
|||||||
GetPendingAssign(context.Context, *PendingAssignRequest) (*PendingAssignResponse, error)
|
GetPendingAssign(context.Context, *PendingAssignRequest) (*PendingAssignResponse, error)
|
||||||
RevertTaskCompletionByUUIDItem(context.Context, *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
RevertTaskCompletionByUUIDItem(context.Context, *RevertTaskCompletionByUUIDItemRequest) (*ComResponse, error)
|
||||||
AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error)
|
||||||
|
CreateTaskWorkLog(context.Context, *CreateTaskWorkLogRequest) (*CommonResponse, error)
|
||||||
// 数据指标
|
// 数据指标
|
||||||
MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error)
|
||||||
MetricsOperatingCreate(context.Context, *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
MetricsOperatingCreate(context.Context, *MetricsOperatingCreateReq) (*MetricsOperatingCreateResp, error)
|
||||||
@ -798,6 +815,7 @@ type BundleServer interface {
|
|||||||
MetricsBundlePurchaseExport(context.Context, *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
MetricsBundlePurchaseExport(context.Context, *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
|
||||||
MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
|
||||||
MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
||||||
|
QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
|
||||||
mustEmbedUnimplementedBundleServer()
|
mustEmbedUnimplementedBundleServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1031,6 +1049,9 @@ func (UnimplementedBundleServer) RevertTaskCompletionByUUIDItem(context.Context,
|
|||||||
func (UnimplementedBundleServer) AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error) {
|
func (UnimplementedBundleServer) AddHiddenTaskAssignee(context.Context, *AddHiddenTaskAssigneeRequest) (*ComResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method AddHiddenTaskAssignee not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method AddHiddenTaskAssignee not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) CreateTaskWorkLog(context.Context, *CreateTaskWorkLogRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CreateTaskWorkLog not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedBundleServer) MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error) {
|
func (UnimplementedBundleServer) MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsBusiness not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method MetricsBusiness not implemented")
|
||||||
}
|
}
|
||||||
@ -1049,6 +1070,9 @@ func (UnimplementedBundleServer) MetricsArtistAccountExport(context.Context, *Me
|
|||||||
func (UnimplementedBundleServer) MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error) {
|
func (UnimplementedBundleServer) MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MetricsVideoSubmitExport not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method MetricsVideoSubmitExport not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method QueryTheOrderSnapshotInformation not implemented")
|
||||||
|
}
|
||||||
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
}
|
}
|
||||||
@ -3252,6 +3276,35 @@ func _Bundle_AddHiddenTaskAssignee_Handler(srv interface{}, ctx context.Context,
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_CreateTaskWorkLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateTaskWorkLogRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||||
|
args := []interface{}{}
|
||||||
|
args = append(args, in)
|
||||||
|
md, _ := metadata.FromIncomingContext(ctx)
|
||||||
|
invAttachment := make(map[string]interface{}, len(md))
|
||||||
|
for k, v := range md {
|
||||||
|
invAttachment[k] = v
|
||||||
|
}
|
||||||
|
invo := invocation.NewRPCInvocation("CreateTaskWorkLog", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _Bundle_MetricsBusiness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Bundle_MetricsBusiness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(MetricsBusinessReq)
|
in := new(MetricsBusinessReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -3426,6 +3479,35 @@ func _Bundle_MetricsVideoSubmitExport_Handler(srv interface{}, ctx context.Conte
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_QueryTheOrderSnapshotInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(QueryTheOrderSnapshotInformationReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||||
|
args := []interface{}{}
|
||||||
|
args = append(args, in)
|
||||||
|
md, _ := metadata.FromIncomingContext(ctx)
|
||||||
|
invAttachment := make(map[string]interface{}, len(md))
|
||||||
|
for k, v := range md {
|
||||||
|
invAttachment[k] = v
|
||||||
|
}
|
||||||
|
invo := invocation.NewRPCInvocation("QueryTheOrderSnapshotInformation", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
||||||
// It's only intended for direct use with grpc_go.RegisterService,
|
// It's only intended for direct use with grpc_go.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@ -3733,6 +3815,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "AddHiddenTaskAssignee",
|
MethodName: "AddHiddenTaskAssignee",
|
||||||
Handler: _Bundle_AddHiddenTaskAssignee_Handler,
|
Handler: _Bundle_AddHiddenTaskAssignee_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CreateTaskWorkLog",
|
||||||
|
Handler: _Bundle_CreateTaskWorkLog_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "MetricsBusiness",
|
MethodName: "MetricsBusiness",
|
||||||
Handler: _Bundle_MetricsBusiness_Handler,
|
Handler: _Bundle_MetricsBusiness_Handler,
|
||||||
@ -3757,6 +3843,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "MetricsVideoSubmitExport",
|
MethodName: "MetricsVideoSubmitExport",
|
||||||
Handler: _Bundle_MetricsVideoSubmitExport_Handler,
|
Handler: _Bundle_MetricsVideoSubmitExport_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "QueryTheOrderSnapshotInformation",
|
||||||
|
Handler: _Bundle_QueryTheOrderSnapshotInformation_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
Metadata: "pb/bundle.proto",
|
Metadata: "pb/bundle.proto",
|
||||||
|
|||||||
@ -63,7 +63,16 @@ func loadMysqlConn(conn string) *gorm.DB {
|
|||||||
&model.BundleActivate{},
|
&model.BundleActivate{},
|
||||||
&model.BundleBalanceLayout{},
|
&model.BundleBalanceLayout{},
|
||||||
)
|
)
|
||||||
|
if db.Migrator().HasColumn(&model.BundleOrderRecords{}, "platform_ids") == false {
|
||||||
|
if err := db.Migrator().AddColumn(&model.BundleOrderRecords{}, "platform_ids"); err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if db.Migrator().HasColumn(&model.BundleOrderRecords{}, "inviter_id") == false {
|
||||||
|
if err := db.Migrator().AddColumn(&model.BundleOrderRecords{}, "inviter_id"); err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// return nil
|
// return nil
|
||||||
panic(err)
|
panic(err)
|
||||||
@ -106,12 +115,12 @@ func loadTaskBenchMysqlConn(conn string) *gorm.DB {
|
|||||||
&model.TaskManagement{},
|
&model.TaskManagement{},
|
||||||
&model.TaskAssignRecords{},
|
&model.TaskAssignRecords{},
|
||||||
// &model.TaskBalance{},
|
// &model.TaskBalance{},
|
||||||
&model.TaskLog{},
|
|
||||||
&model.TaskSyncStatus{},
|
&model.TaskSyncStatus{},
|
||||||
&model.TaskPendingLayout{},
|
&model.TaskPendingLayout{},
|
||||||
&model.TaskAssignUUIDItems{},
|
&model.TaskAssignUUIDItems{},
|
||||||
// 隐藏人员人记录表
|
// 隐藏人员人记录表
|
||||||
&model.TaskAssigneeHidden{},
|
&model.TaskAssigneeHidden{},
|
||||||
|
&model.TaskWorkLog{},
|
||||||
)
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -120,3 +120,9 @@ const (
|
|||||||
AccountService = 4 //账号数
|
AccountService = 4 //账号数
|
||||||
AvailableTimeService = 5 //可用时长
|
AvailableTimeService = 5 //可用时长
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 套餐状态
|
||||||
|
const (
|
||||||
|
IsExpired = 1 //已过期
|
||||||
|
NotExpired = 0 //未过期
|
||||||
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user