Procházet zdrojové kódy

specialSProjectBug

Xingyu Xian před 3 měsíci
rodič
revize
2ba02c11a7

+ 1 - 1
db/s_project.go

@@ -73,7 +73,7 @@ func GetSProjectDetail(ctx context.Context, sProjectId int) (*gorm_model.SProjec
 }
 
 // GetSpecialProjectList 根据服务商ID和其他附加条件查询定向种草任务列表
-func GetSpecialProjectList(ctx context.Context, supplierId int, pageSize, pageNum int32, condition *common_model.SSpecialProjectCondition) ([]*gorm_model.SProjectInfo, int64, error) {
+func GetSpecialProjectList(ctx context.Context, supplierId int, pageSize, pageNum int32, condition *common_model.SpecialSProjectCondition) ([]*gorm_model.SProjectInfo, int64, error) {
 	db := GetReadDB(ctx)
 
 	// 1. 根据服务商id过滤

+ 1 - 1
model/common_model/s_project_condition.go

@@ -11,7 +11,7 @@ type SProjectCondition struct {
 	ContentType     int    `condition:"content_type"`     // 内容形式
 }
 
-type SSpecialProjectCondition struct {
+type SpecialSProjectCondition struct {
 	ProjectName     string `condition:"project_name"`     // 种草任务名称
 	ProjectStatus   int    `condition:"project_status"`   // 种草任务状态
 	ProjectType     int    `condition:"project_type"`     // 项目类型

+ 11 - 3
model/http_model/s_special_project_list.go

@@ -3,8 +3,8 @@ package http_model
 import "time"
 
 type SpecialSProjectListData struct {
-	SpecialProjectInfo []*SpecialProjectResponse `json:"special_project_info"`
-	Total              int64                     `json:"total"`
+	SpecialProjectInfo []*SpecialSProjectResponse `json:"special_project_info"`
+	Total              int64                      `json:"total"`
 }
 
 type SpecialSProjectResponse struct {
@@ -21,7 +21,15 @@ type SpecialSProjectResponse struct {
 	ProductName        string                `json:"product_name"`         // 商品名称
 	ProductId          int64                 `json:"product_id"`           // 商品ID
 	ProductPrice       float64               `json:"product_price"`        // 商品售价
-	Tools              string                `json:"tools"`                // 工具选择,1邀约招募 2样品物流 3审稿工具 4作品审查 5数据巡检 6结算账单(,分隔)
+	Tools              string                `json:"tools"`                // 工具选择,1邀约招募 2样品物流 3审稿工具 4作品审查 5数据巡检 6结算账单
+	StrategyStatus     int                   `json:"strategy_status"`      // 定向种草任务是否替换招募策略
+	SubAccountId       int                   `json:"sub_account_id"`       // 子账号ID
+	SupplierId         int                   `json:"supplier_id"`          // 服务商ID
+	OperatorType       int                   `json:"operator_type"`        // 添加商单操作人类型,1为服务商主账号,2为服务商子账号
+	ApplyNum           int                   `json:"apply_num"`            // 报名人数
+	RecruitNum         int                   `json:"recruit_num"`          // 已招募人数
+	SettleNum          int                   `json:"settle_num"`           // 已结算人数
+	ShareCode          string                `json:"share_code"`           // 分享码url
 }
 
 func NewSpecialSProjectListRequest() *SpecialProjectListRequest {

+ 1 - 0
model/http_model/special_project_list.go

@@ -35,6 +35,7 @@ type SpecialProjectResponse struct {
 	ProductId          int64                 `json:"product_id"`           // 商品ID
 	ProductPrice       float64               `json:"product_price"`        // 商品售价
 	Tools              string                `json:"tools"`                // 工具选择,1邀约招募 2样品物流 3审稿工具 4作品审查 5数据巡检 6结算账单(,分隔)
+
 }
 
 func NewSpecialProjectListRequest() *SpecialProjectListRequest {

+ 2 - 2
pack/special_project_condition.go

@@ -6,8 +6,8 @@ import (
 	"youngee_b_api/model/http_model"
 )
 
-func HttpSpecialProjectRequestToCondition(req *http_model.SpecialProjectListRequest) *common_model.SSpecialProjectCondition {
-	return &common_model.SSpecialProjectCondition{
+func HttpSpecialProjectRequestToCondition(req *http_model.SpecialProjectListRequest) *common_model.SpecialSProjectCondition {
+	return &common_model.SpecialSProjectCondition{
 		ProjectName:     req.ProjectName,
 		ProjectStatus:   conv.MustInt(req.ProjectStatus, 4),
 		ProjectType:     conv.MustInt(req.ProjectType, 2),

+ 2 - 2
route/init.go

@@ -64,8 +64,8 @@ func InitRoute(r *gin.Engine) {
 		m.POST("/qrcode/getWxQrcode", handler.WrapGetWxQRCodeHandler)                    // 获取微信二维码
 
 		// 服务商版定向种草接口
-		m.POST("/sProject/specialList", handler.WrapSpecialProjectListHandler)            // 商单广场 - 定向种草任务列表
-		m.POST("/sProject/sSpecialList", handler.WrapSpecialSProjectListHandler)          // 商单管理 - 定向种草任务列表
+		m.POST("/sProject/specialProjectList", handler.WrapSpecialProjectListHandler)     // 商单广场 - 定向种草任务列表
+		m.POST("/sProject/specialSProjectList", handler.WrapSpecialSProjectListHandler)   // 商单管理 - 定向种草任务列表
 		m.POST("/sProject/specialAddToList", handler.WrapSpecialSProjectAddToListHandler) // 定向种草任务加入商单 (同意/拒绝定向邀约)
 		m.POST("/sProject/specialAddStrategy", handler.WrapSpecialAddStrategyHandler)     // 定向种草任务添加招募策略
 

+ 22 - 18
service/s_project.go

@@ -295,7 +295,7 @@ func (*sProject) GetSPorjectDetail(ctx context.Context, sProjectId int) (*http_m
 }
 
 // GetSpecialProjectList 查找服务商加入商单前的定向种草任务列表
-func (*sProject) GetSpecialProjectList(ctx context.Context, supplierId int, pageSize, pageNum int32, condition *common_model.SSpecialProjectCondition) (*http_model.SpecialProjectListData, error) {
+func (*sProject) GetSpecialProjectList(ctx context.Context, supplierId int, pageSize, pageNum int32, condition *common_model.SpecialSProjectCondition) (*http_model.SpecialProjectListData, error) {
 	var specialProjectListData *http_model.SpecialProjectListData
 	specialProjectListData = &http_model.SpecialProjectListData{}
 
@@ -375,7 +375,7 @@ func (*sProject) GetSpecialProjectList(ctx context.Context, supplierId int, page
 }
 
 // GetSpecialSProjectList 查找服务商加入商单后的定向种草任务列表
-func (*sProject) GetSpecialSProjectList(ctx context.Context, supplierId int, pageSize, pageNum int32, condition *common_model.SSpecialProjectCondition) (*http_model.SpecialSProjectListData, error) {
+func (*sProject) GetSpecialSProjectList(ctx context.Context, supplierId int, pageSize, pageNum int32, condition *common_model.SpecialSProjectCondition) (*http_model.SpecialSProjectListData, error) {
 	var specialProjectListData *http_model.SpecialSProjectListData
 	specialProjectListData = &http_model.SpecialSProjectListData{}
 	specialProjects, total, err := db.GetSpecialProjectList(ctx, supplierId, pageSize, pageNum, condition)
@@ -386,13 +386,17 @@ func (*sProject) GetSpecialSProjectList(ctx context.Context, supplierId int, pag
 		specialProjectListData.Total = total
 		// 1. 定向种草任务基本信息填入
 		for _, specialProject := range specialProjects {
-			var currSpecialProject *http_model.SpecialProjectResponse
-			currSpecialProject = &http_model.SpecialProjectResponse{}
+			var currSpecialProject *http_model.SpecialSProjectResponse
+			currSpecialProject = &http_model.SpecialSProjectResponse{}
 			currSpecialProject.SProjectId = specialProject.SProjectId
 			currSpecialProject.ProjectPlatform = specialProject.ProjectPlatform
 			currSpecialProject.ProjectForm = specialProject.ProjectForm
 			currSpecialProject.ContentType = specialProject.ContentType
 			currSpecialProject.SProjectStatus = specialProject.SProjectStatus
+			currSpecialProject.StrategyStatus = specialProject.StrategyStatus
+			currSpecialProject.ApplyNum = specialProject.ApplyNum
+			currSpecialProject.RecruitNum = specialProject.RecruitNum
+			currSpecialProject.SettleNum = specialProject.SettleNum
 
 			// 2. 定向种草任务商品信息填入
 			// 2.1. 商品信息
@@ -422,20 +426,20 @@ func (*sProject) GetSpecialSProjectList(ctx context.Context, supplierId int, pag
 			}
 
 			// 3. 招募策略信息
-			recruitStrategy, recruitErr := db.GetRecruitStrategyByProjectId(ctx, specialProject.ProjectId)
-			if recruitErr != nil {
-				return nil, recruitErr
-			}
-			if recruitStrategy != nil {
-				for _, strategy := range recruitStrategy {
-					showStrategy := http_model.EasyRecruitStrategy{
-						FeeForm:       strategy.FeeForm,
-						RecruitNumber: strategy.RecruitNumber,
-						StrategyId:    strategy.StrategyID,
-					}
-					currSpecialProject.RecruitStrategy = append(currSpecialProject.RecruitStrategy, showStrategy)
-				}
-			}
+			// recruitStrategy, recruitErr := db.GetRecruitStrategyByProjectId(ctx, specialProject.ProjectId)
+			// if recruitErr != nil {
+			// 	return nil, recruitErr
+			// }
+			// if recruitStrategy != nil {
+			// 	for _, strategy := range recruitStrategy {
+			// 		showStrategy := http_model.EasyRecruitStrategy{
+			// 			FeeForm:       strategy.FeeForm,
+			// 			RecruitNumber: strategy.RecruitNumber,
+			// 			StrategyId:    strategy.StrategyID,
+			// 		}
+			// 		currSpecialProject.RecruitStrategy = append(currSpecialProject.RecruitStrategy, showStrategy)
+			// 	}
+			// }
 
 			// 4. 原种草任务信息
 			projectInfo, projectErr := db.GetProjectDetail(ctx, specialProject.ProjectId)