Compare commits

...

53 Commits

Author SHA1 Message Date
jiaji.H
2d1fe66d90 Updata:增加电话号码映射表 2026-03-13 13:19:43 +08:00
jiaji.H
e5daac90f7 Updata:增加测试艺人id 2026-03-13 10:38:53 +08:00
jiaji.H
651f12d8d7 Updata:增加问卷调查白名单 2026-03-12 13:37:08 +08:00
jiaji.H
b91f06d240 Updata:更新发送问卷逻辑 2026-03-11 22:03:54 +08:00
jiaji.H
cb575bb37c Updata:更新效验规则 2026-03-11 21:48:51 +08:00
jiaji.H
fbf74734c6 Updata:更新增值获取数 2026-03-11 21:42:51 +08:00
jiaji.H
b041c5ce2d Updata:更新数据结构 2026-03-11 19:50:06 +08:00
jiaji.H
090d1ac8cc Updata:更新字段 2026-03-11 19:37:32 +08:00
jiaji.H
96e5872c78 Updata:更新结构 2026-03-11 19:33:47 +08:00
jiaji.H
5fef6272c3 Updata:增加中间数据结构 2026-03-11 19:31:13 +08:00
jiaji.H
1ff83504c2 Updata:更新赋值 2026-03-11 19:20:50 +08:00
jiaji.H
3e55413a35 Updata:更新sql 2026-03-11 19:15:32 +08:00
jiaji.H
332d0a65ff Updata:更新sql 2026-03-11 19:12:39 +08:00
jiaji.H
022d246765 Updata:更新sql 2026-03-11 19:05:37 +08:00
jiaji.H
fa3bf5c824 Updata:更新sql 2026-03-11 19:01:18 +08:00
jiaji.H
e17a3df63a Updata:更新数据库 2026-03-11 18:49:42 +08:00
jiaji.H
a21668b585 Updata:更新sql 2026-03-11 18:42:50 +08:00
jiaji.H
14609d29ca Updata 2026-03-11 18:39:10 +08:00
jiaji.H
9b22520851 Updata:更新sql 2026-03-11 18:38:30 +08:00
jiaji.H
1bec8e5ebf Updata:更新sql 2026-03-11 18:27:32 +08:00
jiaji.H
de3d4919e0 Updata:更新sql 2026-03-11 18:22:48 +08:00
jiaji.H
83d4a7d9c7 Updata:更新sql 2026-03-11 18:19:49 +08:00
jiaji.H
23b996bfd5 Updata:增加字段 2026-03-11 17:24:15 +08:00
jiaji.H
5bba22d18a Updata:增加字段 2026-03-11 17:16:57 +08:00
jiaji.H
9d31ce3d05 Updata:增加字段 2026-03-11 17:14:15 +08:00
jiaji.H
447cbff99e Updata:更新pb文件 2026-03-11 17:04:49 +08:00
jiaji.H
bd15ee93e9 Updata:修正逻辑 2026-03-11 16:54:41 +08:00
jiaji.H
f548ac9571 feat:新增问卷调查模块逻辑 2026-03-11 16:17:57 +08:00
jiaji.H
4a35f6fa9d Updata:增加艺人编号检索与补充显示字段 2026-03-11 10:03:29 +08:00
jiaji.H
691ffa96de Updata:更新竞品数导出数据计算 2026-03-06 14:33:25 +08:00
jiaji.H
3baffe8d2f Updata:修正检索 2026-03-03 16:14:38 +08:00
jiaji.H
45620df185 Updata:优化sql 2026-02-26 16:20:46 +08:00
jiaji.H
e4fa5eb9de Updata:优化查询sql 2026-02-26 16:17:16 +08:00
jiaji.H
1acc7eadf1 Updata:修正sql排序问题 2026-02-26 15:44:37 +08:00
jiaji.H
de5bf9beba Updata:优化数据指标套餐检索 2026-02-26 15:32:45 +08:00
cjy
bd8fbfb292 Merge branch 'feat-cjy-taskBench'
# Conflicts:
#	internal/dao/taskDao.go
#	pb/bundle/bundle.pb.go
#	pb/bundle/bundle_triple.pb.go
2026-02-13 10:10:17 +08:00
cjy
253f2ee33b fix:不再联表
# Conflicts:
#	internal/dao/taskDao.go
2026-02-13 10:08:10 +08:00
cjy
2051f44b1c fix:增加排序键,防止批量指派时operator_time的时间一致 2026-02-12 18:36:01 +08:00
cjy
252a0fbdfe fix:不再联表 2026-02-12 16:44:27 +08:00
cjy
571dc8f5a9 fix: 修复查询失败 2026-02-11 16:24:37 +08:00
cjy
7ce953fd5c fix:不再关联实名表,提高查询速度 2026-02-11 16:16:54 +08:00
cjy
eeb6616636 Revert "fix: 待确认列表新增返回字段"
This reverts commit 5dc2538a50.
2026-02-11 15:35:44 +08:00
cjy
5dc2538a50 fix: 待确认列表新增返回字段 2026-02-11 14:01:08 +08:00
cjy
138a109223 fix:不再查询订单获取艺人uuid 2026-02-10 16:36:00 +08:00
cjy
b37f35ec67 fix: 布局接口增加竞品报告相关字段 2026-02-09 16:11:41 +08:00
cjy
b764722fab feat: 查询任务完成日志,根据任务的uuid查询对应作品的uuid列表 2026-02-06 13:41:31 +08:00
cjy
d60aa877f3 feat:待指派任务列表和待指派数量增加上竞品报告的数量 2026-02-06 11:55:30 +08:00
cjy
898b9ca9c5 Revert "feat:产品需要待上传视频脚本和待指派视频脚本的数量减掉2025年上传的视频数"
This reverts commit deb68e25a9.
2026-02-06 11:16:23 +08:00
cjy
6ad2d52e9d feat:任务管理台增加竞品报告 2026-02-06 11:15:01 +08:00
cjy
deb68e25a9 feat:产品需要待上传视频脚本和待指派视频脚本的数量减掉2025年上传的视频数 2026-02-06 09:44:42 +08:00
cjy
9ee3e15938 feat:增加竞品报告的相关字段 2026-02-06 09:19:38 +08:00
cjy
72f23c58b6 fix: 移除没用的表 2026-02-06 09:17:33 +08:00
cjy
719d81347d fix:日志添加竞品报告和视频脚本 2026-02-05 15:36:46 +08:00
19 changed files with 5859 additions and 3019 deletions

View File

@ -0,0 +1,23 @@
package controller
import (
"context"
"micro-bundle/internal/logic"
"micro-bundle/pb/bundle"
)
func (b *BundleProvider) SendQuestionnaireSurvey(_ context.Context, req *bundle.SendQuestionnaireSurveyRequest) (*bundle.SendQuestionnaireSurveyResponse, error) {
return logic.SendQuestionnaireSurvey(req)
}
func (b *BundleProvider) GetQuestionnaireSurveyInfo(_ context.Context, req *bundle.GetQuestionnaireSurveyInfoRequest) (*bundle.GetQuestionnaireSurveyInfoResponse, error) {
return logic.GetQuestionnaireSurveyInfo(req)
}
func (b *BundleProvider) CreateQuestionnaireSurveyAnswer(_ context.Context, req *bundle.CreateQuestionnaireSurveyAnswerRequest) (*bundle.CreateQuestionnaireSurveyAnswerResponse, error) {
return logic.CreateQuestionnaireSurveyAnswer(req)
}
func (b *BundleProvider) GetQuestionnaireSurveyList(_ context.Context, req *bundle.GetQuestionnaireSurveyListRequest) (*bundle.GetQuestionnaireSurveyListResponse, error) {
return logic.GetQuestionnaireSurveyList(req)
}

View File

@ -28,6 +28,8 @@ func (b *BundleProvider) AssignTask(_ context.Context, req *bundle.TaskAssignReq
AssignPostCount: int(req.AssignPostCount), AssignPostCount: int(req.AssignPostCount),
AssignDataCount: int(req.AssignDataCount), AssignDataCount: int(req.AssignDataCount),
AssignVideoScriptCount: int(req.AssignVideoScriptCount), AssignVideoScriptCount: int(req.AssignVideoScriptCount),
AssignReportCount: int(req.AssignReportCount),
UserID: int(req.UserID),
} }
err := logic.AssignTask(daoReq) err := logic.AssignTask(daoReq)
@ -260,6 +262,8 @@ func convertToTaskAssignRecordInfo(record *dto.TaskAssignRecordsResponse) *bundl
CompleteVideoCount: int32(record.CompleteVideoCount), CompleteVideoCount: int32(record.CompleteVideoCount),
CompletePostCount: int32(record.CompletePostCount), CompletePostCount: int32(record.CompletePostCount),
CompleteDataCount: int32(record.CompleteDataCount), CompleteDataCount: int32(record.CompleteDataCount),
PendingReportCount: int32(record.PendingReportCount),
CompleteReportCount: int32(record.CompleteReportCount),
} }
} }
@ -273,10 +277,12 @@ func convertToTaskAssignRecordsSummary(s *dto.TaskAssignRecordsSummary) *bundle.
TotalPendingVideoCount: int32(s.TotalPendingVideoCount), TotalPendingVideoCount: int32(s.TotalPendingVideoCount),
TotalPendingPostCount: int32(s.TotalPendingPostCount), TotalPendingPostCount: int32(s.TotalPendingPostCount),
TotalPendingDataCount: int32(s.TotalPendingDataCount), TotalPendingDataCount: int32(s.TotalPendingDataCount),
TotalPendingReportCount: int32(s.TotalPendingReportCount),
TotalCompleteVideoScriptCount: int32(s.TotalCompleteVideoScriptCount), TotalCompleteVideoScriptCount: int32(s.TotalCompleteVideoScriptCount),
TotalCompleteVideoCount: int32(s.TotalCompleteVideoCount), TotalCompleteVideoCount: int32(s.TotalCompleteVideoCount),
TotalCompletePostCount: int32(s.TotalCompletePostCount), TotalCompletePostCount: int32(s.TotalCompletePostCount),
TotalCompleteDataCount: int32(s.TotalCompleteDataCount), TotalCompleteDataCount: int32(s.TotalCompleteDataCount),
TotalCompleteReportCount: int32(s.TotalCompleteReportCount),
} }
} }
@ -305,7 +311,9 @@ func (b *BundleProvider) BatchAssignTask(_ context.Context, req *bundle.BatchAss
AssignPostCount: int(it.AssignPostCount), AssignPostCount: int(it.AssignPostCount),
AssignDataCount: int(it.AssignDataCount), AssignDataCount: int(it.AssignDataCount),
AssignVideoScriptCount: int(it.AssignVideoScriptCount), AssignVideoScriptCount: int(it.AssignVideoScriptCount),
AssignReportCount: int(it.AssignReportCount),
TaskBatch: it.TaskBatch, TaskBatch: it.TaskBatch,
UserID: int(it.UserID),
}) })
} }
@ -373,6 +381,11 @@ func (b *BundleProvider) GetArtistUploadStatsList(_ context.Context, req *bundle
IncreaseDataAnalysisTotal: int32(it.IncreaseDataAnalysisTotal), IncreaseDataAnalysisTotal: int32(it.IncreaseDataAnalysisTotal),
ReleasedDataAnalysisTotal: int32(it.ReleasedDataAnalysisTotal), ReleasedDataAnalysisTotal: int32(it.ReleasedDataAnalysisTotal),
PendingDataAnalysisCount: int32(it.PendingDataAnalysisCount), PendingDataAnalysisCount: int32(it.PendingDataAnalysisCount),
UploadedReportCount: int32(it.UploadedReportCount),
BundleReportTotal: int32(it.BundleReportTotal),
IncreaseReportTotal: int32(it.IncreaseReportTotal),
ReleasedReportTotal: int32(it.ReleasedReportTotal),
PendingReportCount: int32(it.PendingReportCount),
LastTaskAssignee: it.LastTaskAssignee, LastTaskAssignee: it.LastTaskAssignee,
TaskAssigneeNum: it.TaskAssigneeNum, TaskAssigneeNum: it.TaskAssigneeNum,
ProgressTaskCount: int32(it.ProgressTaskCount), ProgressTaskCount: int32(it.ProgressTaskCount),
@ -383,6 +396,7 @@ func (b *BundleProvider) GetArtistUploadStatsList(_ context.Context, req *bundle
AllowVideoCount: int32(it.AllowVideoCount), AllowVideoCount: int32(it.AllowVideoCount),
AllowPostCount: int32(it.AllowPostCount), AllowPostCount: int32(it.AllowPostCount),
AllowDataCount: int32(it.AllowDataCount), AllowDataCount: int32(it.AllowDataCount),
AllowReportCount: int32(it.AllowReportCount),
}) })
} }
@ -410,6 +424,7 @@ func (b *BundleProvider) GetPendingAssign(_ context.Context, req *bundle.Pending
AllowVideoCount: int32(it.AllowVideoCount), AllowVideoCount: int32(it.AllowVideoCount),
AllowPostCount: int32(it.AllowPostCount), AllowPostCount: int32(it.AllowPostCount),
AllowDataCount: int32(it.AllowDataCount), AllowDataCount: int32(it.AllowDataCount),
AllowReportCount: int32(it.AllowReportCount),
}) })
} }
return &bundle.PendingAssignResponse{Items: respItems, Total: total, Page: req.Page, PageSize: req.PageSize}, nil return &bundle.PendingAssignResponse{Items: respItems, Total: total, Page: req.Page, PageSize: req.PageSize}, nil
@ -437,6 +452,54 @@ func (b *BundleProvider) AddHiddenTaskAssignee(_ context.Context, req *bundle.Ad
return &bundle.ComResponse{Msg: "删除该指派人成功"}, nil return &bundle.ComResponse{Msg: "删除该指派人成功"}, nil
} }
func (b *BundleProvider) GetTaskWorkLogList(_ context.Context, req *bundle.TaskWorkLogQueryRequest) (*bundle.TaskWorkLogQueryResponse, error) {
daoReq := &dto.TaskWorkLogQueryRequest{
AssignRecordsUUID: req.AssignRecordsUUID,
OperationType: int(req.OperationType),
TaskType: int(req.TaskType),
ArtistUUID: req.ArtistUUID,
SubNum: req.SubNum,
ArtistName: req.ArtistName,
Page: int(req.Page),
PageSize: int(req.PageSize),
}
records, total, err := logic.GetTaskWorkLogList(daoReq)
if err != nil {
return nil, err
}
respItems := make([]*bundle.TaskWorkLogInfo, 0, len(records))
for _, record := range records {
respItems = append(respItems, &bundle.TaskWorkLogInfo{
WorkLogUUID: record.WorkLogUUID,
AssignRecordsUUID: record.AssignRecordsUUID,
WorkUUID: record.WorkUUID,
Title: record.Title,
ArtistUUID: record.ArtistUUID,
SubNum: record.SubNum,
TelNum: record.TelNum,
ArtistName: record.ArtistName,
OperationType: int32(record.OperationType),
TaskType: int32(record.TaskType),
TaskCount: int32(record.TaskCount),
Remark: record.Remark,
OperatorName: record.OperatorName,
OperatorNum: record.OperatorNum,
OperationTime: int64(record.OperationTime),
CreatedAt: int64(record.CreatedAt),
UpdatedAt: int64(record.UpdatedAt),
})
}
return &bundle.TaskWorkLogQueryResponse{
Records: respItems,
Total: total,
Page: req.Page,
PageSize: req.PageSize,
}, nil
}
// CreateTaskWorkLog 创建任务日志记录 // CreateTaskWorkLog 创建任务日志记录
func (b *BundleProvider) CreateTaskWorkLog(_ context.Context, req *bundle.CreateTaskWorkLogRequest) (*bundle.CommonResponse, error) { func (b *BundleProvider) CreateTaskWorkLog(_ context.Context, req *bundle.CreateTaskWorkLogRequest) (*bundle.CommonResponse, error) {
// 转换请求参数 // 转换请求参数

View File

@ -96,7 +96,7 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
if utils.IsPhoneNumber(req.UserName) { if utils.IsPhoneNumber(req.UserName) {
session = session.Where("u.tel_num = ?", req.UserName) session = session.Where("u.tel_num = ?", req.UserName)
} else { } else {
session = session.Where("rn.name like ?", "%"+req.UserName+"%") session = session.Where("rn.name LIKE ? OR bor.customer_num LIKE ?", "%"+req.UserName+"%", "%"+req.UserName+"%")
} }
} }
if req.BundleName != "" { if req.BundleName != "" {
@ -120,17 +120,18 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
if req.Bought == 1 { if req.Bought == 1 {
session = session.Where("bb.user_id IS NULL") session = session.Where("bb.user_id IS NULL")
} }
t := time.Now()
if req.StatusType != 0 { if req.StatusType != 0 {
if req.ExpiredTimeStart > time.Now().UnixMilli() { if req.ExpiredTimeStart > time.Now().UnixMilli() {
if req.StatusType == 1 { if req.StatusType == 1 {
session = session.Where("bb.expired_at <= ?", time.Now().UnixMilli()) session = session.Where("bb.expired_at <= ?", t.Format("2006-01-02 15:04:05"))
} else { } else {
} }
} else { } else {
if req.StatusType == 1 { if req.StatusType == 1 {
session = session.Where("bb.expired_at <= ?", time.Now().UnixMilli()) session = session.Where("bb.expired_at <= ?", t.Format("2006-01-02 15:04:05"))
} else { } else {
session = session.Where("bb.expired_at >= ?", time.Now().UnixMilli()) session = session.Where("bb.expired_at >= ?", t.Format("2006-01-02 15:04:05"))
} }
} }
} }

View File

@ -334,13 +334,13 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
newVideoUsed = videoCountInfo.VideoUsed + videoCountInfo.UnUsedVideo newVideoUsed = videoCountInfo.VideoUsed + videoCountInfo.UnUsedVideo
} else { } else {
query = app.ModuleClients.BundleDB.Model(&model.CastWork{}). query = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
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 cast_work_extra cwe ON cwe.work_uuid = cast_work.uuid").
Joins("left join bundle_order_records bor ON bor.uuid = bb.order_uuid"). Joins("left join bundle_order_records bor ON bor.uuid COLLATE utf8mb4_general_ci = cwe.bundle_order_uuid COLLATE utf8mb4_general_ci").
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.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 cwe.deleted_at = 0").
Where("bor.bundle_uuid = ?", req.BundleUuid) Where("bor.bundle_uuid = ?", req.BundleUuid)
err = query.Count(&newVideoUsed).Error err = query.Count(&newVideoUsed).Error
if err != nil { if err != nil {
@ -473,13 +473,13 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
newImageUsed = imageCountInfo.ImageUsed + imageCountInfo.UnUsedImage newImageUsed = imageCountInfo.ImageUsed + imageCountInfo.UnUsedImage
} else { } else {
query = app.ModuleClients.BundleDB.Model(&model.CastWork{}). query = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
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 cast_work_extra cwe ON cwe.work_uuid = cast_work.uuid ").
Joins("left join bundle_order_records bor ON bor.uuid = bb.order_uuid"). Joins("left join bundle_order_records bor ON bor.uuid COLLATE utf8mb4_general_ci = cwe.bundle_order_uuid COLLATE utf8mb4_general_ci").
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.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 cwe.deleted_at = 0").
Where("bor.bundle_uuid = ?", req.BundleUuid) Where("bor.bundle_uuid = ?", req.BundleUuid)
err = query.Count(&newImageUsed).Error err = query.Count(&newImageUsed).Error
if err != nil { if err != nil {
@ -551,11 +551,11 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
newDataAnalysisUsed = dataAnalysisCountInfo.DataAnalysisUsed + dataAnalysisCountInfo.UnUsedDataAnalysis newDataAnalysisUsed = dataAnalysisCountInfo.DataAnalysisUsed + dataAnalysisCountInfo.UnUsedDataAnalysis
} else { } else {
query = app.ModuleClients.BundleDB.Table("cast_work_analysis as cwa"). 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 = 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 cast_work_analysis_extra cwae ON cwae.analysis_uuid = cwa.uuid").
Joins("left join bundle_order_records bor ON bor.uuid = bb.order_uuid"). Joins("left join bundle_order_records bor ON bor.uuid COLLATE utf8mb4_general_ci = cwae.bundle_order_uuid COLLATE utf8mb4_general_ci").
Where("cwa.submit_time >= ?", req.Start+" 00:00:00"). Where("cwa.submit_time >= ?", req.Start+" 00:00:00").
Where("cwa.submit_time <= ?", req.End+" 23:59:59"). Where("cwa.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("cwa.deleted_at = 0 and bor.deleted_at IS NULL and cwae.deleted_at = 0").
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 {
@ -621,11 +621,11 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
newConpetitiveUsed = conpetitiveCountInfo.ConpetitiveUsed + conpetitiveCountInfo.UnUsedConpetitive newConpetitiveUsed = conpetitiveCountInfo.ConpetitiveUsed + conpetitiveCountInfo.UnUsedConpetitive
} else { } else {
query = app.ModuleClients.BundleDB.Table("cast_competitive_report as ccr"). query = app.ModuleClients.BundleDB.Table("cast_competitive_report as ccr").
Joins("left join bundle_balance bb ON CAST(bb.user_id AS CHAR) COLLATE utf8mb4_general_ci = ccr.artist_id COLLATE utf8mb4_general_ci AND ccr.submit_time >= bb.start_at AND ccr.submit_time <= bb.expired_at and bb.month = DATE_FORMAT(ccr.submit_time, '%Y-%m')"). Joins("LEFT JOIN cast_competitive_report_extra ccrpe ON ccrpe.report_uuid = ccr.uuid").
Joins("left join bundle_order_records bor ON bor.uuid = bb.order_uuid"). Joins("left join bundle_order_records bor ON bor.uuid COLLATE utf8mb4_general_ci = ccrpe.bundle_order_uuid COLLATE utf8mb4_general_ci").
Where("ccr.submit_time >= ?", req.Start+" 00:00:00"). Where("ccr.submit_time >= ?", req.Start+" 00:00:00").
Where("ccr.submit_time <= ?", req.End+" 23:59:59"). Where("ccr.submit_time <= ?", req.End+" 23:59:59").
Where("ccr.deleted_at = 0 and bor.deleted_at IS NULL and bb.deleted_at IS NULL"). Where("ccr.deleted_at = 0 and bor.deleted_at IS NULL and ccrpe.deleted_at = 0").
Where("bor.bundle_uuid = ?", req.BundleUuid) Where("bor.bundle_uuid = ?", req.BundleUuid)
err = query.Count(&newConpetitiveUsed).Error err = query.Count(&newConpetitiveUsed).Error
if err != nil { if err != nil {

View File

@ -0,0 +1,228 @@
package dao
import (
"encoding/json"
"errors"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"micro-bundle/pkg/app"
"micro-bundle/pkg/msg"
"time"
"github.com/google/uuid"
"github.com/samber/lo"
"gorm.io/gorm"
)
// 电话号码映射表:原始号码 -> 目标号码
var phoneMapping = map[string]string{
"15863272183": "15624971336", //毕德瑞
"15039229900": "18803928946", //陈春芳
"13832480736": "17746107444", //程宝江
"19290778586": "13196080727", //董跃亭
"18710227028": "13954838868", //方民
"17801586080": "15233398990", //韩玉玲
}
// 使用示例:仅当号码在白名单中时才返回映射结果,否则返回原号码
func MapPhoneIfInList(phone string) string {
if phoneMapping[phone] != "" {
return phoneMapping[phone]
}
return phone
}
func SendQuestionnaireSurvey(req *bundle.SendQuestionnaireSurveyRequest) (resp *bundle.SendQuestionnaireSurveyResponse, err error) {
resp = new(bundle.SendQuestionnaireSurveyResponse)
phone := MapPhoneIfInList(req.UserTel)
userInfo := &model.UserInfo{}
err = app.ModuleClients.BundleDB.Raw(`
SELECT
mau.id as user_id,
mau.sub_num as user_num,
mau.tel_num as user_tel,
marn.name as user_name
from `+"`micro-account`.`user`"+` as mau
left join `+"`micro-account`.`real_name`"+` as marn on marn.id = mau.real_name_id and marn.deleted_at = 0
where mau.deleted_at = 0 and mau.tel_num = ?
`, phone).Scan(&userInfo).Error
if err != nil {
return resp, err
}
if userInfo.UserId == 0 {
resp.Status = 1
return resp, nil
}
//判断是否在指定id列表中
userIds := []int{76, 77, 80, 82, 83, 98, 110, 119, 121, 137, 138, 140, 149, 152, 155, 156, 157, 163, 171, 178, 179, 183, 184, 187, 189, 195, 210, 212, 221, 223, 224, 225, 227, 229, 232, 233, 249, 279, 311, 274, 268, 314, 327, 291, 326, 320, 273, 319, 278, 264, 313, 296, 393, 395, 387, 371, 391, 366, 398, 400, 410, 411, 412, 419, 421, 430, 432, 540, 592, 630, 1015}
if lo.Contains(userIds, userInfo.UserId) {
resp.Status = 0
} else {
resp.Status = 1
return resp, nil
}
questionnaireInfo := &model.QuestionnaireSurvey{}
err = app.ModuleClients.BundleDB.Model(&model.QuestionnaireSurvey{}).
Where("user_tel = ? and deleted_at is null", phone).
Order("created_at desc").
First(&questionnaireInfo).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
resp.Status = 0
} else {
return resp, err
}
}
if questionnaireInfo.UserId != 0 {
if questionnaireInfo.SurveyStatus == msg.QuestionnaireSent {
resp.Status = 0
return resp, nil
}
resp.Status = 2
return resp, nil
}
orderRecord := &model.BundleOrderRecords{}
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
Where("customer_num = ? and deleted_at is null", userInfo.UserNum).
Order("created_at desc").
First(&orderRecord).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
resp.Status = 1
return resp, nil
}
return resp, err
}
bundleBalance := &model.BundleBalance{}
month := timeParse(req.EndTime + " 23:59:59").Format("2006-01")
err = app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).
Where("order_uuid = ? and deleted_at is null", orderRecord.UUID).
Where("month = ?", month).
First(&bundleBalance).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
resp.Status = 1
return resp, nil
}
return resp, err
}
if bundleBalance.ID == 0 {
resp.Status = 1
return resp, nil
}
bundleInfo := &model.BundleInfo{
BundleName: orderRecord.BundleName,
StartAt: bundleBalance.StartAt,
ExpiredAt: bundleBalance.ExpiredAt,
BundleAccountNumber: 3,
BundleVideoNumber: bundleBalance.BundleLimitVideoConsumptionNumber,
IncreaseVideoNumber: bundleBalance.IncreaseVideoConsumptionNumber,
BundleImageNumber: bundleBalance.BundleLimitImageConsumptionNumber,
BundleDataNumber: bundleBalance.BundleLimitDataAnalysisConsumptionNumber,
BundleCompetitiveNumber: bundleBalance.BundleLimitCompetitiveConsumptionNumber,
}
bundleInfoJSON, err := json.Marshal(bundleInfo)
if err != nil {
return resp, err
}
data := &model.QuestionnaireSurvey{
SurveyUUID: uuid.New().String(),
UserId: userInfo.UserId,
UserNum: userInfo.UserNum,
UserName: userInfo.UserName,
UserTel: userInfo.UserTel,
OrderUUID: orderRecord.UUID,
SendTime: timeParse(time.Now().Format("2006-01-02 15:04:05")),
SubmitTime: timeParse(time.Now().Format("2006-01-02 15:04:05")),
SurveyStatus: msg.QuestionnaireSent,
BundleInfo: string(bundleInfoJSON),
SurveyTitle: req.SurveyTitle,
}
err = app.ModuleClients.BundleDB.Model(&model.QuestionnaireSurvey{}).Create(data).Error
if err != nil {
return resp, err
}
resp.Status = 0
return resp, nil
}
func GetQuestionnaireSurveyInfo(req *bundle.GetQuestionnaireSurveyInfoRequest) (data *model.QuestionnaireSurvey, err error) {
data = &model.QuestionnaireSurvey{}
phone := MapPhoneIfInList(req.UserTel)
err = app.ModuleClients.BundleDB.Model(&model.QuestionnaireSurvey{}).
Where("user_tel = ? and deleted_at is null", phone).
Order("created_at desc").
First(&data).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errors.New("问卷信息不存在")
}
return data, err
}
return data, nil
}
func CreateQuestionnaireSurveyAnswer(req *bundle.CreateQuestionnaireSurveyAnswerRequest) (err error) {
phone := MapPhoneIfInList(req.UserTel)
surveyAnswer := &model.SurveyAnswer{
BundleAccountScore: req.SurveyAnswer.BundleAccountScore,
BundleVideoScore: req.SurveyAnswer.BundleVideoScore,
IncreaseVideoScore: req.SurveyAnswer.IncreaseVideoScore,
BundleImageScore: req.SurveyAnswer.BundleImageScore,
BundleDataScore: req.SurveyAnswer.BundleDataScore,
BundleCompetitiveScore: req.SurveyAnswer.BundleCompetitiveScore,
ServiceResponseSpeed: req.SurveyAnswer.ServiceResponseSpeed,
ServiceStaffProfessionalism: req.SurveyAnswer.ServiceStaffProfessionalism,
}
surveyAnswerJSON, err := json.Marshal(surveyAnswer)
if err != nil {
return err
}
err = app.ModuleClients.BundleDB.Model(&model.QuestionnaireSurvey{}).
Where("user_tel = ? and deleted_at is null", phone).
Updates(map[string]interface{}{
"survey_answer": string(surveyAnswerJSON),
"merits_review": req.SurveyFeedback.MeritsReview,
"suggestionsor_improvements": req.SurveyFeedback.SuggestionsorImprovements,
"additional_comments": req.SurveyFeedback.AdditionalComments,
"submit_time": timeParse(time.Now().Format("2006-01-02 15:04:05")),
"survey_status": msg.QuestionnaireSubmitted,
"survey_url": req.SurveyUrl,
"submit_by": req.SubmitBy,
}).Error
if err != nil {
return err
}
return nil
}
func GetQuestionnaireSurveyList(req *bundle.GetQuestionnaireSurveyListRequest) (data []*model.QuestionnaireSurvey, total int64, err error) {
if req.Page == 0 {
req.Page = 1
}
if req.PageSize == 0 {
req.PageSize = 10
}
query := app.ModuleClients.BundleDB.Model(&model.QuestionnaireSurvey{})
if req.UserName != "" {
query = query.Where("user_name = ?", req.UserName)
}
if req.SurveyTitle != "" {
query = query.Where("survey_title = ?", req.SurveyTitle)
}
if req.SurveyStatus != 0 {
query = query.Where("survey_status = ?", req.SurveyStatus)
}
query = query.Order("created_at desc")
query.Count(&total)
query = query.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
err = query.Find(&data).Error
if err != nil {
return data, total, err
}
return data, total, nil
}

View File

@ -7,7 +7,6 @@ import (
"micro-bundle/internal/model" "micro-bundle/internal/model"
"micro-bundle/pkg/app" "micro-bundle/pkg/app"
commonErr "micro-bundle/pkg/err" commonErr "micro-bundle/pkg/err"
"strconv"
"strings" "strings"
"time" "time"
@ -104,6 +103,9 @@ active_windows AS (
bb.bundle_data_analysis_number, bb.bundle_limit_data_analysis_number, bb.bundle_limit_data_analysis_expired_number, bb.bundle_data_analysis_number, bb.bundle_limit_data_analysis_number, bb.bundle_limit_data_analysis_expired_number,
bb.increase_data_analysis_number, bb.increase_limit_data_analysis_number, bb.increase_limit_data_analysis_expired_number, bb.increase_data_analysis_number, bb.increase_limit_data_analysis_number, bb.increase_limit_data_analysis_expired_number,
bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number, bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number,
bb.bundle_competitive_number, bb.bundle_limit_competitive_number, bb.bundle_limit_competitive_expired_number,
bb.increase_competitive_number, bb.increase_limit_competitive_number, bb.increase_limit_competitive_expired_number,
bb.manual_competitive_number, bb.manual_competitive_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 AND rn.deleted_at = 0 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
@ -156,7 +158,15 @@ balance_sum AS (
+ bb2.monthly_increase_limit_expired_data_analysis_number + bb2.invalid_increase_data_analysis_number + bb2.monthly_increase_limit_expired_data_analysis_number + bb2.invalid_increase_data_analysis_number
+ bb2.increase_limit_data_analysis_consumption_number + bb2.increase_limit_data_analysis_expired_consumption_number + bb2.increase_limit_data_analysis_consumption_number + bb2.increase_limit_data_analysis_expired_consumption_number
- bb2.monthly_increase_limit_expired_data_analysis_consumption_number - bb2.monthly_increase_limit_expired_data_analysis_consumption_number
- bb2.monthly_increase_limit_data_analysis_consumption_number) AS increase_data_sum - bb2.monthly_increase_limit_data_analysis_consumption_number) AS increase_data_sum,
SUM(bb2.bundle_competitive_number + bb2.monthly_bundle_limit_competitive_number + bb2.monthly_bundle_limit_expired_competitive_number
+ bb2.invalid_bundle_competitive_number + bb2.bundle_limit_competitive_consumption_number
+ bb2.bundle_limit_competitive_expired_consumption_number - bb2.monthly_bundle_limit_expired_competitive_consumption_number
- bb2.monthly_bundle_limit_competitive_consumption_number) AS competitive_sum,
SUM(bb2.increase_competitive_number + bb2.monthly_increase_limit_competitive_number + bb2.monthly_increase_limit_expired_competitive_number
+ bb2.invalid_increase_competitive_number + bb2.increase_limit_competitive_consumption_number
+ bb2.increase_limit_competitive_expired_consumption_number - bb2.monthly_increase_limit_expired_competitive_consumption_number
- bb2.monthly_increase_limit_competitive_consumption_number) AS increase_competitive_sum
FROM bundle_balance bb2 FROM bundle_balance bb2
INNER JOIN latest_per_order lpo ON bb2.user_id = lpo.user_id INNER JOIN latest_per_order lpo ON bb2.user_id = lpo.user_id
AND bb2.order_uuid = lpo.order_uuid AND bb2.order_uuid = lpo.order_uuid
@ -193,7 +203,18 @@ cwa_agg AS (
GROUP BY aw.user_id GROUP BY aw.user_id
), ),
-- 8. 视频脚本统计 -- 8. 竞品报告统计
ccr_agg AS (
SELECT
aw.user_id,
COUNT(CASE WHEN ccr.deleted_at = 0 AND ccr.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS uploaded_report_count,
COUNT(CASE WHEN ccr.cost = 1 AND ccr.deleted_at = 0 AND ccr.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS released_report_consumed
FROM active_windows aw
LEFT JOIN cast_competitive_report ccr ON ccr.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
GROUP BY aw.user_id
),
-- 9. 视频脚本统计
cvs_agg AS ( cvs_agg AS (
SELECT SELECT
aw.user_id, aw.user_id,
@ -244,7 +265,13 @@ assigned_pending_agg AS (
WHEN tar.actual_status = 1 THEN tar.pending_data_count WHEN tar.actual_status = 1 THEN tar.pending_data_count
ELSE 0 ELSE 0
END END
), 0) AS assigned_data_count ), 0) AS assigned_data_count,
COALESCE(SUM(
CASE
WHEN tar.actual_status = 1 THEN tar.pending_report_count
ELSE 0
END
), 0) AS assigned_report_count
FROM active_windows aw FROM active_windows aw
LEFT JOIN ` + "`" + taskSchema + "`" + `.task_assign_records tar ON tar.sub_num COLLATE utf8mb4_general_ci = aw.customer_num COLLATE utf8mb4_general_ci LEFT JOIN ` + "`" + taskSchema + "`" + `.task_assign_records tar ON tar.sub_num COLLATE utf8mb4_general_ci = aw.customer_num COLLATE utf8mb4_general_ci
AND tar.actual_status IN (1, 3) AND tar.actual_status IN (1, 3)
@ -271,6 +298,7 @@ LEFT JOIN balance_sum bs ON bs.user_id = aw.user_id
LEFT JOIN task_mgmt tm ON tm.user_id = aw.user_id LEFT JOIN task_mgmt tm ON tm.user_id = aw.user_id
LEFT JOIN cw_agg cw ON cw.user_id = aw.user_id LEFT JOIN cw_agg cw ON cw.user_id = aw.user_id
LEFT JOIN cwa_agg cwa ON cwa.user_id = aw.user_id LEFT JOIN cwa_agg cwa ON cwa.user_id = aw.user_id
LEFT JOIN ccr_agg ccr ON ccr.user_id = aw.user_id
LEFT JOIN cvs_agg cvs ON cvs.user_id = aw.user_id LEFT JOIN cvs_agg cvs ON cvs.user_id = aw.user_id
LEFT JOIN tar_agg ta ON ta.user_id = aw.user_id LEFT JOIN tar_agg ta ON ta.user_id = aw.user_id
LEFT JOIN assigned_pending_agg apa ON apa.user_id = aw.user_id` LEFT JOIN assigned_pending_agg apa ON apa.user_id = aw.user_id`
@ -338,6 +366,12 @@ LEFT JOIN assigned_pending_agg apa ON apa.user_id = aw.user_id`
"allow_video_count": true, "allow_video_count": true,
"allow_post_count": true, "allow_post_count": true,
"allow_data_count": true, "allow_data_count": true,
"uploaded_report_count": true,
"bundle_report_total": true,
"increase_report_total": true,
"released_report_total": true,
"pending_report_count": true,
"allow_report_count": true,
} }
if allowed[req.SortBy] { if allowed[req.SortBy] {
orderClause = fmt.Sprintf("%s %s", req.SortBy, sortType) orderClause = fmt.Sprintf("%s %s", req.SortBy, sortType)
@ -367,6 +401,11 @@ LEFT JOIN assigned_pending_agg apa ON apa.user_id = aw.user_id`
(aw.increase_data_analysis_number + aw.increase_limit_data_analysis_number + aw.increase_limit_data_analysis_expired_number + aw.manual_data_analysis_number) AS increase_data_total, (aw.increase_data_analysis_number + aw.increase_limit_data_analysis_number + aw.increase_limit_data_analysis_expired_number + aw.manual_data_analysis_number) AS increase_data_total,
GREATEST(COALESCE(bs.data_sum, 0) + COALESCE(bs.increase_data_sum, 0) + aw.manual_data_analysis_number - aw.manual_data_analysis_consumption_number, 0) AS released_data_total, GREATEST(COALESCE(bs.data_sum, 0) + COALESCE(bs.increase_data_sum, 0) + aw.manual_data_analysis_number - aw.manual_data_analysis_consumption_number, 0) AS released_data_total,
GREATEST(COALESCE(bs.data_sum, 0) + COALESCE(bs.increase_data_sum, 0) + aw.manual_data_analysis_number - aw.manual_data_analysis_consumption_number, 0) - COALESCE(cwa.uploaded_data_count, 0) AS pending_data_count, GREATEST(COALESCE(bs.data_sum, 0) + COALESCE(bs.increase_data_sum, 0) + aw.manual_data_analysis_number - aw.manual_data_analysis_consumption_number, 0) - COALESCE(cwa.uploaded_data_count, 0) AS pending_data_count,
COALESCE(ccr.uploaded_report_count, 0) AS uploaded_report_count,
(aw.bundle_competitive_number + aw.bundle_limit_competitive_number + aw.bundle_limit_competitive_expired_number) AS bundle_report_total,
(aw.increase_competitive_number + aw.increase_limit_competitive_number + aw.increase_limit_competitive_expired_number + aw.manual_competitive_number) AS increase_report_total,
GREATEST(COALESCE(bs.competitive_sum, 0) + COALESCE(bs.increase_competitive_sum, 0) + aw.manual_competitive_number - aw.manual_competitive_consumption_number, 0) AS released_report_total,
GREATEST(COALESCE(bs.competitive_sum, 0) + COALESCE(bs.increase_competitive_sum, 0) + aw.manual_competitive_number - aw.manual_competitive_consumption_number, 0) - COALESCE(ccr.uploaded_report_count, 0) AS pending_report_count,
tm.last_task_assignee, tm.last_task_assignee,
tm.task_assignee_num, tm.task_assignee_num,
COALESCE(ta.progress_task_count, 0) AS progress_task_count, COALESCE(ta.progress_task_count, 0) AS progress_task_count,
@ -374,7 +413,8 @@ LEFT JOIN assigned_pending_agg apa ON apa.user_id = aw.user_id`
(GREATEST(COALESCE(bs.video_sum, 0) + COALESCE(bs.increase_video_sum, 0) + aw.manual_video_number - aw.manual_video_consumption_number, 0) - COALESCE(cvs.uploaded_video_script_count, 0)) - COALESCE(apa.assigned_video_script_count, 0) AS allow_video_script_count, (GREATEST(COALESCE(bs.video_sum, 0) + COALESCE(bs.increase_video_sum, 0) + aw.manual_video_number - aw.manual_video_consumption_number, 0) - COALESCE(cvs.uploaded_video_script_count, 0)) - COALESCE(apa.assigned_video_script_count, 0) AS allow_video_script_count,
(GREATEST(COALESCE(bs.video_sum, 0) + COALESCE(bs.increase_video_sum, 0) + aw.manual_video_number - aw.manual_video_consumption_number, 0) - COALESCE(cw.uploaded_video_count, 0)) - COALESCE(apa.assigned_video_count, 0) AS allow_video_count, (GREATEST(COALESCE(bs.video_sum, 0) + COALESCE(bs.increase_video_sum, 0) + aw.manual_video_number - aw.manual_video_consumption_number, 0) - COALESCE(cw.uploaded_video_count, 0)) - COALESCE(apa.assigned_video_count, 0) AS allow_video_count,
(GREATEST(COALESCE(bs.post_sum, 0) + COALESCE(bs.increase_post_sum, 0) + aw.manual_image_number - aw.manual_image_consumption_number, 0) - COALESCE(cw.uploaded_post_count, 0)) - COALESCE(apa.assigned_post_count, 0) AS allow_post_count, (GREATEST(COALESCE(bs.post_sum, 0) + COALESCE(bs.increase_post_sum, 0) + aw.manual_image_number - aw.manual_image_consumption_number, 0) - COALESCE(cw.uploaded_post_count, 0)) - COALESCE(apa.assigned_post_count, 0) AS allow_post_count,
(GREATEST(COALESCE(bs.data_sum, 0) + COALESCE(bs.increase_data_sum, 0) + aw.manual_data_analysis_number - aw.manual_data_analysis_consumption_number, 0) - COALESCE(cwa.uploaded_data_count, 0)) - COALESCE(apa.assigned_data_count, 0) AS allow_data_count (GREATEST(COALESCE(bs.data_sum, 0) + COALESCE(bs.increase_data_sum, 0) + aw.manual_data_analysis_number - aw.manual_data_analysis_consumption_number, 0) - COALESCE(cwa.uploaded_data_count, 0)) - COALESCE(apa.assigned_data_count, 0) AS allow_data_count,
(GREATEST(COALESCE(bs.competitive_sum, 0) + COALESCE(bs.increase_competitive_sum, 0) + aw.manual_competitive_number - aw.manual_competitive_consumption_number, 0) - COALESCE(ccr.uploaded_report_count, 0)) - COALESCE(apa.assigned_report_count, 0) AS allow_report_count
` + fromClause + whereClause + " ORDER BY " + orderClause ` + fromClause + whereClause + " ORDER BY " + orderClause
listArgs := make([]interface{}, 0, len(args)+2) listArgs := make([]interface{}, 0, len(args)+2)
@ -442,6 +482,7 @@ active_windows AS (
bb.manual_video_number, bb.manual_video_consumption_number, bb.manual_video_number, bb.manual_video_consumption_number,
bb.manual_image_number, bb.manual_image_consumption_number, bb.manual_image_number, bb.manual_image_consumption_number,
bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number, bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number,
bb.manual_competitive_number, bb.manual_competitive_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
@ -494,7 +535,15 @@ balance_sum AS (
+ bb2.monthly_increase_limit_expired_data_analysis_number + bb2.invalid_increase_data_analysis_number + bb2.monthly_increase_limit_expired_data_analysis_number + bb2.invalid_increase_data_analysis_number
+ bb2.increase_limit_data_analysis_consumption_number + bb2.increase_limit_data_analysis_expired_consumption_number + bb2.increase_limit_data_analysis_consumption_number + bb2.increase_limit_data_analysis_expired_consumption_number
- bb2.monthly_increase_limit_expired_data_analysis_consumption_number - bb2.monthly_increase_limit_expired_data_analysis_consumption_number
- bb2.monthly_increase_limit_data_analysis_consumption_number) AS increase_data_sum - bb2.monthly_increase_limit_data_analysis_consumption_number) AS increase_data_sum,
SUM(bb2.bundle_competitive_number + bb2.monthly_bundle_limit_competitive_number + bb2.monthly_bundle_limit_expired_competitive_number
+ bb2.invalid_bundle_competitive_number + bb2.bundle_limit_competitive_consumption_number
+ bb2.bundle_limit_competitive_expired_consumption_number - bb2.monthly_bundle_limit_expired_competitive_consumption_number
- bb2.monthly_bundle_limit_competitive_consumption_number) AS competitive_sum,
SUM(bb2.increase_competitive_number + bb2.monthly_increase_limit_competitive_number + bb2.monthly_increase_limit_expired_competitive_number
+ bb2.invalid_increase_competitive_number + bb2.increase_limit_competitive_consumption_number
+ bb2.increase_limit_competitive_expired_consumption_number - bb2.monthly_increase_limit_expired_competitive_consumption_number
- bb2.monthly_increase_limit_competitive_consumption_number) AS increase_competitive_sum
FROM bundle_balance bb2 FROM bundle_balance bb2
INNER JOIN latest_per_order lpo ON bb2.user_id = lpo.user_id INNER JOIN latest_per_order lpo ON bb2.user_id = lpo.user_id
AND bb2.order_uuid = lpo.order_uuid AND bb2.order_uuid = lpo.order_uuid
@ -518,17 +567,27 @@ cw_agg AS (
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
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
), ),
-- 8. 视频脚本统计 -- 8. 竞品报告统计
ccr_agg AS (
SELECT
aw.user_id,
COUNT(CASE WHEN ccr.deleted_at = 0 AND ccr.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS uploaded_report_count
FROM active_windows aw
LEFT JOIN cast_competitive_report ccr ON ccr.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
GROUP BY aw.user_id
),
-- 9. 视频脚本统计
cvs_agg AS ( cvs_agg AS (
SELECT SELECT
aw.user_id, aw.user_id,
@ -568,7 +627,13 @@ assigned_pending_agg AS (
WHEN tar.actual_status = 1 THEN tar.pending_data_count WHEN tar.actual_status = 1 THEN tar.pending_data_count
ELSE 0 ELSE 0
END END
), 0) AS assigned_data_count ), 0) AS assigned_data_count,
COALESCE(SUM(
CASE
WHEN tar.actual_status = 1 THEN tar.pending_report_count
ELSE 0
END
), 0) AS assigned_report_count
FROM active_windows aw FROM active_windows aw
LEFT JOIN ` + "`" + taskSchema + "`" + `.task_assign_records tar ON tar.sub_num COLLATE utf8mb4_general_ci = aw.customer_num COLLATE utf8mb4_general_ci LEFT JOIN ` + "`" + taskSchema + "`" + `.task_assign_records tar ON tar.sub_num COLLATE utf8mb4_general_ci = aw.customer_num COLLATE utf8mb4_general_ci
AND tar.actual_status IN (1, 3) AND tar.actual_status IN (1, 3)
@ -581,6 +646,7 @@ assigned_pending_agg AS (
LEFT JOIN balance_sum bs ON bs.user_id = aw.user_id LEFT JOIN balance_sum bs ON bs.user_id = aw.user_id
LEFT JOIN cw_agg cw ON cw.user_id = aw.user_id LEFT JOIN cw_agg cw ON cw.user_id = aw.user_id
LEFT JOIN cwa_agg cwa ON cwa.user_id = aw.user_id LEFT JOIN cwa_agg cwa ON cwa.user_id = aw.user_id
LEFT JOIN ccr_agg ccr ON ccr.user_id = aw.user_id
LEFT JOIN cvs_agg cvs ON cvs.user_id = aw.user_id LEFT JOIN cvs_agg cvs ON cvs.user_id = aw.user_id
LEFT JOIN assigned_pending_agg apa ON apa.user_id = aw.user_id` LEFT JOIN assigned_pending_agg apa ON apa.user_id = aw.user_id`
@ -601,7 +667,8 @@ LEFT JOIN assigned_pending_agg apa ON apa.user_id = aw.user_id`
(GREATEST(COALESCE(bs.video_sum, 0) + COALESCE(bs.increase_video_sum, 0) + aw.manual_video_number - aw.manual_video_consumption_number, 0) - COALESCE(cvs.uploaded_video_script_count, 0)) - COALESCE(apa.assigned_video_script_count, 0) AS allow_video_script_count, (GREATEST(COALESCE(bs.video_sum, 0) + COALESCE(bs.increase_video_sum, 0) + aw.manual_video_number - aw.manual_video_consumption_number, 0) - COALESCE(cvs.uploaded_video_script_count, 0)) - COALESCE(apa.assigned_video_script_count, 0) AS allow_video_script_count,
(GREATEST(COALESCE(bs.video_sum, 0) + COALESCE(bs.increase_video_sum, 0) + aw.manual_video_number - aw.manual_video_consumption_number, 0) - COALESCE(cw.uploaded_video_count, 0)) - COALESCE(apa.assigned_video_count, 0) AS allow_video_count, (GREATEST(COALESCE(bs.video_sum, 0) + COALESCE(bs.increase_video_sum, 0) + aw.manual_video_number - aw.manual_video_consumption_number, 0) - COALESCE(cw.uploaded_video_count, 0)) - COALESCE(apa.assigned_video_count, 0) AS allow_video_count,
(GREATEST(COALESCE(bs.post_sum, 0) + COALESCE(bs.increase_post_sum, 0) + aw.manual_image_number - aw.manual_image_consumption_number, 0) - COALESCE(cw.uploaded_post_count, 0)) - COALESCE(apa.assigned_post_count, 0) AS allow_post_count, (GREATEST(COALESCE(bs.post_sum, 0) + COALESCE(bs.increase_post_sum, 0) + aw.manual_image_number - aw.manual_image_consumption_number, 0) - COALESCE(cw.uploaded_post_count, 0)) - COALESCE(apa.assigned_post_count, 0) AS allow_post_count,
(GREATEST(COALESCE(bs.data_sum, 0) + COALESCE(bs.increase_data_sum, 0) + aw.manual_data_analysis_number - aw.manual_data_analysis_consumption_number, 0) - COALESCE(cwa.uploaded_data_count, 0)) - COALESCE(apa.assigned_data_count, 0) AS allow_data_count (GREATEST(COALESCE(bs.data_sum, 0) + COALESCE(bs.increase_data_sum, 0) + aw.manual_data_analysis_number - aw.manual_data_analysis_consumption_number, 0) - COALESCE(cwa.uploaded_data_count, 0)) - COALESCE(apa.assigned_data_count, 0) AS allow_data_count,
(GREATEST(COALESCE(bs.competitive_sum, 0) + COALESCE(bs.increase_competitive_sum, 0) + aw.manual_competitive_number - aw.manual_competitive_consumption_number, 0) - COALESCE(ccr.uploaded_report_count, 0)) - COALESCE(apa.assigned_report_count, 0) AS allow_report_count
` + fromClause + " ORDER BY aw.user_id" ` + fromClause + " ORDER BY aw.user_id"
listArgs := make([]interface{}, 0, len(args)+2) listArgs := make([]interface{}, 0, len(args)+2)
@ -636,41 +703,11 @@ func AssignTask(req *dto.TaskAssignRequest, progressTaskCount int, completeTaskC
// 1. 查询当前艺人的任务记录 // 1. 查询当前艺人的任务记录
var taskManagement model.TaskManagement var taskManagement model.TaskManagement
err := tx.Where("sub_num = ? AND tel_num = ?", req.SubNum, req.TelNum).First(&taskManagement).Error err := tx.Where("user_id = ? AND deleted_at = 0", req.UserID).First(&taskManagement).Error
if err != nil { if err != nil {
if err == gorm.ErrRecordNotFound { if err == gorm.ErrRecordNotFound {
var userID int
if req.SubNum != "" {
var row struct{ ID int }
_ = tx.Table("`micro-account`.`user`").Unscoped().Select("id").Where("sub_num COLLATE utf8mb4_general_ci = ? COLLATE utf8mb4_general_ci AND deleted_at = 0", req.SubNum).Limit(1).Scan(&row).Error
if row.ID > 0 {
userID = row.ID
}
}
if userID == 0 && req.SubNum != "" {
// 使用子查询获取每个 customer_id 最新订单记录的 customer_id
// 逻辑:找到 customer_num 匹配且 created_at 为该 customer_id 最大值的记录
var o struct{ CustomerID string }
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records").
Select("customer_id, MAX(created_at) AS max_created_time").
Where("deleted_at IS NULL AND status = 2").
Group("customer_id")
_ = app.ModuleClients.BundleDB.Table("bundle_order_records bor1").
Select("bor1.customer_id").
Joins("INNER JOIN (?) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time", subQuery).
Where("bor1.deleted_at IS NULL AND bor1.status = 2").
Where("bor1.customer_num COLLATE utf8mb4_general_ci = ? COLLATE utf8mb4_general_ci", req.SubNum).
Limit(1).
Scan(&o).Error
if o.CustomerID != "" {
if id64, _ := strconv.ParseInt(o.CustomerID, 10, 64); id64 > 0 {
userID = int(id64)
}
}
}
taskManagement = model.TaskManagement{ taskManagement = model.TaskManagement{
UserId: userID, UserId: req.UserID,
SubNum: req.SubNum, SubNum: req.SubNum,
TelNum: req.TelNum, TelNum: req.TelNum,
ArtistName: req.ArtistName, ArtistName: req.ArtistName,
@ -731,14 +768,17 @@ func AssignTask(req *dto.TaskAssignRequest, progressTaskCount int, completeTaskC
PendingVideoCount: req.AssignVideoCount, PendingVideoCount: req.AssignVideoCount,
PendingPostCount: req.AssignPostCount, PendingPostCount: req.AssignPostCount,
PendingDataCount: req.AssignDataCount, PendingDataCount: req.AssignDataCount,
PendingReportCount: req.AssignReportCount,
AssignVideoScriptCount: req.AssignVideoScriptCount, AssignVideoScriptCount: req.AssignVideoScriptCount,
AssignVideoCount: req.AssignVideoCount, AssignVideoCount: req.AssignVideoCount,
AssignPostCount: req.AssignPostCount, AssignPostCount: req.AssignPostCount,
AssignDataCount: req.AssignDataCount, AssignDataCount: req.AssignDataCount,
AssignReportCount: req.AssignReportCount,
CompleteVideoScriptCount: 0, CompleteVideoScriptCount: 0,
CompleteVideoCount: 0, CompleteVideoCount: 0,
CompletePostCount: 0, CompletePostCount: 0,
CompleteDataCount: 0, CompleteDataCount: 0,
CompleteReportCount: 0,
CreatedAt: time.Now(), CreatedAt: time.Now(),
UpdatedAt: time.Now(), UpdatedAt: time.Now(),
} }
@ -821,6 +861,13 @@ func RevertTaskCompletionByUUIDItem(uuid string) error {
cs = 0 cs = 0
} }
updateData["complete_video_script_count"] = cs updateData["complete_video_script_count"] = cs
case 5:
updateData["pending_report_count"] = assignRecord.PendingReportCount + 1
cr := assignRecord.CompleteReportCount - 1
if cr < 0 {
cr = 0
}
updateData["complete_report_count"] = cr
} }
if err := tx.Model(&assignRecord).Updates(updateData).Error; err != nil { if err := tx.Model(&assignRecord).Updates(updateData).Error; err != nil {
tx.Rollback() tx.Rollback()
@ -841,14 +888,15 @@ func BatchAssignTasks(items []*dto.BatchAssignItem) error {
now := time.Now() now := time.Now()
subNumSet := make(map[string]struct{}) subNumSet := make(map[string]struct{})
userIDSet := make(map[int]struct{})
subTelKeys := make(map[string]*dto.BatchAssignItem) // key: sub_num|tel_num subTelKeys := make(map[string]*dto.BatchAssignItem) // key: sub_num|tel_num
for _, it := range items { for _, it := range items {
if it == nil { if it == nil {
return commonErr.ReturnError(nil, "参数错误", "存在空的指派项") return commonErr.ReturnError(nil, "参数错误", "存在空的指派项")
} }
// 校验数量不可为负且不可全部为0 // 校验数量不可为负且不可全部为0
if it.AssignVideoCount < 0 || it.AssignPostCount < 0 || it.AssignDataCount < 0 || it.AssignVideoScriptCount < 0 || if it.AssignVideoCount < 0 || it.AssignPostCount < 0 || it.AssignDataCount < 0 || it.AssignVideoScriptCount < 0 || it.AssignReportCount < 0 ||
(it.AssignVideoCount == 0 && it.AssignPostCount == 0 && it.AssignDataCount == 0 && it.AssignVideoScriptCount == 0) { (it.AssignVideoCount == 0 && it.AssignPostCount == 0 && it.AssignDataCount == 0 && it.AssignVideoScriptCount == 0 && it.AssignReportCount == 0) {
errMsg := fmt.Sprintf("\"%s\"老师任务不可全部为0", it.ArtistName) errMsg := fmt.Sprintf("\"%s\"老师任务不可全部为0", it.ArtistName)
return commonErr.ReturnError(nil, errMsg, "批量指派校验失败: ") return commonErr.ReturnError(nil, errMsg, "批量指派校验失败: ")
} }
@ -858,6 +906,9 @@ func BatchAssignTasks(items []*dto.BatchAssignItem) error {
if it.SubNum != "" { if it.SubNum != "" {
subNumSet[it.SubNum] = struct{}{} subNumSet[it.SubNum] = struct{}{}
} }
if it.UserID > 0 {
userIDSet[it.UserID] = struct{}{}
}
key := it.SubNum + "|" + it.TelNum key := it.SubNum + "|" + it.TelNum
subTelKeys[key] = it subTelKeys[key] = it
} }
@ -869,18 +920,13 @@ func BatchAssignTasks(items []*dto.BatchAssignItem) error {
} }
// 2.1 批量查询已存在的 task_management 记录 // 2.1 批量查询已存在的 task_management 记录
existingTMMap := make(map[string]*model.TaskManagement) // key: sub_num|tel_num existingTMMap := make(map[string]*model.TaskManagement) // key: sub_num|tel_num
if len(subTelKeys) > 0 { if len(userIDSet) > 0 {
var existingTMs []model.TaskManagement userIDs := make([]int, 0, len(userIDSet))
// 构建 OR 条件查询 for id := range userIDSet {
var conditions []string userIDs = append(userIDs, id)
var args []interface{}
for key := range subTelKeys {
parts := strings.SplitN(key, "|", 2)
conditions = append(conditions, "(sub_num = ? AND tel_num = ?)")
args = append(args, parts[0], parts[1])
} }
query := strings.Join(conditions, " OR ") var existingTMs []model.TaskManagement
if err := app.ModuleClients.TaskBenchDB.Where(query, args...).Find(&existingTMs).Error; err != nil { if err := app.ModuleClients.TaskBenchDB.Where("user_id IN ? AND deleted_at = 0", userIDs).Find(&existingTMs).Error; err != nil {
return commonErr.ReturnError(err, "批量查询任务记录失败", "批量查询任务记录失败: ") return commonErr.ReturnError(err, "批量查询任务记录失败", "批量查询任务记录失败: ")
} }
for i := range existingTMs { for i := range existingTMs {
@ -890,63 +936,7 @@ func BatchAssignTasks(items []*dto.BatchAssignItem) error {
} }
} }
// 2.2 批量查询 user_id从 micro-account.user 表) // 2.2 批量统计每个 sub_num 的进行中与已完成任务数量
userIDMap := make(map[string]int) // key: sub_num
if len(subNums) > 0 {
var userRows []struct {
SubNum string `gorm:"column:sub_num"`
ID int `gorm:"column:id"`
}
_ = app.ModuleClients.TaskBenchDB.Table("`micro-account`.`user`").Unscoped().
Select("sub_num, id").
Where("sub_num COLLATE utf8mb4_general_ci IN ? AND deleted_at = 0", subNums).
Scan(&userRows).Error
for _, row := range userRows {
if row.ID > 0 {
userIDMap[row.SubNum] = row.ID
}
}
}
// 2.3 批量查询 customer_id从 bundle_order_records 表,针对未找到 user_id 的 sub_num
missingSubNums := make([]string, 0)
for _, sn := range subNums {
if _, found := userIDMap[sn]; !found {
missingSubNums = append(missingSubNums, sn)
}
}
if len(missingSubNums) > 0 {
var orderRows []struct {
CustomerNum string `gorm:"column:customer_num"`
CustomerID string `gorm:"column:customer_id"`
}
// 使用子查询获取每个 customer_num 对应的最新订单的 customer_id
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records").
Select("customer_id, customer_num, MAX(created_at) AS max_created_time").
Where("deleted_at IS NULL AND status = 2").
Where("customer_num COLLATE utf8mb4_general_ci IN ?", missingSubNums).
Group("customer_id, customer_num")
_ = app.ModuleClients.BundleDB.Table("bundle_order_records bor1").
Select("bor1.customer_num, bor1.customer_id").
Joins("INNER JOIN (?) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time", subQuery).
Where("bor1.deleted_at IS NULL AND bor1.status = 2").
Where("bor1.customer_num COLLATE utf8mb4_general_ci IN ?", missingSubNums).
Scan(&orderRows).Error
for _, row := range orderRows {
if row.CustomerID != "" {
if id64, _ := strconv.ParseInt(row.CustomerID, 10, 64); id64 > 0 {
// 只有当 userIDMap 中没有时才设置
if _, found := userIDMap[row.CustomerNum]; !found {
userIDMap[row.CustomerNum] = int(id64)
}
}
}
}
}
// 2.4 批量统计每个 sub_num 的进行中与已完成任务数量
statsMap := make(map[string]struct { statsMap := make(map[string]struct {
ProgressTaskCount int ProgressTaskCount int
CompleteTaskCount int CompleteTaskCount int
@ -990,9 +980,8 @@ func BatchAssignTasks(items []*dto.BatchAssignItem) error {
if _, exists := existingTMMap[key]; !exists { if _, exists := existingTMMap[key]; !exists {
// 检查是否已经在 newTMs 中(同一批次可能有重复的 sub_num|tel_num // 检查是否已经在 newTMs 中(同一批次可能有重复的 sub_num|tel_num
if _, inNew := newTMMap[key]; !inNew { if _, inNew := newTMMap[key]; !inNew {
userID := userIDMap[it.SubNum]
tm := model.TaskManagement{ tm := model.TaskManagement{
UserId: userID, UserId: it.UserID,
SubNum: it.SubNum, SubNum: it.SubNum,
TelNum: it.TelNum, TelNum: it.TelNum,
ArtistName: it.ArtistName, ArtistName: it.ArtistName,
@ -1048,14 +1037,17 @@ func BatchAssignTasks(items []*dto.BatchAssignItem) error {
PendingVideoCount: it.AssignVideoCount, PendingVideoCount: it.AssignVideoCount,
PendingPostCount: it.AssignPostCount, PendingPostCount: it.AssignPostCount,
PendingDataCount: it.AssignDataCount, PendingDataCount: it.AssignDataCount,
PendingReportCount: it.AssignReportCount,
AssignVideoScriptCount: it.AssignVideoScriptCount, AssignVideoScriptCount: it.AssignVideoScriptCount,
AssignVideoCount: it.AssignVideoCount, AssignVideoCount: it.AssignVideoCount,
AssignPostCount: it.AssignPostCount, AssignPostCount: it.AssignPostCount,
AssignDataCount: it.AssignDataCount, AssignDataCount: it.AssignDataCount,
AssignReportCount: it.AssignReportCount,
CompleteVideoScriptCount: 0, CompleteVideoScriptCount: 0,
CompleteVideoCount: 0, CompleteVideoCount: 0,
CompletePostCount: 0, CompletePostCount: 0,
CompleteDataCount: 0, CompleteDataCount: 0,
CompleteReportCount: 0,
CreatedAt: now, CreatedAt: now,
UpdatedAt: now, UpdatedAt: now,
} }
@ -1164,15 +1156,12 @@ func GetEmployeeAssignedTasks(req *dto.EmployeeTaskQueryRequest) ([]*model.TaskA
// 构建查询条件 // 构建查询条件
query := app.ModuleClients.TaskBenchDB.Model(&model.TaskAssignRecords{}). query := app.ModuleClients.TaskBenchDB.Model(&model.TaskAssignRecords{}).
Select("task_assign_records.id, task_assign_records.assign_records_uuid, task_assign_records.sub_num, task_assign_records.tel_num, task_assign_records.task_batch, task_assign_records.status, task_assign_records.actual_status, task_assign_records.complete_time, task_assign_records.operator_type, task_assign_records.operator, task_assign_records.operator_id, task_assign_records.operator_num, task_assign_records.operator_time, task_assign_records.task_assignee, task_assign_records.task_assignee_num, task_assign_records.pending_video_script_count, task_assign_records.pending_video_count, task_assign_records.pending_post_count, task_assign_records.pending_data_count, task_assign_records.assign_video_script_count, task_assign_records.assign_video_count, task_assign_records.assign_post_count, task_assign_records.assign_data_count, task_assign_records.complete_video_script_count, task_assign_records.complete_video_count, task_assign_records.complete_post_count, task_assign_records.complete_data_count, task_assign_records.created_at, task_assign_records.updated_at, task_assign_records.deleted_at, rn.name AS artist_name"). Select("task_assign_records.id, task_assign_records.assign_records_uuid, task_assign_records.sub_num, task_assign_records.tel_num, task_assign_records.task_batch, task_assign_records.status, task_assign_records.actual_status, task_assign_records.complete_time, task_assign_records.operator_type, task_assign_records.operator, task_assign_records.operator_id, task_assign_records.operator_num, task_assign_records.operator_time, task_assign_records.task_assignee, task_assign_records.task_assignee_num, task_assign_records.pending_video_script_count, task_assign_records.pending_video_count, task_assign_records.pending_post_count, task_assign_records.pending_data_count, task_assign_records.pending_report_count, task_assign_records.assign_video_script_count, task_assign_records.assign_video_count, task_assign_records.assign_post_count, task_assign_records.assign_data_count, task_assign_records.assign_report_count, task_assign_records.complete_video_script_count, task_assign_records.complete_video_count, task_assign_records.complete_post_count, task_assign_records.complete_data_count, task_assign_records.complete_report_count, task_assign_records.created_at, task_assign_records.updated_at, task_assign_records.deleted_at, task_assign_records.artist_name AS artist_name").
Joins("LEFT JOIN `micro-account`.`user` u ON u.sub_num COLLATE utf8mb4_general_ci = task_assign_records.sub_num COLLATE utf8mb4_general_ci").
Joins("LEFT JOIN `micro-account`.real_name rn ON u.real_name_id = rn.id").
Where("u.deleted_at = 0").
Where("task_assign_records.task_assignee_num = ?", req.TaskAssigneeNum) Where("task_assign_records.task_assignee_num = ?", req.TaskAssigneeNum)
// 关键词搜索(艺人姓名、编号、手机号) // 关键词搜索(艺人姓名、编号、手机号)
if req.Keyword != "" { if req.Keyword != "" {
query = query.Where("task_assign_records.sub_num LIKE ? OR task_assign_records.tel_num LIKE ? OR rn.name LIKE ?", query = query.Where("task_assign_records.sub_num LIKE ? OR task_assign_records.tel_num LIKE ? OR task_assign_records.artist_name LIKE ?",
"%"+req.Keyword+"%", "%"+req.Keyword+"%", "%"+req.Keyword+"%") "%"+req.Keyword+"%", "%"+req.Keyword+"%", "%"+req.Keyword+"%")
} }
@ -1212,7 +1201,7 @@ func GetEmployeeAssignedTasks(req *dto.EmployeeTaskQueryRequest) ([]*model.TaskA
// 根据排序字段倒序 // 根据排序字段倒序
if req.SortBy != "" { if req.SortBy != "" {
if strings.EqualFold(req.SortBy, "artist_name") { if strings.EqualFold(req.SortBy, "artist_name") {
query = query.Order("rn.name DESC") query = query.Order("task_assign_records.artist_name DESC")
} else { } else {
query = query.Order("task_assign_records." + req.SortBy + " DESC") query = query.Order("task_assign_records." + req.SortBy + " DESC")
} }
@ -1228,7 +1217,7 @@ func GetEmployeeAssignedTasks(req *dto.EmployeeTaskQueryRequest) ([]*model.TaskA
} }
// 按操作时间倒序 // 按操作时间倒序
err := query.Order("task_assign_records.operator_time DESC").Find(&records).Error err := query.Order("task_assign_records.operator_time DESC, task_assign_records.id DESC").Find(&records).Error
if err != nil { if err != nil {
return nil, 0, commonErr.ReturnError(err, "查询员工指派任务失败", "查询员工指派任务失败: ") return nil, 0, commonErr.ReturnError(err, "查询员工指派任务失败", "查询员工指派任务失败: ")
} }
@ -1412,9 +1401,11 @@ func UpdateTaskProgress(req *dto.CompleteTaskRequest) error {
query = query.Where("pending_data_count > 0 AND complete_data_count < assign_data_count") query = query.Where("pending_data_count > 0 AND complete_data_count < assign_data_count")
case "script": case "script":
query = query.Where("pending_video_script_count > 0 AND complete_video_script_count < assign_video_script_count") query = query.Where("pending_video_script_count > 0 AND complete_video_script_count < assign_video_script_count")
case "report":
query = query.Where("pending_report_count > 0 AND complete_report_count < assign_report_count")
default: default:
tx.Rollback() tx.Rollback()
return commonErr.ReturnError(nil, "无效的任务类型", "任务类型必须是视频、图文、数据或脚本") return commonErr.ReturnError(nil, "无效的任务类型", "任务类型必须是视频、图文、数据、脚本或竞品报告")
} }
err = query. err = query.
@ -1606,9 +1597,49 @@ func UpdateTaskProgress(req *dto.CompleteTaskRequest) error {
} }
updateData["complete_video_script_count"] = newCompleteCount updateData["complete_video_script_count"] = newCompleteCount
updateData["pending_video_script_count"] = newPending updateData["pending_video_script_count"] = newPending
case "report":
newCompleteCount := assignRecord.CompleteReportCount + req.CompleteCount
if newCompleteCount > assignRecord.AssignReportCount {
if req.AssignRecordsUUID != "false" {
app.ModuleClients.Lg.Info("竞品报告完成数量超出限制,跳过更新",
zap.String("assignRecordsUUID", assignRecord.AssignRecordsUUID),
zap.String("employeeName", req.EmployeeName),
zap.String("employeeNum", req.EmployeeNum),
zap.Int("currentCompleteCount", assignRecord.CompleteReportCount),
zap.Int("requestCompleteCount", req.CompleteCount),
zap.Int("newCompleteCount", newCompleteCount),
zap.Int("assignReportCount", assignRecord.AssignReportCount),
)
tx.Rollback()
return nil
} else {
tx.Rollback()
return commonErr.ReturnError(nil, "完成数量超出指派数量", "竞品报告完成数量不能超过已指派数量")
}
}
newPending := assignRecord.PendingReportCount - req.CompleteCount
if newPending < 0 {
if req.AssignRecordsUUID != "false" {
app.ModuleClients.Lg.Info("待发竞品报告数不足,跳过更新",
zap.String("assignRecordsUUID", assignRecord.AssignRecordsUUID),
zap.String("employeeName", req.EmployeeName),
zap.String("employeeNum", req.EmployeeNum),
zap.Int("currentPendingCount", assignRecord.PendingReportCount),
zap.Int("requestCompleteCount", req.CompleteCount),
zap.Int("newPendingCount", newPending),
)
tx.Rollback()
return nil
} else {
tx.Rollback()
return commonErr.ReturnError(nil, "待发竞品报告数不足", "待发竞品报告数不能小于0")
}
}
updateData["complete_report_count"] = newCompleteCount
updateData["pending_report_count"] = newPending
default: default:
tx.Rollback() tx.Rollback()
return commonErr.ReturnError(nil, "无效的任务类型", "任务类型必须是视频、图文、数据或脚本") return commonErr.ReturnError(nil, "无效的任务类型", "任务类型必须是视频、图文、数据、脚本或竞品报告")
} }
// 3. 更新指派记录 // 3. 更新指派记录
@ -1626,7 +1657,9 @@ func UpdateTaskProgress(req *dto.CompleteTaskRequest) error {
// 5. 检查是否所有任务都已完成 // 5. 检查是否所有任务都已完成
if assignRecord.CompleteVideoCount == assignRecord.AssignVideoCount && if assignRecord.CompleteVideoCount == assignRecord.AssignVideoCount &&
assignRecord.CompletePostCount == assignRecord.AssignPostCount && assignRecord.CompletePostCount == assignRecord.AssignPostCount &&
assignRecord.CompleteDataCount == assignRecord.AssignDataCount { assignRecord.CompleteDataCount == assignRecord.AssignDataCount &&
assignRecord.CompleteVideoScriptCount == assignRecord.AssignVideoScriptCount &&
assignRecord.CompleteReportCount == assignRecord.AssignReportCount {
// 更新实际完成状态 // 更新实际完成状态
if err = tx.Model(&assignRecord).Update("actual_status", 2).Error; err != nil { if err = tx.Model(&assignRecord).Update("actual_status", 2).Error; err != nil {
tx.Rollback() tx.Rollback()
@ -1645,6 +1678,8 @@ func UpdateTaskProgress(req *dto.CompleteTaskRequest) error {
typeCode = 3 typeCode = 3
case "script": case "script":
typeCode = 4 typeCode = 4
case "report":
typeCode = 5
} }
if req.UUID != "" { if req.UUID != "" {
uuidItem := &model.TaskAssignUUIDItems{ uuidItem := &model.TaskAssignUUIDItems{
@ -1686,15 +1721,11 @@ func GetTaskAssignRecordsList(req *dto.TaskAssignRecordsQueryRequest) ([]*model.
var summary dto.TaskAssignRecordsSummary var summary dto.TaskAssignRecordsSummary
// 构建查询条件 // 构建查询条件
query := app.ModuleClients.TaskBenchDB.Model(&model.TaskAssignRecords{}). query := app.ModuleClients.TaskBenchDB.Model(&model.TaskAssignRecords{})
Select("task_assign_records.*, rn.name AS artist_name").
Joins("LEFT JOIN `micro-account`.`user` u ON u.sub_num COLLATE utf8mb4_general_ci = task_assign_records.sub_num COLLATE utf8mb4_general_ci").
Joins("LEFT JOIN `micro-account`.real_name rn ON u.real_name_id = rn.id").
Where("u.deleted_at = 0")
// 关键词搜索(艺人姓名、编号、手机号) // 关键词搜索(艺人姓名、编号、手机号)
if req.Keyword != "" { if req.Keyword != "" {
query = query.Where("task_assign_records.sub_num LIKE ? OR task_assign_records.tel_num LIKE ? OR rn.name LIKE ?", query = query.Where("task_assign_records.sub_num LIKE ? OR task_assign_records.tel_num LIKE ? OR task_assign_records.artist_name LIKE ?",
"%"+req.Keyword+"%", "%"+req.Keyword+"%", "%"+req.Keyword+"%") "%"+req.Keyword+"%", "%"+req.Keyword+"%", "%"+req.Keyword+"%")
} }
@ -1740,15 +1771,12 @@ func GetTaskAssignRecordsList(req *dto.TaskAssignRecordsQueryRequest) ([]*model.
// 计算总数 // 计算总数
query.Count(&total) query.Count(&total)
// 汇总:根据筛选条件分页前的所有艺人待发与已完成数量(同筛选条件,关联用户与实名表以支持按实名筛选) // 汇总:根据筛选条件分页前的所有艺人待发与已完成数量(同筛选条件)
sumQuery := app.ModuleClients.TaskBenchDB.Model(&model.TaskAssignRecords{}). sumQuery := app.ModuleClients.TaskBenchDB.Model(&model.TaskAssignRecords{})
Joins("LEFT JOIN `micro-account`.`user` u ON u.sub_num COLLATE utf8mb4_general_ci = task_assign_records.sub_num COLLATE utf8mb4_general_ci").
Joins("LEFT JOIN `micro-account`.real_name rn ON u.real_name_id = rn.id").
Where("u.deleted_at = 0")
if req.Keyword != "" { if req.Keyword != "" {
// 与列表查询保持一致:按艺人编号、手机号、实名表姓名进行模糊匹配 // 与列表查询保持一致:按艺人编号、手机号、艺人名称进行模糊匹配
sumQuery = sumQuery.Where("task_assign_records.sub_num LIKE ? OR task_assign_records.tel_num LIKE ? OR rn.name LIKE ?", sumQuery = sumQuery.Where("task_assign_records.sub_num LIKE ? OR task_assign_records.tel_num LIKE ? OR task_assign_records.artist_name LIKE ?",
"%"+req.Keyword+"%", "%"+req.Keyword+"%", "%"+req.Keyword+"%") "%"+req.Keyword+"%", "%"+req.Keyword+"%", "%"+req.Keyword+"%")
} }
if req.TaskAssignee != "" { if req.TaskAssignee != "" {
@ -1778,7 +1806,7 @@ func GetTaskAssignRecordsList(req *dto.TaskAssignRecordsQueryRequest) ([]*model.
} }
// 执行汇总查询(不分页) // 执行汇总查询(不分页)
errSum := sumQuery.Select("\n SUM(task_assign_records.assign_video_script_count) AS total_pending_video_script_count,\n SUM(task_assign_records.assign_video_count) AS total_pending_video_count,\n SUM(task_assign_records.assign_post_count) AS total_pending_post_count,\n SUM(task_assign_records.assign_data_count) AS total_pending_data_count,\n SUM(task_assign_records.complete_video_script_count) AS total_complete_video_script_count,\n SUM(task_assign_records.complete_video_count) AS total_complete_video_count,\n SUM(task_assign_records.complete_post_count) AS total_complete_post_count,\n SUM(task_assign_records.complete_data_count) AS total_complete_data_count\n ").Scan(&summary).Error errSum := sumQuery.Select("\n SUM(task_assign_records.assign_video_script_count) AS total_pending_video_script_count,\n SUM(task_assign_records.assign_video_count) AS total_pending_video_count,\n SUM(task_assign_records.assign_post_count) AS total_pending_post_count,\n SUM(task_assign_records.assign_data_count) AS total_pending_data_count,\n SUM(task_assign_records.assign_report_count) AS total_pending_report_count,\n SUM(task_assign_records.complete_video_script_count) AS total_complete_video_script_count,\n SUM(task_assign_records.complete_video_count) AS total_complete_video_count,\n SUM(task_assign_records.complete_post_count) AS total_complete_post_count,\n SUM(task_assign_records.complete_data_count) AS total_complete_data_count,\n SUM(task_assign_records.complete_report_count) AS total_complete_report_count\n ").Scan(&summary).Error
if errSum != nil { if errSum != nil {
return nil, 0, nil, commonErr.ReturnError(errSum, "查询操作记录汇总失败", "查询操作记录汇总失败: ") return nil, 0, nil, commonErr.ReturnError(errSum, "查询操作记录汇总失败", "查询操作记录汇总失败: ")
} }
@ -1809,14 +1837,17 @@ func GetTaskAssignRecordsList(req *dto.TaskAssignRecordsQueryRequest) ([]*model.
"pending_post_count": true, "pending_post_count": true,
"pending_data_count": true, "pending_data_count": true,
"pending_video_script_count": true, "pending_video_script_count": true,
"pending_report_count": true,
"assign_video_count": true, "assign_video_count": true,
"assign_post_count": true, "assign_post_count": true,
"assign_data_count": true, "assign_data_count": true,
"assign_video_script_count": true, "assign_video_script_count": true,
"assign_report_count": true,
"complete_video_count": true, "complete_video_count": true,
"complete_post_count": true, "complete_post_count": true,
"complete_data_count": true, "complete_data_count": true,
"complete_video_script_count": true, "complete_video_script_count": true,
"complete_report_count": true,
"created_at": true, "created_at": true,
"assign_records_uuid": true, "assign_records_uuid": true,
} }
@ -1945,3 +1976,47 @@ func CreateTaskWorkLog(req *dto.CreateTaskWorkLogRequest) error {
return nil return nil
} }
func GetTaskWorkLogList(req *dto.TaskWorkLogQueryRequest) ([]*model.TaskWorkLog, int64, error) {
if req == nil {
return nil, 0, commonErr.ReturnError(nil, "参数错误", "请求参数不能为空")
}
var records []*model.TaskWorkLog
var total int64
query := app.ModuleClients.TaskBenchDB.Model(&model.TaskWorkLog{})
if req.AssignRecordsUUID != "" {
query = query.Where("assign_records_uuid = ?", req.AssignRecordsUUID)
}
if req.OperationType != 0 {
query = query.Where("operation_type = ?", req.OperationType)
}
if req.TaskType != 0 {
query = query.Where("task_type = ?", req.TaskType)
}
if req.ArtistUUID != "" {
query = query.Where("artist_uuid = ?", req.ArtistUUID)
}
if req.SubNum != "" {
query = query.Where("sub_num = ?", req.SubNum)
}
if req.ArtistName != "" {
query = query.Where("artist_name LIKE ?", "%"+req.ArtistName+"%")
}
query.Count(&total)
if req.PageSize > 0 && req.Page > 0 {
offset := (req.Page - 1) * req.PageSize
query = query.Limit(req.PageSize).Offset(offset)
}
err := query.Order("operation_time DESC").Find(&records).Error
if err != nil {
return nil, 0, commonErr.ReturnError(err, "查询任务日志失败", "查询任务日志失败: ")
}
return records, total, nil
}

View File

@ -26,7 +26,9 @@ type TaskAssignRequest struct {
AssignPostCount int `json:"assignPostCount"` // 指派图文数 AssignPostCount int `json:"assignPostCount"` // 指派图文数
AssignDataCount int `json:"assignDataCount"` // 指派数据数 AssignDataCount int `json:"assignDataCount"` // 指派数据数
AssignVideoScriptCount int `json:"assignVideoScriptCount"` // 指派视频脚本数 AssignVideoScriptCount int `json:"assignVideoScriptCount"` // 指派视频脚本数
AssignReportCount int `json:"assignReportCount"` // 指派竞品报告数
TaskBatch string `json:"taskBatch"` // 任务批次 TaskBatch string `json:"taskBatch"` // 任务批次
UserID int `json:"userID"` // 用户ID
} }
// BatchAssignItem 批量指派项(仅写入指派记录,不更新任务管理表) // BatchAssignItem 批量指派项(仅写入指派记录,不更新任务管理表)
@ -42,7 +44,9 @@ type BatchAssignItem struct {
AssignPostCount int `json:"assignPostCount"` // 指派图文数 AssignPostCount int `json:"assignPostCount"` // 指派图文数
AssignDataCount int `json:"assignDataCount"` // 指派数据数 AssignDataCount int `json:"assignDataCount"` // 指派数据数
AssignVideoScriptCount int `json:"assignVideoScriptCount"` // 指派视频脚本数 AssignVideoScriptCount int `json:"assignVideoScriptCount"` // 指派视频脚本数
AssignReportCount int `json:"assignReportCount"` // 指派竞品报告数
TaskBatch string `json:"taskBatch"` // 任务批次 TaskBatch string `json:"taskBatch"` // 任务批次
UserID int `json:"userID"` // 用户ID
} }
// EmployeeTaskQueryRequest 员工任务查询请求参数 // EmployeeTaskQueryRequest 员工任务查询请求参数
@ -67,7 +71,7 @@ type CompleteTaskRequest struct {
AssignRecordsUUID string `json:"assignRecordsUUID,omitempty"` // 指派记录UUID可选 AssignRecordsUUID string `json:"assignRecordsUUID,omitempty"` // 指派记录UUID可选
EmployeeName string `json:"employeeName"` // 员工姓名(必要) EmployeeName string `json:"employeeName"` // 员工姓名(必要)
EmployeeNum string `json:"employeeNum"` // 员工工号(必要) EmployeeNum string `json:"employeeNum"` // 员工工号(必要)
TaskType string `json:"taskType"` // 任务类型: video/post/data/script TaskType string `json:"taskType"` // 任务类型: video/post/data/script/report
UUID string `json:"uuid"` // 任务UUID UUID string `json:"uuid"` // 任务UUID
CompleteCount int `json:"completeCount"` // 完成数量 CompleteCount int `json:"completeCount"` // 完成数量
} }
@ -109,11 +113,13 @@ type TaskAssignRecordsResponse struct {
PendingPostCount int `gorm:"column:pending_post_count;comment:待发图文数量" json:"pendingPostCount"` PendingPostCount int `gorm:"column:pending_post_count;comment:待发图文数量" json:"pendingPostCount"`
PendingDataCount int `gorm:"column:pending_data_count;comment:待发数据数量" json:"pendingDataCount"` PendingDataCount int `gorm:"column:pending_data_count;comment:待发数据数量" json:"pendingDataCount"`
PendingVideoScriptCount int `gorm:"column:pending_video_script_count;comment:待发视频脚本数量" json:"pendingVideoScriptCount"` PendingVideoScriptCount int `gorm:"column:pending_video_script_count;comment:待发视频脚本数量" json:"pendingVideoScriptCount"`
PendingReportCount int `gorm:"column:pending_report_count;comment:待发竞品报告数量" json:"pendingReportCount"`
// 已完成统计 // 已完成统计
CompleteVideoScriptCount int `gorm:"column:complete_video_script_count;comment:已完成视频脚本数" json:"completeVideoScriptCount"` CompleteVideoScriptCount int `gorm:"column:complete_video_script_count;comment:已完成视频脚本数" json:"completeVideoScriptCount"`
CompleteVideoCount int `gorm:"column:complete_video_count;comment:已完成视频数" json:"completeVideoCount"` CompleteVideoCount int `gorm:"column:complete_video_count;comment:已完成视频数" json:"completeVideoCount"`
CompletePostCount int `gorm:"column:complete_post_count;comment:已完成图文数" json:"completePostCount"` CompletePostCount int `gorm:"column:complete_post_count;comment:已完成图文数" json:"completePostCount"`
CompleteDataCount int `gorm:"column:complete_data_count;comment:已完成数据数" json:"completeDataCount"` CompleteDataCount int `gorm:"column:complete_data_count;comment:已完成数据数" json:"completeDataCount"`
CompleteReportCount int `gorm:"column:complete_report_count;comment:已完成竞品报告数" json:"completeReportCount"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"` UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"`
} }
@ -123,10 +129,12 @@ type TaskAssignRecordsSummary struct {
TotalPendingVideoCount int `json:"totalPendingVideoCount"` TotalPendingVideoCount int `json:"totalPendingVideoCount"`
TotalPendingPostCount int `json:"totalPendingPostCount"` TotalPendingPostCount int `json:"totalPendingPostCount"`
TotalPendingDataCount int `json:"totalPendingDataCount"` TotalPendingDataCount int `json:"totalPendingDataCount"`
TotalPendingReportCount int `json:"totalPendingReportCount"`
TotalCompleteVideoScriptCount int `json:"totalCompleteVideoScriptCount"` TotalCompleteVideoScriptCount int `json:"totalCompleteVideoScriptCount"`
TotalCompleteVideoCount int `json:"totalCompleteVideoCount"` TotalCompleteVideoCount int `json:"totalCompleteVideoCount"`
TotalCompletePostCount int `json:"totalCompletePostCount"` TotalCompletePostCount int `json:"totalCompletePostCount"`
TotalCompleteDataCount int `json:"totalCompleteDataCount"` TotalCompleteDataCount int `json:"totalCompleteDataCount"`
TotalCompleteReportCount int `json:"totalCompleteReportCount"`
} }
// ValidArtistInfo 有效艺人信息结构体 // ValidArtistInfo 有效艺人信息结构体
@ -180,6 +188,13 @@ type ArtistUploadStatsItem struct {
ReleasedDataAnalysisTotal int `json:"releasedDataAnalysisTotal" gorm:"column:released_data_total"` ReleasedDataAnalysisTotal int `json:"releasedDataAnalysisTotal" gorm:"column:released_data_total"`
PendingDataAnalysisCount int `json:"pendingDataAnalysisCount" gorm:"column:pending_data_count"` PendingDataAnalysisCount int `json:"pendingDataAnalysisCount" gorm:"column:pending_data_count"`
// 竞品报告
UploadedReportCount int `json:"uploadedReportCount" gorm:"column:uploaded_report_count"`
BundleReportTotal int `json:"bundleReportTotal" gorm:"column:bundle_report_total"`
IncreaseReportTotal int `json:"increaseReportTotal" gorm:"column:increase_report_total"`
ReleasedReportTotal int `json:"releasedReportTotal" gorm:"column:released_report_total"`
PendingReportCount int `json:"pendingReportCount" gorm:"column:pending_report_count"`
// 任务管理 // 任务管理
LastTaskAssignee string `json:"lastTaskAssignee" gorm:"column:last_task_assignee"` LastTaskAssignee string `json:"lastTaskAssignee" gorm:"column:last_task_assignee"`
TaskAssigneeNum string `json:"taskAssigneeNum" gorm:"column:task_assignee_num"` TaskAssigneeNum string `json:"taskAssigneeNum" gorm:"column:task_assignee_num"`
@ -195,6 +210,7 @@ type ArtistUploadStatsItem struct {
AllowVideoCount int `json:"allowVideoCount" gorm:"column:allow_video_count"` AllowVideoCount int `json:"allowVideoCount" gorm:"column:allow_video_count"`
AllowPostCount int `json:"allowPostCount" gorm:"column:allow_post_count"` AllowPostCount int `json:"allowPostCount" gorm:"column:allow_post_count"`
AllowDataCount int `json:"allowDataCount" gorm:"column:allow_data_count"` AllowDataCount int `json:"allowDataCount" gorm:"column:allow_data_count"`
AllowReportCount int `json:"allowReportCount" gorm:"column:allow_report_count"`
} }
// ArtistPendingAssignItem 艺人可指派数量(可上传数 - 已指派且未完成的数量) // ArtistPendingAssignItem 艺人可指派数量(可上传数 - 已指派且未完成的数量)
@ -206,6 +222,7 @@ type ArtistPendingAssignItem struct {
AllowVideoCount int `json:"allowVideoCount" gorm:"column:allow_video_count"` AllowVideoCount int `json:"allowVideoCount" gorm:"column:allow_video_count"`
AllowPostCount int `json:"allowPostCount" gorm:"column:allow_post_count"` AllowPostCount int `json:"allowPostCount" gorm:"column:allow_post_count"`
AllowDataCount int `json:"allowDataCount" gorm:"column:allow_data_count"` AllowDataCount int `json:"allowDataCount" gorm:"column:allow_data_count"`
AllowReportCount int `json:"allowReportCount" gorm:"column:allow_report_count"`
} }
// CreateTaskWorkLogRequest 创建任务日志请求参数 // CreateTaskWorkLogRequest 创建任务日志请求参数
@ -221,7 +238,7 @@ type CreateTaskWorkLogRequest struct {
// 操作信息 // 操作信息
OperationType int `json:"operationType"` // 任务操作类型 1:加任务 2:消耗任务 3:完成任务 4:任务过期(必填) OperationType int `json:"operationType"` // 任务操作类型 1:加任务 2:消耗任务 3:完成任务 4:任务过期(必填)
TaskType int `json:"taskType"` // 任务类型 1:视频 2:图片 3:数据分析(必填) TaskType int `json:"taskType"` // 任务类型 1:视频 2:图片 3:数据分析 4: 视频脚本 5: 竞品报告
TaskCount int `json:"taskCount"` // 任务数量(必填) TaskCount int `json:"taskCount"` // 任务数量(必填)
Remark string `json:"remark"` // 任务备注 Remark string `json:"remark"` // 任务备注
@ -229,3 +246,14 @@ type CreateTaskWorkLogRequest struct {
OperatorName string `json:"operatorName"` // 任务操作人姓名 OperatorName string `json:"operatorName"` // 任务操作人姓名
OperatorNum string `json:"operatorNum"` // 任务操作人账号 OperatorNum string `json:"operatorNum"` // 任务操作人账号
} }
type TaskWorkLogQueryRequest struct {
AssignRecordsUUID string `json:"assignRecordsUUID"`
OperationType int `json:"operationType"`
TaskType int `json:"taskType"`
ArtistUUID string `json:"artistUUID"`
SubNum string `json:"subNum"`
ArtistName string `json:"artistName"`
Page int `json:"page"`
PageSize int `json:"pageSize"`
}

View File

@ -156,8 +156,8 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundl
IncreaseCompetitiveConsumptionNumber: int32(m.IncreaseCompetitiveConsumptionNumber) + int32(m.IncreaseLimitCompetitiveConsumptionNumber) + int32(m.IncreaseLimitCompetitiveExpiredConsumptionNumber), IncreaseCompetitiveConsumptionNumber: int32(m.IncreaseCompetitiveConsumptionNumber) + int32(m.IncreaseLimitCompetitiveConsumptionNumber) + int32(m.IncreaseLimitCompetitiveExpiredConsumptionNumber),
InvalidBundleCompetitiveNumber: int32(m.InvalidBundleCompetitiveNumber), InvalidBundleCompetitiveNumber: int32(m.InvalidBundleCompetitiveNumber),
InvalidIncreaseCompetitiveNumber: int32(m.InvalidIncreaseCompetitiveNumber), InvalidIncreaseCompetitiveNumber: int32(m.InvalidIncreaseCompetitiveNumber),
MonthlyNewBundleCompetitiveNumber: int32(cal(m.BundleBalance, m.BundleLimitCompetitiveNumber, m.MonthlyLimitCompetitiveQuotaNumber, date) + cal(m.BundleBalance, m.BundleLimitCompetitiveExpiredNumber, m.MonthlyLimitCompetitiveQuotaNumber, date)), MonthlyNewBundleCompetitiveNumber: int32(qua(m.BundleBalance, m.BundleLimitCompetitiveNumber, m.MonthlyLimitCompetitiveQuotaNumber, date) + cal(m.BundleBalance, m.BundleLimitCompetitiveExpiredNumber, m.MonthlyLimitCompetitiveQuotaNumber, date)),
MonthlyNewIncreaseCompetitiveNumber: int32(cal(m.BundleBalance, m.IncreaseLimitCompetitiveNumber, m.MonthlyLimitCompetitiveQuotaNumber, date) + cal(m.BundleBalance, m.IncreaseLimitCompetitiveExpiredNumber, m.MonthlyLimitCompetitiveQuotaNumber, date)), MonthlyNewIncreaseCompetitiveNumber: int32(qua(m.BundleBalance, m.IncreaseLimitCompetitiveNumber, m.MonthlyLimitCompetitiveQuotaNumber, date) + cal(m.BundleBalance, m.IncreaseLimitCompetitiveExpiredNumber, m.MonthlyLimitCompetitiveQuotaNumber, date)),
MonthBundleCompetitiveConsumptionNumber: int32(m.MonthlyBundleCompetitiveConsumptionNumber) + int32(m.MonthlyBundleLimitCompetitiveConsumptionNumber) + int32(m.MonthlyBundleLimitExpiredCompetitiveConsumptionNumber), MonthBundleCompetitiveConsumptionNumber: int32(m.MonthlyBundleCompetitiveConsumptionNumber) + int32(m.MonthlyBundleLimitCompetitiveConsumptionNumber) + int32(m.MonthlyBundleLimitExpiredCompetitiveConsumptionNumber),
MonthIncreaseCompetitiveConsumptionNumber: int32(m.MonthlyIncreaseCompetitiveConsumptionNumber) + int32(m.MonthlyIncreaseLimitCompetitiveConsumptionNumber) + int32(m.MonthlyIncreaseLimitExpiredCompetitiveConsumptionNumber), MonthIncreaseCompetitiveConsumptionNumber: int32(m.MonthlyIncreaseCompetitiveConsumptionNumber) + int32(m.MonthlyIncreaseLimitCompetitiveConsumptionNumber) + int32(m.MonthlyIncreaseLimitExpiredCompetitiveConsumptionNumber),
MonthlyBundleCompetitiveNumber: int32(m.BundleCompetitiveNumber) - int32(m.BundleCompetitiveConsumptionNumber) + int32(m.MonthlyBundleLimitCompetitiveNumber) + int32(m.MonthlyBundleLimitExpiredCompetitiveNumber) - int32(m.MonthlyBundleLimitCompetitiveConsumptionNumber), MonthlyBundleCompetitiveNumber: int32(m.BundleCompetitiveNumber) - int32(m.BundleCompetitiveConsumptionNumber) + int32(m.MonthlyBundleLimitCompetitiveNumber) + int32(m.MonthlyBundleLimitExpiredCompetitiveNumber) - int32(m.MonthlyBundleLimitCompetitiveConsumptionNumber),
@ -325,6 +325,26 @@ func cal(data model.BundleBalance, total, limit int, date time.Time) int {
return min(limit, remaining) return min(limit, remaining)
} }
// 计算每个季度发放的数目
func qua(data model.BundleBalance, total, limit int, date time.Time) int {
var released int // 已释放的次数
if data.StartAt.Month() == date.Month() && data.StartAt.Year() == date.Year() {
} else {
released += limit
}
interval := max((date.Year()*12+int(date.Month())-(data.StartAt.Year()*12+int(data.StartAt.Month())))/3, 1) // 释放了多少个季度
released += max(interval-1, 0) * limit // 已经释放的数量
remaining := max(total-released, 0) // 还剩余多少次没有发放
if data.StartAt.Month() == date.Month() && data.StartAt.Year() == date.Year() { // 本月为第一个月购买
return min(limit, remaining)
}
monthDiff := date.Year()*12 + int(date.Month()) - (data.StartAt.Year()*12 + int(data.StartAt.Month()))
if monthDiff%3 == 0 && data.ExpiredAt.Month() != date.Month() {
return min(limit, remaining)
}
return 0
}
func CreateBundleBalance(req *bundle.CreateBundleBalanceReq) (*bundle.CreateBundleBalanceResp, error) { func CreateBundleBalance(req *bundle.CreateBundleBalanceReq) (*bundle.CreateBundleBalanceResp, error) {
var data model.BundleBalance var data model.BundleBalance
orderReq := &bundle.OrderRecordsDetailRequest{} orderReq := &bundle.OrderRecordsDetailRequest{}
@ -755,6 +775,8 @@ func buildDefaultBalanceLayout() string {
{"增值数据总数", "increaseDataAnalysisNumber", 2}, {"增值数据总数", "increaseDataAnalysisNumber", 2},
{"当前已用套餐数据数", "bundleDataAnalysisConsumptionNumber", 2}, {"当前已用套餐数据数", "bundleDataAnalysisConsumptionNumber", 2},
{"当前已用增值数据数", "increaseDataAnalysisConsumptionNumber", 2}, {"当前已用增值数据数", "increaseDataAnalysisConsumptionNumber", 2},
{"当前可用套餐数据数", "monthlyBundleDataAnalysisNumber", 2},
{"当前可用增值数据数", "monthlyIncreaseDataAnalysisNumber", 2},
{"当前作废套餐数据数", "invalidBundleDataAnalysisNumber", 2}, {"当前作废套餐数据数", "invalidBundleDataAnalysisNumber", 2},
{"当前作废增值数据数", "invalidIncreaseDataAnalysisNumber", 2}, {"当前作废增值数据数", "invalidIncreaseDataAnalysisNumber", 2},
{"当月新增套餐数据数", "monthlyNewBundleDataAnalysisNumber", 2}, {"当月新增套餐数据数", "monthlyNewBundleDataAnalysisNumber", 2},
@ -769,6 +791,8 @@ func buildDefaultBalanceLayout() string {
{"增值竞品总数", "increaseCompetitiveNumber", 2}, {"增值竞品总数", "increaseCompetitiveNumber", 2},
{"当前已用套餐竞品数", "bundleCompetitiveConsumptionNumber", 2}, {"当前已用套餐竞品数", "bundleCompetitiveConsumptionNumber", 2},
{"当前已用增值竞品数", "increaseCompetitiveConsumptionNumber", 2}, {"当前已用增值竞品数", "increaseCompetitiveConsumptionNumber", 2},
{"当前可用套餐竞品数", "monthlyBundleCompetitiveNumber", 2},
{"当前可用增值竞品数", "monthlyIncreaseCompetitiveNumber", 2},
{"当前作废套餐竞品数", "invalidBundleCompetitiveNumber", 2}, {"当前作废套餐竞品数", "invalidBundleCompetitiveNumber", 2},
{"当前作废增值竞品数", "invalidIncreaseCompetitiveNumber", 2}, {"当前作废增值竞品数", "invalidIncreaseCompetitiveNumber", 2},
{"当月新增套餐竞品数", "monthlyNewBundleCompetitiveNumber", 2}, {"当月新增套餐竞品数", "monthlyNewBundleCompetitiveNumber", 2},

View File

@ -0,0 +1,77 @@
package logic
import (
"encoding/json"
"errors"
"fmt"
"micro-bundle/internal/dao"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"github.com/samber/lo"
)
func SendQuestionnaireSurvey(req *bundle.SendQuestionnaireSurveyRequest) (*bundle.SendQuestionnaireSurveyResponse, error) {
resp, err := dao.SendQuestionnaireSurvey(req)
if err != nil {
return nil, err
}
return resp, nil
}
func GetQuestionnaireSurveyInfo(req *bundle.GetQuestionnaireSurveyInfoRequest) (*bundle.GetQuestionnaireSurveyInfoResponse, error) {
resp := new(bundle.GetQuestionnaireSurveyInfoResponse)
data, err := dao.GetQuestionnaireSurveyInfo(req)
if err != nil {
return nil, errors.New("获取问卷信息失败")
}
bundleInfo := &model.BundleInfo{}
err = json.Unmarshal([]byte(data.BundleInfo), bundleInfo)
if err != nil {
return nil, errors.New("反序列化失败")
}
fmt.Println("获取套餐名称:", bundleInfo.BundleName)
resp.UserName = data.UserName
resp.BundleInfo = &bundle.SurveyBundleInfo{}
resp.BundleInfo.BundleName = bundleInfo.BundleName
resp.BundleInfo.StartAt = bundleInfo.StartAt.Format("2006-01-02 15:04:05")
resp.BundleInfo.ExpiredAt = bundleInfo.ExpiredAt.Format("2006-01-02 15:04:05")
resp.BundleInfo.BundleAccountNumber = int32(bundleInfo.BundleAccountNumber)
resp.BundleInfo.BundleVideoNumber = int32(bundleInfo.BundleVideoNumber)
resp.BundleInfo.IncreaseVideoNumber = int32(bundleInfo.IncreaseVideoNumber)
resp.BundleInfo.BundleImageNumber = int32(bundleInfo.BundleImageNumber)
resp.BundleInfo.BundleDataNumber = int32(bundleInfo.BundleDataNumber)
resp.BundleInfo.BundleCompetitiveNumber = int32(bundleInfo.BundleCompetitiveNumber)
return resp, nil
}
func CreateQuestionnaireSurveyAnswer(req *bundle.CreateQuestionnaireSurveyAnswerRequest) (*bundle.CreateQuestionnaireSurveyAnswerResponse, error) {
resp := new(bundle.CreateQuestionnaireSurveyAnswerResponse)
err := dao.CreateQuestionnaireSurveyAnswer(req)
if err != nil {
return nil, err
}
return resp, nil
}
func GetQuestionnaireSurveyList(req *bundle.GetQuestionnaireSurveyListRequest) (resp *bundle.GetQuestionnaireSurveyListResponse, err error) {
resp = &bundle.GetQuestionnaireSurveyListResponse{}
data, total, err := dao.GetQuestionnaireSurveyList(req)
if err != nil {
return nil, err
}
resp.Total = int32(total)
resp.Page = req.Page
resp.Size = req.PageSize
resp.SurveyList = lo.Map(data, func(m *model.QuestionnaireSurvey, _ int) *bundle.SurveyListInfo {
return &bundle.SurveyListInfo{
UserName: m.UserName,
UserTel: m.UserTel,
UserNum: m.UserNum,
SurveyTitle: m.SurveyTitle,
SurveyStatus: int32(m.SurveyStatus),
SurveyUrl: m.SurveyUrl,
}
})
return resp, nil
}

View File

@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"micro-bundle/internal/dao" "micro-bundle/internal/dao"
"micro-bundle/internal/dto" "micro-bundle/internal/dto"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle" "micro-bundle/pb/bundle"
commonErr "micro-bundle/pkg/err" commonErr "micro-bundle/pkg/err"
"strings" "strings"
@ -80,10 +81,10 @@ func AssignTask(req *dto.TaskAssignRequest) error {
if !isValid { if !isValid {
return commonErr.ReturnError(nil, "员工不能被指派任务", "该员工不在可指派任务的员工列表中") return commonErr.ReturnError(nil, "员工不能被指派任务", "该员工不在可指派任务的员工列表中")
} }
if req.AssignVideoCount < 0 || req.AssignPostCount < 0 || req.AssignDataCount < 0 || req.AssignVideoScriptCount < 0 { if req.AssignVideoCount < 0 || req.AssignPostCount < 0 || req.AssignDataCount < 0 || req.AssignVideoScriptCount < 0 || req.AssignReportCount < 0 {
return commonErr.ReturnError(nil, "指派数量不能小于0", "任一指派数量不得小于0") return commonErr.ReturnError(nil, "指派数量不能小于0", "任一指派数量不得小于0")
} }
if req.AssignVideoCount == 0 && req.AssignPostCount == 0 && req.AssignDataCount == 0 && req.AssignVideoScriptCount == 0 { if req.AssignVideoCount == 0 && req.AssignPostCount == 0 && req.AssignDataCount == 0 && req.AssignVideoScriptCount == 0 && req.AssignReportCount == 0 {
return commonErr.ReturnError(nil, "指派数量不能全部为0", "至少有一个指派数量需大于0") return commonErr.ReturnError(nil, "指派数量不能全部为0", "至少有一个指派数量需大于0")
} }
@ -117,13 +118,13 @@ func BatchAssignTask(items []*dto.BatchAssignItem) error {
if !isValid { if !isValid {
return commonErr.ReturnError(nil, "员工不能被指派任务", "该员工不在可指派任务的员工列表中") return commonErr.ReturnError(nil, "员工不能被指派任务", "该员工不在可指派任务的员工列表中")
} }
if it.AssignVideoCount < 0 || it.AssignPostCount < 0 || it.AssignDataCount < 0 || it.AssignVideoScriptCount < 0 { if it.AssignVideoCount < 0 || it.AssignPostCount < 0 || it.AssignDataCount < 0 || it.AssignVideoScriptCount < 0 || it.AssignReportCount < 0 {
return commonErr.ReturnError(nil, "指派数量不能小于0", "任一指派数量不得小于0") return commonErr.ReturnError(nil, "指派数量不能小于0", "任一指派数量不得小于0")
} }
if it.AssignVideoCount == 0 && it.AssignPostCount == 0 && it.AssignDataCount == 0 && it.AssignVideoScriptCount == 0 { if it.AssignVideoCount == 0 && it.AssignPostCount == 0 && it.AssignDataCount == 0 && it.AssignVideoScriptCount == 0 && it.AssignReportCount == 0 {
return commonErr.ReturnError(nil, "指派数量不能全部为0", "至少有一个指派数量需大于0") return commonErr.ReturnError(nil, "指派数量不能全部为0", "至少有一个指派数量需大于0")
} }
if it.AssignVideoCount > 0 || it.AssignPostCount > 0 || it.AssignDataCount > 0 || it.AssignVideoScriptCount > 0 { if it.AssignVideoCount > 0 || it.AssignPostCount > 0 || it.AssignDataCount > 0 || it.AssignVideoScriptCount > 0 || it.AssignReportCount > 0 {
hasPositive = true hasPositive = true
} }
} }
@ -165,25 +166,31 @@ func GetEmployeeAssignedTasks(req *dto.EmployeeTaskQueryRequest) ([]*dto.TaskAss
var recordResponse []*dto.TaskAssignRecordsResponse var recordResponse []*dto.TaskAssignRecordsResponse
for _, record := range record { for _, record := range record {
recordResponse = append(recordResponse, &dto.TaskAssignRecordsResponse{ recordResponse = append(recordResponse, &dto.TaskAssignRecordsResponse{
AssignRecordsUUID: record.AssignRecordsUUID, AssignRecordsUUID: record.AssignRecordsUUID,
SubNum: record.SubNum, SubNum: record.SubNum,
TelNum: record.TelNum, TelNum: record.TelNum,
ArtistName: record.ArtistName, ArtistName: record.ArtistName,
Status: record.Status, Status: record.Status,
ActualStatus: record.ActualStatus, ActualStatus: record.ActualStatus,
CompleteTime: record.CompleteTime, CompleteTime: record.CompleteTime,
OperatorType: record.OperatorType, OperatorType: record.OperatorType,
Operator: record.Operator, Operator: record.Operator,
OperatorNum: record.OperatorNum, OperatorNum: record.OperatorNum,
OperatorTime: record.OperatorTime, OperatorTime: record.OperatorTime,
TaskAssignee: record.TaskAssignee, TaskAssignee: record.TaskAssignee,
TaskAssigneeNum: record.TaskAssigneeNum, TaskAssigneeNum: record.TaskAssigneeNum,
PendingVideoCount: record.AssignVideoCount, PendingVideoCount: record.AssignVideoCount,
PendingPostCount: record.AssignPostCount, PendingPostCount: record.AssignPostCount,
PendingDataCount: record.AssignDataCount, PendingDataCount: record.AssignDataCount,
PendingVideoScriptCount: record.AssignVideoScriptCount, PendingVideoScriptCount: record.AssignVideoScriptCount,
TaskBatch: record.TaskBatch, PendingReportCount: record.AssignReportCount,
UpdatedAt: record.UpdatedAt, CompleteVideoScriptCount: record.CompleteVideoScriptCount,
CompleteVideoCount: record.CompleteVideoCount,
CompletePostCount: record.CompletePostCount,
CompleteDataCount: record.CompleteDataCount,
CompleteReportCount: record.CompleteReportCount,
TaskBatch: record.TaskBatch,
UpdatedAt: record.UpdatedAt,
}) })
} }
@ -211,6 +218,7 @@ func GetEmployeeAssignedTasks(req *dto.EmployeeTaskQueryRequest) ([]*dto.TaskAss
PendingPostCount: record.PendingPostCount, PendingPostCount: record.PendingPostCount,
PendingDataCount: record.PendingDataCount, PendingDataCount: record.PendingDataCount,
PendingVideoScriptCount: record.PendingVideoScriptCount, PendingVideoScriptCount: record.PendingVideoScriptCount,
PendingReportCount: record.PendingReportCount,
TaskBatch: record.TaskBatch, TaskBatch: record.TaskBatch,
UpdatedAt: record.UpdatedAt, UpdatedAt: record.UpdatedAt,
}) })
@ -331,10 +339,12 @@ func GetTaskAssignRecordsList(req *dto.TaskAssignRecordsQueryRequest) ([]*dto.Ta
PendingPostCount: record.AssignPostCount, PendingPostCount: record.AssignPostCount,
PendingDataCount: record.AssignDataCount, PendingDataCount: record.AssignDataCount,
PendingVideoScriptCount: record.AssignVideoScriptCount, PendingVideoScriptCount: record.AssignVideoScriptCount,
PendingReportCount: record.AssignReportCount,
CompleteVideoScriptCount: record.CompleteVideoScriptCount, CompleteVideoScriptCount: record.CompleteVideoScriptCount,
CompleteVideoCount: record.CompleteVideoCount, CompleteVideoCount: record.CompleteVideoCount,
CompletePostCount: record.CompletePostCount, CompletePostCount: record.CompletePostCount,
CompleteDataCount: record.CompleteDataCount, CompleteDataCount: record.CompleteDataCount,
CompleteReportCount: record.CompleteReportCount,
UpdatedAt: record.UpdatedAt, UpdatedAt: record.UpdatedAt,
}) })
} }
@ -401,6 +411,12 @@ func buildDefaultPendingLayout() string {
{"已释放数据额度", "releasedDataAnalysisTotal", 1}, {"已释放数据额度", "releasedDataAnalysisTotal", 1},
{"套餐数据总数", "bundleDataAnalysisTotal", 1}, {"套餐数据总数", "bundleDataAnalysisTotal", 1},
{"增值数据总数", "increaseDataAnalysisTotal", 1}, {"增值数据总数", "increaseDataAnalysisTotal", 1},
{"可指派竞品报告数", "allowReportCount", 1},
{"可上传竞品报告数", "pendingReportCount", 1},
{"已上传竞品报告数", "uploadedReportCount", 1},
{"已释放竞品报告额度", "releasedReportTotal", 1},
{"套餐竞品报告总数", "bundleReportTotal", 1},
{"增值竞品报告总数", "increaseReportTotal", 1},
{"进行中任务数", "progressTaskCount", 1}, {"进行中任务数", "progressTaskCount", 1},
{"已完成任务数", "completeTaskCount", 1}, {"已完成任务数", "completeTaskCount", 1},
} }
@ -426,13 +442,17 @@ func AddHiddenTaskAssignee(taskAssignee string, taskAssigneeNum string) error {
return dao.AddHiddenTaskAssignee(taskAssignee, taskAssigneeNum) return dao.AddHiddenTaskAssignee(taskAssignee, taskAssigneeNum)
} }
func GetTaskWorkLogList(req *dto.TaskWorkLogQueryRequest) ([]*model.TaskWorkLog, int64, error) {
return dao.GetTaskWorkLogList(req)
}
// CreateTaskWorkLog 创建任务日志记录 // CreateTaskWorkLog 创建任务日志记录
func CreateTaskWorkLog(req *dto.CreateTaskWorkLogRequest) error { func CreateTaskWorkLog(req *dto.CreateTaskWorkLogRequest) error {
if req.OperationType < 1 || req.OperationType > 4 { if req.OperationType < 1 || req.OperationType > 4 {
return commonErr.ReturnError(nil, "参数错误", "操作类型必须在1-4之间") return commonErr.ReturnError(nil, "参数错误", "操作类型必须在1-4之间")
} }
if req.TaskType < 1 || req.TaskType > 3 { if req.TaskType < 1 || req.TaskType > 6 {
return commonErr.ReturnError(nil, "参数错误", "任务类型必须在1-3之间") return commonErr.ReturnError(nil, "参数错误", "任务类型必须在1-6之间")
} }
if req.TaskCount < 0 { if req.TaskCount < 0 {
return commonErr.ReturnError(nil, "参数错误", "任务数量不能为负数") return commonErr.ReturnError(nil, "参数错误", "任务数量不能为负数")

View File

@ -239,3 +239,68 @@ type VideoScript struct {
func (VideoScript) TableName() string { func (VideoScript) TableName() string {
return "cast_video_script" return "cast_video_script"
} }
// 竞品报告表
type CastCompetitiveReport struct {
Uuid string `gorm:"column:uuid;type:varchar(50);NOT NULL;primary_key;" json:"id"`
SubNum string `gorm:"column:subNum;type:varchar(50);NOT NULL;default:'';comment:'艺人编号'" json:"subNum"`
ArtistName string `gorm:"column:artist_name;type:varchar(50);NOT NULL;default:'';comment:'艺人名字'" json:"artistName"`
ArtistID string `gorm:"column:artist_id;type:varchar(50);NOT NULL;default:'';comment:'艺人ID';" json:"artistID"`
ArtistPhone string `gorm:"column:artist_phone;type:varchar(50);NOT NULL;default:'';comment:'艺人手机号'" json:"artistPhone"`
ReportContent string `gorm:"column:report_content;type:text;NOT NULL;comment:报告内容" json:"reportContent"`
ImageUrl string `gorm:"column:image_url;type:varchar(255);NOT NULL;default:'';comment:图片url" json:"imageUrl"`
Title string `gorm:"column:title;type:varchar(50);NOT NULL;" json:"title"`
OperatorID string `gorm:"column:operator_id;type:varchar(50);NOT NULL;default:'';comment:操作人ID" json:"operatorID"`
OperatorName string `gorm:"column:operator_name;type:varchar(50);NOT NULL;default:'';comment:操作人名称" json:"operatorName"`
WorkReportStatus uint8 `gorm:"column:work_report_status;type:tinyint(1);NOT NULL;default:1;comment: 1 待提交 2 审批中 3 审批驳回 4 待艺人验收 5 验收失败 6 待阅读 7 已阅读" json:"workReportStatus"`
Reason string `gorm:"column:reason;type:varchar(255);NOT NULL;default:'';comment:原因" json:"reason"`
ComfirmType int `gorm:"column:comfirm_type;type:tinyint(1);NOT NULL;default:0;comment:'确认类型 1 艺人确认 2 系统确认'" json:"comfirmType"`
Cost uint8 `gorm:"column:cost;type:tinyint(1);NOT NULL;default:0;comment: 1 消耗 2 未消耗" json:"cost"`
SubmitTime string `gorm:"column:submit_time;type:varchar(50);NOT NULL;default:'';comment:'提交时间'" json:"submitTime"`
StatusUpdateTime string `gorm:"column:status_update_time;type:varchar(50);NOT NULL;default:'';comment:状态更新时间" json:"statusUpdateTime"`
ApprovalID string `gorm:"column:approval_id;type:varchar(50);NOT NULL;default:'';comment:审批ID" json:"approvalID"`
ConfirmRemark string `gorm:"column:confirm_remark;type:varchar(300);NOT NULL;default:'';comment:艺人确认备注" json:"confirmRemark"`
// pdf 的 url 链接
PdfUrl string `gorm:"column:pdf_url;type:varchar(255);NOT NULL;default:'';comment:'pdf 的 url 链接'" json:"pdfUrl"`
Source uint8 `gorm:"column:source;type:tinyint(1);NOT NULL;default:1;comment: 1 系统 2 导入" json:"source"`
Extra *CastCompetitiveReportExtra `gorm:"foreignKey:ReportUuid;references:Uuid" json:"extra,omitempty"`
WorkItems []CastCompetitiveReportWorkItem `gorm:"foreignKey:ReportUuid;references:Uuid" json:"workItems,omitempty"`
CreatedAt int `gorm:"column:created_at;type:int(11);autoCreateTime" json:"createdAt"`
UpdatedAt int `gorm:"column:updated_at;type:int(11);autoUpdateTime" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt
}
func (CastCompetitiveReport) TableName() string {
return "cast_competitive_report"
}
type CastCompetitiveReportExtra struct {
ReportUuid string `gorm:"column:report_uuid;type:varchar(50);NOT NULL;index:idx_report_uuid;default:'';comment:竞品报告uuid;primary_key" json:"reportUuid"`
ArtistConfirmedTime int64 `gorm:"column:artist_confirmed_time;type:bigint(20);NOT NULL;default:0;comment:艺人确认时间" json:"artistConfirmedTime"`
CostType uint32 `gorm:"column:cost_type;type:tinyint(3);NOT NULL;default:1;comment:计费类型 1 套餐 2 增值" json:"costType"`
CreatedAt int `gorm:"column:created_at;type:int(11);autoCreateTime" json:"createdAt"`
UpdatedAt int `gorm:"column:updated_at;type:int(11);autoUpdateTime" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt
}
func (CastCompetitiveReportExtra) TableName() string {
return "cast_competitive_report_extra"
}
// 竞品报告作品关联表 - 存储竞品报告关联的作品uuid最多5个
type CastCompetitiveReportWorkItem struct {
// 使用联合主键 (report_uuid, work_uuid) 防止同一报告重复关联同一作品
ReportUuid string `gorm:"column:report_uuid;type:varchar(50);NOT NULL;primaryKey;index:idx_report_uuid;default:'';comment:竞品报告uuid" json:"reportUuid"`
WorkUuid string `gorm:"column:work_uuid;type:varchar(50);NOT NULL;primaryKey;index:idx_work_uuid;default:'';comment:作品uuid" json:"workUuid"`
CreatedAt int `gorm:"column:created_at;type:int(11);autoCreateTime" json:"createdAt"`
UpdatedAt int `gorm:"column:updated_at;type:int(11);autoUpdateTime" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt
}
func (CastCompetitiveReportWorkItem) TableName() string {
return "cast_competitive_report_work_item"
}

View File

@ -0,0 +1,75 @@
package model
import (
"time"
"gorm.io/gorm"
)
type QuestionnaireSurvey struct {
gorm.Model
SurveyUUID string `gorm:"column:survey_uuid;comment:问卷UUID" json:"survey_uuid"`
UserId int `gorm:"column:user_id;comment:用户ID" json:"user_id"`
UserNum string `gorm:"column:user_num;comment:用户编号" json:"user_num"`
UserName string `gorm:"column:user_name;comment:用户姓名" json:"user_name"`
UserTel string `gorm:"column:user_tel;comment:用户电话" json:"user_tel"`
OrderUUID string `gorm:"column:order_uuid;comment:订单UUID" json:"order_uuid"`
SendTime time.Time `gorm:"column:send_time;comment:发送时间" json:"send_time"`
SubmitTime time.Time `gorm:"column:submit_time;comment:提交时间" json:"submit_time"`
SurveyTitle string `gorm:"column:survey_title;comment:问卷标题" json:"survey_title"`
SurveyStatus int `gorm:"column:survey_status;comment:问卷状态 1:已发送 2:已提交" json:"survey_status"`
BundleInfo string `gorm:"column:bundle_info;type:varchar(1024);comment:套餐信息" json:"bundle_info"`
SurveyAnswer string `gorm:"column:survey_answer;type:varchar(512);comment:问卷答案" json:"survey_answer"`
MeritsReview string `gorm:"column:merits_review;type:varchar(512);comment:优点评价" json:"merits_review"`
SuggestionsorImprovements string `gorm:"column:suggestionsor_improvements;type:varchar(512);comment:改进建议" json:"suggestionsor_improvements"`
AdditionalComments string `gorm:"column:additional_comments;type:varchar(512);comment:补充意见" json:"additional_comments"`
SurveyUrl string `gorm:"column:survey_url;comment:问卷URL" json:"survey_url"`
SubmitBy string `gorm:"column:submit_by;comment:提交人" json:"submit_by"`
}
func (QuestionnaireSurvey) TableName() string {
return "questionnaire_survey"
}
type BundleInfo struct {
BundleName string `gorm:"column:bundle_name;not null;comment:套餐名称" json:"bundle_name"`
StartAt time.Time `gorm:"column:start_at;type:datetime;comment:套餐开始时间"`
ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:套餐过期时间"`
BundleAccountNumber int `gorm:"column:bundle_account_number;not null;comment:套餐账号数量" json:"bundle_account_number"`
BundleVideoNumber int `gorm:"column:bundle_video_number;not null;comment:套餐视频数量" json:"bundle_video_number"`
IncreaseVideoNumber int `gorm:"column:increase_video_number;not null;comment:增值视频数量" json:"increase_video_number"`
BundleImageNumber int `gorm:"column:bundle_image_number;not null;comment:套餐图片数量" json:"bundle_image_number"`
BundleDataNumber int `gorm:"column:bundle_data_number;not null;comment:套餐数据数量" json:"bundle_data_number"`
BundleCompetitiveNumber int `gorm:"column:bundle_competitive_number;not null;comment:套餐竞品数量" json:"bundle_competitive_number"`
}
type SurveyAnswer struct {
BundleAccountScore int32 `gorm:"column:bundle_account_score;not null;comment:套餐账号评分" json:"bundle_account_score"`
BundleVideoScore int32 `gorm:"column:bundle_video_score;not null;comment:套餐视频评分" json:"bundle_video_score"`
IncreaseVideoScore int32 `gorm:"column:increase_video_score;not null;comment:增值视频评分" json:"increase_video_score"`
BundleImageScore int32 `gorm:"column:bundle_image_score;not null;comment:套餐图片评分" json:"bundle_image_score"`
BundleDataScore int32 `gorm:"column:bundle_data_score;not null;comment:套餐数据评分" json:"bundle_data_score"`
BundleCompetitiveScore int32 `gorm:"column:bundle_competitive_score;not null;comment:套餐竞品评分" json:"bundle_competitive_score"`
ServiceResponseSpeed int32 `gorm:"column:service_response_speed;not null;comment:服务响应速度评分" json:"service_response_speed"`
ServiceStaffProfessionalism int32 `gorm:"column:service_staff_professionalism;not null;comment:服务人员专业性评分" json:"service_staff_professionalism"`
}
type UserInfo struct {
UserId int `gorm:"column:user_id;not null;comment:用户ID" json:"user_id"`
UserNum string `gorm:"column:user_num;not null;comment:用户编号" json:"user_num"`
UserName string `gorm:"column:user_name;not null;comment:用户姓名" json:"user_name"`
UserTel string `gorm:"column:user_tel;not null;comment:用户电话" json:"user_tel"`
}
type DbBundleInfo struct {
UserName string `json:"user_name"`
BundleName string `json:"bundle_name"`
StartAt time.Time `json:"start_at"`
ExpiredAt time.Time `json:"expired_at"`
BundleAccountNumber int32 `json:"bundle_account_number"`
BundleVideoNumber int32 `json:"bundle_video_number"`
IncreaseVideoNumber int32 `json:"increase_video_number"`
BundleImageNumber int32 `json:"bundle_image_number"`
BundleDataNumber int32 `json:"bundle_data_number"`
BundleCompetitiveNumber int32 `json:"bundle_competitive_number"`
}

View File

@ -20,6 +20,7 @@ var OrderByPending = map[string]string{
"pending_post_count": "assign_post_count", "pending_post_count": "assign_post_count",
"pending_data_count": "assign_data_count", "pending_data_count": "assign_data_count",
"pending_video_script_count": "assign_video_script_count", "pending_video_script_count": "assign_video_script_count",
"pending_report_count": "assign_report_count",
} }
type TaskManagement struct { type TaskManagement struct {
@ -65,16 +66,19 @@ type TaskAssignRecords struct {
PendingVideoCount int `gorm:"column:pending_video_count;comment:待发视频数量" json:"pendingVideoCount"` PendingVideoCount int `gorm:"column:pending_video_count;comment:待发视频数量" json:"pendingVideoCount"`
PendingPostCount int `gorm:"column:pending_post_count;comment:待发图文数量" json:"pendingPostCount"` PendingPostCount int `gorm:"column:pending_post_count;comment:待发图文数量" json:"pendingPostCount"`
PendingDataCount int `gorm:"column:pending_data_count;comment:待发数据数量" json:"pendingDataCount"` PendingDataCount int `gorm:"column:pending_data_count;comment:待发数据数量" json:"pendingDataCount"`
PendingReportCount int `gorm:"column:pending_report_count;comment:待发竞品报告数量" json:"pendingReportCount"`
// 指派视频脚本数 // 指派视频脚本数
AssignVideoScriptCount int `gorm:"column:assign_video_script_count;comment:指派待发视频脚本数" json:"assignVideoScriptCount"` AssignVideoScriptCount int `gorm:"column:assign_video_script_count;comment:指派待发视频脚本数" json:"assignVideoScriptCount"`
AssignVideoCount int `gorm:"column:assign_video_count;comment:指派待发视频数" json:"assignVideoCount"` AssignVideoCount int `gorm:"column:assign_video_count;comment:指派待发视频数" json:"assignVideoCount"`
AssignPostCount int `gorm:"column:assign_post_count;comment:指派待发图文数" json:"assignPostCount"` AssignPostCount int `gorm:"column:assign_post_count;comment:指派待发图文数" json:"assignPostCount"`
AssignDataCount int `gorm:"column:assign_data_count;comment:指派待发数据数" json:"assignDataCount"` AssignDataCount int `gorm:"column:assign_data_count;comment:指派待发数据数" json:"assignDataCount"`
AssignReportCount int `gorm:"column:assign_report_count;comment:指派待发竞品报告数" json:"assignReportCount"`
// 已完成视频脚本数 // 已完成视频脚本数
CompleteVideoScriptCount int `gorm:"column:complete_video_script_count;comment:已完成视频脚本数" json:"completeVideoScriptCount"` CompleteVideoScriptCount int `gorm:"column:complete_video_script_count;comment:已完成视频脚本数" json:"completeVideoScriptCount"`
CompleteVideoCount int `gorm:"column:complete_video_count;comment:已完成视频数" json:"completeVideoCount"` CompleteVideoCount int `gorm:"column:complete_video_count;comment:已完成视频数" json:"completeVideoCount"`
CompletePostCount int `gorm:"column:complete_post_count;comment:已完成图文数" json:"completePostCount"` CompletePostCount int `gorm:"column:complete_post_count;comment:已完成图文数" json:"completePostCount"`
CompleteDataCount int `gorm:"column:complete_data_count;comment:已完成数据数" json:"completeDataCount"` CompleteDataCount int `gorm:"column:complete_data_count;comment:已完成数据数" json:"completeDataCount"`
CompleteReportCount int `gorm:"column:complete_report_count;comment:已完成竞品报告数" json:"completeReportCount"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"` CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间;index:idx_updated_at" json:"updatedAt"` UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间;index:idx_updated_at" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_assign_deleted_at" json:"deletedAt"` DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_assign_deleted_at" json:"deletedAt"`
@ -84,10 +88,12 @@ func (t *TaskAssignRecords) TableName() string {
return "task_assign_records" return "task_assign_records"
} }
// 指派记录的完成明细表
// 用于记录每次完成的具体 UUID保障可追溯与可回滚避免仅靠汇总计数导致不可逆的统计偏差。
type TaskAssignUUIDItems struct { type TaskAssignUUIDItems struct {
ID int64 `gorm:"primarykey;autoIncrement"` ID int64 `gorm:"primarykey;autoIncrement"`
AssignRecordsUUID string `gorm:"column:assign_records_uuid;comment:指派记录UUID;index:idx_assign_records_uuid;index:idx_assign_records_uuid_type,priority:1" json:"assignRecordsUUID"` AssignRecordsUUID string `gorm:"column:assign_records_uuid;comment:指派记录UUID;index:idx_assign_records_uuid;index:idx_assign_records_uuid_type,priority:1" json:"assignRecordsUUID"`
Type int `gorm:"column:type;comment:指派类型 1:视频 2:图文 3:数据 4:视频脚本;index:idx_assign_records_uuid_type,priority:2" json:"type"` Type int `gorm:"column:type;comment:指派类型 1:视频 2:图文 3:数据 4:视频脚本 5:竞品报告;index:idx_assign_records_uuid_type,priority:2" json:"type"`
UUID string `gorm:"column:uuid;comment:任务UUID;index:idx_uuid" json:"uuid"` UUID string `gorm:"column:uuid;comment:任务UUID;index:idx_uuid" json:"uuid"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"` CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
@ -108,140 +114,6 @@ func (TaskPendingLayout) TableName() string {
return "task_pending_layout" return "task_pending_layout"
} }
// 任务余额表
type TaskBalance struct {
ID int64 `gorm:"primarykey"`
SubNum string `gorm:"column:sub_num;comment:用户编号;index:idx_task_sub_num;not null" json:"subNum"`
TelNum string `gorm:"column:tel_num;comment:手机号;index:idx_task_tel_num;not null" json:"telNum"`
Month string `gorm:"column:month;type:varchar(32);comment:月份;index:idx_task_month;not null" json:"month"`
ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:任务过期时间" json:"expiredAt"`
StartAt time.Time `gorm:"column:start_at;type:datetime;comment:任务开始时间" json:"startAt"`
// ===== 视频类 =====
BundleVideoNumber int `gorm:"column:bundle_video_number;not null;comment:非限制类型套餐权益视频总数"`
IncreaseVideoNumber int `gorm:"column:increase_video_number;not null;comment:非限制类型增值权益视频总数"`
BundleLimitVideoNumber int `gorm:"column:bundle_limit_video_number;not null;comment:套餐权益限制类型非过期总数"`
IncreaseLimitVideoNumber int `gorm:"column:increase_limit_video_number;not null;comment:增值权益限制类型非过期总数"`
BundleLimitVideoExpiredNumber int `gorm:"column:bundle_limit_video_expired_number;not null;comment:套餐权益限制类型会过期总数"`
IncreaseLimitVideoExpiredNumber int `gorm:"column:increase_limit_video_expired_number;not null;comment:增值权益限制类型会过期总数"`
MonthlyInvalidBundleVideoNumber int `gorm:"column:monthly_invalid_bundle_video_number;not null;comment:当月失效的套餐权益视频总数"`
InvalidBundleVideoNumber int `gorm:"column:invalid_bundle_video_number;not null;comment:历史失效的套餐权益视频总数"`
MonthlyInvalidIncreaseVideoNumber int `gorm:"column:monthly_invalid_increase_video_number;not null;comment:当月失效的增值权益视频总数"`
InvalidIncreaseVideoNumber int `gorm:"column:invalid_increase_video_number;not null;comment:历史失效的增值权益视频总数"`
BundleVideoConsumptionNumber int `gorm:"column:bundle_video_consumption_number;not null;comment:非限制类型套餐权益视频使用数"`
IncreaseVideoConsumptionNumber int `gorm:"column:increase_video_consumption_number;not null;comment:非限制类型增值权益视频使用数"`
BundleLimitVideoConsumptionNumber int `gorm:"column:bundle_limit_video_consumption_number;not null;comment:套餐权益限制类型非过期使用数"`
IncreaseLimitVideoConsumptionNumber int `gorm:"column:increase_limit_video_consumption_number;not null;comment:增值权益限制类型非过期使用数"`
BundleLimitVideoExpiredConsumptionNumber int `gorm:"column:bundle_limit_video_expired_consumption_number;not null;comment:套餐权益限制类型会过期使用数"`
IncreaseLimitVideoExpiredConsumptionNumber int `gorm:"column:increase_limit_video_expired_consumption_number;not null;comment:增值权益限制类型会过期使用数"`
MonthlyBundleVideoConsumptionNumber int `gorm:"column:monthly_bundle_video_consumption_number;not null;comment:当月套餐类型视频已使用额度"`
MonthlyIncreaseVideoConsumptionNumber int `gorm:"column:monthly_increase_video_consumption_number;not null;comment:当月增值类型视频已使用额度"`
MonthlyBundleLimitVideoNumber int `gorm:"column:monthly_bundle_limit_video_number;not null;comment:当月套餐限制类型视频可使用额度"`
MonthlyIncreaseLimitVideoNumber int `gorm:"column:monthly_increase_limit_video_number;not null;comment:当月增值限制类型视频可使用额度"`
MonthlyBundleLimitVideoConsumptionNumber int `gorm:"column:monthly_bundle_limit_video_consumption_number;not null;comment:当月套餐限制类型视频已使用额度"`
MonthlyIncreaseLimitVideoConsumptionNumber int `gorm:"column:monthly_increase_limit_video_consumption_number;not null;comment:当月增值限制类型视频已使用额度"`
MonthlyBundleLimitExpiredVideoNumber int `gorm:"column:monthly_bundle_limit_expired_video_number;not null;comment:当月套餐限制类会过期型视频可使用额度"`
MonthlyIncreaseLimitExpiredVideoNumber int `gorm:"column:monthly_increase_limit_expired_video_number;not null;comment:当月增值限制类会过期型视频可使用额度"`
MonthlyBundleLimitExpiredVideoConsumptionNumber int `gorm:"column:monthly_bundle_limit_expired_video_consumption_number;not null;comment:当月套餐限制类型会过期视频已使用额度"`
MonthlyIncreaseLimitExpiredVideoConsumptionNumber int `gorm:"column:monthly_increase_limit_expired_video_consumption_number;not null;comment:当月增值限制类会过期型视频已使用额度"`
MonthlyLimitVideoQuotaNumber int `gorm:"column:monthly_limit_video_quota_number;not null;comment:当月限制类型视频额度"`
ManualVideoNumber int `gorm:"column:manual_video_number;comment:手动扩展视频总数"`
ManualVideoConsumptionNumber int `gorm:"column:manual_video_consumption_number;comment:手动扩展视频使用数"`
MonthlyNewManualVideoNumber int `gorm:"column:monthly_new_manual_video_number;comment:当月手动扩展视频新增数"`
MonthlyManualVideoConsumptionNumber int `gorm:"column:monthly_manual_video_consumption_number;comment:当月手动扩展视频使用数"`
// ===== 图片类 =====
BundleImageNumber int `gorm:"column:bundle_image_number;not null;comment:非限制类型套餐权益图片总数"`
IncreaseImageNumber int `gorm:"column:increase_image_number;not null;comment:非限制类型增值权益图片总数"`
BundleLimitImageNumber int `gorm:"column:bundle_limit_image_number;not null;comment:套餐权益限制类型非过期总数"`
IncreaseLimitImageNumber int `gorm:"column:increase_limit_image_number;not null;comment:增值权益限制类型非过期总数"`
BundleLimitImageExpiredNumber int `gorm:"column:bundle_limit_image_expired_number;not null;comment:套餐权益限制类型会过期总数"`
IncreaseLimitImageExpiredNumber int `gorm:"column:increase_limit_image_expired_number;not null;comment:增值权益限制类型会过期总数"`
MonthlyInvalidBundleImageNumber int `gorm:"column:monthly_invalid_bundle_image_number;not null;comment:当月失效的套餐权益图片总数"`
InvalidBundleImageNumber int `gorm:"column:invalid_bundle_image_number;not null;comment:历史失效的套餐权益图片总数"`
MonthlyInvalidIncreaseImageNumber int `gorm:"column:monthly_invalid_increase_image_number;not null;comment:当月失效的增值权益图片总数"`
InvalidIncreaseImageNumber int `gorm:"column:invalid_increase_image_number;not null;comment:历史失效的增值权益图片总数"`
BundleImageConsumptionNumber int `gorm:"column:bundle_image_consumption_number;not null;comment:非限制类型套餐权益图片使用数"`
IncreaseImageConsumptionNumber int `gorm:"column:increase_image_consumption_number;not null;comment:非限制类型增值权益图片使用数"`
BundleLimitImageConsumptionNumber int `gorm:"column:bundle_limit_image_consumption_number;not null;comment:套餐权益限制类型非过期使用数"`
IncreaseLimitImageConsumptionNumber int `gorm:"column:increase_limit_image_consumption_number;not null;comment:增值权益限制类型非过期使用数"`
BundleLimitImageExpiredConsumptionNumber int `gorm:"column:bundle_limit_image_expired_consumption_number;not null;comment:套餐权益限制类型会过期使用数"`
IncreaseLimitImageExpiredConsumptionNumber int `gorm:"column:increase_limit_image_expired_consumption_number;not null;comment:增值权益限制类型会过期使用数"`
MonthlyBundleImageConsumptionNumber int `gorm:"column:monthly_bundle_image_consumption_number;not null;comment:当月套餐类型图片已使用额度"`
MonthlyIncreaseImageConsumptionNumber int `gorm:"column:monthly_increase_image_consumption_number;not null;comment:当月增值类型图片已使用额度"`
MonthlyBundleLimitImageNumber int `gorm:"column:monthly_bundle_limit_image_number;not null;comment:当月套餐限制类型图片可使用额度"`
MonthlyIncreaseLimitImageNumber int `gorm:"column:monthly_increase_limit_image_number;not null;comment:当月增值限制类型图片可使用额度"`
MonthlyBundleLimitImageConsumptionNumber int `gorm:"column:monthly_bundle_limit_image_consumption_number;not null;comment:当月套餐限制类型图片已使用额度"`
MonthlyIncreaseLimitImageConsumptionNumber int `gorm:"column:monthly_increase_limit_image_consumption_number;not null;comment:当月增值限制类型图片已使用额度"`
MonthlyBundleLimitExpiredImageNumber int `gorm:"column:monthly_bundle_limit_expired_image_number;not null;comment:当月套餐限制类会过期型图片可使用额度"`
MonthlyIncreaseLimitExpiredImageNumber int `gorm:"column:monthly_increase_limit_expired_image_number;not null;comment:当月增值限制类会过期型图片可使用额度"`
MonthlyBundleLimitExpiredImageConsumptionNumber int `gorm:"column:monthly_bundle_limit_expired_image_consumption_number;not null;comment:当月套餐限制类型会过期图片已使用额度"`
MonthlyIncreaseLimitExpiredImageConsumptionNumber int `gorm:"column:monthly_increase_limit_expired_image_consumption_number;not null;comment:当月增值限制类会过期型图片已使用额度"`
MonthlyLimitImageQuotaNumber int `gorm:"column:monthly_limit_image_quota_number;not null;comment:当月限制类型图片额度"`
ManualImageNumber int `gorm:"column:manual_image_number;comment:手动扩展图片总数"`
ManualImageConsumptionNumber int `gorm:"column:manual_image_consumption_number;comment:手动扩展图片使用数"`
MonthlyNewManualImageNumber int `gorm:"column:monthly_new_manual_image_number;comment:当月手动扩展图片新增数"`
MonthlyManualImageConsumptionNumber int `gorm:"column:monthly_manual_image_consumption_number;comment:当月手动扩展图片使用数"`
// ===== 数据分析类 =====
BundleDataAnalysisNumber int `gorm:"column:bundle_data_analysis_number;not null;comment:非限制类型套餐权益数据分析总数"`
IncreaseDataAnalysisNumber int `gorm:"column:increase_data_analysis_number;not null;comment:非限制类型增值权益数据分析总数"`
BundleLimitDataAnalysisNumber int `gorm:"column:bundle_limit_data_analysis_number;not null;comment:套餐权益限制类型非过期总数"`
IncreaseLimitDataAnalysisNumber int `gorm:"column:increase_limit_data_analysis_number;not null;comment:增值权益限制类型非过期总数"`
BundleLimitDataAnalysisExpiredNumber int `gorm:"column:bundle_limit_data_analysis_expired_number;not null;comment:套餐权益限制类型会过期总数"`
IncreaseLimitDataAnalysisExpiredNumber int `gorm:"column:increase_limit_data_analysis_expired_number;not null;comment:增值权益限制类型会过期总数"`
MonthlyInvalidBundleDataAnalysisNumber int `gorm:"column:monthly_invalid_bundle_data_analysis_number;not null;comment:当月失效的套餐权益数据分析总数"`
InvalidBundleDataAnalysisNumber int `gorm:"column:invalid_bundle_data_analysis_number;not null;comment:历史失效的套餐权益数据分析总数"`
MonthlyInvalidIncreaseDataAnalysisNumber int `gorm:"column:monthly_invalid_increase_data_analysis_number;not null;comment:当月失效的增值权益数据分析总数"`
InvalidIncreaseDataAnalysisNumber int `gorm:"column:invalid_increase_data_analysis_number;not null;comment:历史失效的增值权益数据分析总数"`
BundleDataAnalysisConsumptionNumber int `gorm:"column:bundle_data_analysis_consumption_number;not null;comment:非限制类型套餐权益数据分析使用数"`
IncreaseDataAnalysisConsumptionNumber int `gorm:"column:increase_data_analysis_consumption_number;not null;comment:非限制类型增值权益数据分析使用数"`
BundleLimitDataAnalysisConsumptionNumber int `gorm:"column:bundle_limit_data_analysis_consumption_number;not null;comment:套餐权益限制类型非过期使用数"`
IncreaseLimitDataAnalysisConsumptionNumber int `gorm:"column:increase_limit_data_analysis_consumption_number;not null;comment:增值权益限制类型非过期使用数"`
BundleLimitDataAnalysisExpiredConsumptionNumber int `gorm:"column:bundle_limit_data_analysis_expired_consumption_number;not null;comment:套餐权益限制类型会过期使用数"`
IncreaseLimitDataAnalysisExpiredConsumptionNumber int `gorm:"column:increase_limit_data_analysis_expired_consumption_number;not null;comment:增值权益限制类型会过期使用数"`
MonthlyBundleDataAnalysisConsumptionNumber int `gorm:"column:monthly_bundle_data_analysis_consumption_number;not null;comment:当月套餐类型数据分析已使用额度"`
MonthlyIncreaseDataAnalysisConsumptionNumber int `gorm:"column:monthly_increase_data_analysis_consumption_number;not null;comment:当月增值类型数据分析已使用额度"`
MonthlyBundleLimitDataAnalysisNumber int `gorm:"column:monthly_bundle_limit_data_analysis_number;not null;comment:当月套餐限制类型数据分析可使用额度"`
MonthlyIncreaseLimitDataAnalysisNumber int `gorm:"column:monthly_increase_limit_data_analysis_number;not null;comment:当月增值限制类型数据分析可使用额度"`
MonthlyBundleLimitDataAnalysisConsumptionNumber int `gorm:"column:monthly_bundle_limit_data_analysis_consumption_number;not null;comment:当月套餐限制类型数据分析已使用额度"`
MonthlyIncreaseLimitDataAnalysisConsumptionNumber int `gorm:"column:monthly_increase_limit_data_analysis_consumption_number;not null;comment:当月增值限制类型数据分析已使用额度"`
MonthlyBundleLimitExpiredDataAnalysisNumber int `gorm:"column:monthly_bundle_limit_expired_data_analysis_number;not null;comment:当月套餐限制类会过期型数据分析可使用额度"`
MonthlyIncreaseLimitExpiredDataAnalysisNumber int `gorm:"column:monthly_increase_limit_expired_data_analysis_number;not null;comment:当月增值限制类会过期型数据分析可使用额度"`
MonthlyBundleLimitExpiredDataAnalysisConsumptionNumber int `gorm:"column:monthly_bundle_limit_expired_data_analysis_consumption_number;not null;comment:当月套餐限制类型会过期数据分析已使用额度"`
MonthlyIncreaseLimitExpiredDataAnalysisConsumptionNumber int `gorm:"column:monthly_increase_limit_expired_data_analysis_consumption_number;not null;comment:当月增值限制类会过期型数据分析已使用额度"`
MonthlyLimitDataAnalysisQuotaNumber int `gorm:"column:monthly_limit_data_analysis_quota_number;not null;comment:当月限制类型数据分析额度"`
ManualDataAnalysisNumber int `gorm:"column:manual_data_analysis_number;comment:手动扩展数据分析总数"`
ManualDataAnalysisConsumptionNumber int `gorm:"column:manual_data_analysis_consumption_number;comment:手动扩展数据分析使用数"`
MonthlyNewManualDataAnalysisNumber int `gorm:"column:monthly_new_manual_data_analysis_number;comment:当月手动扩展数据分析新增数"`
MonthlyManualDataAnalysisConsumptionNumber int `gorm:"column:monthly_manual_data_analysis_consumption_number;comment:当月手动扩展数据分析使用数"`
MonthlyNewDurationNumber int `gorm:"column:monthly_new_duration_number;comment:当月新增手动扩展时长(天)"`
ExpansionPacksNumber int `gorm:"column:expansion_packs_number;not null;comment:扩展包数量"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_task_balance_deleted_at" json:"deletedAt"`
}
func (t *TaskBalance) TableName() string {
return "task_balance_new"
}
// TaskSyncStatus 用于标记一次性任务余额同步是否已经执行
// 记录键唯一,避免重复执行
type TaskSyncStatus struct {
ID int64 `gorm:"primarykey"`
SyncKey string `gorm:"column:sync_key;type:varchar(100);uniqueIndex;not null"`
ExecutedAt time.Time `gorm:"column:executed_at;type:datetime;not null"`
Remark string `gorm:"column:remark;type:varchar(255)"`
}
func (TaskSyncStatus) TableName() string { return "task_sync_status" }
// InitialSyncKey 一次性同步的唯一标识键
const InitialSyncKey = "bundle_to_task_balance_initial_sync"
// 隐藏指派人表 // 隐藏指派人表
type TaskAssigneeHidden struct { type TaskAssigneeHidden struct {
// 让id自增 // 让id自增
@ -272,7 +144,7 @@ type TaskWorkLog struct {
// ===== 操作信息 ===== // ===== 操作信息 =====
OperationType int `gorm:"column:operation_type;type:int(11);comment:任务操作类型 1:加任务 2:消耗任务 3:完成任务;4:任务过期;index:idx_operation_type;not null" default:"0" json:"operationType"` 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"` TaskType int `gorm:"column:task_type;type:int(11);comment:任务类型 1:视频 2:图片 3:数据分析 4:视频脚本 5:竞品报告;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"` 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"` Remark string `gorm:"column:remark;type:varchar(500);comment:任务备注" default:"" json:"remark"`

View File

@ -104,6 +104,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 GetTaskWorkLogList(TaskWorkLogQueryRequest) returns (TaskWorkLogQueryResponse) {}
rpc CreateTaskWorkLog(CreateTaskWorkLogRequest) returns (CommonResponse) {} // rpc CreateTaskWorkLog(CreateTaskWorkLogRequest) returns (CommonResponse) {} //
// //
@ -145,6 +146,13 @@ service Bundle {
rpc UpdateOrderRecordByOrderUuid(OrderRecord) returns (CommonResponse) {} rpc UpdateOrderRecordByOrderUuid(OrderRecord) returns (CommonResponse) {}
rpc OrderListByOrderUuid(OrderInfoByOrderUuidRequest) returns (OrderInfoByOrderNoResp) {} rpc OrderListByOrderUuid(OrderInfoByOrderUuidRequest) returns (OrderInfoByOrderNoResp) {}
//
rpc SendQuestionnaireSurvey(SendQuestionnaireSurveyRequest) returns (SendQuestionnaireSurveyResponse) {}
rpc GetQuestionnaireSurveyInfo(GetQuestionnaireSurveyInfoRequest) returns (GetQuestionnaireSurveyInfoResponse) {}
rpc CreateQuestionnaireSurveyAnswer(CreateQuestionnaireSurveyAnswerRequest) returns (CreateQuestionnaireSurveyAnswerResponse) {}
rpc GetQuestionnaireSurveyList(GetQuestionnaireSurveyListRequest) returns (GetQuestionnaireSurveyListResponse) {}
} }
message GetInEffectOrderRecordRequest{ message GetInEffectOrderRecordRequest{
uint64 userID = 1; uint64 userID = 1;
@ -1340,6 +1348,8 @@ message TaskAssignRequest {
int32 assignDataCount = 10 [json_name = "assignDataCount"]; // int32 assignDataCount = 10 [json_name = "assignDataCount"]; //
string taskBatch = 11 [json_name = "taskBatch"]; // string taskBatch = 11 [json_name = "taskBatch"]; //
int32 assignVideoScriptCount = 12 [json_name = "assignVideoScriptCount"]; // int32 assignVideoScriptCount = 12 [json_name = "assignVideoScriptCount"]; //
int32 assignReportCount = 13 [json_name = "assignReportCount"]; //
int32 userID = 14 [json_name = "userID"]; // ID
} }
// //
@ -1423,6 +1433,8 @@ message TaskAssignRecordInfo {
int32 completeVideoCount = 21 [json_name = "completeVideoCount"]; // int32 completeVideoCount = 21 [json_name = "completeVideoCount"]; //
int32 completePostCount = 22 [json_name = "completePostCount"]; // int32 completePostCount = 22 [json_name = "completePostCount"]; //
int32 completeDataCount = 23 [json_name = "completeDataCount"]; // int32 completeDataCount = 23 [json_name = "completeDataCount"]; //
int32 pendingReportCount = 24 [json_name = "pendingReportCount"]; //
int32 completeReportCount = 25 [json_name = "completeReportCount"]; //
} }
// //
@ -1439,6 +1451,8 @@ message BatchAssignTaskItem {
int32 assignDataCount = 10 [json_name = "assignDataCount"]; // int32 assignDataCount = 10 [json_name = "assignDataCount"]; //
string taskBatch = 11 [json_name = "taskBatch"]; // string taskBatch = 11 [json_name = "taskBatch"]; //
int32 assignVideoScriptCount = 12 [json_name = "assignVideoScriptCount"]; // int32 assignVideoScriptCount = 12 [json_name = "assignVideoScriptCount"]; //
int32 assignReportCount = 13 [json_name = "assignReportCount"]; //
int32 userID = 14 [json_name = "userID"]; // ID
} }
message BatchAssignTaskRequest { message BatchAssignTaskRequest {
@ -1478,7 +1492,7 @@ message UpdateTaskProgressRequest {
string assignRecordsUUID = 1 [json_name = "assignRecordsUUID"]; // UUID string assignRecordsUUID = 1 [json_name = "assignRecordsUUID"]; // UUID
string employeeName = 2 [json_name = "employeeName"]; // string employeeName = 2 [json_name = "employeeName"]; //
string employeeNum = 3 [json_name = "employeeNum"]; // string employeeNum = 3 [json_name = "employeeNum"]; //
string taskType = 4 [json_name = "taskType"]; // : video/post/data/script string taskType = 4 [json_name = "taskType"]; // : video/post/data/script/report
int32 completeCount = 5 [json_name = "completeCount"]; // int32 completeCount = 5 [json_name = "completeCount"]; //
string uuid = 6 [json_name = "uuid"]; // cast_work UUID string uuid = 6 [json_name = "uuid"]; // cast_work UUID
} }
@ -1519,12 +1533,14 @@ message TaskAssignRecordsSummary {
int32 totalPendingVideoCount = 2 [json_name = "totalPendingVideoCount"]; int32 totalPendingVideoCount = 2 [json_name = "totalPendingVideoCount"];
int32 totalPendingPostCount = 3 [json_name = "totalPendingPostCount"]; int32 totalPendingPostCount = 3 [json_name = "totalPendingPostCount"];
int32 totalPendingDataCount = 4 [json_name = "totalPendingDataCount"]; int32 totalPendingDataCount = 4 [json_name = "totalPendingDataCount"];
int32 totalPendingReportCount = 9 [json_name = "totalPendingReportCount"];
// //
int32 totalCompleteVideoScriptCount = 5 [json_name = "totalCompleteVideoScriptCount"]; int32 totalCompleteVideoScriptCount = 5 [json_name = "totalCompleteVideoScriptCount"];
int32 totalCompleteVideoCount = 6 [json_name = "totalCompleteVideoCount"]; int32 totalCompleteVideoCount = 6 [json_name = "totalCompleteVideoCount"];
int32 totalCompletePostCount = 7 [json_name = "totalCompletePostCount"]; int32 totalCompletePostCount = 7 [json_name = "totalCompletePostCount"];
int32 totalCompleteDataCount = 8 [json_name = "totalCompleteDataCount"]; int32 totalCompleteDataCount = 8 [json_name = "totalCompleteDataCount"];
int32 totalCompleteReportCount = 10 [json_name = "totalCompleteReportCount"];
} }
// //
@ -1573,6 +1589,15 @@ message ArtistUploadStatsItem {
int32 allowPostCount = 28 [json_name = "allowPostCount"]; int32 allowPostCount = 28 [json_name = "allowPostCount"];
int32 allowDataCount = 29 [json_name = "allowDataCount"]; int32 allowDataCount = 29 [json_name = "allowDataCount"];
int32 allowVideoScriptCount = 30 [json_name = "allowVideoScriptCount"]; int32 allowVideoScriptCount = 30 [json_name = "allowVideoScriptCount"];
//
int32 uploadedReportCount = 31 [json_name = "uploadedReportCount"];
int32 bundleReportTotal = 32 [json_name = "bundleReportTotal"];
int32 increaseReportTotal = 33 [json_name = "increaseReportTotal"];
int32 releasedReportTotal = 34 [json_name = "releasedReportTotal"];
int32 pendingReportCount = 35 [json_name = "pendingReportCount"];
int32 allowReportCount = 36 [json_name = "allowReportCount"];
} }
// //
@ -1625,6 +1650,7 @@ message PendingAssignItem {
int32 allowVideoCount = 5 [json_name = "allowVideoCount"]; int32 allowVideoCount = 5 [json_name = "allowVideoCount"];
int32 allowPostCount = 6 [json_name = "allowPostCount"]; int32 allowPostCount = 6 [json_name = "allowPostCount"];
int32 allowDataCount = 7 [json_name = "allowDataCount"]; int32 allowDataCount = 7 [json_name = "allowDataCount"];
int32 allowReportCount = 8 [json_name = "allowReportCount"];
} }
// //
@ -1689,6 +1715,44 @@ message GetPendingTaskLayoutResp{ string data = 1; }
message SetPendingTaskLayoutReq{ string data = 1; } message SetPendingTaskLayoutReq{ string data = 1; }
message SetPendingTaskLayoutResp{} message SetPendingTaskLayoutResp{}
message TaskWorkLogQueryRequest {
string assignRecordsUUID = 1 [json_name = "assignRecordsUUID"];
int32 operationType = 2 [json_name = "operationType"];
int32 taskType = 3 [json_name = "taskType"];
string artistUUID = 4 [json_name = "artistUUID"];
string subNum = 5 [json_name = "subNum"];
string artistName = 6 [json_name = "artistName"];
int32 page = 7 [json_name = "page"];
int32 pageSize = 8 [json_name = "pageSize"];
}
message TaskWorkLogInfo {
string workLogUUID = 1 [json_name = "taskWorkLogUUID"];
string assignRecordsUUID = 2 [json_name = "assignRecordsUUID"];
string workUUID = 3 [json_name = "workUUID"];
string title = 4 [json_name = "title"];
string artistUUID = 5 [json_name = "artistUUID"];
string subNum = 6 [json_name = "subNum"];
string telNum = 7 [json_name = "telNum"];
string artistName = 8 [json_name = "artistName"];
int32 operationType = 9 [json_name = "operationType"];
int32 taskType = 10 [json_name = "taskType"];
int32 taskCount = 11 [json_name = "taskCount"];
string remark = 12 [json_name = "remark"];
string operatorName = 13 [json_name = "taskOperatorName"];
string operatorNum = 14 [json_name = "taskOperatorNum"];
int64 operationTime = 15 [json_name = "taskOperationTime"];
int64 createdAt = 16 [json_name = "taskCreatedAt"];
int64 updatedAt = 17 [json_name = "taskUpdatedAt"];
}
message TaskWorkLogQueryResponse {
repeated TaskWorkLogInfo records = 1 [json_name = "records"];
int64 total = 2 [json_name = "total"];
int32 page = 3 [json_name = "page"];
int32 pageSize = 4 [json_name = "pageSize"];
}
// //
message CreateTaskWorkLogRequest { message CreateTaskWorkLogRequest {
string assignRecordsUUID = 1 [json_name = "assignRecordsUUID"]; // UUID string assignRecordsUUID = 1 [json_name = "assignRecordsUUID"]; // UUID
@ -2318,3 +2382,88 @@ message UpdataInvoiceInfoReq{
message UpdataInvoiceInfoResp{ message UpdataInvoiceInfoResp{
} }
message SendQuestionnaireSurveyRequest{
string endTime = 1;
string userTel = 2;
string surveyTitle = 3;
}
message SendQuestionnaireSurveyResponse{
int32 status = 1;//0 1 2
}
message GetQuestionnaireSurveyInfoRequest{
string userTel = 1;
}
message SurveyBundleInfo{
string bundleName = 1;
string startAt = 2;
string expiredAt = 3;
int32 bundleAccountNumber = 4;
int32 bundleVideoNumber = 5;
int32 increaseVideoNumber = 6;
int32 bundleImageNumber = 7;
int32 bundleDataNumber = 8;
int32 bundleCompetitiveNumber = 9;
}
message GetQuestionnaireSurveyInfoResponse{
string userName = 1;
SurveyBundleInfo bundleInfo = 2;
}
message SurveyAnswer {
int32 BundleAccountScore = 1;
int32 BundleVideoScore = 2;
int32 IncreaseVideoScore = 3;
int32 BundleImageScore = 4;
int32 BundleDataScore = 5;
int32 BundleCompetitiveScore = 6;
int32 ServiceResponseSpeed = 7;
int32 ServiceStaffProfessionalism = 8;
}
message SurveyFeedback {
string MeritsReview = 1;
string SuggestionsorImprovements = 2;
string AdditionalComments = 3;
}
message CreateQuestionnaireSurveyAnswerRequest{
string userTel = 1;
SurveyAnswer surveyAnswer = 2;
SurveyFeedback surveyFeedback = 3;
string surveyUrl = 4;
string submitTime = 5;
string submitBy = 6;
string longitude = 7;
string latitude = 8;
}
message CreateQuestionnaireSurveyAnswerResponse{
}
message GetQuestionnaireSurveyListRequest{
int32 page = 1;
int32 pageSize = 2;
string userName = 3;
string surveyTitle = 4;
int32 surveyStatus = 5;
}
message SurveyListInfo{
string userName = 1;
string userTel = 2;
string userNum = 3;
string surveyTitle = 4;
int32 surveyStatus = 5;
string surveyUrl = 6;
}
message GetQuestionnaireSurveyListResponse{
repeated SurveyListInfo surveyList = 1;
int32 total = 2;
int32 page = 3;
int32 size = 4;
}

File diff suppressed because it is too large Load Diff

View File

@ -749,6 +749,22 @@ func (this *SetPendingTaskLayoutReq) Validate() error {
func (this *SetPendingTaskLayoutResp) Validate() error { func (this *SetPendingTaskLayoutResp) Validate() error {
return nil return nil
} }
func (this *TaskWorkLogQueryRequest) Validate() error {
return nil
}
func (this *TaskWorkLogInfo) Validate() error {
return nil
}
func (this *TaskWorkLogQueryResponse) Validate() error {
for _, item := range this.Records {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Records", err)
}
}
}
return nil
}
func (this *CreateTaskWorkLogRequest) Validate() error { func (this *CreateTaskWorkLogRequest) Validate() error {
return nil return nil
} }
@ -1080,3 +1096,61 @@ func (this *UpdataInvoiceInfoReq) Validate() error {
func (this *UpdataInvoiceInfoResp) Validate() error { func (this *UpdataInvoiceInfoResp) Validate() error {
return nil return nil
} }
func (this *SendQuestionnaireSurveyRequest) Validate() error {
return nil
}
func (this *SendQuestionnaireSurveyResponse) Validate() error {
return nil
}
func (this *GetQuestionnaireSurveyInfoRequest) Validate() error {
return nil
}
func (this *SurveyBundleInfo) Validate() error {
return nil
}
func (this *GetQuestionnaireSurveyInfoResponse) Validate() error {
if this.BundleInfo != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.BundleInfo); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("BundleInfo", err)
}
}
return nil
}
func (this *SurveyAnswer) Validate() error {
return nil
}
func (this *SurveyFeedback) Validate() error {
return nil
}
func (this *CreateQuestionnaireSurveyAnswerRequest) Validate() error {
if this.SurveyAnswer != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.SurveyAnswer); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SurveyAnswer", err)
}
}
if this.SurveyFeedback != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.SurveyFeedback); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SurveyFeedback", err)
}
}
return nil
}
func (this *CreateQuestionnaireSurveyAnswerResponse) Validate() error {
return nil
}
func (this *GetQuestionnaireSurveyListRequest) Validate() error {
return nil
}
func (this *SurveyListInfo) Validate() error {
return nil
}
func (this *GetQuestionnaireSurveyListResponse) Validate() error {
for _, item := range this.SurveyList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SurveyList", err)
}
}
}
return nil
}

View File

@ -112,6 +112,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)
GetTaskWorkLogList(ctx context.Context, in *TaskWorkLogQueryRequest, opts ...grpc_go.CallOption) (*TaskWorkLogQueryResponse, common.ErrorWithAttachment)
CreateTaskWorkLog(ctx context.Context, in *CreateTaskWorkLogRequest, opts ...grpc_go.CallOption) (*CommonResponse, 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)
@ -146,6 +147,11 @@ type BundleClient interface {
GetPaymentCyclesByContractUUID(ctx context.Context, in *GetPaymentCyclesByContractUUIDRequest, opts ...grpc_go.CallOption) (*GetPaymentCyclesByContractUUIDResponse, common.ErrorWithAttachment) GetPaymentCyclesByContractUUID(ctx context.Context, in *GetPaymentCyclesByContractUUIDRequest, opts ...grpc_go.CallOption) (*GetPaymentCyclesByContractUUIDResponse, common.ErrorWithAttachment)
UpdateOrderRecordByOrderUuid(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) UpdateOrderRecordByOrderUuid(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
OrderListByOrderUuid(ctx context.Context, in *OrderInfoByOrderUuidRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment) OrderListByOrderUuid(ctx context.Context, in *OrderInfoByOrderUuidRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment)
// 问卷调查
SendQuestionnaireSurvey(ctx context.Context, in *SendQuestionnaireSurveyRequest, opts ...grpc_go.CallOption) (*SendQuestionnaireSurveyResponse, common.ErrorWithAttachment)
GetQuestionnaireSurveyInfo(ctx context.Context, in *GetQuestionnaireSurveyInfoRequest, opts ...grpc_go.CallOption) (*GetQuestionnaireSurveyInfoResponse, common.ErrorWithAttachment)
CreateQuestionnaireSurveyAnswer(ctx context.Context, in *CreateQuestionnaireSurveyAnswerRequest, opts ...grpc_go.CallOption) (*CreateQuestionnaireSurveyAnswerResponse, common.ErrorWithAttachment)
GetQuestionnaireSurveyList(ctx context.Context, in *GetQuestionnaireSurveyListRequest, opts ...grpc_go.CallOption) (*GetQuestionnaireSurveyListResponse, common.ErrorWithAttachment)
} }
type bundleClient struct { type bundleClient struct {
@ -230,6 +236,7 @@ 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)
GetTaskWorkLogList func(ctx context.Context, in *TaskWorkLogQueryRequest) (*TaskWorkLogQueryResponse, error)
CreateTaskWorkLog func(ctx context.Context, in *CreateTaskWorkLogRequest) (*CommonResponse, 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)
@ -259,6 +266,10 @@ type BundleClientImpl struct {
GetPaymentCyclesByContractUUID func(ctx context.Context, in *GetPaymentCyclesByContractUUIDRequest) (*GetPaymentCyclesByContractUUIDResponse, error) GetPaymentCyclesByContractUUID func(ctx context.Context, in *GetPaymentCyclesByContractUUIDRequest) (*GetPaymentCyclesByContractUUIDResponse, error)
UpdateOrderRecordByOrderUuid func(ctx context.Context, in *OrderRecord) (*CommonResponse, error) UpdateOrderRecordByOrderUuid func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
OrderListByOrderUuid func(ctx context.Context, in *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error) OrderListByOrderUuid func(ctx context.Context, in *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error)
SendQuestionnaireSurvey func(ctx context.Context, in *SendQuestionnaireSurveyRequest) (*SendQuestionnaireSurveyResponse, error)
GetQuestionnaireSurveyInfo func(ctx context.Context, in *GetQuestionnaireSurveyInfoRequest) (*GetQuestionnaireSurveyInfoResponse, error)
CreateQuestionnaireSurveyAnswer func(ctx context.Context, in *CreateQuestionnaireSurveyAnswerRequest) (*CreateQuestionnaireSurveyAnswerResponse, error)
GetQuestionnaireSurveyList func(ctx context.Context, in *GetQuestionnaireSurveyListRequest) (*GetQuestionnaireSurveyListResponse, error)
} }
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient { func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
@ -735,6 +746,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) GetTaskWorkLogList(ctx context.Context, in *TaskWorkLogQueryRequest, opts ...grpc_go.CallOption) (*TaskWorkLogQueryResponse, common.ErrorWithAttachment) {
out := new(TaskWorkLogQueryResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetTaskWorkLogList", in, out)
}
func (c *bundleClient) CreateTaskWorkLog(ctx context.Context, in *CreateTaskWorkLogRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) { func (c *bundleClient) CreateTaskWorkLog(ctx context.Context, in *CreateTaskWorkLogRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse) out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string) interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -909,6 +926,30 @@ func (c *bundleClient) OrderListByOrderUuid(ctx context.Context, in *OrderInfoBy
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderListByOrderUuid", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderListByOrderUuid", in, out)
} }
func (c *bundleClient) SendQuestionnaireSurvey(ctx context.Context, in *SendQuestionnaireSurveyRequest, opts ...grpc_go.CallOption) (*SendQuestionnaireSurveyResponse, common.ErrorWithAttachment) {
out := new(SendQuestionnaireSurveyResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SendQuestionnaireSurvey", in, out)
}
func (c *bundleClient) GetQuestionnaireSurveyInfo(ctx context.Context, in *GetQuestionnaireSurveyInfoRequest, opts ...grpc_go.CallOption) (*GetQuestionnaireSurveyInfoResponse, common.ErrorWithAttachment) {
out := new(GetQuestionnaireSurveyInfoResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetQuestionnaireSurveyInfo", in, out)
}
func (c *bundleClient) CreateQuestionnaireSurveyAnswer(ctx context.Context, in *CreateQuestionnaireSurveyAnswerRequest, opts ...grpc_go.CallOption) (*CreateQuestionnaireSurveyAnswerResponse, common.ErrorWithAttachment) {
out := new(CreateQuestionnaireSurveyAnswerResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateQuestionnaireSurveyAnswer", in, out)
}
func (c *bundleClient) GetQuestionnaireSurveyList(ctx context.Context, in *GetQuestionnaireSurveyListRequest, opts ...grpc_go.CallOption) (*GetQuestionnaireSurveyListResponse, common.ErrorWithAttachment) {
out := new(GetQuestionnaireSurveyListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetQuestionnaireSurveyList", 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
@ -997,6 +1038,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)
GetTaskWorkLogList(context.Context, *TaskWorkLogQueryRequest) (*TaskWorkLogQueryResponse, error)
CreateTaskWorkLog(context.Context, *CreateTaskWorkLogRequest) (*CommonResponse, error) CreateTaskWorkLog(context.Context, *CreateTaskWorkLogRequest) (*CommonResponse, error)
// 数据指标 // 数据指标
MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error) MetricsBusiness(context.Context, *MetricsBusinessReq) (*MetricsBusinessResp, error)
@ -1031,6 +1073,11 @@ type BundleServer interface {
GetPaymentCyclesByContractUUID(context.Context, *GetPaymentCyclesByContractUUIDRequest) (*GetPaymentCyclesByContractUUIDResponse, error) GetPaymentCyclesByContractUUID(context.Context, *GetPaymentCyclesByContractUUIDRequest) (*GetPaymentCyclesByContractUUIDResponse, error)
UpdateOrderRecordByOrderUuid(context.Context, *OrderRecord) (*CommonResponse, error) UpdateOrderRecordByOrderUuid(context.Context, *OrderRecord) (*CommonResponse, error)
OrderListByOrderUuid(context.Context, *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error) OrderListByOrderUuid(context.Context, *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error)
// 问卷调查
SendQuestionnaireSurvey(context.Context, *SendQuestionnaireSurveyRequest) (*SendQuestionnaireSurveyResponse, error)
GetQuestionnaireSurveyInfo(context.Context, *GetQuestionnaireSurveyInfoRequest) (*GetQuestionnaireSurveyInfoResponse, error)
CreateQuestionnaireSurveyAnswer(context.Context, *CreateQuestionnaireSurveyAnswerRequest) (*CreateQuestionnaireSurveyAnswerResponse, error)
GetQuestionnaireSurveyList(context.Context, *GetQuestionnaireSurveyListRequest) (*GetQuestionnaireSurveyListResponse, error)
mustEmbedUnimplementedBundleServer() mustEmbedUnimplementedBundleServer()
} }
@ -1270,6 +1317,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) GetTaskWorkLogList(context.Context, *TaskWorkLogQueryRequest) (*TaskWorkLogQueryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetTaskWorkLogList not implemented")
}
func (UnimplementedBundleServer) CreateTaskWorkLog(context.Context, *CreateTaskWorkLogRequest) (*CommonResponse, error) { func (UnimplementedBundleServer) CreateTaskWorkLog(context.Context, *CreateTaskWorkLogRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateTaskWorkLog not implemented") return nil, status.Errorf(codes.Unimplemented, "method CreateTaskWorkLog not implemented")
} }
@ -1357,6 +1407,18 @@ func (UnimplementedBundleServer) UpdateOrderRecordByOrderUuid(context.Context, *
func (UnimplementedBundleServer) OrderListByOrderUuid(context.Context, *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error) { func (UnimplementedBundleServer) OrderListByOrderUuid(context.Context, *OrderInfoByOrderUuidRequest) (*OrderInfoByOrderNoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method OrderListByOrderUuid not implemented") return nil, status.Errorf(codes.Unimplemented, "method OrderListByOrderUuid not implemented")
} }
func (UnimplementedBundleServer) SendQuestionnaireSurvey(context.Context, *SendQuestionnaireSurveyRequest) (*SendQuestionnaireSurveyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendQuestionnaireSurvey not implemented")
}
func (UnimplementedBundleServer) GetQuestionnaireSurveyInfo(context.Context, *GetQuestionnaireSurveyInfoRequest) (*GetQuestionnaireSurveyInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetQuestionnaireSurveyInfo not implemented")
}
func (UnimplementedBundleServer) CreateQuestionnaireSurveyAnswer(context.Context, *CreateQuestionnaireSurveyAnswerRequest) (*CreateQuestionnaireSurveyAnswerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateQuestionnaireSurveyAnswer not implemented")
}
func (UnimplementedBundleServer) GetQuestionnaireSurveyList(context.Context, *GetQuestionnaireSurveyListRequest) (*GetQuestionnaireSurveyListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetQuestionnaireSurveyList not implemented")
}
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) { func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl s.proxyImpl = impl
} }
@ -3618,6 +3680,35 @@ func _Bundle_AddHiddenTaskAssignee_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Bundle_GetTaskWorkLogList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(TaskWorkLogQueryRequest)
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("GetTaskWorkLogList", 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_CreateTaskWorkLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { func _Bundle_CreateTaskWorkLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateTaskWorkLogRequest) in := new(CreateTaskWorkLogRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -4459,6 +4550,122 @@ func _Bundle_OrderListByOrderUuid_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Bundle_SendQuestionnaireSurvey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(SendQuestionnaireSurveyRequest)
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("SendQuestionnaireSurvey", 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_GetQuestionnaireSurveyInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetQuestionnaireSurveyInfoRequest)
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("GetQuestionnaireSurveyInfo", 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_CreateQuestionnaireSurveyAnswer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateQuestionnaireSurveyAnswerRequest)
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("CreateQuestionnaireSurveyAnswer", 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_GetQuestionnaireSurveyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetQuestionnaireSurveyListRequest)
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("GetQuestionnaireSurveyList", 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)
@ -4774,6 +4981,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "AddHiddenTaskAssignee", MethodName: "AddHiddenTaskAssignee",
Handler: _Bundle_AddHiddenTaskAssignee_Handler, Handler: _Bundle_AddHiddenTaskAssignee_Handler,
}, },
{
MethodName: "GetTaskWorkLogList",
Handler: _Bundle_GetTaskWorkLogList_Handler,
},
{ {
MethodName: "CreateTaskWorkLog", MethodName: "CreateTaskWorkLog",
Handler: _Bundle_CreateTaskWorkLog_Handler, Handler: _Bundle_CreateTaskWorkLog_Handler,
@ -4890,6 +5101,22 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "OrderListByOrderUuid", MethodName: "OrderListByOrderUuid",
Handler: _Bundle_OrderListByOrderUuid_Handler, Handler: _Bundle_OrderListByOrderUuid_Handler,
}, },
{
MethodName: "SendQuestionnaireSurvey",
Handler: _Bundle_SendQuestionnaireSurvey_Handler,
},
{
MethodName: "GetQuestionnaireSurveyInfo",
Handler: _Bundle_GetQuestionnaireSurveyInfo_Handler,
},
{
MethodName: "CreateQuestionnaireSurveyAnswer",
Handler: _Bundle_CreateQuestionnaireSurveyAnswer_Handler,
},
{
MethodName: "GetQuestionnaireSurveyList",
Handler: _Bundle_GetQuestionnaireSurveyList_Handler,
},
}, },
Streams: []grpc_go.StreamDesc{}, Streams: []grpc_go.StreamDesc{},
Metadata: "pb/bundle.proto", Metadata: "pb/bundle.proto",

View File

@ -68,6 +68,7 @@ func loadMysqlConn(conn string) *gorm.DB {
&model.Customer{}, &model.Customer{},
&model.Invoice{}, &model.Invoice{},
&model.PaperInvoiceAddress{}, &model.PaperInvoiceAddress{},
&model.QuestionnaireSurvey{},
) )
if db.Migrator().HasColumn(&model.BundleOrderRecords{}, "platform_ids") == false { if db.Migrator().HasColumn(&model.BundleOrderRecords{}, "platform_ids") == false {
if err := db.Migrator().AddColumn(&model.BundleOrderRecords{}, "platform_ids"); err != nil { if err := db.Migrator().AddColumn(&model.BundleOrderRecords{}, "platform_ids"); err != nil {
@ -131,7 +132,6 @@ func loadTaskBenchMysqlConn(conn string) *gorm.DB {
&model.TaskManagement{}, &model.TaskManagement{},
&model.TaskAssignRecords{}, &model.TaskAssignRecords{},
// &model.TaskBalance{}, // &model.TaskBalance{},
&model.TaskSyncStatus{},
&model.TaskPendingLayout{}, &model.TaskPendingLayout{},
&model.TaskAssignUUIDItems{}, &model.TaskAssignUUIDItems{},
// 隐藏人员人记录表 // 隐藏人员人记录表

View File

@ -126,3 +126,11 @@ const (
IsExpired = 1 //已过期 IsExpired = 1 //已过期
NotExpired = 0 //未过期 NotExpired = 0 //未过期
) )
// 问卷状态
const (
//已发送
QuestionnaireSent = 1
//已提交
QuestionnaireSubmitted = 2
)