|
@@ -361,6 +361,9 @@ func (*sProject) GetSpecialProjectList(ctx context.Context, supplierId int, page
|
|
for _, specialProject := range specialProjects {
|
|
for _, specialProject := range specialProjects {
|
|
var currSpecialProject *http_model.SpecialProjectResponse
|
|
var currSpecialProject *http_model.SpecialProjectResponse
|
|
currSpecialProject = &http_model.SpecialProjectResponse{}
|
|
currSpecialProject = &http_model.SpecialProjectResponse{}
|
|
|
|
+ currSpecialProject.ProjectId = specialProject.ProjectId
|
|
|
|
+ currSpecialProject.ProjectName = specialProject.ProjectName
|
|
|
|
+ currSpecialProject.ProjectStatus = int(specialProject.ProjectStatus)
|
|
currSpecialProject.SProjectId = specialProject.SProjectId
|
|
currSpecialProject.SProjectId = specialProject.SProjectId
|
|
currSpecialProject.ProjectPlatform = specialProject.ProjectPlatform
|
|
currSpecialProject.ProjectPlatform = specialProject.ProjectPlatform
|
|
currSpecialProject.ProjectForm = specialProject.ProjectForm
|
|
currSpecialProject.ProjectForm = specialProject.ProjectForm
|
|
@@ -440,6 +443,9 @@ func (*sProject) GetSpecialSProjectList(ctx context.Context, supplierId int, pag
|
|
for _, specialProject := range specialProjects {
|
|
for _, specialProject := range specialProjects {
|
|
var currSpecialProject *http_model.SpecialSProjectResponse
|
|
var currSpecialProject *http_model.SpecialSProjectResponse
|
|
currSpecialProject = &http_model.SpecialSProjectResponse{}
|
|
currSpecialProject = &http_model.SpecialSProjectResponse{}
|
|
|
|
+ currSpecialProject.ProjectId = specialProject.ProjectId
|
|
|
|
+ currSpecialProject.ProjectName = specialProject.ProjectName
|
|
|
|
+ currSpecialProject.ProjectStatus = int(specialProject.ProjectStatus)
|
|
currSpecialProject.SProjectId = specialProject.SProjectId
|
|
currSpecialProject.SProjectId = specialProject.SProjectId
|
|
currSpecialProject.ProjectPlatform = specialProject.ProjectPlatform
|
|
currSpecialProject.ProjectPlatform = specialProject.ProjectPlatform
|
|
currSpecialProject.ProjectForm = specialProject.ProjectForm
|
|
currSpecialProject.ProjectForm = specialProject.ProjectForm
|
|
@@ -449,7 +455,25 @@ func (*sProject) GetSpecialSProjectList(ctx context.Context, supplierId int, pag
|
|
currSpecialProject.ApplyNum = specialProject.ApplyNum
|
|
currSpecialProject.ApplyNum = specialProject.ApplyNum
|
|
currSpecialProject.RecruitNum = specialProject.RecruitNum
|
|
currSpecialProject.RecruitNum = specialProject.RecruitNum
|
|
currSpecialProject.SettleNum = specialProject.SettleNum
|
|
currSpecialProject.SettleNum = specialProject.SettleNum
|
|
- currSpecialProject.ProjectId = specialProject.ProjectId
|
|
|
|
|
|
+
|
|
|
|
+ // 加入商单操作人信息
|
|
|
|
+ if specialProject.OperatorType == 1 {
|
|
|
|
+ supplierInfo, supplierErr := db.GetSupplierById(ctx, supplierId)
|
|
|
|
+ if supplierErr != nil {
|
|
|
|
+ return nil, supplierErr
|
|
|
|
+ }
|
|
|
|
+ if supplierInfo != nil {
|
|
|
|
+ currSpecialProject.AddToListOperate = supplierInfo.SupplierName
|
|
|
|
+ }
|
|
|
|
+ } else if specialProject.OperatorType == 2 {
|
|
|
|
+ subAccountInfo, subAccountErr := db.FindSubAccountById(ctx, specialProject.SubAccountId)
|
|
|
|
+ if subAccountErr != nil {
|
|
|
|
+ return nil, subAccountErr
|
|
|
|
+ }
|
|
|
|
+ if subAccountInfo != nil {
|
|
|
|
+ currSpecialProject.AddToListOperate = subAccountInfo.SubAccountName
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
// 2. 定向种草任务商品信息填入
|
|
// 2. 定向种草任务商品信息填入
|
|
// 2.1. 商品信息
|
|
// 2.1. 商品信息
|
|
@@ -523,15 +547,36 @@ func (*sProject) UpdateSProject(ctx context.Context, request *http_model.Special
|
|
func (*sProject) CreateSpecialStrategy(ctx context.Context, request *http_model.SpecialAddStrategyRequest) error {
|
|
func (*sProject) CreateSpecialStrategy(ctx context.Context, request *http_model.SpecialAddStrategyRequest) error {
|
|
// 1. 添加服务商招募策略
|
|
// 1. 添加服务商招募策略
|
|
// 1.1. 整理数据
|
|
// 1.1. 整理数据
|
|
|
|
+ var recruitStrategys []gorm_model.RecruitStrategy
|
|
for _, strategy := range request.RecruitStrategys {
|
|
for _, strategy := range request.RecruitStrategys {
|
|
|
|
+ var recruitStrategy *gorm_model.RecruitStrategy
|
|
|
|
+ recruitStrategy = &gorm_model.RecruitStrategy{}
|
|
|
|
+
|
|
|
|
+ recruitStrategy.StrategyID = strategy.StrategyID
|
|
|
|
+ recruitStrategy.QuoteRecruitStrategyId = strategy.QuoteRecruitStrategyId
|
|
|
|
+ recruitStrategy.FeeForm = strategy.FeeForm
|
|
|
|
+ recruitStrategy.StrategyID = strategy.StrategyID
|
|
|
|
+ recruitStrategy.FollowersLow = strategy.FollowersLow
|
|
|
|
+ recruitStrategy.FollowersUp = strategy.FollowersUp
|
|
|
|
+ recruitStrategy.RecruitNumber = strategy.RecruitNumber
|
|
|
|
+ recruitStrategy.Offer = strategy.Offer
|
|
|
|
+ recruitStrategy.ServiceCharge = strategy.ServiceCharge
|
|
|
|
+ recruitStrategy.StrategyType = 2
|
|
|
|
+ recruitStrategy.QuoteRecruitStrategyId = strategy.QuoteRecruitStrategyId
|
|
|
|
+
|
|
// 一口价需要计算服务费率和达人所见报价
|
|
// 一口价需要计算服务费率和达人所见报价
|
|
- strategy.ServiceRate = int(strategy.ServiceCharge / strategy.Offer)
|
|
|
|
- strategy.TOffer = strategy.Offer - strategy.ServiceCharge
|
|
|
|
- strategy.ProjectID = "0"
|
|
|
|
- strategy.SProjectId = request.SProjectId
|
|
|
|
- strategy.QuoteRecruitStrategyId = int(strategy.RecruitStrategyID)
|
|
|
|
|
|
+ if strategy.FeeForm == 3 {
|
|
|
|
+ recruitStrategy.ServiceRate = strategy.ServiceRate
|
|
|
|
+ } else {
|
|
|
|
+ recruitStrategy.ServiceRate = int(strategy.ServiceCharge / strategy.Offer)
|
|
|
|
+ }
|
|
|
|
+ recruitStrategy.TOffer = strategy.Offer - strategy.ServiceCharge
|
|
|
|
+ recruitStrategy.ProjectID = "0"
|
|
|
|
+ recruitStrategy.SProjectId = request.SProjectId
|
|
|
|
+ recruitStrategys = append(recruitStrategys, *recruitStrategy)
|
|
}
|
|
}
|
|
- createErr := db.CreateSpecialStrategy(ctx, request.RecruitStrategys)
|
|
|
|
|
|
+
|
|
|
|
+ createErr := db.CreateSpecialStrategy(ctx, recruitStrategys)
|
|
if createErr != nil {
|
|
if createErr != nil {
|
|
return createErr
|
|
return createErr
|
|
}
|
|
}
|