Xingyu Xian преди 4 седмици
родител
ревизия
c3206c75d8
променени са 33 файла, в които са добавени 1110 реда и са изтрити 32 реда
  1. 12 1
      db/platform_kuaishou_user.go
  2. 77 0
      db/s_t_cooperate.go
  3. 39 0
      db/supplier_payment.go
  4. 28 4
      db/task.go
  5. 18 1
      handler/project_change_taskStatus.go
  6. 1 1
      handler/supplier_withdraw_amount.go
  7. 50 0
      handler/talent_cooperate_data.go
  8. 50 0
      handler/talent_data.go
  9. 50 0
      handler/talent_list.go
  10. 54 0
      handler/talent_local_list.go
  11. 54 0
      handler/talent_project_list.go
  12. 58 0
      handler/update_contact.go
  13. 49 0
      handler/withdraw_create_payment_info.go
  14. 1 0
      model/gorm_model/platform_kuaishou_user_info.go
  15. 1 0
      model/gorm_model/project_task.go
  16. 1 0
      model/gorm_model/supplier.go
  17. 20 0
      model/gorm_model/supplier_talent_cooperate.go
  18. 1 0
      model/gorm_model/supplier_withdraw_payment_info.go
  19. 8 6
      model/http_model/project_change_taskStatus.go
  20. 1 1
      model/http_model/s_local_life_list.go
  21. 22 0
      model/http_model/talent_cooperate_data.go
  22. 32 0
      model/http_model/talent_data.go
  23. 40 0
      model/http_model/talent_list.go
  24. 38 0
      model/http_model/talent_local_list.go
  25. 38 0
      model/http_model/talent_project_list.go
  26. 15 0
      model/http_model/update_contact.go
  27. 9 8
      model/http_model/update_withdraw_payment_info.go
  28. 25 0
      model/http_model/withdraw_create_payment_info.go
  29. 4 2
      model/http_model/withdraw_payment_info.go
  30. 9 1
      route/init.go
  31. 2 2
      service/project.go
  32. 163 0
      service/s_t_cooperate.go
  33. 140 5
      service/supplier.go

+ 12 - 1
db/platform_kuaishou_user.go

@@ -19,7 +19,18 @@ func FindUserInfoByTalentId(ctx context.Context, talentId string) (*gorm_model.P
 func FindUserInfoByOpenId(ctx context.Context, openId string) (*gorm_model.PlatformKuaishouUserInfo, error) {
 	db := GetReadDB(ctx)
 	var userInfo gorm_model.PlatformKuaishouUserInfo
-	err := db.Model(gorm_model.PlatformKuaishouUserInfo{}).Where("open_id = ? and platform_id = ?", openId, 4).Find(&userInfo).Error
+	err := db.Model(gorm_model.PlatformKuaishouUserInfo{}).Where("open_id = ?", openId).Find(&userInfo).Error
+	if err != nil {
+		return nil, err
+	}
+	return &userInfo, nil
+}
+
+// FindUserInfoById 根据ID去查找快手授权信息
+func FindUserInfoById(ctx context.Context, Id int) (*gorm_model.PlatformKuaishouUserInfo, error) {
+	db := GetReadDB(ctx)
+	var userInfo gorm_model.PlatformKuaishouUserInfo
+	err := db.Model(gorm_model.PlatformKuaishouUserInfo{}).Where("id = ?", Id).Find(&userInfo).Error
 	if err != nil {
 		return nil, err
 	}

+ 77 - 0
db/s_t_cooperate.go

@@ -0,0 +1,77 @@
+package db
+
+import (
+	"context"
+	"github.com/sirupsen/logrus"
+	"gorm.io/gorm"
+	"youngee_b_api/model/gorm_model"
+)
+
+// CreateSTCooperateInfo 创建服务商-达人合作关系
+func CreateSTCooperateInfo(ctx context.Context, cooperateInfo *gorm_model.SupplierTalentCooperate) error {
+	db := GetWriteDB(ctx)
+	err := db.Create(&cooperateInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// CountCooperateInfoBySupplierAndPlatform 查找服务商-商家是否建立合作关系
+func CountCooperateInfoBySupplierAndPlatform(ctx context.Context, supplierId int, platformUserId int) (int64, error) {
+	db := GetReadDB(ctx)
+	whereCondition := gorm_model.SupplierTalentCooperate{
+		PlatformUserId: platformUserId,
+		SupplierId:     supplierId,
+	}
+	db = db.Debug().Model(gorm_model.SupplierTalentCooperate{}).Where(whereCondition)
+	var total int64
+	if err := db.Count(&total).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetCooperateInfoByIds] error query mysql total, err:%+v", err)
+		return 0, err
+	}
+	return total, nil
+}
+
+// UpdateSTCooperateInfo 更新服务商-达人合作关系
+func UpdateSTCooperateInfo(ctx context.Context, supplierId int, platformUserId int) error {
+	db := GetWriteDB(ctx)
+	whereCondition := gorm_model.SupplierTalentCooperate{SupplierId: supplierId, PlatformUserId: platformUserId}
+	err := db.Model(&gorm_model.SupplierTalentCooperate{}).
+		Where(whereCondition).
+		Update("cooperate_num", gorm.Expr("cooperate_num + 1")).
+		Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// GetSTCooperateInfo 查找合作列表
+func GetSTCooperateInfo(ctx context.Context, supplierId int, taskType int, platform int, nickname string, pageSize, pageNum int64) ([]*gorm_model.SupplierTalentCooperate, int64, error) {
+	db := GetReadDB(ctx)
+	whereCondition := gorm_model.SupplierTalentCooperate{
+		SupplierId: supplierId,
+		Platform:   platform,
+		TaskType:   taskType,
+	}
+
+	// 1. 按条件过滤
+	db = db.Debug().Model(gorm_model.SupplierTalentCooperate{}).Where(whereCondition)
+
+	// 2. 返回当前页数据并统计总数
+	var total int64
+	var cooperateInfp []*gorm_model.SupplierTalentCooperate
+	if err := db.Count(&total).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetCooperateInfoByIds] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	limit := pageSize
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err := db.Order("supplier_id desc").Limit(int(limit)).Offset(int(offset)).Find(&cooperateInfp).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetCooperateInfoByIds] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	return cooperateInfp, total, nil
+}

+ 39 - 0
db/supplier_payment.go

@@ -0,0 +1,39 @@
+package db
+
+import (
+	"context"
+	"youngee_b_api/model/gorm_model"
+)
+
+// GetSupplierPaymentInfoById 根据服务商ID查询提现账号信息
+func GetSupplierPaymentInfoById(ctx context.Context, supplierId int) (*gorm_model.SupplierPaymentInfo, error) {
+	db := GetWriteDB(ctx)
+	var supplierPaymentInfo *gorm_model.SupplierPaymentInfo
+	whereCondition := gorm_model.SupplierPaymentInfo{SupplierID: supplierId}
+	err := db.Model(gorm_model.SupplierPaymentInfo{}).Where(whereCondition).Find(&supplierPaymentInfo).Error
+	if err != nil {
+		return nil, err
+	}
+	return supplierPaymentInfo, nil
+}
+
+// CreateSupplierPayment 新建提现收款信息
+func CreateSupplierPayment(ctx context.Context, paymentInfo *gorm_model.SupplierPaymentInfo) error {
+	db := GetWriteDB(ctx)
+	err := db.Create(&paymentInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// UpdateSupplierPayment 更新提现收款信息
+func UpdateSupplierPayment(ctx context.Context, paymentInfo *gorm_model.SupplierPaymentInfo) error {
+	db := GetWriteDB(ctx)
+	whereCondition := gorm_model.SupplierPaymentInfo{PaymentInfoID: paymentInfo.PaymentInfoID}
+	err := db.Model(&gorm_model.SupplierPaymentInfo{}).Where(whereCondition).Updates(paymentInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 28 - 4
db/task.go

@@ -64,13 +64,19 @@ func GetProjectIdByTaskId(ctx context.Context, taskID string) (*string, error) {
 	return &task.ProjectID, nil
 }
 
-func ChangeTaskStatus(ctx context.Context, taskIds []string, supplierStatus int) ([]int64, error) {
+func ChangeTaskStatus(ctx context.Context, taskIds []string, supplierStatus int, supplierId int, subAccountId int, sOperateType int) ([]int64, error) {
 	db := GetReadDB(ctx)
 	// taskSta, err := strconv.Atoi(taskStatus)
 	taskSta := supplierStatus
+	var tag int
+	if sOperateType == 1 {
+		tag = supplierId
+	} else {
+		tag = subAccountId
+	}
 
 	if err := db.Debug().Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", taskIds).
-		Updates(gorm_model.YoungeeTaskInfo{SupplierStatus: taskSta}).Error; err != nil {
+		Updates(gorm_model.YoungeeTaskInfo{SupplierStatus: taskSta, SupplierId: supplierId, SOperator: tag, SOperatorType: sOperateType}).Error; err != nil {
 		logrus.WithContext(ctx).Errorf("[ChangeTaskStatus]2 error query mysql total, err:%+v", err)
 		return nil, err
 	}
@@ -95,10 +101,16 @@ func ChangeTaskStatus(ctx context.Context, taskIds []string, supplierStatus int)
 	return recruitStrategysIDs, nil
 }
 
-func ChangeSpecialTaskStatus(ctx context.Context, taskIds []string, supplierStatus int) error {
+func ChangeSpecialTaskStatus(ctx context.Context, taskIds []string, supplierStatus int, supplierId int, subAccountId int, sOperateType int) error {
 	db := GetReadDB(ctx)
+	var tag int
+	if sOperateType == 1 {
+		tag = supplierId
+	} else {
+		tag = subAccountId
+	}
 	if err := db.Debug().Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", taskIds).
-		Updates(gorm_model.YoungeeTaskInfo{SupplierStatus: supplierStatus}).Error; err != nil {
+		Updates(gorm_model.YoungeeTaskInfo{SupplierStatus: supplierStatus, SupplierId: supplierId, SOperator: tag, SOperatorType: sOperateType}).Error; err != nil {
 		logrus.WithContext(ctx).Errorf("[ChangeTaskStatus]2 error query mysql total, err:%+v", err)
 		return err
 	}
@@ -422,3 +434,15 @@ func GetTaskByTaskId(ctx context.Context, taskId string) (*gorm_model.YoungeeTas
 	}
 	return taskInfo, nil
 }
+
+// CountTaskNumByTaskStage 根据子任务状态查找对应的种草子任务数量
+func CountTaskNumByTaskStage(ctx context.Context, taskStage int, openId string) (int64, error) {
+	db := GetReadDB(ctx)
+	var taskNum int64
+	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_stage = ? and open_id = ?", taskStage, openId).Count(&taskNum).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[CreateMessageByTask] error read mysql, err:%+v", err)
+		return 0, err
+	}
+	return taskNum, nil
+}

+ 18 - 1
handler/project_change_taskStatus.go

@@ -52,6 +52,8 @@ func (p *ProjectChangeTaskStatusHandler) run() {
 			logrus.Errorf("[ChangeTaskStatusHandler] call Create err:%+v\n", err)
 			util.HandlerPackErrorResp(p.resp, consts.ErrorInternal, "")
 			logrus.Info("ChangeTaskStatus fail,req:%+v", p.req)
+			p.resp.Message = "状态变更失败"
+			p.resp.Status = 40000
 			return
 		}
 	} else {
@@ -61,10 +63,25 @@ func (p *ProjectChangeTaskStatusHandler) run() {
 			logrus.Errorf("[ChangeTaskStatusHandler] call Create err:%+v\n", err)
 			util.HandlerPackErrorResp(p.resp, consts.ErrorInternal, "")
 			logrus.Info("ChangeTaskStatus fail,req:%+v", p.req)
+			p.resp.Message = "状态变更失败"
+			p.resp.Status = 40000
 			return
 		}
 	}
-	p.resp.Message = "任务状态更换成功"
+
+	// 变更达人和服务商合作次数
+	if data.SupplierStatus == 2 {
+		cooperateErr := service.STCooperate.CreateSTCooperate(p.ctx, data.SupplierId, data.TaskIds)
+		if cooperateErr != nil {
+			logrus.Errorf("[ChangeTaskStatusHandler] call Create err:%+v", cooperateErr)
+			util.HandlerPackErrorResp(p.resp, consts.ErrorInternal, "")
+			logrus.Info("ChangeTaskStatus fail,req:%+v", p.req)
+			p.resp.Message = "合作次数修改失败"
+			p.resp.Status = 40000
+			return
+		}
+	}
+	p.resp.Message = "ok"
 }
 
 func (p *ProjectChangeTaskStatusHandler) checkParam() error {

+ 1 - 1
handler/supplier_withdraw_amount.go

@@ -42,7 +42,7 @@ func (h *WithdrawAmountHandler) run() {
 		return
 	}
 	h.resp.Data = amount
-	h.resp.Message = "成功添加"
+	h.resp.Message = "ok"
 }
 
 func (h *WithdrawAmountHandler) checkParam() error {

+ 50 - 0
handler/talent_cooperate_data.go

@@ -0,0 +1,50 @@
+package handler
+
+import (
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapTalentCooperateDataHandler(ctx *gin.Context) {
+	handler := newTalentCooperateDataHandler(ctx)
+	baseRun(handler)
+}
+
+func newTalentCooperateDataHandler(ctx *gin.Context) *TalentCooperateDataHandler {
+	return &TalentCooperateDataHandler{
+		req:  http_model.NewTalentCooperateDataRequest(),
+		resp: http_model.NewTalentCooperateDataResponse(),
+		ctx:  ctx,
+	}
+}
+
+type TalentCooperateDataHandler struct {
+	req  *http_model.TalentCooperateDataRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *TalentCooperateDataHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *TalentCooperateDataHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *TalentCooperateDataHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *TalentCooperateDataHandler) run() {
+	talentData, err := service.STCooperate.CountTalentTaskNum(h.ctx, h.req)
+	if err != nil {
+		h.resp.Message = "查询失败"
+		h.resp.Data = err
+		fmt.Println(err)
+	}
+	h.resp.Message = "成功查询达人合作信息"
+	h.resp.Data = talentData
+}
+func (h *TalentCooperateDataHandler) checkParam() error {
+	return nil
+}

+ 50 - 0
handler/talent_data.go

@@ -0,0 +1,50 @@
+package handler
+
+import (
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapTalentDataHandler(ctx *gin.Context) {
+	handler := newTalentDataHandler(ctx)
+	baseRun(handler)
+}
+
+func newTalentDataHandler(ctx *gin.Context) *TalentDataHandler {
+	return &TalentDataHandler{
+		req:  http_model.NewTalentDataRequest(),
+		resp: http_model.NewTalentDataResponse(),
+		ctx:  ctx,
+	}
+}
+
+type TalentDataHandler struct {
+	req  *http_model.TalentDataRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *TalentDataHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *TalentDataHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *TalentDataHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *TalentDataHandler) run() {
+	talentData, err := service.STCooperate.GetTalentInfo(h.ctx, h.req)
+	if err != nil {
+		h.resp.Message = "查询失败"
+		h.resp.Data = err
+		fmt.Println(err)
+	}
+	h.resp.Message = "成功查询达人合作信息"
+	h.resp.Data = talentData
+}
+func (h *TalentDataHandler) checkParam() error {
+	return nil
+}

+ 50 - 0
handler/talent_list.go

@@ -0,0 +1,50 @@
+package handler
+
+import (
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapTalentListHandler(ctx *gin.Context) {
+	handler := newTalentListHandler(ctx)
+	baseRun(handler)
+}
+
+func newTalentListHandler(ctx *gin.Context) *TalentListHandler {
+	return &TalentListHandler{
+		req:  http_model.NewTalentListRequest(),
+		resp: http_model.NewTalentListResponse(),
+		ctx:  ctx,
+	}
+}
+
+type TalentListHandler struct {
+	req  *http_model.TalentListRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *TalentListHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *TalentListHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *TalentListHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *TalentListHandler) run() {
+	talentListData, err := service.STCooperate.GetTalentListInfo(h.ctx, h.req)
+	if err != nil {
+		h.resp.Message = "查询失败"
+		h.resp.Data = err
+		fmt.Println(err)
+	}
+	h.resp.Message = "成功查询达人合作信息"
+	h.resp.Data = talentListData
+}
+func (h *TalentListHandler) checkParam() error {
+	return nil
+}

+ 54 - 0
handler/talent_local_list.go

@@ -0,0 +1,54 @@
+package handler
+
+import (
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapTalentLocalListHandler(ctx *gin.Context) {
+	handler := newTalentLocalListHandler(ctx)
+	baseRun(handler)
+}
+
+func newTalentLocalListHandler(ctx *gin.Context) *TalentLocalListHandler {
+	return &TalentLocalListHandler{
+		req:  http_model.NewTalentLocalListRequest(),
+		resp: http_model.NewTalentLocalListResponse(),
+		ctx:  ctx,
+	}
+}
+
+type TalentLocalListHandler struct {
+	req  *http_model.TalentLocalListRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *TalentLocalListHandler) getRequest() interface{} {
+	return h.req
+}
+
+func (h *TalentLocalListHandler) getContext() *gin.Context {
+	return h.ctx
+}
+
+func (h *TalentLocalListHandler) getResponse() interface{} {
+	return h.resp
+}
+
+func (h *TalentLocalListHandler) run() {
+	talentListData, err := service.STCooperate.GetTalentLocalList(h.ctx, h.req)
+	if err != nil {
+		h.resp.Message = "查询失败"
+		h.resp.Data = err
+		fmt.Println(err)
+	}
+	h.resp.Message = "ok"
+	h.resp.Data = talentListData
+}
+
+func (h *TalentLocalListHandler) checkParam() error {
+	return nil
+}

+ 54 - 0
handler/talent_project_list.go

@@ -0,0 +1,54 @@
+package handler
+
+import (
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapTalentProjectListHandler(ctx *gin.Context) {
+	handler := newTalentProjectListHandler(ctx)
+	baseRun(handler)
+}
+
+func newTalentProjectListHandler(ctx *gin.Context) *TalentProjectListHandler {
+	return &TalentProjectListHandler{
+		req:  http_model.NewTalentProjectListRequest(),
+		resp: http_model.NewTalentProjectListResponse(),
+		ctx:  ctx,
+	}
+}
+
+type TalentProjectListHandler struct {
+	req  *http_model.TalentProjectListRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *TalentProjectListHandler) getRequest() interface{} {
+	return h.req
+}
+
+func (h *TalentProjectListHandler) getContext() *gin.Context {
+	return h.ctx
+}
+
+func (h *TalentProjectListHandler) getResponse() interface{} {
+	return h.resp
+}
+
+func (h *TalentProjectListHandler) run() {
+	talentListData, err := service.STCooperate.GetTalentProjectList(h.ctx, h.req)
+	if err != nil {
+		h.resp.Message = "查询失败"
+		h.resp.Data = err
+		fmt.Println(err)
+	}
+	h.resp.Message = "ok"
+	h.resp.Data = talentListData
+}
+
+func (h *TalentProjectListHandler) checkParam() error {
+	return nil
+}

+ 58 - 0
handler/update_contact.go

@@ -0,0 +1,58 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapUpdateContactHandler(ctx *gin.Context) {
+	handler := newUpdateContactHandler(ctx)
+	baseRun(handler)
+}
+
+func newUpdateContactHandler(ctx *gin.Context) *UpdateContactHandler {
+	return &UpdateContactHandler{
+		req:  http_model.NewFindAllJobRequest(),
+		resp: http_model.NewFindAllJobResponse(),
+		ctx:  ctx,
+	}
+}
+
+type UpdateContactHandler struct {
+	req  *http_model.FindAllJobRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *UpdateContactHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *UpdateContactHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *UpdateContactHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *UpdateContactHandler) run() {
+	data, err := service.Job.FindJobBySupplierId(h.ctx, *h.req)
+	if err != nil {
+		logrus.Errorf("[FindSubAccountByEnterpriseId] call SetSession err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, err.Error())
+		log.Info("FindSubAccountByEnterpriseId fail,req:%+v", h.req)
+		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
+	}
+	h.resp.Data = data
+	h.resp.Status = 20000
+	h.resp.Message = "ok"
+}
+
+func (h *UpdateContactHandler) checkParam() error {
+	return nil
+}

+ 49 - 0
handler/withdraw_create_payment_info.go

@@ -0,0 +1,49 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapCreateWithdrawPaymentInfoHandler(ctx *gin.Context) {
+	handler := newCreateWithdrawPaymentInfoHandler(ctx)
+	baseRun(handler)
+}
+
+func newCreateWithdrawPaymentInfoHandler(ctx *gin.Context) *CreateWithdrawPaymentInfoHandler {
+	return &CreateWithdrawPaymentInfoHandler{
+		req:  http_model.NewCreateWithdrawPaymentInfoRequest(),
+		resp: http_model.NewCreateWithdrawPaymentInfoResponse(),
+		ctx:  ctx,
+	}
+}
+
+type CreateWithdrawPaymentInfoHandler struct {
+	req  *http_model.CreateWithdrawPaymentInfoRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *CreateWithdrawPaymentInfoHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *CreateWithdrawPaymentInfoHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *CreateWithdrawPaymentInfoHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *CreateWithdrawPaymentInfoHandler) run() {
+	err := service.Supplier.CreateWithdrawPaymentInfo(h.ctx, h.req)
+	if err != nil {
+		h.resp.Status = 40000
+		h.resp.Message = err.Error()
+		return
+	}
+	h.resp.Message = "ok"
+}
+
+func (h *CreateWithdrawPaymentInfoHandler) checkParam() error {
+	return nil
+}

+ 1 - 0
model/gorm_model/platform_kuaishou_user_info.go

@@ -25,6 +25,7 @@ type PlatformKuaishouUserInfo struct {
 	VideoNum     int       `gorm:"column:video_num;type:int(11);default:0;comment:作品数" json:"video_num"`
 	Gender       string    `gorm:"column:gender;type:varchar(255);comment:快手性别" json:"gender"`
 	City         string    `gorm:"column:city;type:varchar(255);comment:快手用户城市所在地" json:"city"`
+	Skill        string    `gorm:"column:skill"` // 技能
 }
 
 func (m *PlatformKuaishouUserInfo) TableName() string {

+ 1 - 0
model/gorm_model/project_task.go

@@ -60,6 +60,7 @@ type YoungeeTaskInfo struct {
 	CancelTime             time.Time `gorm:"column:cancel_time"`                          // 解约时间
 	CancelReason           string    `gorm:"column:cancel_reason"`                        // 解约理由
 	SketchMissingTime      time.Time `gorm:"column:sketch_missing_time"`                  // 未传初稿违约时间
+	OpenId                 string    `gorm:"column:open_id"`                              // openID
 }
 
 func (m *YoungeeTaskInfo) TableName() string {

+ 1 - 0
model/gorm_model/supplier.go

@@ -5,6 +5,7 @@ type YoungeeSupplier struct {
 	SupplierId      int    `gorm:"column:supplier_id;primary_key;AUTO_INCREMENT"` // 服务商ID
 	SupplierName    string `gorm:"column:supplier_name"`                          // 服务商名称
 	PhoneNumber     string `gorm:"column:phone_number"`                           // 手机号
+	ContactPhone    string `gorm:"column:contact_phone"`                          // 手机联系方式
 	BusinessLicense string `gorm:"column:business_license"`                       // 营业执照url
 	Usci            string `gorm:"column:usci"`                                   // 统一社会信用代码
 	CompanyName     string `gorm:"column:company_name"`                           // 公司名称

+ 20 - 0
model/gorm_model/supplier_talent_cooperate.go

@@ -0,0 +1,20 @@
+package gorm_model
+
+import "time"
+
+type SupplierTalentCooperate struct {
+	CooperateID    int        `gorm:"column:cooperate_id;primary_key;AUTO_INCREMENT"` // 合作主键ID
+	TalentID       string     `gorm:"column:talent_id"`                               // 达人ID
+	TaskType       int        `gorm:"column:task_type"`                               // 达人任务类型,1种草,2本地生活
+	ProjectTaskId  string     `gorm:"column:project_task_id"`                         // 种草子任务ID
+	LocalTaskID    string     `gorm:"column:local_task_id"`                           // 本地生活子任务ID
+	Platform       int        `gorm:"column:platform"`                                // 平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	CooperateNum   int        `gorm:"column:cooperate_num"`                           // 合作次数
+	PlatformUserId int        `gorm:"column:platform_user_id"`                        // 第三方平台ID
+	SupplierId     int        `gorm:"column:supplier_id"`                             // 服务商ID
+	CreateTime     *time.Time `gorm:"column:create_time"`                             // 创建时间
+}
+
+func (m *SupplierTalentCooperate) TableName() string {
+	return "supplier_talent_cooperate"
+}

+ 1 - 0
model/gorm_model/supplier_withdraw_payment_info.go

@@ -9,6 +9,7 @@ type SupplierPaymentInfo struct {
 	IDNumber      string `gorm:"column:id_number"`                                  // 个人服务商身份证号码
 	Phone         string `gorm:"column:phone"`                                      // 个人服务商银行预留手机号码
 	SupplierType  int    `gorm:"column:supplier_type"`                              // 服务商类型,1个人,2机构
+	Company       string `gorm:"column:company"`                                    // 机构服务商公司
 }
 
 func (m *SupplierPaymentInfo) TableName() string {

+ 8 - 6
model/http_model/project_change_taskStatus.go

@@ -1,12 +1,14 @@
 package http_model
 
 type ProjectChangeTaskStatusRequest struct {
-	TaskIds        []string `json:"task_ids"`
-	TaskStatus     string   `json:"task_status"`
-	TaskStage      string   `json:"task_stage"`
-	IsSpecial      string   `json:"is_special"` // 1为定向种草
-	ProjectId      string   `json:"project_id"`
-	ClickIndex     string   `json:"clickIndex"`
+	TaskIds        []string `json:"task_ids"`        // 子任务ID
+	TaskStatus     string   `json:"task_status"`     // 子任务状态
+	TaskStage      string   `json:"task_stage"`      // 子任务阶段
+	IsSpecial      string   `json:"is_special"`      // 1为定向种草
+	ProjectId      string   `json:"project_id"`      // 种草任务ID
+	SupplierId     int      `json:"supplier_id"`     // 服务商ID
+	SubAccountId   int      `json:"sub_account_id"`  // 子账号ID,若提报或拒绝达人操作人不是子账号则0,否则填入ID
+	SOperatorType  int      `json:"s_operator_type"` // 服务商提报或拒绝达人操作人类型,1服务商主账号,2服务商子账号,3管理后台
 	SupplierStatus int      `json:"supplier_status"` // 服务商任务状态 0表示达人来源非服务商 1待选 2已选 3落选
 }
 

+ 1 - 1
model/http_model/s_local_life_list.go

@@ -25,7 +25,7 @@ type FullSLocalPreview struct {
 	ServiceCharge        float64 `json:"service_charge"`          // 预估赚
 	ServiceChargeActual  float64 `json:"service_charge_actual"`   // 实际已赚
 	RecruitDdl           string  `json:"recruit_ddl"`             // 招募截至时间
-	StoreMainPhotoUrl    string  `json:"store_main_photo_url"`    // 商品主图URL
+	StoreMainPhotoUrl    string  `json:"store_main_photo_url"`    // 门店主图URL
 	StoreMainPhotoSymbol int64   `json:"store_main_photo_symbol"` // 标志位
 	StoreMainPhotoUid    string  `json:"store_main_photo_uid"`    // uid
 	StoreName            string  `json:"store_name"`              // 门店名称

+ 22 - 0
model/http_model/talent_cooperate_data.go

@@ -0,0 +1,22 @@
+package http_model
+
+type TalentCooperateDataRequest struct {
+	PlatformUserId int `json:"platform_user_id"` // 平台用户ID
+}
+
+type TalentCooperateData struct {
+	VoteTaskNum     int `json:"vote_task_num"`     // 报名任务数
+	SelectedTaskNum int `json:"selected_task_num"` // 选中任务数
+	TaskingNum      int `json:"tasking_num"`       // 进行中任务数
+	FinishTaskNum   int `json:"finish_task_num"`   // 完成任务数
+}
+
+func NewTalentCooperateDataRequest() *TalentCooperateDataRequest {
+	return new(TalentCooperateDataRequest)
+}
+
+func NewTalentCooperateDataResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(TalentCooperateData)
+	return resp
+}

+ 32 - 0
model/http_model/talent_data.go

@@ -0,0 +1,32 @@
+package http_model
+
+type TalentDataRequest struct {
+	PlatformUserId int `json:"platform_user_id"` // 平台用户ID
+}
+
+type TalentData struct {
+	Fans       string `json:"fans"`         // 粉丝数
+	VoteNum    int    `json:"vote_num"`     // 点赞数
+	CollectNum int    `json:"collect_num"`  // 收藏数
+	CommitNum  int    `json:"commit_num"`   // 评论数
+	Sale30Days int    `json:"sale_30_days"` // 30天销量
+	Sale60Days int    `json:"sale_60_days"` // 60天销量
+	Sale90Days int    `json:"sale_90_days"` // 90天销量
+	HeadUrl    string `json:"head_url"`     // 头像
+	Nickname   string `json:"nickname"`     // 昵称
+	City       string `json:"city"`         // 城市
+	Skill      string `json:"skill"`        // 擅长领域
+	Gender     string `json:"gender"`       // 性别
+	WXNumber   string `json:"wx_number"`    // 微信号
+	Phone      string `json:"phone"`        // 手机号
+}
+
+func NewTalentDataRequest() *TalentDataRequest {
+	return new(TalentDataRequest)
+}
+
+func NewTalentDataResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(TalentData)
+	return resp
+}

+ 40 - 0
model/http_model/talent_list.go

@@ -0,0 +1,40 @@
+package http_model
+
+type TalentListRequest struct {
+	PageSize   int64  `json:"page_size"`
+	PageNum    int64  `json:"page_num"`
+	SupplierId int    `json:"supplier_id"` // 服务商ID
+	Platform   int    `json:"platform"`    // 平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	Type       int    `json:"type"`        // 达人库达人类型,1种草,2本地
+	Nickname   string `json:"nickname"`    // 昵称
+}
+
+type TalentListData struct {
+	TalentListInfo []*SupplierTalentCooperateData `json:"talent_list_info"`
+	Total          int64                          `json:"total"`
+}
+
+type SupplierTalentCooperateData struct {
+	CooperateID    int    `json:"cooperate_id"`     // 合作主键ID
+	Platform       int    `json:"platform"`         // 平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	CooperateNum   int    `json:"cooperate_num"`    // 合作次数
+	PlatformUserId int    `json:"platform_user_id"` // 第三方平台ID
+	SupplierId     int    `json:"supplier_id"`      // 服务商ID
+	City           string `json:"city"`             // 用户城市所在地
+	Nickname       string `json:"nickname"`         // 昵称
+	HeadUrl        string `json:"head_url"`         // 头像
+	Fans           string `json:"fans"`             // 粉丝数
+	LikeNum        int    `json:"like_num"`         // 点赞数
+	CommitNum      int    `json:"commit_num"`       // 评论数
+	CollectNum     int    `json:"collect_num"`      // 收藏数
+}
+
+func NewTalentListRequest() *TalentListRequest {
+	return new(TalentListRequest)
+}
+
+func NewTalentListResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(TalentListData)
+	return resp
+}

+ 38 - 0
model/http_model/talent_local_list.go

@@ -0,0 +1,38 @@
+package http_model
+
+type TalentLocalListRequest struct {
+	PageSize       int64  `json:"page_size"`
+	PageNum        int64  `json:"page_num"`
+	PlatformUserId int    `json:"platform_user_id"` // 平台用户ID
+	Nickname       string `json:"nickname"`         // 昵称
+}
+
+type TalentLocalListData struct {
+	TalentLocalDataListInfo []*TalentLocalData `json:"talent_local_data_list_info"`
+	Total                   int64              `json:"total"`
+}
+
+type TalentLocalData struct {
+	// 任务信息
+	LocalName            string `json:"local_name"`              // 种草任务名称
+	StoreMainPhotoUrl    string `json:"store_main_photo_url"`    // 门店主图URL
+	StoreMainPhotoSymbol int64  `json:"store_main_photo_symbol"` // 标志位
+	StoreMainPhotoUid    string `json:"store_main_photo_uid"`    // uid
+	StoreName            string `json:"store_name"`              // 门店名称
+	StoreId              int    `json:"store_id"`                // 门店ID
+
+	ReadNum    int `json:"read_num"`    // 阅读数
+	VoteNum    int `json:"vote_num"`    // 点赞数
+	CollectNum int `json:"collect_num"` // 收藏数
+	CommitNum  int `json:"commit_num"`  // 评论数
+}
+
+func NewTalentLocalListRequest() *TalentLocalListRequest {
+	return new(TalentLocalListRequest)
+}
+
+func NewTalentLocalListResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(TalentLocalListData)
+	return resp
+}

+ 38 - 0
model/http_model/talent_project_list.go

@@ -0,0 +1,38 @@
+package http_model
+
+type TalentProjectListRequest struct {
+	PageSize       int64  `json:"page_size"`
+	PageNum        int64  `json:"page_num"`
+	PlatformUserId int    `json:"platform_user_id"` // 平台用户ID
+	Nickname       string `json:"nickname"`         // 昵称
+}
+
+type TalentProjectListData struct {
+	TalentProjectDataListInfo []*TalentProjectData `json:"talent_project_data_list_info"`
+	Total                     int64                `json:"total"`
+}
+
+type TalentProjectData struct {
+	// 任务信息
+	ProjectName        string  `json:"project_name"`         // 种草任务名称
+	ProductPhotoUrl    string  `json:"product_photo_url"`    // 商品主图URL
+	ProductPhotoSymbol int64   `json:"product_photo_symbol"` // 标志位
+	ProductPhotoUid    string  `json:"product_photo_uid"`    // uid
+	ProductId          int64   `json:"product_id"`           // 商品ID
+	ProductPrice       float64 `json:"product_price"`        // 商品售价
+
+	ReadNum    int `json:"read_num"`    // 阅读数
+	VoteNum    int `json:"vote_num"`    // 点赞数
+	CollectNum int `json:"collect_num"` // 收藏数
+	CommitNum  int `json:"commit_num"`  // 评论数
+}
+
+func NewTalentProjectListRequest() *TalentProjectListRequest {
+	return new(TalentProjectListRequest)
+}
+
+func NewTalentProjectListResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(TalentProjectListData)
+	return resp
+}

+ 15 - 0
model/http_model/update_contact.go

@@ -0,0 +1,15 @@
+package http_model
+
+type UpdateContactRequest struct {
+	SupplierId int `json:"supplier_id"` // 子账号属于的服务商id
+	
+}
+
+func NewUpdateContactRequest() *UpdateContactRequest {
+	return new(UpdateContactRequest)
+}
+
+func NewUpdateContactResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	return resp
+}

+ 9 - 8
model/http_model/update_withdraw_payment_info.go

@@ -1,14 +1,15 @@
 package http_model
 
 type UpdateWithdrawPaymentInfoRequest struct {
-	BankName     string `json:"bank_name"`     // 开户银行
-	BankNumber   string `json:"bank_number"`   // 银行账户
-	Company      string `json:"company"`       // 服务商企业名称
-	SupplierID   int    `json:"supplier_id"`   // 服务商ID
-	Name         string `json:"name"`          // 个人服务商姓名
-	IDNumber     string `json:"id_number"`     // 个人服务商身份证号码
-	Phone        string `json:"phone"`         // 个人服务商银行预留手机号码
-	SupplierType int    `json:"supplier_type"` // 服务商类型,1个人,2机构
+	PaymentInfoId int    `json:"payment_info_id"` // 收款信息ID
+	BankName      string `json:"bank_name"`       // 开户银行
+	BankNumber    string `json:"bank_number"`     // 银行账户
+	Company       string `json:"company"`         // 服务商企业名称
+	SupplierID    int    `json:"supplier_id"`     // 服务商ID
+	Name          string `json:"name"`            // 个人服务商姓名
+	IDNumber      string `json:"id_number"`       // 个人服务商身份证号码
+	Phone         string `json:"phone"`           // 个人服务商银行预留手机号码
+	SupplierType  int    `json:"supplier_type"`   // 服务商类型,1个人,2机构
 }
 
 type UpdateWithdrawPaymentInfoData struct {

+ 25 - 0
model/http_model/withdraw_create_payment_info.go

@@ -0,0 +1,25 @@
+package http_model
+
+type CreateWithdrawPaymentInfoRequest struct {
+	BankName     string `json:"bank_name"`     // 开户银行
+	BankNumber   string `json:"bank_number"`   // 银行账户
+	Company      string `json:"company"`       // 服务商企业名称
+	SupplierID   int    `json:"supplier_id"`   // 服务商ID
+	Name         string `json:"name"`          // 个人服务商姓名
+	IDNumber     string `json:"id_number"`     // 个人服务商身份证号码
+	Phone        string `json:"phone"`         // 个人服务商银行预留手机号码
+	SupplierType int    `json:"supplier_type"` // 服务商类型,1个人,2机构
+}
+
+type CreateWithdrawPaymentInfoData struct {
+}
+
+func NewCreateWithdrawPaymentInfoRequest() *CreateWithdrawPaymentInfoRequest {
+	return new(CreateWithdrawPaymentInfoRequest)
+}
+
+func NewCreateWithdrawPaymentInfoResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(CreateWithdrawPaymentInfoData)
+	return resp
+}

+ 4 - 2
model/http_model/withdraw_payment_info.go

@@ -1,8 +1,10 @@
 package http_model
 
 type WithdrawPaymentInfoRequest struct {
-	SupplierId   int `json:"supplier_id"`   // 服务商ID
-	SupplierType int `json:"supplier_type"` // 服务商类型,1个人,2企业
+	SupplierId   int `json:"supplier_id"`    // 服务商ID
+	SubAccountId int `json:"sub_account_id"` // 服务商子账号ID,无就填0
+	SOperateType int `json:"s_operate_type"` // 提现操作人类型,1服务商,2服务商子账号
+	SupplierType int `json:"supplier_type"`  // 服务商类型,1个人,2企业
 }
 
 type WithdrawPaymentInfoData struct {

+ 9 - 1
route/init.go

@@ -25,6 +25,7 @@ func InitRoute(r *gin.Engine) {
 		a.POST("/sendCode", handler.WrapSendCodeHandler)                   // 发送登录验证码
 		a.POST("/login", handler.WrapCodeLoginHandler)                     // 服务商登录
 		a.POST("/getUserInfo", handler.WrapGetUserInfoHandler)             // 商家用户信息
+		a.POST("/updateContact", handler.WrapUpdateContactHandler)         // 更新联系方式
 		a.GET("/test/ping", func(c *gin.Context) {
 			resp := http_model.CommonResponse{
 				Status:  0,
@@ -185,6 +186,12 @@ func InitRoute(r *gin.Engine) {
 		c.POST("/cooperate/enterpriseList", handler.WrapEnterpriseListHandler)   // 商家列表
 		c.POST("/cooperate/agreeCooperate", handler.WrapAgreeCooperateHandler)   // 同意入库邀请
 		c.POST("/cooperate/rejectCooperate", handler.WrapRejectCooperateHandler) // 拒绝入库邀请
+
+		c.POST("/cooperate/talentList", handler.WrapTalentListHandler)                   // 达人库达人列表
+		c.POST("/cooperate/talentData", handler.WrapTalentDataHandler)                   // 达人库核心数据、达人信息查询
+		c.POST("/cooperate/talentCooperateData", handler.WrapTalentCooperateDataHandler) // 达人库合作数据 - 活跃数据查询
+		c.POST("/cooperate/projectList", handler.WrapTalentProjectListHandler)           // 达人种草表现
+		c.POST("/cooperate/localList", handler.WrapTalentLocalListHandler)               // 达人本地生活表现
 	}
 
 	// 本地生活板块
@@ -232,7 +239,8 @@ func InitRoute(r *gin.Engine) {
 
 		// 提现
 		f.POST("/supplierWithdraw/amount", handler.WrapWithdrawAmountHandler)                       // 可提现、提现中、已提现金额
-		f.POST("/supplierWithdraw/paymentInfo", handler.WrapWithdrawPaymentInfoHandler)             // 提现收款信息
+		f.POST("/supplierWithdraw/paymentInfo", handler.WrapWithdrawPaymentInfoHandler)             // 查询提现收款信息
+		f.POST("/supplierWithdraw/createPaymentInfo", handler.WrapCreateWithdrawPaymentInfoHandler) // 新增收款信息
 		f.POST("/supplierWithdraw/updatePaymentInfo", handler.WrapUpdateWithdrawPaymentInfoHandler) // 更新收款信息
 		f.POST("/supplierWithdraw/toList", handler.WrapSupplierToWithdrawListHandler)               // 服务商可提现账单列表
 		f.POST("/supplierWithdraw/create", handler.WrapCreateSupplierWithdrawHandler)               // 服务商提现

+ 2 - 2
service/project.go

@@ -571,7 +571,7 @@ func (*project) GetTaskLogisticsList(ctx context.Context, projectID string, page
 
 // ChangeTaskStatus 提报达人或拒绝提报达人
 func (*project) ChangeTaskStatus(ctx *gin.Context, data http_model.ProjectChangeTaskStatusRequest) interface{} {
-	RecruitStrategyIDs, err := db.ChangeTaskStatus(ctx, data.TaskIds, data.SupplierStatus)
+	RecruitStrategyIDs, err := db.ChangeTaskStatus(ctx, data.TaskIds, data.SupplierStatus, data.SupplierId, data.SubAccountId, data.SOperatorType)
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[project service] call ChangeTaskStatus error,err:%+v", err)
 		return err
@@ -600,7 +600,7 @@ func (*project) ChangeTaskStatus(ctx *gin.Context, data http_model.ProjectChange
 
 // ChangeSpecialTaskStatus 定向种草任务 提报达人,拒绝提报
 func (*project) ChangeSpecialTaskStatus(ctx *gin.Context, data http_model.ProjectChangeTaskStatusRequest) interface{} {
-	err := db.ChangeSpecialTaskStatus(ctx, data.TaskIds, data.SupplierStatus)
+	err := db.ChangeSpecialTaskStatus(ctx, data.TaskIds, data.SupplierStatus, data.SupplierId, data.SubAccountId, data.SOperatorType)
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[project service] call ChangeSpecialTaskStatus error,err:%+v", err)
 		return err

+ 163 - 0
service/s_t_cooperate.go

@@ -0,0 +1,163 @@
+package service
+
+import (
+	"context"
+	"time"
+	"youngee_b_api/db"
+	"youngee_b_api/model/gorm_model"
+	"youngee_b_api/model/http_model"
+)
+
+var STCooperate *stcooperate
+
+type stcooperate struct {
+}
+
+// CreateSTCooperate 创建或更新服务商-达人合作关系
+func (*stcooperate) CreateSTCooperate(ctx context.Context, supplierId int, TaskIds []string) error {
+	// 1. 根据taskId取出对应的platform_user_id
+	for _, taskId := range TaskIds {
+		taskInfo, taskInfoErr := db.GetTaskByTaskId(ctx, taskId)
+		if taskInfoErr != nil {
+			return taskInfoErr
+		}
+		if taskInfo != nil {
+			platformUserInfo, platformUserInfoErr := db.FindUserInfoByOpenId(ctx, taskInfo.OpenId)
+			if platformUserInfoErr != nil {
+				return platformUserInfoErr
+			}
+			if platformUserInfo != nil {
+				// 根据platformUserId判断需要新增一条记录还是合作次数增加
+				total, countErr := db.CountCooperateInfoBySupplierAndPlatform(ctx, supplierId, platformUserInfo.Id)
+				if countErr != nil {
+					return countErr
+				}
+				if total == 0 {
+					// create
+					var cooperateInfo *gorm_model.SupplierTalentCooperate
+					cooperateInfo = &gorm_model.SupplierTalentCooperate{}
+					cooperateInfo.SupplierId = supplierId
+					cooperateInfo.CooperateNum = 1
+					cooperateInfo.TalentID = taskInfo.TalentID
+					cooperateInfo.TaskType = 1
+					// cooperateInfo.ProjectTaskId = taskId
+					cooperateInfo.Platform = platformUserInfo.PlatformId
+					cooperateInfo.PlatformUserId = platformUserInfo.Id
+					current := time.Now()
+					cooperateInfo.CreateTime = &current
+					createErr := db.CreateSTCooperateInfo(ctx, cooperateInfo)
+					if createErr != nil {
+						return createErr
+					}
+
+				} else {
+					// +1
+					plusErr := db.UpdateSTCooperateInfo(ctx, supplierId, platformUserInfo.Id)
+					if plusErr != nil {
+						return plusErr
+					}
+				}
+			}
+		}
+	}
+	return nil
+}
+
+// GetTalentListInfo 合作列表信息
+func (*stcooperate) GetTalentListInfo(ctx context.Context, request *http_model.TalentListRequest) (*http_model.TalentListData, error) {
+	var talentListData *http_model.TalentListData
+	talentListData = &http_model.TalentListData{}
+
+	// 1. 查找信息
+	talentListInfo, total, talentListInfoErr := db.GetSTCooperateInfo(ctx, request.SupplierId, request.Type, request.Platform, request.Nickname, request.PageSize, request.PageNum)
+	if talentListInfoErr != nil {
+		return nil, talentListInfoErr
+	}
+	if talentListInfo != nil {
+		talentListData.Total = total
+		for _, c := range talentListInfo {
+			var cooperateData *http_model.SupplierTalentCooperateData
+			cooperateData = &http_model.SupplierTalentCooperateData{}
+			cooperateData.SupplierId = c.SupplierId
+			cooperateData.CooperateID = c.CooperateID
+			cooperateData.Platform = c.Platform
+			cooperateData.CooperateNum = c.CooperateNum
+			cooperateData.PlatformUserId = c.PlatformUserId
+
+			// 查询平台信息
+			platformUserInfo, platformUserErr := db.FindUserInfoById(ctx, cooperateData.PlatformUserId)
+			if platformUserErr != nil {
+				return nil, platformUserErr
+			}
+			if platformUserInfo != nil {
+				cooperateData.City = platformUserInfo.City
+				cooperateData.Nickname = platformUserInfo.NickName
+				cooperateData.HeadUrl = platformUserInfo.HeadUri
+				cooperateData.Fans = platformUserInfo.Fan
+				cooperateData.LikeNum = platformUserInfo.LikeNum
+				cooperateData.CommitNum = 0
+				cooperateData.CollectNum = 0
+			}
+
+			talentListData.TalentListInfo = append(talentListData.TalentListInfo, cooperateData)
+		}
+
+	}
+	return talentListData, nil
+}
+
+// GetTalentInfo 达人信息
+func (*stcooperate) GetTalentInfo(ctx context.Context, request *http_model.TalentDataRequest) (*http_model.TalentData, error) {
+
+	var cooperateData *http_model.TalentData
+	cooperateData = &http_model.TalentData{}
+
+	// 查询平台信息
+	platformUserInfo, platformUserErr := db.FindUserInfoById(ctx, request.PlatformUserId)
+	if platformUserErr != nil {
+		return nil, platformUserErr
+	}
+	if platformUserInfo != nil {
+		cooperateData.City = platformUserInfo.City
+		cooperateData.Nickname = platformUserInfo.NickName
+		cooperateData.HeadUrl = platformUserInfo.HeadUri
+		cooperateData.Fans = platformUserInfo.Fan
+		cooperateData.VoteNum = platformUserInfo.LikeNum
+		cooperateData.Sale30Days = 0
+		cooperateData.Sale60Days = 0
+		cooperateData.Sale90Days = 0
+		cooperateData.CommitNum = 0
+		cooperateData.CollectNum = 0
+		cooperateData.Skill = platformUserInfo.Skill
+		cooperateData.Gender = platformUserInfo.Gender
+	}
+	return cooperateData, nil
+}
+
+// CountTalentTaskNum 统计达人任务数量
+func (*stcooperate) CountTalentTaskNum(ctx context.Context, request *http_model.TalentCooperateDataRequest) (*http_model.TalentCooperateData, error) {
+
+	var cooperateData *http_model.TalentCooperateData
+	cooperateData = &http_model.TalentCooperateData{}
+
+	// 查询平台信息
+	platformUserInfo, platformUserErr := db.FindUserInfoById(ctx, request.PlatformUserId)
+	if platformUserErr != nil {
+		return nil, platformUserErr
+	}
+	if platformUserInfo != nil {
+	}
+	return cooperateData, nil
+}
+
+// GetTalentProjectList 达人种草表现
+func (*stcooperate) GetTalentProjectList(ctx context.Context, request *http_model.TalentProjectListRequest) (*http_model.TalentProjectListData, error) {
+
+	return nil, nil
+}
+
+// GetTalentLocalList 达人本地表现
+func (*stcooperate) GetTalentLocalList(ctx context.Context, request *http_model.TalentLocalListRequest) (*http_model.TalentLocalListData, error) {
+
+	return nil, nil
+}

+ 140 - 5
service/supplier.go

@@ -87,6 +87,8 @@ func (*supplier) GetSupplierIncomeList(ctx context.Context, req *http_model.Full
 					sProjectInfo.ProjectPlatform = sProjectData.ProjectPlatform
 					sProjectInfo.ServiceCharge = sProjectData.ServiceCharge
 					sProjectInfo.ServiceChargeSettle = sProjectData.ServiceChargeSettle
+					sProjectInfo.RecruitNum = sProjectData.RecruitNum
+					sProjectInfo.SettleNum = sProjectData.SettleNum
 					sProjectInfo.FinishTime = conv.MustString(sProjectData.FinishTime)
 
 					// 2.2. 商品基本信息
@@ -135,6 +137,8 @@ func (*supplier) GetSupplierIncomeList(ctx context.Context, req *http_model.Full
 					sLocalInfo.LocalPlatform = sLocalData.LocalPlatform
 					sLocalInfo.ServiceCharge = sLocalData.ServiceCharge
 					sLocalInfo.ServiceChargeSettle = sLocalData.ServiceChargeSettle
+					sLocalInfo.RecruitNum = sLocalData.RecruitNum
+					sLocalInfo.SettleNum = sLocalData.SettleNum
 					sLocalInfo.FinishTime = conv.MustString(sLocalData.FinishTime)
 
 					// 2.2. 门店基本信息
@@ -657,9 +661,9 @@ func (*supplier) GetManageInvoiceInfo(ctx context.Context, req *http_model.Manag
 
 	var invoiceInfo *http_model.ManageInvoiceInfoData
 	invoiceInfo = &http_model.ManageInvoiceInfoData{}
-	manageInvoiceInfo, mamageInvoiceErr := db.GetManageInvoice(ctx)
-	if mamageInvoiceErr != nil {
-		return nil, mamageInvoiceErr
+	manageInvoiceInfo, manageInvoiceErr := db.GetManageInvoice(ctx)
+	if manageInvoiceErr != nil {
+		return nil, manageInvoiceErr
 	}
 	if manageInvoiceInfo != nil {
 		invoiceInfo.InvoiceInfoID = manageInvoiceInfo.InvoiceInfoID
@@ -683,6 +687,39 @@ func (*supplier) GetWithdrawAmount(ctx context.Context, req *http_model.Withdraw
 	amountInfo.PendingWithdraw = 0.0
 	amountInfo.Withdrawn = 0.0
 
+	// 可提现
+	platformConfirmingIncome, platformConfirmingErr := db.GetFullSupplierIncomeList(ctx, req.SupplierId, 5)
+	if platformConfirmingErr != nil {
+		return nil, platformConfirmingErr
+	}
+	if platformConfirmingIncome != nil {
+		for _, income := range platformConfirmingIncome {
+			amountInfo.WithdrawAble += income.ServiceChargeSettle
+		}
+	}
+
+	// 提现中
+	pendingWithdrawIncome, pendingWithdrawErr := db.GetFullSupplierIncomeList(ctx, req.SupplierId, 7)
+	if pendingWithdrawErr != nil {
+		return nil, pendingWithdrawErr
+	}
+	if pendingWithdrawIncome != nil {
+		for _, income := range pendingWithdrawIncome {
+			amountInfo.PendingWithdraw += income.ServiceChargeSettle
+		}
+	}
+
+	// 已经提现
+	withdrawnIncome, withdrawnErr := db.GetFullSupplierIncomeList(ctx, req.SupplierId, 8)
+	if withdrawnErr != nil {
+		return nil, withdrawnErr
+	}
+	if withdrawnIncome != nil {
+		for _, income := range withdrawnIncome {
+			amountInfo.Withdrawn += income.ServiceChargeSettle
+		}
+	}
+
 	return amountInfo, nil
 }
 
@@ -734,7 +771,7 @@ func (*supplier) GetSupplierBillAmount(ctx context.Context, req *http_model.Supp
 	return incomeData, nil
 }
 
-// GetWithdrawPaymentInfo 提现收款信息
+// GetWithdrawPaymentInfo 查找提现收款信息
 func (*supplier) GetWithdrawPaymentInfo(ctx context.Context, req *http_model.WithdrawPaymentInfoRequest) (*http_model.WithdrawPaymentInfoData, error) {
 
 	var paymentInfo *http_model.WithdrawPaymentInfoData
@@ -742,15 +779,113 @@ func (*supplier) GetWithdrawPaymentInfo(ctx context.Context, req *http_model.Wit
 
 	// 1. 个人服务商
 	if req.SupplierType == 1 {
+		// 1.1. 个人认证信息
+		supplierInfo, supplierErr := db.GetSupplierById(ctx, req.SupplierId)
+		if supplierErr != nil {
+			return nil, supplierErr
+		}
+		if supplierInfo != nil {
+			paymentInfo.Name = supplierInfo.Name
+			paymentInfo.IDNumber = supplierInfo.IdNumber
+		}
 
+		// 1.2. 提现收款信息查询
+		supplierPaymentInfo, supplierPaymentErr := db.GetSupplierPaymentInfoById(ctx, req.SupplierId)
+		if supplierPaymentErr != nil {
+			return nil, supplierPaymentErr
+		}
+		if supplierPaymentInfo != nil {
+			paymentInfo.Tag = 2
+			paymentInfo.Phone = supplierPaymentInfo.Phone
+			paymentInfo.SupplierType = supplierPaymentInfo.SupplierType
+			paymentInfo.BankName = supplierPaymentInfo.BankName
+			paymentInfo.BankNumber = supplierPaymentInfo.BankNumber
+		} else {
+			paymentInfo.Tag = 1
+		}
+	} else if req.SupplierType == 2 {
+		// 2. 机构服务商
+		// 2.1. 机构认证信息
+		supplierInfo, supplierErr := db.GetSupplierById(ctx, req.SupplierId)
+		if supplierErr != nil {
+			return nil, supplierErr
+		}
+		if supplierInfo != nil {
+			paymentInfo.Company = supplierInfo.CompanyName
+		}
+
+		// 2.2. 提现收款信息查询
+		supplierPaymentInfo, supplierPaymentErr := db.GetSupplierPaymentInfoById(ctx, req.SupplierId)
+		if supplierPaymentErr != nil {
+			return nil, supplierPaymentErr
+		}
+		if supplierPaymentInfo != nil {
+			paymentInfo.Tag = 2
+			paymentInfo.PaymentInfoID = supplierPaymentInfo.PaymentInfoID
+			paymentInfo.SupplierType = supplierPaymentInfo.SupplierType
+			paymentInfo.BankName = supplierPaymentInfo.BankName
+			paymentInfo.BankNumber = supplierPaymentInfo.BankNumber
+		} else {
+			paymentInfo.Tag = 1
+		}
 	}
 
 	return paymentInfo, nil
 }
 
-// UpdateWithdrawPaymentInfo 提现收款信息
+// UpdateWithdrawPaymentInfo 更新提现收款信息
 func (*supplier) UpdateWithdrawPaymentInfo(ctx context.Context, req *http_model.UpdateWithdrawPaymentInfoRequest) error {
+	var paymentInfo *gorm_model.SupplierPaymentInfo
+	paymentInfo = &gorm_model.SupplierPaymentInfo{}
+	paymentInfo.PaymentInfoID = req.PaymentInfoId
+	paymentInfo.SupplierID = req.SupplierID
+	paymentInfo.Phone = req.Phone
+	paymentInfo.BankName = req.BankName
+	paymentInfo.BankNumber = req.BankNumber
+	paymentInfo.Name = req.Name
+	paymentInfo.IDNumber = req.IDNumber
+	paymentInfo.Company = req.Company
+	updatePaymentInfoErr := db.UpdateSupplierPayment(ctx, paymentInfo)
+	if updatePaymentInfoErr != nil {
+		return updatePaymentInfoErr
+	}
+	return nil
+}
+
+// CreateWithdrawPaymentInfo 创建提现收款信息
+func (*supplier) CreateWithdrawPaymentInfo(ctx context.Context, req *http_model.CreateWithdrawPaymentInfoRequest) error {
 
+	// 1. 个人服务商
+	if req.SupplierType == 1 {
+		var paymentInfo *gorm_model.SupplierPaymentInfo
+		paymentInfo = &gorm_model.SupplierPaymentInfo{}
+		paymentInfo.SupplierID = req.SupplierID
+		paymentInfo.Phone = req.Phone
+		paymentInfo.BankName = req.BankName
+		paymentInfo.BankNumber = req.BankNumber
+		paymentInfo.Name = req.Name
+		paymentInfo.IDNumber = req.IDNumber
+		paymentInfo.SupplierType = req.SupplierType
+		createPaymentInfoErr := db.CreateSupplierPayment(ctx, paymentInfo)
+		if createPaymentInfoErr != nil {
+			return createPaymentInfoErr
+		}
+	} else if req.SupplierType == 2 {
+		// 2. 机构服务商
+		var paymentInfo *gorm_model.SupplierPaymentInfo
+		paymentInfo = &gorm_model.SupplierPaymentInfo{}
+		paymentInfo.SupplierType = req.SupplierType
+		paymentInfo.SupplierID = req.SupplierID
+		paymentInfo.BankName = req.BankName
+		paymentInfo.BankNumber = req.BankNumber
+		paymentInfo.Name = req.Name
+		paymentInfo.IDNumber = req.IDNumber
+		paymentInfo.Company = req.Company
+		createPaymentInfoErr := db.CreateSupplierPayment(ctx, paymentInfo)
+		if createPaymentInfoErr != nil {
+			return createPaymentInfoErr
+		}
+	}
 	return nil
 }