Ethan 3 місяців тому
батько
коміт
e7e65f60cf
2 змінених файлів з 52 додано та 20 видалено
  1. 32 17
      app/entity/s_project.go
  2. 20 3
      app/service/cooperation_service.go

+ 32 - 17
app/entity/s_project.go

@@ -1,25 +1,40 @@
+// Code generated by sql2gorm. DO NOT EDIT.
 package entity
 
-import "time"
+import (
+	"time"
+)
 
 // 服务商加入商单的种草任务
 type SProjectInfo struct {
-	SProjectId          int64     `gorm:"column:s_project_id;primary_key;AUTO_INCREMENT"` // 服务商加入商单后的种草任务ID
-	ProjectId           string    `gorm:"column:project_id;"`                             // 被服务商加入商单的原种草任务ID
-	ShareCode           string    `gorm:"column:share_code"`                              // 分享码URL
-	SupplierId          int64     `gorm:"column:supplier_id"`                             // 所属服务商ID
-	ApplyNum            int64     `gorm:"column:apply_num;default:0;NOT NULL"`            // 报名人数
-	RecruitNum          int64     `gorm:"column:recruit_num;default:0;NOT NULL"`          // 已招募人数
-	SettleNum           int64     `gorm:"column:settle_num;default:0;NOT NULL"`           // 已结算人数
-	SubAccountId        int64     `gorm:"column:sub_account_id"`                          // 所属子账号ID
-	ServiceCharge       float64   `gorm:"column:service_charge"`                          // 服务商预估可赚服务费
-	ServiceChargeActual float64   `gorm:"column:service_charge_actual"`                   // 服务商实际可赚服务费
-	OperatorType        int64     `gorm:"column:operator_type"`                           // 添加商单操作人类型,1为服务商主账号,2为服务商子账号
-	SProjectStatus      int64     `gorm:"column:s_project_status"`                        // 服务商种草任务状态,1待确认,2已确认,3已拒绝
-	StrategyStatus      int64     `gorm:"column:strategy_status"`                         // 定向种草任务是否替换招募策略
-	BOperator           string    `gorm:"column:b_operator"`                              // 商家发起入库邀约人
-	BOperatorType       int64     `gorm:"column:b_operator_type"`                         // 商家发起入库邀约人类型:1主账号,2子账号
-	CreateTime          time.Time `gorm:"column:create_time;default:0;NOT NULL"`
+	SProjectID          int64     `gorm:"column:s_project_id;primary_key;AUTO_INCREMENT"` // 服务商种草任务ID
+	ProjectID           string    `gorm:"column:project_id"`                              // 被服务商加入商单的原种草任务ID
+	ProductID           int64     `gorm:"column:product_id"`                              // 商品ID
+	ProjectName         string    `gorm:"column:project_name"`
+	ProjectStatus       int64     `gorm:"column:project_status"`
+	ProjectType         int64     `gorm:"column:project_type"`
+	ProjectPlatform     int64     `gorm:"column:project_platform"`
+	ProjectForm         int64     `gorm:"column:project_form"`
+	ContentType         int64     `gorm:"column:content_type"`
+	ShareCode           string    `gorm:"column:share_code"` // 分享码URL
+	EnterpriseID        string    `gorm:"column:enterprise_id"`
+	SupplierID          int64     `gorm:"column:supplier_id"`                        // 服务商ID
+	ApplyNum            int64     `gorm:"column:apply_num;default:0"`                // 报名人数
+	RecruitNum          int64     `gorm:"column:recruit_num;default:0"`              // 已招募人数
+	SettleNum           int64     `gorm:"column:settle_num;default:0"`               // 已结算人数
+	QuitNum             int64     `gorm:"column:quit_num;default:0"`                 // 已解约人数
+	SubAccountID        int64     `gorm:"column:sub_account_id;default:0"`           // 服务商子账号ID
+	ServiceCharge       string    `gorm:"column:service_charge;default:0.00"`        // 服务商预估可赚服务费
+	ServiceChargeActual string    `gorm:"column:service_charge_actual;default:0.00"` // 服务商实际可赚服务费
+	ServiceChargeSettle string    `gorm:"column:service_charge_settle"`              // 服务商已结算服务费
+	OperatorType        int64     `gorm:"column:operator_type;default:0"`            // 添加商单操作人类型,1为服务商主账号,2为服务商子账号
+	SProjectStatus      int64     `gorm:"column:s_project_status;default:0"`         // 服务商种草任务状态,1待确认,2已确认,3已拒绝
+	StrategyStatus      int64     `gorm:"column:strategy_status;default:0"`          // 定向种草任务是否替换招募策略
+	BOperator           string    `gorm:"column:b_operator"`                         // 商家发起入库邀约人
+	BOperatorType       int64     `gorm:"column:b_operator_type;default:0"`          // 商家发起入库邀约人类型:1主账号 2子账号
+	CreateTime          time.Time `gorm:"column:create_time"`                        // 创建时间
+	CreateStrategyID    int64     `gorm:"column:create_strategy_id"`                 // 服务商修改服务费操作人ID
+	CreateStrategyType  int64     `gorm:"column:create_strategy_type"`               // 服务商修改服务费操作人类型:1服务商主账号,2子账号
 }
 
 func (m *SProjectInfo) TableName() string {

+ 20 - 3
app/service/cooperation_service.go

@@ -233,7 +233,7 @@ func (s CooperationService) GetSupplierInTargetTaskList(param *vo.SupplierSearch
 	if enterpriseSupplierCooperates == nil {
 		if param.TaskType == 2 { // 种草
 			for _, sProjectInfo := range sProjectInfos {
-				supplierId := sProjectInfo.SupplierId
+				supplierId := sProjectInfo.SupplierID
 				enterpriseSupplierCooperate, err1 := dao.EnterpriseSupplierCooperateDao{}.GetDataByEnterpriseAndSupplier(param.EnterpriseId, supplierId)
 				if err1 != nil {
 					return result, err1
@@ -305,8 +305,8 @@ func (s CooperationService) GetSupplierInTargetTaskList(param *vo.SupplierSearch
 func (s CooperationService) InviteSupplierInTargetTask(param *vo.SupplierInviteInTargetTaskParam) error {
 	var sProjectInfo entity.SProjectInfo
 	if param.TaskType == 2 {
-		sProjectInfo.ProjectId = param.TaskId
-		sProjectInfo.SupplierId = param.SupplierId
+		sProjectInfo.ProjectID = param.TaskId
+		sProjectInfo.SupplierID = param.SupplierId
 		sProjectInfo.SProjectStatus = 1
 		sProjectInfo.CreateTime = time.Now()
 		if param.SubAccountId == 0 {
@@ -316,6 +316,23 @@ func (s CooperationService) InviteSupplierInTargetTask(param *vo.SupplierInviteI
 			sProjectInfo.BOperator = strconv.Itoa(int(param.SubAccountId))
 			sProjectInfo.BOperatorType = 2
 		}
+		// 查找该 projectId 对应的信息
+		project, err1 := dao.ProjectDAO{}.GetProjectById(param.TaskId)
+		if err1 != nil {
+			return err1
+		}
+		if project != nil {
+			sProjectInfo.ProductID = project.ProductID
+			sProjectInfo.ProjectName = project.ProjectName
+			sProjectInfo.ProjectStatus = project.ProjectStatus
+			sProjectInfo.ProjectType = project.ProjectType
+			sProjectInfo.ProjectPlatform = project.ProjectPlatform
+			sProjectInfo.ProjectForm = project.ProjectForm
+			sProjectInfo.ContentType = project.ContentType
+			sProjectInfo.EnterpriseID = param.EnterpriseId
+			//sProjectInfo.ApplyNum = project.ApplyNum
+			//sProjectInfo.RecruitNum = project.RecruitNum
+		}
 	} else if param.TaskType == 3 {
 		// 本地生活
 	}