Ethan 6 månader sedan
förälder
incheckning
4971174069

+ 58 - 1
app/controller/task_controller.go

@@ -350,7 +350,7 @@ func (t TaskController) GetSelectionDraftList(c *gin.Context) {
 	returnSuccess(c, 20000, res)
 }
 
-// 草稿箱——电商带货
+// 草稿箱——品牌种草
 func (t TaskController) GetProjectDraftList(c *gin.Context) {
 	param := &vo.ProjectDraftParam{}
 	err := c.BindJSON(param)
@@ -368,3 +368,60 @@ func (t TaskController) GetProjectDraftList(c *gin.Context) {
 
 	returnSuccess(c, 20000, res)
 }
+
+// 违约管理——违约公开任务列表
+func (t TaskController) GetPublicDefaultList(c *gin.Context) {
+	param := &vo.DefaultSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	res, err := service.DefaultService{}.GetPublicDefaultList(param)
+	if err != nil {
+		logrus.Errorf("[GetPublicDefaultList] call Show err:%+v\n", err)
+		returnError(c, 40000, "error")
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 违约管理——违约定向任务列表
+func (t TaskController) GetTargetDefaultList(c *gin.Context) {
+	param := &vo.DefaultSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	res, err := service.DefaultService{}.GetTargetDefaultList(param)
+	if err != nil {
+		logrus.Errorf("[GetTargetDefaultList] call Show err:%+v\n", err)
+		returnError(c, 40000, "error")
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 违约管理——公开任务-违约达人列表
+func (t TaskController) GetPublicDefaultTalentList(c *gin.Context) {
+	param := &vo.DefaultSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	res, err := service.DefaultService{}.GetPublicDefaultTalentList(param)
+	if err != nil {
+		logrus.Errorf("[GetPublicSketchDefaultList] call Show err:%+v\n", err)
+		returnError(c, 40000, "error")
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}

+ 0 - 0
app/dao/info_auto_default.go → app/dao/info_auto_default_dao.go


+ 0 - 0
app/dao/info_auto_task.go → app/dao/info_auto_task_dao.go


+ 18 - 0
app/dao/platform_kuaishou_user_info_dao.go

@@ -0,0 +1,18 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/app/entity"
+)
+
+type PlatformKuaishouUserInfoDao struct{}
+
+func (d PlatformKuaishouUserInfoDao) SelectUserInfo(talentId 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
+	if err != nil {
+		logrus.Errorf("[SelectUserInfo] error query, err:%+v", err)
+		return nil, err
+	}
+	return userInfo, nil
+}

+ 88 - 0
app/dao/project_dao.go

@@ -178,3 +178,91 @@ func (d ProjectDAO) GetProjectList(value int64, fieldName string) ([]*entity.Pro
 	}
 	return projectInfos, nil
 }
+
+// 违约管理——违约公开种草任务列表
+func (d ProjectDAO) GetProjectPublicList(param *vo.DefaultSearchParam) ([]vo.ReTaskDefaultPublic, int64, error) {
+	var reTaskDefaultPublics []vo.ReTaskDefaultPublic
+	var projects []entity.Project
+	var total int64
+	query := Db.Model(&entity.Project{}).Where("project_type = ?", 1)
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reTaskDefaultPublics, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.Platform != 0 {
+		query = query.Where("project_platform = ?", param.Platform)
+	}
+	if param.TaskId != "" {
+		query = query.Where("project_id = ?", param.TaskId)
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, project_id, project_platform, project_form, content_type, product_id")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&projects).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, project := range projects {
+		reTaskDefaultPublic := vo.ReTaskDefaultPublic{
+			EnterpriseId: project.EnterpriseID,
+			SubAccountId: project.SubAccountId,
+			TaskId:       project.ProjectId,
+			Platform:     project.ProjectPlatform,
+			TaskForm:     project.ProjectForm,
+			ContentType:  project.ContentType,
+			TaskType:     1,
+			ProductId:    project.ProductID,
+		}
+		reTaskDefaultPublics = append(reTaskDefaultPublics, reTaskDefaultPublic)
+	}
+
+	return reTaskDefaultPublics, total, nil
+}
+
+// 违约管理——违约定向种草任务列表
+func (d ProjectDAO) GetProjectTargetList(param *vo.DefaultSearchParam) ([]vo.ReTaskDefaultTarget, int64, error) {
+	var reTaskDefaultTargets []vo.ReTaskDefaultTarget
+	var projects []entity.Project
+	var total int64
+	query := Db.Model(&entity.Project{}).Where("project_type = ?", 2)
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reTaskDefaultTargets, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.Platform != 0 {
+		query = query.Where("project_platform = ?", param.Platform)
+	}
+	if param.TaskId != "" {
+		query = query.Where("project_id = ?", param.TaskId)
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, project_id, project_platform, tools, content_type, product_id")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&projects).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, project := range projects {
+		reTaskDefaultPublic := vo.ReTaskDefaultTarget{
+			EnterpriseId: project.EnterpriseID,
+			SubAccountId: project.SubAccountId,
+			TaskId:       project.ProjectId,
+			Platform:     project.ProjectPlatform,
+			Tools:        project.Tools,
+			ContentType:  project.ContentType,
+			TaskType:     1,
+			ProductId:    project.ProductID,
+		}
+		reTaskDefaultTargets = append(reTaskDefaultTargets, reTaskDefaultPublic)
+	}
+
+	return reTaskDefaultTargets, total, nil
+}

+ 92 - 0
app/dao/project_task_info_dao.go

@@ -0,0 +1,92 @@
+package dao
+
+import (
+	"youngee_b_api/app/entity"
+	"youngee_b_api/app/vo"
+)
+
+type ProjectTaskInfoDao struct{}
+
+// 获取指定违约类型的种草子任务数量
+func (d ProjectTaskInfoDao) CountByDefaultType(projectId string, defaultType int64) int64 {
+	var total int64
+	Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", projectId, defaultType).Count(&total)
+	return total
+}
+
+// 获取指定任务阶段的种草子任务数量
+func (d ProjectTaskInfoDao) CountByTaskStage(projectId string, taskStage int64) int64 {
+	var total int64
+	Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", projectId, taskStage).Count(&total)
+	return total
+}
+
+// 获取未传初稿的种草子任务数据
+func (d ProjectTaskInfoDao) GetListBySketchDefault(param *vo.DefaultSearchParam) ([]entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []entity.ProjectTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", param.TaskId, 4)
+	query.Count(&total)
+	query = query.Select("talent_id, settle_amount, draft_fee, sketch_missing_time")
+	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
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取未发作品的种草子任务数据
+func (d ProjectTaskInfoDao) GetListByLinkDefault(param *vo.DefaultSearchParam) ([]entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []entity.ProjectTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", param.TaskId, 6)
+	query.Count(&total)
+	query = query.Select("talent_id, settle_amount, draft_fee, link_missing_time")
+	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
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取未传数据的种草子任务数据
+func (d ProjectTaskInfoDao) GetListByDataDefault(param *vo.DefaultSearchParam) ([]entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []entity.ProjectTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND cur_default_type = ?", param.TaskId, 8)
+	query.Count(&total)
+	query = query.Select("talent_id, settle_amount, draft_fee, data_missing_time")
+	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
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取终止合作的种草子任务数据
+func (d ProjectTaskInfoDao) GetListByTerminateDefault(param *vo.DefaultSearchParam) ([]entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []entity.ProjectTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.TaskId, 17)
+	query.Count(&total)
+	query = query.Select("talent_id, settle_amount, draft_fee, terminate_time, terminate_reason, terminate_operator_type, terminate_operator")
+	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
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取已解约类型的种草子任务数据
+func (d ProjectTaskInfoDao) GetListByCancelDefault(param *vo.DefaultSearchParam) ([]entity.ProjectTaskInfo, int64, error) {
+	projectTaskInfos := []entity.ProjectTaskInfo{}
+	var total int64
+	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.TaskId, 16)
+	query.Count(&total)
+	query = query.Select("talent_id, settle_amount, draft_fee, cancel_time, cancel_reason, cancel_operator_type, cancel_operator")
+	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
+	}
+	return projectTaskInfos, total, nil
+}

+ 1 - 0
app/dao/selection_info_dao.go

@@ -168,6 +168,7 @@ func (d SelectionInfoDAO) GetSelectionDraftList(param *vo.SelectionDraftParam) (
 
 // 获取电商带货悬赏任务中全部指定状态值的项目
 func (d SelectionInfoDAO) GetSelectionInfoList(value int64, fieldName string) ([]*entity.SelectionInfo, error) {
+	fmt.Println("Db", Db)
 	var selectionInfos []*entity.SelectionInfo
 	err := Db.Model(entity.SelectionInfo{}).Where(fmt.Sprintf("task_mode = ? AND %s = ? ", fieldName), 1, value).Find(&selectionInfos).Error
 	if err != nil {

+ 18 - 0
app/dao/talent_info_dao.go

@@ -0,0 +1,18 @@
+package dao
+
+import (
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/app/entity"
+)
+
+type TalentInfoDao struct{}
+
+func (d TalentInfoDao) SelectTalentInfo(talentId string) (*entity.YoungeeTalentInfo, error) {
+	var talentInfo *entity.YoungeeTalentInfo
+	err := Db.Model(entity.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", talentId).Find(&talentInfo).Error
+	if err != nil {
+		logrus.Errorf("[SelectTalentInfo] error query, err:%+v", err)
+		return nil, err
+	}
+	return talentInfo, nil
+}

+ 31 - 0
app/entity/platform_kuaishou_user_info.go

@@ -0,0 +1,31 @@
+// 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"`
+}
+
+func (m *PlatformKuaishouUserInfo) TableName() string {
+	return "platform_kuaishou_user_info"
+}

+ 8 - 0
app/entity/project_task_info.go

@@ -41,6 +41,14 @@ type ProjectTaskInfo struct {
 	CurDefaultType         int       `gorm:"column:cur_default_type"`                     // 任务当前处于的违约类型 0-8分别表示未违约、脚本超时违约、脚本未上传违约、初稿超时违约、初稿未上传违约、链接超时违约、链接未上传违约、数据超时违约、数据未上传违约
 	WithdrawStatus         int       `gorm:"column:withdraw_status;default:1"`            // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
 	SettleStatus           int       `gorm:"column:settle_status;default:1"`              // 结算状态,1、2分别表示待结算、已结算
+	DraftFee               float64   `gorm:"column:draft_fee;NOT NULL"`                   // 达人稿费,达人所见的稿费金额
+	TerminateTime          time.Time `gorm:"column:terminate_time"`
+	TerminateReason        string    `gorm:"column:terminate_reason"`
+	CancelTime             time.Time `gorm:"column:cancel_time"`
+	CancelReason           string    `gorm:"column:cancel_reason"`
+	SketchMissingTime      time.Time `gorm:"column:sketch_missing_time"`
+	LinkMissingTime        time.Time `gorm:"column:link_missing_time"`
+	DataMissingTime        time.Time `gorm:"column:data_missing_time"`
 }
 
 func (m *ProjectTaskInfo) TableName() string {

+ 39 - 0
app/entity/talent_info.go

@@ -0,0 +1,39 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type YoungeeTalentInfo struct {
+	ID                string    `gorm:"column:id;primary_key"`               // 达人id
+	TalentWxOpenid    string    `gorm:"column:talent_wx_openid;NOT NULL"`    // 达人的微信openid
+	TalentWxNickname  string    `gorm:"column:talent_wx_nickname"`           // 达人的微信昵称
+	TalentWxNumber    string    `gorm:"column:talent_wx_number"`             // 达人微信号
+	Income            int64     `gorm:"column:income;default:0"`             // 收益总数
+	Withdrawing       int64     `gorm:"column:withdrawing;default:0"`        // 提现中金额
+	Canwithdraw       int64     `gorm:"column:canwithdraw;default:0"`        // 可提现金额
+	Withdrawed        int64     `gorm:"column:withdrawed;default:0"`         // 已提现金额
+	TalentGender      int64     `gorm:"column:talent_gender"`                // 性别,0未知 1男 2女
+	TalentPhoneNumber string    `gorm:"column:talent_phone_number"`          // 电话号码
+	TalentAgeBracket  int64     `gorm:"column:talent_age_bracket"`           // 年龄段,取tallent_age_bracket表id
+	TalentNationality int64     `gorm:"column:talent_nationality"`           // 国籍,取tallent_nationality表id
+	VisitStoreRegion  int64     `gorm:"column:visit_store_region"`           // 探店区域,取region_info表中的self_code
+	IsBindInfo        uint      `gorm:"column:is_bind_info;default:0"`       // 是否填写个人资料
+	IsBindLocation    uint      `gorm:"column:is_bind_location;default:0"`   // 是否绑定收货地址
+	IsBindBank        uint      `gorm:"column:is_bind_bank;default:0"`       // 是否绑定银行账户信息
+	InBlacklist       uint      `gorm:"column:in_blacklist;default:0"`       // 是否加入黑名单 0否 1是
+	TaskAll           int64     `gorm:"column:task_all;default:0"`           // 任务总数
+	TaskApply         int64     `gorm:"column:task_apply;default:0"`         // 报名任务数量
+	TaskExecute       int64     `gorm:"column:task_execute;default:0"`       // 执行中任务数量
+	TaskEnd           int64     `gorm:"column:task_end;default:0"`           // 结束任务数量
+	CreateDate        time.Time `gorm:"column:create_date;NOT NULL"`         // 创建时间
+	LastLoginDate     time.Time `gorm:"column:last_login_date;NOT NULL"`     // 最后登录时间
+	ApplyNum          int64     `gorm:"column:apply_num;default:5;NOT NULL"` // 剩余申请次数(每天更新)
+	UserType          int64     `gorm:"column:user_type"`
+	Sex               int64     `gorm:"column:sex"`
+}
+
+func (m *YoungeeTalentInfo) TableName() string {
+	return "youngee_talent_info"
+}

+ 173 - 0
app/service/default_service.go

@@ -0,0 +1,173 @@
+package service
+
+import (
+	"youngee_b_api/app/dao"
+	"youngee_b_api/app/vo"
+)
+
+type DefaultService struct{}
+
+// 违约管理——违约公开任务列表
+func (s DefaultService) GetPublicDefaultList(param *vo.DefaultSearchParam) (vo.ResultVO, error) {
+	if param.Page == 0 {
+		param.Page = 1
+	}
+	if param.PageSize == 0 {
+		param.PageSize = 10
+	}
+	var result vo.ResultVO
+	// 以下代码只考虑了种草
+	reTaskDefaultPublics, total, err := (&dao.ProjectDAO{}).GetProjectPublicList(param)
+	if err != nil {
+		return result, err
+	}
+	for i := range reTaskDefaultPublics {
+		// 获取商品详情字段
+		var creatorName string
+		var productName string
+		var productPrice float64
+		var mainImage string
+		if reTaskDefaultPublics[i].SubAccountId == 0 {
+			enterprise, err := dao.EnterpriseDao{}.GetEnterprise(reTaskDefaultPublics[i].EnterpriseId)
+			if err == nil && enterprise != nil {
+				creatorName = enterprise.BusinessName
+			}
+		} else {
+			subAccount, err := dao.SubAccountDao{}.GetSubAccount(reTaskDefaultPublics[i].SubAccountId)
+			if err == nil && subAccount != nil {
+				creatorName = subAccount.SubAccountName
+			}
+		}
+		product, err := dao.ProductDAO{}.GetProductByID(reTaskDefaultPublics[i].ProductId)
+		if err == nil && product != nil {
+			productName = product.ProductName
+			productPrice = product.ProductPrice
+		}
+		mainImage, err = dao.ProductPhotoDAO{}.GetMainPhotoByProductID(reTaskDefaultPublics[i].ProductId)
+		reTaskDefaultPublics[i].CreatorName = creatorName
+		reTaskDefaultPublics[i].ProductName = productName
+		reTaskDefaultPublics[i].ProductPrice = productPrice
+		reTaskDefaultPublics[i].MainImage = mainImage
+		// 获取未传数量字段	0-10分别表示未违约、脚本超时违约、脚本未上传违约、初稿超时违约、初稿未上传违约、链接超时违约、链接未上传违约、数据超时违约、数据未上传违约、解约待处理、解约
+		projectId := reTaskDefaultPublics[i].TaskId
+		noSketchNum := dao.ProjectTaskInfoDao{}.CountByDefaultType(projectId, 4)
+		noLinkNum := dao.ProjectTaskInfoDao{}.CountByDefaultType(projectId, 6)
+		noDataNum := dao.ProjectTaskInfoDao{}.CountByDefaultType(projectId, 8)
+		// 终止合作还是解约字段待确认
+		endCooperationNum := dao.ProjectTaskInfoDao{}.CountByTaskStage(projectId, 17)
+		reTaskDefaultPublics[i].NoSketchNum = noSketchNum
+		reTaskDefaultPublics[i].NoLinkNum = noLinkNum
+		reTaskDefaultPublics[i].NoDataNum = noDataNum
+		reTaskDefaultPublics[i].EndCooperationNum = endCooperationNum
+	}
+	result = vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    total,
+		Data:     reTaskDefaultPublics,
+	}
+	return result, nil
+}
+
+// 违约管理——违约定向任务列表
+func (s DefaultService) GetTargetDefaultList(param *vo.DefaultSearchParam) (vo.ResultVO, error) {
+	if param.Page == 0 {
+		param.Page = 1
+	}
+	if param.PageSize == 0 {
+		param.PageSize = 10
+	}
+	var result vo.ResultVO
+	// 以下代码只考虑了种草
+	reTaskDefaultTargets, total, err := (&dao.ProjectDAO{}).GetProjectTargetList(param)
+	if err != nil {
+		return result, err
+	}
+	for i := range reTaskDefaultTargets {
+		// 获取商品详情字段
+		var creatorName string
+		var productName string
+		var productPrice float64
+		var mainImage string
+		if reTaskDefaultTargets[i].SubAccountId == 0 {
+			enterprise, err := dao.EnterpriseDao{}.GetEnterprise(reTaskDefaultTargets[i].EnterpriseId)
+			if err == nil && enterprise != nil {
+				creatorName = enterprise.BusinessName
+			}
+		} else {
+			subAccount, err := dao.SubAccountDao{}.GetSubAccount(reTaskDefaultTargets[i].SubAccountId)
+			if err == nil && subAccount != nil {
+				creatorName = subAccount.SubAccountName
+			}
+		}
+		product, err := dao.ProductDAO{}.GetProductByID(reTaskDefaultTargets[i].ProductId)
+		if err == nil && product != nil {
+			productName = product.ProductName
+			productPrice = product.ProductPrice
+		}
+		mainImage, err = dao.ProductPhotoDAO{}.GetMainPhotoByProductID(reTaskDefaultTargets[i].ProductId)
+		reTaskDefaultTargets[i].CreatorName = creatorName
+		reTaskDefaultTargets[i].ProductName = productName
+		reTaskDefaultTargets[i].ProductPrice = productPrice
+		reTaskDefaultTargets[i].MainImage = mainImage
+		// 终止合作还是解约字段待确认
+		endCooperationNum := dao.ProjectTaskInfoDao{}.CountByTaskStage(reTaskDefaultTargets[i].TaskId, 17)
+		reTaskDefaultTargets[i].EndCooperationNum = endCooperationNum
+	}
+	result = vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    total,
+		Data:     reTaskDefaultTargets,
+	}
+	return result, nil
+}
+
+// 违约管理——未传初稿公开任务列表
+func (s DefaultService) GetPublicDefaultTalentList(param *vo.DefaultSearchParam) (vo.ResultVO, error) {
+	if param.Page == 0 {
+		param.Page = 1
+	}
+	if param.PageSize == 0 {
+		param.PageSize = 10
+	}
+	var result vo.ResultVO
+	var reTalentDefaults []*vo.ReTalentDefault
+	// 以下代码只考虑了种草
+	if param.DefaultType == 1 {
+		projectTaskInfos, total, err := (&dao.ProjectTaskInfoDao{}).GetListBySketchDefault(param)
+	} else if param.DefaultType == 2 {
+
+	} else if param.DefaultType == 3 {
+
+	} else if param.DefaultType == 4 {
+
+	}
+	projectTaskInfos, total, err := (&dao.ProjectTaskInfoDao{}).GetListByDefaultType(param)
+	if err != nil {
+		return result, err
+	}
+	for _, projectTaskInfo := range projectTaskInfos {
+		talentId := projectTaskInfo.TalentID
+		reTalentDefault := &vo.ReTalentDefault{
+			TalentId:     talentId,
+			DraftFee:     projectTaskInfo.DraftFee,
+			SettleAmount: projectTaskInfo.SettleAmount,
+			DefaultTime:  projectTaskInfo.SketchMissingTime,
+		}
+		talentInfo, _ := dao.TalentInfoDao{}.SelectTalentInfo(talentId)
+		userInfo, _ := dao.PlatformKuaishouUserInfoDao{}.SelectUserInfo(talentId)
+		reTalentDefault.TalentPhone = talentInfo.TalentPhoneNumber
+		reTalentDefault.OpenId = userInfo.OpenId
+		reTalentDefault.NickName = userInfo.NickName
+		reTalentDefault.HeadUri = userInfo.HeadUri
+		reTalentDefaults = append(reTalentDefaults, reTalentDefault)
+	}
+	result = vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    total,
+		Data:     reTalentDefaults,
+	}
+	return result, nil
+}

+ 15 - 0
app/vo/default_search_param.go

@@ -0,0 +1,15 @@
+package vo
+
+type DefaultSearchParam struct {
+	EnterpriseId string `json:"enterprise_id"`
+	SubAccountId int64  `json:"sub_account_id"`
+	Page         int    `json:"page"`
+	PageSize     int    `json:"page_size"`
+	Platform     int64  `json:"platform"`
+	ProjectType  int64  `json:"project_type"` // 任务类型,0全部 1品牌种草,2本地生活
+	DefaultType  int64  `json:"default_type"` // 违约类型 0全部 1未传初稿 2未发作品 3未传数据 4终止合作 5已解约
+
+	TaskId string `json:"task_id"` // 任务ID
+	//ProjectName string `json:"project_name"` // 任务标题
+	//CreatorName string `json:"creator_name"` // 创建者
+}

+ 16 - 0
app/vo/re_talent_default.go

@@ -0,0 +1,16 @@
+package vo
+
+import "time"
+
+type ReTalentDefault struct {
+	TalentId     string    `json:"talentId"`
+	OpenId       string    `json:"openId"` // 表platform_kuaishou_user_info
+	NickName     string    `json:"nickName"`
+	HeadUri      string    `json:"headUri"`
+	City         string    `json:"city"`
+	TalentPhone  string    `json:"talentPhone"`  // 表youngee_talent_info
+	DraftFee     float64   `json:"draftFee"`     // 稿费价格
+	SettleAmount float64   `json:"settleAmount"` // 结算金额
+	DefaultTime  time.Time `json:"defaultTime"`  // 违约时间
+
+}

+ 12 - 12
app/vo/re_task_default_public.go

@@ -6,17 +6,17 @@ type ReTaskDefaultPublic struct {
 	ProductName  string  `json:"productName"`
 	ProductPrice float64 `json:"productPrice"`
 
-	EnterpriseId     string `json:"enterpriseId"`
-	SubAccountId     int64  `json:"subAccountId"`
-	TaskId           string `json:"taskId"`
-	TaskType         string `json:"taskType"` // 任务类型
-	Platform         int64  `json:"platform"`
-	TaskForm         int64  `json:"taskForm"`    // 任务形式
-	ContentType      int64  `json:"contentType"` // 内容形式
-	CreatorName      string `json:"creatorName"`
-	NoSketchNum      int64  `json:"sampleNum"` // 未传初稿
-	NoLinkNum        int64  `json:"reward"`    // 未发作品
-	NoDataNum        int64  `json:"enrollNum"` // 未传数据
-	NoCooperationNum int64  `json:"chooseNum"` // 终止合作
+	EnterpriseId      string `json:"enterpriseId"`
+	SubAccountId      int64  `json:"subAccountId"`
+	TaskId            string `json:"taskId"`
+	TaskType          int64  `json:"taskType"` // 任务类型 1品牌种草 2本地生活
+	Platform          int64  `json:"platform"`
+	TaskForm          int64  `json:"taskForm"`    // 任务形式
+	ContentType       int64  `json:"contentType"` // 内容形式
+	CreatorName       string `json:"creatorName"`
+	NoSketchNum       int64  `json:"sampleNum"` // 未传初稿
+	NoLinkNum         int64  `json:"reward"`    // 未发作品
+	NoDataNum         int64  `json:"enrollNum"` // 未传数据
+	EndCooperationNum int64  `json:"chooseNum"` // 终止合作
 
 }

+ 10 - 10
app/vo/re_task_default_target.go

@@ -6,15 +6,15 @@ type ReTaskDefaultTarget struct {
 	ProductName  string  `json:"productName"`
 	ProductPrice float64 `json:"productPrice"`
 
-	EnterpriseId     string `json:"enterpriseId"`
-	SubAccountId     int64  `json:"subAccountId"`
-	TaskId           string `json:"taskId"`
-	TaskType         string `json:"taskType"` // 任务类型
-	Platform         int64  `json:"platform"`
-	TaskForm         int64  `json:"taskForm"`    // 任务形式
-	ContentType      int64  `json:"contentType"` // 内容形式
-	CreatorName      string `json:"creatorName"`
-	Tools            string `json:"tools"`     // 工具选择
-	NoCooperationNum int64  `json:"chooseNum"` // 终止合作
+	EnterpriseId      string `json:"enterpriseId"`
+	SubAccountId      int64  `json:"subAccountId"`
+	TaskId            string `json:"taskId"`
+	TaskType          int64  `json:"taskType"` // 任务类型 1品牌种草 2本地生活
+	Platform          int64  `json:"platform"`
+	TaskForm          int64  `json:"taskForm"`    // 任务形式
+	ContentType       int64  `json:"contentType"` // 内容形式
+	CreatorName       string `json:"creatorName"`
+	Tools             string `json:"tools"`     // 工具选择
+	EndCooperationNum int64  `json:"chooseNum"` // 终止合作
 
 }

+ 10 - 0
route/init.go

@@ -190,6 +190,16 @@ func InitRoute(r *gin.Engine) {
 		task.POST("/draft/selection/list", controller.TaskController{}.GetSelectionDraftList) // 草稿箱——电商带货列表
 		task.POST("/draft/project/list", controller.TaskController{}.GetProjectDraftList)     // 草稿箱——品牌种草列表
 
+		task.POST("/default/public/list", controller.TaskController{}.GetPublicDefaultList)                       // 违约管理——公开任务列表
+		task.POST("/default/public/sketch/list", controller.TaskController{}.GetPublicDefaultTalentList)          // 违约管理——公开任务-违约达人列表
+		task.POST("/default/public/link/list", controller.TaskController{}.GetPublicLinkDefaultList)              // 违约管理——公开任务-未发作品
+		task.POST("/default/public/data/list", controller.TaskController{}.GetPublicDataDefaultList)              // 违约管理——公开任务-未传数据
+		task.POST("/default/public/endCooperation/list", controller.TaskController{}.GetPublicEndCooperationList) // 违约管理——公开任务-终止合作
+		task.POST("/default/public/cancellation/list", controller.TaskController{}.GetPublicCancellationList)     // 违约管理——公开任务-已解约
+		task.POST("/default/target/list", controller.TaskController{}.GetTargetDefaultList)                       // 违约管理——定向任务列表
+		task.POST("/default/target/endCooperation/list", controller.TaskController{}.GetTargetEndCooperationList) // 违约管理——定向任务-终止合作
+		task.POST("/default/target/cancellation/list", controller.TaskController{}.GetTargetCancellationList)     // 违约管理——定向任务-已解约
+
 	}
 
 }