2
0

11 Коммитууд 1db64b84cf ... ada93a8387

Эзэн SHA1 Мессеж Огноо
  Ethan ada93a8387 统一社媒账号信息 5 өдөр өмнө
  lin-jim-leon d7d9e547fc Merge remote-tracking branch 'origin/develop' into develop 5 өдөр өмнө
  lin-jim-leon aac5e265f0 [20250416]subat->creatat 5 өдөр өмнө
  Ethan 9bdef2c43a 创建中状态招募截止时间转失效 6 өдөр өмнө
  Ethan a5da64abea 创建中状态招募截止时间转失效 6 өдөр өмнө
  Ethan b10f7a4282 探店列表 6 өдөр өмнө
  Ethan c4c8e1a63b 招募截止时间转待支付&超时未支付转失效 6 өдөр өмнө
  Ethan c5e4b7b6ef fix_发货数量&状态 6 өдөр өмнө
  Ethan 2bfcb62e73 fix_物流补充task_id 6 өдөр өмнө
  lin-jim-leon 9375cf80bb Merge remote-tracking branch 'origin/develop' into develop 6 өдөр өмнө
  lin-jim-leon 8ceffec7b9 [20250413]settleflag 6 өдөр өмнө

+ 26 - 11
app/dao/local_life_task_info_dao.go

@@ -22,29 +22,44 @@ func (d LocalLifeTaskInfoDao) CountByTaskStage(localId string, taskStage int64)
 }
 
 // 获取指定任务阶段的本地生活子任务
-func (d LocalLifeTaskInfoDao) GetListByTaskStage(localId string, bookStatus int64, time string, page int, pageSize int) ([]*entity.LocalLifeTaskInfo, int64, error) {
+func (d LocalLifeTaskInfoDao) GetListByTaskStage(localId string, taskStage int64, time string, page int, pageSize int) ([]*entity.LocalLifeTaskInfo, int64, error) {
 	var taskInfos []*entity.LocalLifeTaskInfo
 	var total int64
-	query := Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", localId, bookStatus)
+	query := Db.Debug().Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND task_stage = ?", localId, taskStage)
 	// 计算偏移量
 	offset := (page - 1) * pageSize
 	var err error
-	if bookStatus == 1 {
+	if taskStage == 4 { // 待预约探店
 		query.Count(&total)
 		err = query.Order("select_date asc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
-	} else if bookStatus == 2 {
+	} else if taskStage == 5 { // 待确认探店
 		if time != "" {
 			query = query.Where("DATE(reserve_time) = ?", time)
 		}
 		query.Count(&total)
 		err = query.Order("reserve_time desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
-	} else if bookStatus == 3 {
+	}
+	if err != nil {
+		return nil, 0, err
+	}
+	return taskInfos, total, nil
+}
+
+// 获取指定探店状态的本地生活子任务
+func (d LocalLifeTaskInfoDao) GetListByBookStatus(localId string, bookStatus int64, time string, page int, pageSize int) ([]*entity.LocalLifeTaskInfo, int64, error) {
+	var taskInfos []*entity.LocalLifeTaskInfo
+	var total int64
+	query := Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", localId, bookStatus)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	var err error
+	if bookStatus == 5 { // 待探店
 		if time != "" {
 			query = query.Where("DATE(explore_time) = ?", time)
 		}
 		query.Count(&total)
 		err = query.Order("explore_time desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
-	} else if bookStatus == 4 {
+	} else if bookStatus == 6 { // 已探店
 		if time != "" {
 			query = query.Where("DATE(finish_explore_time) = ?", time)
 		}
@@ -63,7 +78,7 @@ func (d LocalLifeTaskInfoDao) GetListBySketchDefault(param *vo.DefaultSearchPara
 	var total int64
 	query := Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND cur_default_type = ?", param.TaskId, 4)
 	query.Count(&total)
-	query = query.Select("task_id, talent_id, settle_amount, draft_fee, sketch_missing_time")
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, sketch_missing_time, open_id")
 	offset := (param.Page - 1) * param.PageSize
 	if err := query.Order("sketch_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&localTaskInfos).Error; err != nil {
 		return nil, 0, err
@@ -77,7 +92,7 @@ func (d LocalLifeTaskInfoDao) GetListByLinkDefault(param *vo.DefaultSearchParam)
 	var total int64
 	query := Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND cur_default_type = ?", param.TaskId, 6)
 	query.Count(&total)
-	query = query.Select("task_id, talent_id, settle_amount, draft_fee, link_missing_time")
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, link_missing_time, open_id")
 	offset := (param.Page - 1) * param.PageSize
 	if err := query.Order("link_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&localTaskInfos).Error; err != nil {
 		return nil, 0, err
@@ -91,7 +106,7 @@ func (d LocalLifeTaskInfoDao) GetListByDataDefault(param *vo.DefaultSearchParam)
 	var total int64
 	query := Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND cur_default_type = ?", param.TaskId, 8)
 	query.Count(&total)
-	query = query.Select("task_id, talent_id, settle_amount, draft_fee, data_missing_time")
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, data_missing_time, open_id")
 	offset := (param.Page - 1) * param.PageSize
 	if err := query.Order("data_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&localTaskInfos).Error; err != nil {
 		return nil, 0, err
@@ -105,7 +120,7 @@ func (d LocalLifeTaskInfoDao) GetListByTerminateDefault(param *vo.DefaultSearchP
 	var total int64
 	query := Db.Debug().Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND task_stage = ?", param.TaskId, 17)
 	query.Count(&total)
-	query = query.Select("task_id, talent_id, settle_amount, draft_fee, terminate_time, terminate_reason, terminate_operator_type, terminate_operator")
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, terminate_time, terminate_reason, terminate_operator_type, terminate_operator, open_id")
 	offset := (param.Page - 1) * param.PageSize
 	if err := query.Order("terminate_time desc").Offset(offset).Limit(param.PageSize).Find(&localTaskInfos).Error; err != nil {
 		return nil, 0, err
@@ -119,7 +134,7 @@ func (d LocalLifeTaskInfoDao) GetListByCancelDefault(param *vo.DefaultSearchPara
 	var total int64
 	query := Db.Debug().Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND task_stage = ?", param.TaskId, 16)
 	query.Count(&total)
-	query = query.Select("task_id, talent_id, settle_amount, draft_fee, cancel_time, cancel_reason, cancel_operator_type, cancel_operator")
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, cancel_time, cancel_reason, cancel_operator_type, cancel_operator, open_id")
 	offset := (param.Page - 1) * param.PageSize
 	if err := query.Order("cancel_time desc").Offset(offset).Limit(param.PageSize).Find(&localTaskInfos).Error; err != nil {
 		return nil, 0, err

+ 7 - 5
app/dao/platform_kuaishou_user_info_dao.go

@@ -1,18 +1,20 @@
 package dao
 
 import (
-	"github.com/sirupsen/logrus"
 	"youngee_b_api/app/entity"
 )
 
 type PlatformKuaishouUserInfoDao struct{}
 
-func (d PlatformKuaishouUserInfoDao) SelectUserInfo(talentId string) (*entity.PlatformKuaishouUserInfo, error) {
+func (d PlatformKuaishouUserInfoDao) GetUserInfo(openId string) (*entity.PlatformKuaishouUserInfo, error) {
 	var userInfo *entity.PlatformKuaishouUserInfo
-	err := Db.Model(entity.PlatformKuaishouUserInfo{}).Select("open_id, nick_name, head_uri").Where("talent_id = ?", talentId).Find(&userInfo).Error
+	err := Db.Model(entity.PlatformKuaishouUserInfo{}).Select("open_id, platform_id, nick_name, head_uri, city, gender").Where("open_id = ?", openId).Find(userInfo).Error
 	if err != nil {
-		logrus.Errorf("[SelectUserInfo] error query, err:%+v", err)
-		return nil, err
+		userInfo.OpenID = openId
+		userInfo.NickName = ""
+		userInfo.HeadUri = ""
+		userInfo.City = ""
+		userInfo.Gender = ""
 	}
 	return userInfo, nil
 }

+ 16 - 11
app/dao/project_task_info_dao.go

@@ -25,18 +25,23 @@ func (d ProjectTaskInfoDao) CountByTaskStage(projectId string, taskStage int64)
 func (d ProjectTaskInfoDao) GetListByTaskStage(projectId string, taskStage int64, time string, page int, pageSize int, talentNickname string) ([]*entity.ProjectTaskInfo, int64, error) {
 	var taskInfos []*entity.ProjectTaskInfo
 	var total int64
-	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", projectId, taskStage)
+	query := Db.Model(&entity.ProjectTaskInfo{})
+	if taskStage == 6 {
+		query = query.Where("project_id = ? AND task_stage >= ?", projectId, taskStage)
+	} else {
+		query = query.Where("project_id = ? AND task_stage = ?", projectId, taskStage)
+	}
 	if talentNickname != "" {
-		var talentInfos []entity.YoungeeTalentInfo
-		err1 := Db.Model(&entity.YoungeeTalentInfo{}).Where("talent_wx_nickname = ?", talentNickname).Find(&talentInfos).Error
+		var talentInfos []entity.PlatformKuaishouUserInfo
+		err1 := Db.Model(&entity.PlatformKuaishouUserInfo{}).Where("nick_name = ?", talentNickname).Find(&talentInfos).Error
 		if err1 != nil {
 			return nil, 0, err1
 		}
-		var talentIds []string
+		var openIds []string
 		for _, talentInfo := range talentInfos {
-			talentIds = append(talentIds, talentInfo.ID)
+			openIds = append(openIds, talentInfo.OpenID)
 		}
-		query = query.Where("talent_id in ?", talentIds)
+		query = query.Where("open_id in ?", openIds)
 	}
 	// 计算偏移量
 	offset := (page - 1) * pageSize
@@ -66,7 +71,7 @@ func (d ProjectTaskInfoDao) GetListBySketchDefault(param *vo.DefaultSearchParam)
 	var total int64
 	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", param.TaskId, 4)
 	query.Count(&total)
-	query = query.Select("task_id, talent_id, settle_amount, draft_fee, sketch_missing_time")
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, sketch_missing_time, open_id")
 	offset := (param.Page - 1) * param.PageSize
 	if err := query.Order("sketch_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
 		return nil, 0, err
@@ -80,7 +85,7 @@ func (d ProjectTaskInfoDao) GetListByLinkDefault(param *vo.DefaultSearchParam) (
 	var total int64
 	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", param.TaskId, 6)
 	query.Count(&total)
-	query = query.Select("task_id, talent_id, settle_amount, draft_fee, link_missing_time")
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, link_missing_time, open_id")
 	offset := (param.Page - 1) * param.PageSize
 	if err := query.Order("link_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
 		return nil, 0, err
@@ -94,7 +99,7 @@ func (d ProjectTaskInfoDao) GetListByDataDefault(param *vo.DefaultSearchParam) (
 	var total int64
 	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", param.TaskId, 8)
 	query.Count(&total)
-	query = query.Select("task_id, talent_id, settle_amount, draft_fee, data_missing_time")
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, data_missing_time, open_id")
 	offset := (param.Page - 1) * param.PageSize
 	if err := query.Order("data_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
 		return nil, 0, err
@@ -108,7 +113,7 @@ func (d ProjectTaskInfoDao) GetListByTerminateDefault(param *vo.DefaultSearchPar
 	var total int64
 	query := Db.Debug().Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.TaskId, 17)
 	query.Count(&total)
-	query = query.Select("task_id, talent_id, settle_amount, draft_fee, terminate_time, terminate_reason, terminate_operator_type, terminate_operator")
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, terminate_time, terminate_reason, terminate_operator_type, terminate_operator, open_id")
 	offset := (param.Page - 1) * param.PageSize
 	if err := query.Order("terminate_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
 		return nil, 0, err
@@ -122,7 +127,7 @@ func (d ProjectTaskInfoDao) GetListByCancelDefault(param *vo.DefaultSearchParam)
 	var total int64
 	query := Db.Debug().Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.TaskId, 16)
 	query.Count(&total)
-	query = query.Select("task_id, talent_id, settle_amount, draft_fee, cancel_time, cancel_reason, cancel_operator_type, cancel_operator")
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, cancel_time, cancel_reason, cancel_operator_type, cancel_operator, open_id")
 	offset := (param.Page - 1) * param.PageSize
 	if err := query.Order("cancel_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
 		return nil, 0, err

+ 2 - 2
app/dao/talent_info_dao.go

@@ -8,7 +8,7 @@ import (
 
 type TalentInfoDao struct{}
 
-func (d TalentInfoDao) SelectTalentPhone(talentId string) (*string, error) {
+func (d TalentInfoDao) GetTalentPhone(talentId string) (*string, error) {
 	var talentInfo *entity.YoungeeTalentInfo
 	err := Db.Model(entity.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", talentId).Find(&talentInfo).Error
 	if err != nil {
@@ -18,7 +18,7 @@ func (d TalentInfoDao) SelectTalentPhone(talentId string) (*string, error) {
 	return &talentInfo.TalentPhoneNumber, nil
 }
 
-func (d TalentInfoDao) SelectTalentInfo(talentId string) (*entity.YoungeeTalentInfo, error) {
+func (d TalentInfoDao) GetTalentInfo(talentId string) (*entity.YoungeeTalentInfo, error) {
 	var talentInfo *entity.YoungeeTalentInfo
 	err := Db.Model(&entity.YoungeeTalentInfo{}).Where("id = ?", talentId).Find(&talentInfo).Error
 	if err != nil {

+ 0 - 32
app/entity/platform_kuaishou_user_info.go

@@ -1,32 +0,0 @@
-// Code generated by sql2gorm. DO NOT EDIT.
-package entity
-
-import (
-	"time"
-)
-
-type PlatformKuaishouUserInfo struct {
-	ID           int64     `gorm:"column:id;primary_key"` // id
-	OpenId       string    `gorm:"column:open_id;NOT NULL"`
-	PlatformId   int64     `gorm:"column:platform_id;NOT NULL"`
-	TalentId     string    `gorm:"column:talent_id;NOT NULL"`
-	Code         string    `gorm:"column:code;NOT NULL"`
-	AccessToken  string    `gorm:"column:access_token;NOT NULL"`
-	RefreshToken string    `gorm:"column:refresh_token;NOT NULL"`
-	NickName     string    `gorm:"column:nick_name;NOT NULL"`
-	HeadUri      string    `gorm:"column:head_uri;NOT NULL"`
-	Fan          string    `gorm:"column:fan;NOT NULL"`
-	Expired      int64     `gorm:"column:expired"`
-	SaleNumTotal int64     `gorm:"column:sale_num_total;NOT NULL"`
-	SaleNum30day int64     `gorm:"column:sale_num_30day;NOT NULL"`
-	CreateTime   time.Time `gorm:"column:create_time;NOT NULL"`
-	UpdateTime   time.Time `gorm:"column:update_time;NOT NULL"`
-	IsDelete     int64     `gorm:"column:is_delete;NOT NULL"`
-	LikeNum      int64     `gorm:"column:like_num;NOT NULL"`
-	VideoNum     int64     `gorm:"column:video_num;NOT NULL"`
-	City         string    `gorm:"column:city"`
-}
-
-func (m *PlatformKuaishouUserInfo) TableName() string {
-	return "platform_kuaishou_user_info"
-}

+ 37 - 0
app/entity/platform_user_info.go

@@ -0,0 +1,37 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type PlatformKuaishouUserInfo struct {
+	ID                 int64     `gorm:"column:id;primary_key;AUTO_INCREMENT"` // 主键,自增长
+	OpenID             string    `gorm:"column:open_id"`                       // 用户唯一表示
+	PlatformID         int64     `gorm:"column:platform_id"`                   // 1.红book 2。抖音 3。微博 4。快手(电商)5.B站 6.大众点评 7.知乎 8.快手(平台)
+	TalentID           string    `gorm:"column:talent_id"`                     // 达人id
+	Code               string    `gorm:"column:code"`                          // 扫码后获得的临时票据
+	AccessToken        string    `gorm:"column:access_token"`                  // 调用API需要的参数
+	RefreshToken       string    `gorm:"column:refresh_token"`                 // 用于刷新access_token
+	NickName           string    `gorm:"column:nick_name"`                     // 快手昵称
+	HeadUri            string    `gorm:"column:head_uri"`                      // 用户头像
+	Fan                string    `gorm:"column:fan"`                           // 用户粉丝数
+	Expired            int64     `gorm:"column:expired;default:0"`             // access_token是否可用
+	SaleNum30Day       int64     `gorm:"column:sale_num_30day"`                // 30日销量
+	SaleNumTotal       int64     `gorm:"column:sale_num_total"`                // 总销量
+	CreateTime         time.Time `gorm:"column:create_time"`                   // 创建时间
+	UpdateTime         time.Time `gorm:"column:update_time"`                   // 更新时间
+	IsDelete           int64     `gorm:"column:is_delete;default:0"`           // 是否被删除,默认为0,1表示被删除
+	LikeNum            int64     `gorm:"column:like_num;default:0"`            // 点赞数
+	VideoNum           int64     `gorm:"column:video_num;default:0"`           // 作品数
+	SaleNum7Day        string    `gorm:"column:sale_num_7day;default:0"`       // 近7天销量
+	City               string    `gorm:"column:city"`                          // 用户城市所在地
+	Gender             string    `gorm:"column:gender"`                        // 用户性别
+	Skill              string    `gorm:"column:skill"`                         // 擅长领域
+	HomePageCaptureUrl string    `gorm:"column:home_page_capture_url"`         // 用户主页链接截图
+	HomePageUrl        string    `gorm:"column:home_page_url"`                 // 用户主页链接
+}
+
+func (m *PlatformKuaishouUserInfo) TableName() string {
+	return "platform_kuaishou_user_info"
+}

+ 1 - 0
app/entity/project_task_info.go

@@ -55,6 +55,7 @@ type ProjectTaskInfo struct {
 	CancelOperatorType     int64     `gorm:"column:cancel_operator_type;default:0;NOT NULL"`
 	CancelOperator         string    `gorm:"column:cancel_operator"`
 	TalentName             string    `gorm:"column:talent_name"`
+	OpenID                 string    `gorm:"column:open_id"` // 达人报名的唯一标识
 }
 
 func (m *ProjectTaskInfo) TableName() string {

+ 1 - 0
app/entity/selection_task_info.go

@@ -38,6 +38,7 @@ type SelectionTaskInfo struct {
 	TeamIncome             int       `gorm:"column:team_income"`                 // young之团团长现金收益
 	TeamPoint              int       `gorm:"column:team_point"`                  // young之团团长积分收益
 	SaleActual             int64     `gorm:"column:sale_actual"`                 // 实际带货量
+	OpenID                 string    `gorm:"column:open_id"`                     // 达人报名的快手唯一标识
 }
 
 func (m *SelectionTaskInfo) TableName() string {

+ 67 - 42
app/schedule/auto_task_invalid.go

@@ -44,30 +44,44 @@ func AutoTaskInvalid() error {
 func AutoProjectInvalidTask() {
 	log.Println("AutoProjectInvalidTask running Start, Time :", time.Now())
 	var projectInfos []*entity.Project
-	projectInfos, _ = dao.ProjectDAO{}.GetProjectList(6, "project_status")
+	_ = dao.Db.Model(entity.Project{}).Where("project_status <= ?", 6).Select("project_id,project_status,recruit_ddl,auto_task_id,auto_fail_at").Find(&projectInfos).Error
 	// 对于所有未支付的品牌种草项目进行处理
 	for _, projectInfo := range projectInfos {
 		projectId := projectInfo.ProjectId
+		if time.Now().After(projectInfo.RecruitDdl) && projectInfo.ProjectStatus < 4 {
+			// 变成失效
+			_ = dao.ProjectDAO{}.UpdateProject(entity.Project{
+				ProjectId:     projectId,
+				ProjectStatus: 9,
+			})
+			continue
+		}
+		if time.Now().After(projectInfo.RecruitDdl) && projectInfo.ProjectStatus == 4 {
+			// 变成待支付
+			_ = dao.ProjectDAO{}.UpdateProject(entity.Project{
+				ProjectId:     projectId,
+				ProjectStatus: 6,
+			})
+			continue
+		}
 		autoTaskId := projectInfo.AutoTaskID
 		autoTaskInfo := dao.InfoAutoTaskDao{}.GetValueByIdFieldName(autoTaskId, "invalid")
 		dd, _ := time.ParseDuration(conv.MustString(autoTaskInfo.Invalid, "") + "h")
 		// 失效时间计算:任务截止时间 + 设置的失效自动执行时间
-		timeInvalid := projectInfo.RecruitDdl.Add(dd)
 		if projectInfo.AutoFailAt.IsZero() {
+			timeInvalid := projectInfo.RecruitDdl.Add(dd)
 			dao.Db.Model(&entity.Project{}).Where("project_id = ?", projectId).Updates(&entity.Project{AutoFailAt: timeInvalid})
+			projectInfo.AutoFailAt = timeInvalid
 		}
-		projectNeedMod := entity.Project{}
-		dao.Db.Where("project_id = ?", projectId).First(&projectNeedMod)
-		//fmt.Println(fmt.Sprintf("品牌种草项目 %s 失效自动处理时间为:%s", projectId, projectNeedMod.AutoFailAt))
-		// 如果失效自动处理的时间不为空
-		if !projectNeedMod.AutoFailAt.IsZero() {
-			timeNow := time.Now()
-			// 如果 未失效 && 已经过了失效自动处理的时间
-			if projectNeedMod.ProjectStatus < 9 && projectNeedMod.AutoFailAt.Sub(time.Now()) <= 0 {
-				dao.Db.Model(entity.Project{}).Where("project_id = ?", projectId).Updates(&entity.Project{ProjectStatus: 9, FinishAt: timeInvalid, FailReason: 1})
-				fmt.Println(fmt.Sprintf("已更新品牌种草项目 %s 状态为超时未支付的失效状态", projectId))
-				dao.Db.Model(entity.ProjectTaskInfo{}).Where("project_id = ?", projectId).Updates(entity.ProjectTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: timeNow})
-			}
+		// 超时未支付则变为失效
+		if time.Now().After(projectInfo.AutoFailAt) && projectInfo.ProjectStatus == 6 {
+			_ = dao.ProjectDAO{}.UpdateProject(entity.Project{
+				ProjectId:     projectId,
+				ProjectStatus: 9,
+				FailReason:    1,
+			})
+			fmt.Println(fmt.Sprintf("已更新品牌种草项目 %s 状态为超时未支付的失效状态", projectId))
+			dao.Db.Model(entity.ProjectTaskInfo{}).Where("project_id = ?", projectId).Updates(entity.ProjectTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: time.Now()})
 		}
 	}
 	log.Println("AutoProjectInvalidTask running End, Time :", time.Now())
@@ -84,23 +98,20 @@ func AutoSelectionInvalidTask() {
 		autoTaskId := selectionInfo.AutoTaskID
 		autoTaskInfo := dao.InfoAutoTaskDao{}.GetValueByIdFieldName(autoTaskId, "selection_invalid")
 		dd, _ := time.ParseDuration(conv.MustString(autoTaskInfo.SelectionInvalid, "") + "h")
-		// 失效时间计算:任务截止时间 + 设置的失效自动执行时间
-		timeInvalid := selectionInfo.PassAt.Add(dd)
 		if selectionInfo.AutoFailAt.IsZero() {
+			timeInvalid := selectionInfo.PassAt.Add(dd)
 			dao.Db.Model(&entity.SelectionInfo{}).Where("selection_id = ?", selectionId).Updates(&entity.SelectionInfo{AutoFailAt: timeInvalid})
+			selectionInfo.AutoFailAt = timeInvalid
 		}
-		selectionInfoNeedMod := entity.SelectionInfo{}
-		dao.Db.Where("selection_id = ?", selectionId).First(&selectionInfoNeedMod)
-		//fmt.Println(fmt.Sprintf("电商带货项目 %s 失效自动处理时间为:%s", selectionId, selectionInfoNeedMod.AutoFailAt))
-		// 如果失效自动处理的时间不为空
-		if !selectionInfoNeedMod.AutoFailAt.IsZero() {
-			timeNow := time.Now()
-			// 如果 未失效 && 已经过了失效自动处理的时间
-			if selectionInfoNeedMod.SelectionStatus < 5 && selectionInfoNeedMod.AutoFailAt.Sub(time.Now()) <= 0 {
-				dao.Db.Model(entity.SelectionInfo{}).Where("selection_id = ?", selectionId).Updates(&entity.SelectionInfo{SelectionStatus: 7, FinishAt: timeInvalid, FailReason: 1})
-				fmt.Println(fmt.Sprintf("已更新电商带货项目 %s 状态为超时未支付的失效状态", selectionId))
-				dao.Db.Model(entity.SelectionInfo{}).Where("selection_id = ?", selectionId).Updates(entity.SelectionTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: timeNow})
-			}
+		// 超时未支付则变为失效
+		if time.Now().After(selectionInfo.AutoFailAt) && selectionInfo.SelectionStatus == 4 {
+			_ = dao.SelectionInfoDAO{}.UpdateSelectionInfo(entity.SelectionInfo{
+				SelectionID:     selectionId,
+				SelectionStatus: 7,
+				FailReason:      1,
+			})
+			fmt.Println(fmt.Sprintf("已更新电商带货项目 %s 状态为超时未支付的失效状态", selectionId))
+			dao.Db.Model(entity.SelectionInfo{}).Where("selection_id = ?", selectionId).Updates(entity.SelectionTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: time.Now()})
 		}
 	}
 	log.Println("AutoSelectionInvalidTask running End, Time :", time.Now())
@@ -110,30 +121,44 @@ func AutoSelectionInvalidTask() {
 func AutoLocalLifeInvalidTask() {
 	log.Println("AutoLocalLifeInvalidTask running Start, Time :", time.Now())
 	var localLifeInfos []*entity.LocalLifeInfo
-	localLifeInfos, _ = dao.LocalLifeDao{}.GetLocalLifeList(6, "task_status")
+	_ = dao.Db.Model(entity.LocalLifeInfo{}).Where("task_status <= ?", 6).Select("local_id,task_status,recruit_ddl,auto_task_id,auto_fail_at").Find(&localLifeInfos).Error
 	// 对于所有未支付的本地生活项目进行处理
 	for _, localLifeInfo := range localLifeInfos {
 		localId := localLifeInfo.LocalID
+		if time.Now().After(localLifeInfo.RecruitDdl) && localLifeInfo.TaskStatus < 4 {
+			// 变成失效
+			_ = dao.LocalLifeDao{}.UpdateLocal(entity.LocalLifeInfo{
+				LocalID:    localId,
+				TaskStatus: 9,
+			})
+			continue
+		}
+		if time.Now().After(localLifeInfo.RecruitDdl) && localLifeInfo.TaskStatus == 4 {
+			// 变成待支付
+			_ = dao.LocalLifeDao{}.UpdateLocal(entity.LocalLifeInfo{
+				LocalID:    localId,
+				TaskStatus: 6,
+			})
+			continue
+		}
 		autoTaskId := localLifeInfo.AutoTaskID
 		autoTaskInfo := dao.InfoAutoTaskDao{}.GetValueByIdFieldName(autoTaskId, "invalid")
 		dd, _ := time.ParseDuration(conv.MustString(autoTaskInfo.Invalid, "") + "h")
 		// 失效时间计算:任务截止时间 + 设置的失效自动执行时间
-		timeInvalid := localLifeInfo.RecruitDdl.Add(dd)
 		if localLifeInfo.AutoFailAt.IsZero() {
+			timeInvalid := localLifeInfo.RecruitDdl.Add(dd)
 			dao.Db.Model(&entity.LocalLifeInfo{}).Where("local_id = ?", localId).Updates(&entity.LocalLifeInfo{AutoFailAt: timeInvalid})
+			localLifeInfo.AutoFailAt = timeInvalid
 		}
-		localLifeNeedMod := entity.LocalLifeInfo{}
-		dao.Db.Where("local_id = ?", localId).First(&localLifeNeedMod)
-		//fmt.Println(fmt.Sprintf("本地生活项目 %s 失效自动处理时间为:%s", localId, localLifeNeedMod.AutoFailAt))
-		// 如果失效自动处理的时间不为空
-		if !localLifeNeedMod.AutoFailAt.IsZero() {
-			timeNow := time.Now()
-			// 如果 未失效 && 已经过了失效自动处理的时间
-			if localLifeNeedMod.TaskStatus < 9 && localLifeNeedMod.AutoFailAt.Sub(time.Now()) <= 0 {
-				dao.Db.Model(entity.LocalLifeInfo{}).Where("local_id = ?", localId).Updates(&entity.LocalLifeInfo{TaskStatus: 9, FinishAt: timeInvalid, FailReason: 1})
-				fmt.Println(fmt.Sprintf("已更新本地生活项目 %s 状态为超时未支付的失效状态", localId))
-				dao.Db.Model(entity.LocalLifeTaskInfo{}).Where("local_id = ?", localId).Updates(entity.LocalLifeTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: timeNow})
-			}
+		// 超时未支付则变为失效
+		if time.Now().After(localLifeInfo.AutoFailAt) && localLifeInfo.TaskStatus == 6 {
+			_ = dao.LocalLifeDao{}.UpdateLocal(entity.LocalLifeInfo{
+				LocalID:    localId,
+				TaskStatus: 9,
+				FailReason: 1,
+			})
+			fmt.Println(fmt.Sprintf("已更新本地生活项目 %s 状态为超时未支付的失效状态", localId))
+			dao.Db.Model(entity.LocalLifeTaskInfo{}).Where("local_id = ?", localId).Updates(entity.LocalLifeTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: time.Now()})
 		}
 	}
 	log.Println("AutoLocalLifeInvalidTask running End, Time :", time.Now())

+ 19 - 14
app/service/default_service.go

@@ -228,18 +228,19 @@ func (s DefaultService) GetPublicDefaultTalentList(param *vo.DefaultSearchParam)
 		}
 		for _, projectTaskInfo := range projectTaskInfos {
 			talentId := projectTaskInfo.TalentID
-			talentInfo, _ := dao.TalentInfoDao{}.SelectTalentInfo(talentId)
-			platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.SelectUserInfo(talentId)
+			talentInfo, _ := dao.TalentInfoDao{}.GetTalentInfo(talentId)
+			platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.GetUserInfo(projectTaskInfo.OpenID)
 			reTalentDefault := &vo.ReTalentDefault{
 				TalentId:    talentId,
 				TalentPhone: talentInfo.TalentPhoneNumber,
 				TaskId:      projectTaskInfo.TaskID,
 				DraftFee:    projectTaskInfo.DraftFee,
-				OpenId:      platformKuaishouUserInfo.OpenId,
+				OpenId:      platformKuaishouUserInfo.OpenID,
+				PlatformId:  platformKuaishouUserInfo.PlatformID,
 				NickName:    platformKuaishouUserInfo.NickName,
 				HeadUri:     platformKuaishouUserInfo.HeadUri,
 				City:        platformKuaishouUserInfo.City,
-				Gender:      talentInfo.Sex,
+				Gender:      platformKuaishouUserInfo.Gender,
 			}
 			if defaultType == 1 {
 				reTalentDefault.DefaultTime = projectTaskInfo.SketchMissingTime.Format("2006-01-02 15:04:05")
@@ -296,8 +297,8 @@ func (s DefaultService) GetPublicDefaultTalentList(param *vo.DefaultSearchParam)
 			Data:     resultMap,
 		}
 		return result, nil
-		// 本地生活
 	} else if param.TaskType == 2 {
+		// 本地生活
 		var localLifeTaskInfos []entity.LocalLifeTaskInfo
 		var total int64
 		var err error
@@ -328,18 +329,19 @@ func (s DefaultService) GetPublicDefaultTalentList(param *vo.DefaultSearchParam)
 		}
 		for _, localLifeTaskInfo := range localLifeTaskInfos {
 			talentId := localLifeTaskInfo.TalentID
-			talentInfo, _ := dao.TalentInfoDao{}.SelectTalentInfo(talentId)
-			platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.SelectUserInfo(talentId)
+			talentInfo, _ := dao.TalentInfoDao{}.GetTalentInfo(talentId)
+			platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.GetUserInfo(localLifeTaskInfo.OpenID)
 			reTalentDefault := &vo.ReTalentDefault{
 				TalentId:    talentId,
 				TalentPhone: talentInfo.TalentPhoneNumber,
 				TaskId:      localLifeTaskInfo.TaskID,
 				DraftFee:    localLifeTaskInfo.DraftFee,
-				OpenId:      platformKuaishouUserInfo.OpenId,
+				OpenId:      platformKuaishouUserInfo.OpenID,
+				PlatformId:  platformKuaishouUserInfo.PlatformID,
 				NickName:    platformKuaishouUserInfo.NickName,
 				HeadUri:     platformKuaishouUserInfo.HeadUri,
 				City:        platformKuaishouUserInfo.City,
-				Gender:      talentInfo.Sex,
+				Gender:      platformKuaishouUserInfo.Gender,
 			}
 			if defaultType == 1 {
 				reTalentDefault.DefaultTime = localLifeTaskInfo.SketchMissingTime.Format("2006-01-02 15:04:05")
@@ -455,16 +457,19 @@ func (s DefaultService) GetTargetDefaultTalentList(param *vo.DefaultSearchParam)
 	}
 	for _, projectTaskInfo := range projectTaskInfos {
 		talentId := projectTaskInfo.TalentID
-		talentPhone, _ := dao.TalentInfoDao{}.SelectTalentPhone(talentId)
-		platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.SelectUserInfo(talentId)
+		talentInfo, _ := dao.TalentInfoDao{}.GetTalentInfo(talentId)
+		platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.GetUserInfo(projectTaskInfo.OpenID)
 		reTalentDefault := &vo.ReTalentDefault{
 			TalentId:    talentId,
-			TalentPhone: *talentPhone,
+			TalentPhone: talentInfo.TalentPhoneNumber,
+			TaskId:      projectTaskInfo.TaskID,
 			DraftFee:    projectTaskInfo.DraftFee,
-			OpenId:      platformKuaishouUserInfo.OpenId,
+			OpenId:      platformKuaishouUserInfo.OpenID,
+			PlatformId:  platformKuaishouUserInfo.PlatformID,
 			NickName:    platformKuaishouUserInfo.NickName,
 			HeadUri:     platformKuaishouUserInfo.HeadUri,
-			City:        "-",
+			City:        platformKuaishouUserInfo.City,
+			Gender:      platformKuaishouUserInfo.Gender,
 		}
 		if defaultType == 4 {
 			reTalentDefault.DefaultTime = projectTaskInfo.TerminateTime.Format("2006-01-02 15:04:05")

+ 12 - 20
app/service/local_life_service.go

@@ -1123,35 +1123,27 @@ func (s LocalLifeService) GetStoreExploreInfo(param *vo.StoreExploreParam) (*vo.
 	var err error
 	localLifeId := param.LocalLifeId
 	if param.Status == 1 { // 待预约
-		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByTaskStage(localLifeId, 1, "", param.Page, param.PageSize)
+		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByTaskStage(localLifeId, 4, "", param.Page, param.PageSize)
 	} else if param.Status == 2 { // 待确认
-		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByTaskStage(localLifeId, 2, param.SearchTime, param.Page, param.PageSize)
-	} else if param.Status == 3 { // 待探店
 		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByTaskStage(localLifeId, 5, param.SearchTime, param.Page, param.PageSize)
+	} else if param.Status == 3 { // 待探店
+		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByBookStatus(localLifeId, 5, param.SearchTime, param.Page, param.PageSize)
 	} else if param.Status == 4 { // 已探店
-		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByTaskStage(localLifeId, 6, param.SearchTime, param.Page, param.PageSize)
+		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByBookStatus(localLifeId, 6, param.SearchTime, param.Page, param.PageSize)
 	}
 	if err != nil {
 		return nil, err
 	}
 	for _, localLifeTaskInfo := range localLifeTaskInfos {
 		// 获取达人信息
-		talentInfo, err := dao.TalentInfoDao{}.SelectTalentInfo(localLifeTaskInfo.TalentID)
-		if err != nil {
-			return nil, err
-		}
-		//regionName, err := dao.RegionInfoDao{}.SelectRegion(talentInfo.VisitStoreRegion)
-		//if err != nil {
-		//	regionName = ""
-		//}
-		regionName := localLifeTaskInfo.City
+		platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.GetUserInfo(localLifeTaskInfo.OpenID)
 		talentPreview := &vo.TalentPreview{
 			TalentId:    localLifeTaskInfo.TalentID,
-			TalentPhoto: talentInfo.Avatar,
-			TalentName:  talentInfo.TalentWxNickname,
-			Account:     "",
-			Location:    regionName,
-			Gender:      talentInfo.Sex,
+			TalentPhoto: platformKuaishouUserInfo.HeadUri,
+			TalentName:  platformKuaishouUserInfo.NickName,
+			Account:     platformKuaishouUserInfo.OpenID,
+			Location:    platformKuaishouUserInfo.City,
+			Gender:      platformKuaishouUserInfo.Gender,
 		}
 		reStoreExploreTalent := &vo.ReStoreExploreTalent{
 			ReTalentPreview: talentPreview,
@@ -1186,8 +1178,8 @@ func (t LocalLifeService) StoreExploreInfoCount(param *vo.StoreExploreParam) map
 	var needConfirm int64
 	var needExplore int64
 	var explored int64
-	dao.Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", param.LocalLifeId, 1).Count(&needBook)
-	dao.Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", param.LocalLifeId, 2).Count(&needConfirm)
+	dao.Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND task_stage = ?", param.LocalLifeId, 4).Count(&needBook)
+	dao.Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND task_stage = ?", param.LocalLifeId, 5).Count(&needConfirm)
 	dao.Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", param.LocalLifeId, 5).Count(&needExplore)
 	dao.Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", param.LocalLifeId, 6).Count(&explored)
 	res["needBook"] = needBook

+ 21 - 21
app/service/task_info_service.go

@@ -60,27 +60,23 @@ func (t TaskInfoService) LogisticsTalentList(param *vo.LogisticsTalentParam) (*v
 	}
 	for _, projectTaskInfo := range projectTaskInfos {
 		// 获取达人信息
-		talentInfo, err := dao.TalentInfoDao{}.SelectTalentInfo(projectTaskInfo.TalentID)
-		if err != nil {
-			return nil, err
-		}
-		regionName, err := dao.RegionInfoDao{}.SelectRegion(talentInfo.VisitStoreRegion)
-		if err != nil {
-			regionName = ""
-		}
+		platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.GetUserInfo(projectTaskInfo.OpenID)
 		taskLogistics, err := dao.TaskLogisticsDao{}.SelectTaskLogistics(projectTaskInfo.TaskID)
 		if err != nil {
 			return nil, err
 		}
 		talentPreview := &vo.TalentPreview{
 			TalentId:    projectTaskInfo.TalentID,
-			TalentPhoto: talentInfo.Avatar,
-			TalentName:  talentInfo.TalentWxNickname,
-			Account:     "",
-			Location:    regionName,
-			Gender:      talentInfo.Sex,
+			TalentPhoto: platformKuaishouUserInfo.HeadUri,
+			TalentName:  platformKuaishouUserInfo.NickName,
+			TaskId:      projectTaskInfo.TaskID,
+			Account:     platformKuaishouUserInfo.OpenID,
+			PlatformId:  platformKuaishouUserInfo.PlatformID,
+			Location:    platformKuaishouUserInfo.City,
+			Gender:      platformKuaishouUserInfo.Gender,
 		}
 		reLogisticsTalent := &vo.ReLogisticsTalent{
+			TaskId:             projectTaskInfo.TaskID,
 			TalentPostAddrSnap: projectTaskInfo.TalentPostAddrSnap,
 			ReTalentPreview:    talentPreview,
 			LogisticsId:        taskLogistics.LogisticsID,
@@ -194,7 +190,7 @@ func (t TaskInfoService) LogisticsTalentCount(param *vo.LogisticsTalentParam) ma
 	var received int64
 	dao.Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.ProjectId, 4).Count(&needDelivery)
 	dao.Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.ProjectId, 5).Count(&needReceive)
-	dao.Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.ProjectId, 6).Count(&received)
+	dao.Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage >= ?", param.ProjectId, 6).Count(&received)
 	res["needDelivery"] = needDelivery
 	res["needReceive"] = needReceive
 	res["received"] = received
@@ -202,6 +198,7 @@ func (t TaskInfoService) LogisticsTalentCount(param *vo.LogisticsTalentParam) ma
 	return res
 }
 
+// 电商带货执行中-悬赏兑现
 func (t TaskInfoService) SelectionRewardCashDetail(param *vo.SelectionRewardCashParam) (*vo.ReSelectionRewardCash, error) {
 	if param.Page == 0 {
 		param.Page = 1
@@ -221,14 +218,17 @@ func (t TaskInfoService) SelectionRewardCashDetail(param *vo.SelectionRewardCash
 	}
 	var talentRewardMsgs []vo.TalentRewardMsg
 	for _, selectionTaskInfo := range selectionTaskInfos {
-		talentInfo, _ := dao.TalentInfoDao{}.SelectTalentInfo(selectionTaskInfo.TalentID)
+		platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.GetUserInfo(selectionTaskInfo.OpenID)
 		talentRewardMsg := vo.TalentRewardMsg{
-			PhotoUrl: talentInfo.Avatar,
-			Nickname: talentInfo.TalentNickname,
-			Account:  talentInfo.TalentWxOpenid,
-			Gender:   talentInfo.Sex,
-			OrderNum: selectionTaskInfo.SaleActual,
-			CashTime: selectionTaskInfo.WithdrawDate.Format("2006-01-02 15:04:05"),
+			PhotoUrl:   platformKuaishouUserInfo.HeadUri,
+			Nickname:   platformKuaishouUserInfo.NickName,
+			Account:    platformKuaishouUserInfo.OpenID,
+			PlatformId: platformKuaishouUserInfo.PlatformID,
+			City:       platformKuaishouUserInfo.City,
+			Gender:     platformKuaishouUserInfo.Gender,
+			OrderNum:   selectionTaskInfo.SaleActual,
+			CashTime:   selectionTaskInfo.WithdrawDate.Format("2006-01-02 15:04:05"),
+			TaskId:     selectionTaskInfo.TaskID,
 		}
 		talentRewardMsgs = append(talentRewardMsgs, talentRewardMsg)
 	}

+ 4 - 1
app/vo/re_logistics_talent.go

@@ -1,6 +1,7 @@
 package vo
 
 type ReLogisticsTalent struct {
+	TaskId             string         `json:"taskId"`
 	LogisticsId        int64          `json:"logisticsId"`        // 物流id
 	CompanyName        string         `json:"companyName"`        // 快递公司
 	LogisticsNumber    string         `json:"logisticsNumber"`    // 快递单号
@@ -16,6 +17,8 @@ type TalentPreview struct {
 	TalentPhoto string `json:"talentPhoto"`
 	TalentName  string `json:"talentName"`
 	Account     string `json:"account"`
+	PlatformId  int64  `json:"platformId"`
 	Location    string `json:"location"`
-	Gender      int64  `json:"gender"`
+	Gender      string `json:"gender"`
+	TaskId      string `json:"taskId"`
 }

+ 9 - 6
app/vo/re_selection_reward_cash.go

@@ -9,10 +9,13 @@ type ReSelectionRewardCash struct {
 }
 
 type TalentRewardMsg struct {
-	PhotoUrl string `json:"photoUrl"`
-	Nickname string `json:"nickname"`
-	Account  string `json:"account"`
-	OrderNum int64  `json:"orderNum"`
-	CashTime string `json:"cashTime"`
-	Gender   int64  `json:"gender"` // 0未知 1男 2女
+	PhotoUrl   string `json:"photoUrl"`
+	Nickname   string `json:"nickname"`
+	Account    string `json:"account"`
+	PlatformId int64  `json:"platformId"`
+	City       string `json:"city"`
+	OrderNum   int64  `json:"orderNum"`
+	CashTime   string `json:"cashTime"`
+	Gender     string `json:"gender"` // U:未知;M,m:男; F女
+	TaskId     string `json:"taskId"`
 }

+ 2 - 1
app/vo/re_talent_default.go

@@ -3,10 +3,11 @@ package vo
 type ReTalentDefault struct {
 	TalentId     string  `json:"talentId"`
 	OpenId       string  `json:"openId"` // 表platform_kuaishou_user_info
+	PlatformId   int64   `json:"platformId"`
 	NickName     string  `json:"nickName"`
 	HeadUri      string  `json:"headUri"`
 	City         string  `json:"city"`
-	Gender       int64   `json:"gender"`       // 0未知 1男 2
+	Gender       string  `json:"gender"`       // U:未知;M,m:男;F f
 	TalentPhone  string  `json:"talentPhone"`  // 表youngee_talent_info
 	TaskId       string  `json:"taskId"`       // 任务id
 	DraftFee     float64 `json:"draftFee"`     // 稿费价格

+ 10 - 6
db/locallife_task.go

@@ -198,7 +198,7 @@ func GetLocallifetaskList(ctx context.Context, request http_model.GetLocalTaskLi
 				if err != nil {
 					return nil, err
 				}
-				listtime = sketchinfo.SubmitAt.Format("2006-01-02 15:04:05")
+				listtime = sketchinfo.CreateAt.Format("2006-01-02 15:04:05")
 				stageintro = "达人上传初稿时间" //
 			}
 		case 11:
@@ -213,7 +213,7 @@ func GetLocallifetaskList(ctx context.Context, request http_model.GetLocalTaskLi
 				if err != nil {
 					return nil, err
 				}
-				listtime = linkinfo.SubmitAt.Format("2006-01-02 15:04:05")
+				listtime = linkinfo.CreateAt.Format("2006-01-02 15:04:05")
 				stageintro = "达人上传链接时间"
 			}
 		case 13:
@@ -228,7 +228,11 @@ func GetLocallifetaskList(ctx context.Context, request http_model.GetLocalTaskLi
 				if err != nil {
 					return nil, err
 				}
-				listtime = datainfo.SubmitAt.Format("2006-01-02 15:04:05")
+				var auto_task_finish gorm_model.InfoAutoTask
+				db.Model(&gorm_model.InfoAutoTask{}).Where("enterprise_id = ?", request.EnterPriseId).First(&auto_task_finish)
+				// 将小时数转换为 Duration 后相加
+				resultTime := datainfo.CreateAt.Add(time.Duration(auto_task_finish.TaskFinishAuto) * time.Hour)
+				listtime = resultTime.Format("2006-01-02 15:04:05")
 				stageintro = "品牌最晚结算时间"
 			}
 		case 15:
@@ -870,7 +874,7 @@ func GetLocalSketchList(ctx context.Context, request http_model.LocalTasksketchl
 		response := &http_model.LocalTasksketchinfo{
 			Task:       taskinfo,
 			SketchId:   sketchinfo.SketchID,
-			SubmitAt:   sketchinfo.SubmitAt.Format("2006-01-02 15:04:05"),
+			SubmitAt:   sketchinfo.CreateAt.Format("2006-01-02 15:04:05"),
 			AgreeAt:    sketchinfo.AgreeAt.Format("2006-01-02 15:04:05"),
 			SketchType: sketchinfo.Type,
 			Operator:   boperator,
@@ -1106,7 +1110,7 @@ func GetLocalLinkList(ctx context.Context, request http_model.LocalTaskLinklistR
 		response := &http_model.LocalTaskLinkinfo{
 			Task:     taskinfo,
 			LinkId:   linkinfo.LinkID,
-			SubmitAt: linkinfo.SubmitAt.Format("2006-01-02 15:04:05"),
+			SubmitAt: linkinfo.CreateAt.Format("2006-01-02 15:04:05"),
 			AgreeAt:  linkinfo.AgreeAt.Format("2006-01-02 15:04:05"),
 			LinkUrl:  linkinfo.LinkUrl,
 			PhotoUrl: linkinfo.PhotoUrl,
@@ -1341,7 +1345,7 @@ func GetLocalDataList(ctx context.Context, request http_model.LocalTaskDatalistR
 		response := &http_model.LocalTaskDatainfo{
 			Task:          taskinfo,
 			DataId:        datainfo.DataID,
-			SubmitAt:      datainfo.SubmitAt.Format("2006-01-02 15:04:05"),
+			SubmitAt:      datainfo.CreateAt.Format("2006-01-02 15:04:05"),
 			AgreeAt:       datainfo.AgreeAt.Format("2006-01-02 15:04:05"),
 			PhotoUrl:      datainfo.PhotoUrl,
 			PlayNumber:    datainfo.PlayNumber,

+ 8 - 7
db/project_task.go

@@ -190,7 +190,7 @@ func GetProjecttaskList(ctx context.Context, request http_model.GetTaskListReque
 				if err != nil {
 					return nil, err
 				}
-				listtime = sketchinfo.SubmitAt.Format("2006-01-02 15:04:05")
+				listtime = sketchinfo.CreateAt.Format("2006-01-02 15:04:05")
 				stageintro = "达人上传初稿时间" //
 			}
 		case 11:
@@ -205,7 +205,7 @@ func GetProjecttaskList(ctx context.Context, request http_model.GetTaskListReque
 				if err != nil {
 					return nil, err
 				}
-				listtime = linkinfo.SubmitAt.Format("2006-01-02 15:04:05")
+				listtime = linkinfo.CreateAt.Format("2006-01-02 15:04:05")
 				stageintro = "达人上传链接时间"
 			}
 		case 13:
@@ -223,7 +223,7 @@ func GetProjecttaskList(ctx context.Context, request http_model.GetTaskListReque
 				var auto_task_finish gorm_model.InfoAutoTask
 				db.Model(&gorm_model.InfoAutoTask{}).Where("enterprise_id = ?", request.EnterPriseId).First(&auto_task_finish)
 				// 将小时数转换为 Duration 后相加
-				resultTime := datainfo.SubmitAt.Add(time.Duration(auto_task_finish.TaskFinishAuto) * time.Hour)
+				resultTime := datainfo.CreateAt.Add(time.Duration(auto_task_finish.TaskFinishAuto) * time.Hour)
 				listtime = resultTime.Format("2006-01-02 15:04:05")
 				stageintro = "品牌最晚结算时间"
 			}
@@ -573,7 +573,7 @@ func RefuseproTaskCoop(ctx context.Context, taskIds []string, operatorid string,
 
 	var tasks []gorm_model.YoungeeTaskInfo
 	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id IN ? AND task_stage = 1", taskIds).Find(&tasks).Error
-
+	fmt.Println(taskIds, talentIds)
 	err = db.Transaction(func(tx *gorm.DB) error {
 		// 2. 修改任务状态和任务阶段
 		for _, taskInfo := range tasks {
@@ -821,7 +821,7 @@ func GetSketchList(ctx context.Context, request http_model.TasksketchlistRequest
 		response := &http_model.Tasksketchinfo{
 			Task:       taskinfo,
 			SketchId:   sketchinfo.SketchID,
-			SubmitAt:   sketchinfo.SubmitAt.Format("2006-01-02 15:04:05"),
+			SubmitAt:   sketchinfo.CreateAt.Format("2006-01-02 15:04:05"),
 			AgreeAt:    sketchinfo.AgreeAt.Format("2006-01-02 15:04:05"),
 			SketchType: sketchinfo.Type,
 			Operator:   boperator,
@@ -1055,7 +1055,7 @@ func GetLinkList(ctx context.Context, request http_model.TaskLinklistRequest) (*
 		response := &http_model.TaskLinkinfo{
 			Task:     taskinfo,
 			LinkId:   linkinfo.LinkID,
-			SubmitAt: linkinfo.SubmitAt.Format("2006-01-02 15:04:05"),
+			SubmitAt: linkinfo.CreateAt.Format("2006-01-02 15:04:05"),
 			AgreeAt:  linkinfo.AgreeAt.Format("2006-01-02 15:04:05"),
 			LinkUrl:  linkinfo.LinkUrl,
 			PhotoUrl: linkinfo.PhotoUrl,
@@ -1190,6 +1190,7 @@ func GetDataList(ctx context.Context, request http_model.TaskDatalistRequest) (*
 		query = query.Where("talent_name LIKE ? OR s_operate_name LIKE ?", "%"+request.Others+"%", "%"+request.Others+"%")
 	}
 	// 计算总数
+	fmt.Println(projecrtaskinfo)
 	var total int64
 	if err := query.Count(&total).Error; err != nil {
 		return nil, err
@@ -1288,7 +1289,7 @@ func GetDataList(ctx context.Context, request http_model.TaskDatalistRequest) (*
 		response := &http_model.TaskDatainfo{
 			Task:          taskinfo,
 			DataId:        datainfo.DataID,
-			SubmitAt:      datainfo.SubmitAt.Format("2006-01-02 15:04:05"),
+			SubmitAt:      datainfo.CreateAt.Format("2006-01-02 15:04:05"),
 			AgreeAt:       datainfo.AgreeAt.Format("2006-01-02 15:04:05"),
 			PhotoUrl:      datainfo.PhotoUrl,
 			PlayNumber:    datainfo.PlayNumber,

+ 5 - 1
service/logistics.go

@@ -83,7 +83,11 @@ func (*logistics) Create(ctx context.Context, newLogistics http_model.CreateLogi
 		return nil, err1
 	}
 
-	dao.Db.Model(&entity.Project{ProjectId: *projectId}).Update("delivery_num", gorm.Expr("delivery_num + ?", 1))
+	// 更新发货数值
+	dao.Db.Model(&entity.Project{}).Where("task_id = ?", projectId).Updates(map[string]interface{}{
+		"delivery_num":        gorm.Expr("delivery_num + ?", 1),
+		"before_delivery_num": gorm.Expr("before_delivery_num - ?", 1),
+	})
 
 	// 查询StrategyID 通过 StrategyID 和 projectId
 	RecruitStrategyId, err2 := db.GetRecruitStrategyIdByTS(ctx, *projectId, StrategyID)