Browse Source

违约管理&时间格式

Ethan 7 months ago
parent
commit
08d897fbba

+ 100 - 1
app/controller/task_controller.go

@@ -115,6 +115,26 @@ func (t TaskController) GetSelectionDetail(c *gin.Context) {
 	returnSuccess(c, 20000, res)
 }
 
+// 电商带货提交审核
+func (t TaskController) SelectionToReview(c *gin.Context) {
+	data := &vo.SelectionInfoUpdateParam{}
+	err := c.BindJSON(data)
+	if err != nil || data.SelectionID == "" {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	selectionId, err := service.SelectionInfoService{}.SelectionToReview(data)
+	if err != nil {
+		logrus.Errorf("[SelectionToReview] call SelectionToReview err:%+v\n", err)
+		returnError(c, 40000, "error")
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["selectionId"] = *selectionId
+	returnSuccess(c, 20000, resultMap)
+}
+
 // 电商带货任务列表
 func (t TaskController) SelectionTaskList(c *gin.Context) {
 	param := &vo.SelectionSearchParam{}
@@ -292,6 +312,26 @@ func (t TaskController) GetProjectDetail(c *gin.Context) {
 	returnSuccess(c, 20000, res)
 }
 
+// 种草提交审核
+func (t TaskController) ProjectToReview(c *gin.Context) {
+	data := &vo.ProjectUpdateParam{}
+	err := c.BindJSON(data)
+	if err != nil || data.ProjectID == "" {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	projectId, err := service.ProjectService{}.ProjectToReview(data)
+	if err != nil {
+		logrus.Errorf("[ProjectToReview] call ProjectToReview err:%+v\n", err)
+		returnError(c, 40000, "error")
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["projectId"] = *projectId
+	returnSuccess(c, 20000, resultMap)
+}
+
 // 公开种草任务列表
 func (t TaskController) ProjectTaskList(c *gin.Context) {
 	param := &vo.ProjectSearchParam{}
@@ -418,10 +458,69 @@ func (t TaskController) GetPublicDefaultTalentList(c *gin.Context) {
 	}
 	res, err := service.DefaultService{}.GetPublicDefaultTalentList(param)
 	if err != nil {
-		logrus.Errorf("[GetPublicSketchDefaultList] call Show err:%+v\n", err)
+		logrus.Errorf("[GetPublicDefaultTalentList] call Show err:%+v\n", err)
+		returnError(c, 40000, "error")
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 违约管理——定向任务-违约达人列表
+func (t TaskController) GetTargetDefaultTalentList(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{}.GetTargetDefaultTalentList(param)
+	if err != nil {
+		logrus.Errorf("[GetTargetDefaultTalentList] call Show err:%+v\n", err)
 		returnError(c, 40000, "error")
 		return
 	}
 
 	returnSuccess(c, 20000, res)
 }
+
+// 违约管理——达人解约
+func (t TaskController) CancelTalent(c *gin.Context) {
+	param := &vo.TalentCancelParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	err = service.DefaultService{}.CancelTalent(param)
+	if err != nil {
+		logrus.Errorf("[CancelTalent] call Show err:%+v\n", err)
+		returnError(c, 40000, "error")
+		return
+	}
+	resultMap := make(map[string]string)
+	resultMap["taskId"] = param.TaskId
+	returnSuccess(c, 20000, resultMap)
+}
+
+// 违约管理——达人批量解约
+func (t TaskController) CancelTalentList(c *gin.Context) {
+	param := &vo.TalentCancelParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	err = service.DefaultService{}.CancelTalentList(param)
+	if err != nil {
+		logrus.Errorf("[CancelTalentList] call Show err:%+v\n", err)
+		returnError(c, 40000, "error")
+		return
+	}
+	resultMap := make(map[string][]string)
+	resultMap["taskIds"] = param.TaskIds
+	returnSuccess(c, 20000, resultMap)
+}

+ 4 - 4
app/dao/info_auto_default_dao.go

@@ -14,8 +14,8 @@ func (d InfoAutoDefaultDao) GetAutoDefaultLast(enterpriseId string) entity.InfoA
 }
 
 // 获取指定 auto_default_id 的指定字段值
-func (d InfoAutoDefaultDao) GetValueByIdFieldName(autoDefaultId int64, fieldName string) entity.InfoAutoDefault {
-	autoDefaultInfo := entity.InfoAutoDefault{}
-	Db.Model(&entity.InfoAutoDefault{}).Select(fieldName).Where("auto_default_id = ?", autoDefaultId).First(&autoDefaultInfo)
-	return autoDefaultInfo
+func (d InfoAutoDefaultDao) GetValueByIdFieldName(autoDefaultId int64, fieldName string) int64 {
+	var value int64
+	Db.Model(&entity.InfoAutoDefault{}).Select(fieldName).Where("auto_default_id = ?", autoDefaultId).Find(&value)
+	return value
 }

+ 11 - 1
app/dao/project_dao.go

@@ -25,6 +25,16 @@ func (d ProjectDAO) GetProjectById(projectId string) (*entity.Project, error) {
 	return &Project, err
 }
 
+// 根据projectId获取违约状态id
+func (d ProjectDAO) GetAutoDefaultId(projectId string) (*int64, error) {
+	var autoDefaultId int64
+	err := Db.Model(&entity.Project{}).Where("project_id = ?", projectId).Select("auto_default_id").Find(&autoDefaultId).Error
+	if err != nil {
+		return nil, nil
+	}
+	return &autoDefaultId, nil
+}
+
 // 根据enterpriseId查询指定某天的所有带货数据
 func (d ProjectDAO) GetProjectListOfDay(enterpriseId string, date time.Time) ([]entity.Project, error) {
 	var Projects []entity.Project
@@ -160,7 +170,7 @@ func (d ProjectDAO) GetProjectDraftList(param *vo.ProjectDraftParam) ([]vo.RePro
 			ProjectId:       project.ProjectId,
 			ProjectPlatform: project.ProjectPlatform,
 			ProjectType:     project.ProjectType,
-			CreatedAt:       project.CreatedAt,
+			CreatedAt:       project.CreatedAt.Format("2006-01-02 15:04:05"),
 			ProductId:       project.ProductID,
 		}
 		reProjectTaskPreviews = append(reProjectTaskPreviews, reProjectTaskPreview)

+ 24 - 6
app/dao/project_task_info_dao.go

@@ -27,7 +27,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("talent_id, settle_amount, draft_fee, sketch_missing_time")
+	query = query.Select("task_id, 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
@@ -41,7 +41,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("talent_id, settle_amount, draft_fee, link_missing_time")
+	query = query.Select("task_id, 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
@@ -55,7 +55,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("talent_id, settle_amount, draft_fee, data_missing_time")
+	query = query.Select("task_id, 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
@@ -69,7 +69,7 @@ func (d ProjectTaskInfoDao) GetListByTerminateDefault(param *vo.DefaultSearchPar
 	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")
+	query = query.Select("task_id, 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
@@ -77,16 +77,34 @@ func (d ProjectTaskInfoDao) GetListByTerminateDefault(param *vo.DefaultSearchPar
 	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")
+	query = query.Select("task_id, 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
 }
+
+// 更新字段
+func (d ProjectTaskInfoDao) UpdateField(taskId string, updateData map[string]interface{}) error {
+	err := Db.Model(&entity.ProjectTaskInfo{}).Where("task_id = ?", taskId).Updates(updateData).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 批量更新字段
+func (d ProjectTaskInfoDao) UpdateFieldBatch(taskIds []string, updateData map[string]interface{}) error {
+	err := Db.Model(&entity.ProjectTaskInfo{}).Where("task_id IN ?", taskIds).Updates(updateData).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 3 - 3
app/dao/selection_info_dao.go

@@ -102,8 +102,8 @@ func (d SelectionInfoDAO) GetSelectionPreviews(param *vo.SelectionSearchParam) (
 			SelectionId:       selectionInfo.SelectionID,
 			SelectionPlatform: selectionInfo.Platform,
 			SelectionStatus:   selectionInfo.SelectionStatus,
-			CreatedAt:         selectionInfo.CreatedAt,
-			TaskDdl:           selectionInfo.TaskDdl,
+			CreatedAt:         selectionInfo.CreatedAt.Format("2006-01-02 15:04:05"),
+			TaskDdl:           selectionInfo.TaskDdl.Format("2006-01-02 15:04:05"),
 			SampleNum:         selectionInfo.SampleNum,
 			EnrollNum:         selectionInfo.EnrollNum,
 			ChooseNum:         selectionInfo.ChooseNum,
@@ -157,7 +157,7 @@ func (d SelectionInfoDAO) GetSelectionDraftList(param *vo.SelectionDraftParam) (
 			SubAccountId:      selectionInfo.SubAccountId,
 			SelectionId:       selectionInfo.SelectionID,
 			SelectionPlatform: selectionInfo.Platform,
-			CreatedAt:         selectionInfo.CreatedAt,
+			CreatedAt:         selectionInfo.CreatedAt.Format("2006-01-02 15:04:05"),
 			ProductId:         selectionInfo.ProductID,
 		}
 		reSelectionTaskPreviews = append(reSelectionTaskPreviews, reSelectionTaskPreview)

+ 2 - 2
app/dao/talent_info_dao.go

@@ -7,12 +7,12 @@ import (
 
 type TalentInfoDao struct{}
 
-func (d TalentInfoDao) SelectTalentInfo(talentId string) (*entity.YoungeeTalentInfo, error) {
+func (d TalentInfoDao) SelectTalentPhone(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 {
 		logrus.Errorf("[SelectTalentInfo] error query, err:%+v", err)
 		return nil, err
 	}
-	return talentInfo, nil
+	return &talentInfo.TalentPhoneNumber, nil
 }

+ 9 - 0
app/dao/user_dao.go

@@ -12,3 +12,12 @@ func (d UserDao) GetPhoneByUserId(userId int64) (string, error) {
 	}
 	return user.Phone, nil
 }
+
+func (d UserDao) GetNameByUserId(userId int64) (string, error) {
+	var user entity.User
+	err := Db.Model(&entity.User{}).Where("id = ?", userId).Select("username").First(&user).Error
+	if err != nil {
+		return "", err
+	}
+	return user.Username, nil
+}

+ 4 - 0
app/entity/project_task_info.go

@@ -49,6 +49,10 @@ type ProjectTaskInfo struct {
 	SketchMissingTime      time.Time `gorm:"column:sketch_missing_time"`
 	LinkMissingTime        time.Time `gorm:"column:link_missing_time"`
 	DataMissingTime        time.Time `gorm:"column:data_missing_time"`
+	TerminateOperatorType  int       `gorm:"column:terminate_operator_type;default:0;NOT NULL"`
+	TerminateOperator      string    `gorm:"column:terminate_operator"`
+	CancelOperatorType     int       `gorm:"column:cancel_operator_type;default:0;NOT NULL"`
+	CancelOperator         string    `gorm:"column:cancel_operator"`
 }
 
 func (m *ProjectTaskInfo) TableName() string {

+ 5 - 5
app/schedule/auto_task.go

@@ -13,7 +13,7 @@ import (
 func AutoTask() error {
 	// 新建一个定时任务对象
 	crontab := cron.New(cron.WithSeconds()) // 精确到秒
-	spec := "0 */1 * * * ?"                 //cron表达式,每10h一次
+	spec := "0 0 */5 * * ?"                 //cron表达式,每10h一次
 	// "0 0 12 * * ?" 每天中午12点执行
 
 	// 添加定时任务
@@ -53,14 +53,14 @@ func AutoInvalidTask() {
 		}
 		projectNeedMod := entity.Project{}
 		dao.Db.Where("project_id = ?", projectId).First(&projectNeedMod)
-		fmt.Println("品牌种草项目失效自动处理时间为:", projectNeedMod.AutoFailAt)
+		fmt.Println(fmt.Sprintf("品牌种草项目 %s 失效自动处理时间为:%s", projectId, projectNeedMod.AutoFailAt))
 		// 如果失效自动处理的时间不为空
 		if !projectNeedMod.AutoFailAt.IsZero() {
 			timeNow := time.Now()
 			// 如果 未失效 && 已经过了失效自动处理的时间
 			if projectNeedMod.ProjectStatus < 8 && projectNeedMod.AutoFailAt.Sub(time.Now()) <= 0 {
 				dao.Db.Model(entity.Project{}).Where("project_id = ?", projectId).Updates(&entity.Project{ProjectStatus: 8, FinishAt: timeInvalid, FailReason: 1})
-				fmt.Println("已更新品牌种草项目状态为超时未支付的失效状态")
+				fmt.Println(fmt.Sprintf("已更新品牌种草项目 %s 状态为超时未支付的失效状态", projectId))
 				dao.Db.Model(entity.ProjectTaskInfo{}).Where("project_id = ?", projectId).Updates(entity.ProjectTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: timeNow})
 			}
 		}
@@ -86,14 +86,14 @@ func AutoSelectionInvalidTask() {
 		}
 		selectionInfoNeedMod := entity.SelectionInfo{}
 		dao.Db.Where("selection_id = ?", selectionId).First(&selectionInfoNeedMod)
-		fmt.Println("电商带货项目失效自动处理时间为:", selectionInfoNeedMod.AutoFailAt)
+		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.Println(fmt.Sprintf("已更新电商带货项目 %s 状态为超时未支付的失效状态", selectionId))
 				dao.Db.Model(entity.SelectionInfo{}).Where("selection_id = ?", selectionId).Updates(entity.SelectionTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: timeNow})
 			}
 		}

+ 192 - 19
app/service/default_service.go

@@ -1,7 +1,10 @@
 package service
 
 import (
+	"strconv"
+	"time"
 	"youngee_b_api/app/dao"
+	"youngee_b_api/app/entity"
 	"youngee_b_api/app/vo"
 )
 
@@ -123,7 +126,7 @@ func (s DefaultService) GetTargetDefaultList(param *vo.DefaultSearchParam) (vo.R
 	return result, nil
 }
 
-// 违约管理——未传初稿公开任务列表
+// 违约管理——公开任务-违约达人列表
 func (s DefaultService) GetPublicDefaultTalentList(param *vo.DefaultSearchParam) (vo.ResultVO, error) {
 	if param.Page == 0 {
 		param.Page = 1
@@ -134,33 +137,171 @@ func (s DefaultService) GetPublicDefaultTalentList(param *vo.DefaultSearchParam)
 	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 {
+	var projectTaskInfos []entity.ProjectTaskInfo
+	var total int64
+	var err error
+	var cutRate int64
+	defaultType := param.DefaultType
+	if defaultType == 1 { // 未传初稿
+		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListBySketchDefault(param)
+		autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
+		cutRate = dao.InfoAutoDefaultDao{}.GetValueByIdFieldName(*autoDefaultId, "sketch_replace_not_upload")
+	} else if defaultType == 2 { // 未发作品
+		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByLinkDefault(param)
+		autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
+		cutRate = dao.InfoAutoDefaultDao{}.GetValueByIdFieldName(*autoDefaultId, "link_replace_not_upload")
+	} else if defaultType == 3 { // 未传数据
+		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByDataDefault(param)
+		autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
+		cutRate = dao.InfoAutoDefaultDao{}.GetValueByIdFieldName(*autoDefaultId, "data_replace_not_upload")
+	} else if defaultType == 4 { // 终止合作
+		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTerminateDefault(param)
+	} else if defaultType == 5 { // 已解约
+		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByCancelDefault(param)
+	}
+	if err != nil {
+		return result, err
+	}
+	for _, projectTaskInfo := range projectTaskInfos {
+		talentId := projectTaskInfo.TalentID
+		talentPhone, _ := dao.TalentInfoDao{}.SelectTalentPhone(talentId)
+		platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.SelectUserInfo(talentId)
+		reTalentDefault := &vo.ReTalentDefault{
+			TalentId:    talentId,
+			TalentPhone: *talentPhone,
+			TaskId:      projectTaskInfo.TaskID,
+			DraftFee:    projectTaskInfo.DraftFee,
+			OpenId:      platformKuaishouUserInfo.OpenId,
+			NickName:    platformKuaishouUserInfo.NickName,
+			HeadUri:     platformKuaishouUserInfo.HeadUri,
+			City:        "-",
+		}
+		if defaultType == 1 {
+			reTalentDefault.DefaultTime = projectTaskInfo.SketchMissingTime.Format("2006-01-02 15:04:05")
+			reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
+		} else if defaultType == 2 {
+			reTalentDefault.DefaultTime = projectTaskInfo.LinkMissingTime.Format("2006-01-02 15:04:05")
+			reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
+		} else if defaultType == 3 {
+			reTalentDefault.DefaultTime = projectTaskInfo.DataMissingTime.Format("2006-01-02 15:04:05")
+			reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
+		} else if defaultType == 4 {
+			reTalentDefault.DefaultTime = projectTaskInfo.TerminateTime.Format("2006-01-02 15:04:05")
+			reTalentDefault.Reason = projectTaskInfo.TerminateReason
+			terminateOperatorType := projectTaskInfo.TerminateOperatorType
+			if terminateOperatorType == 1 {
+				enterprise, _ := dao.EnterpriseDao{}.GetEnterprise(projectTaskInfo.TerminateOperator)
+				reTalentDefault.OperatorName = enterprise.BusinessName
+			} else if terminateOperatorType == 2 {
+				operatorId, _ := strconv.ParseInt(projectTaskInfo.TerminateOperator, 10, 64)
+				subAccount, _ := dao.SubAccountDao{}.GetSubAccount(operatorId)
+				reTalentDefault.OperatorName = subAccount.SubAccountName
+			} else if terminateOperatorType == 3 {
+				operatorId, _ := strconv.ParseInt(projectTaskInfo.TerminateOperator, 10, 64)
+				userName, _ := dao.UserDao{}.GetNameByUserId(operatorId)
+				reTalentDefault.OperatorName = userName
+			}
+		} else if defaultType == 5 {
+			reTalentDefault.DefaultTime = projectTaskInfo.CancelTime.Format("2006-01-02 15:04:05")
+			reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
+			reTalentDefault.Reason = projectTaskInfo.CancelReason
+			cancelOperatorType := projectTaskInfo.CancelOperatorType
+			if cancelOperatorType == 1 {
+				enterprise, _ := dao.EnterpriseDao{}.GetEnterprise(projectTaskInfo.CancelOperator)
+				reTalentDefault.OperatorName = enterprise.BusinessName
+			} else if cancelOperatorType == 2 {
+				operatorId, _ := strconv.ParseInt(projectTaskInfo.CancelOperator, 10, 64)
+				subAccount, _ := dao.SubAccountDao{}.GetSubAccount(operatorId)
+				reTalentDefault.OperatorName = subAccount.SubAccountName
+			} else if cancelOperatorType == 3 {
+				operatorId, _ := strconv.ParseInt(projectTaskInfo.CancelOperator, 10, 64)
+				userName, _ := dao.UserDao{}.GetNameByUserId(operatorId)
+				reTalentDefault.OperatorName = userName
+			}
+		}
+		reTalentDefaults = append(reTalentDefaults, reTalentDefault)
+	}
+	resultMap := make(map[string]interface{})
+	resultMap["cutRate"] = cutRate
+	resultMap["reTalentDefaults"] = reTalentDefaults
+	result = vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    total,
+		Data:     resultMap,
+	}
+	return result, nil
+}
 
+// 违约管理——定向任务-违约达人列表
+func (s DefaultService) GetTargetDefaultTalentList(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
+	// 以下代码只考虑了种草
+	var projectTaskInfos []entity.ProjectTaskInfo
+	var total int64
+	var err error
+	defaultType := param.DefaultType
+	if defaultType == 4 { // 终止合作
+		projectTaskInfos, total, err = (&dao.ProjectTaskInfoDao{}).GetListByTerminateDefault(param)
+	} else if defaultType == 5 { // 已解约
+		projectTaskInfos, total, err = (&dao.ProjectTaskInfoDao{}).GetListByCancelDefault(param)
 	}
-	projectTaskInfos, total, err := (&dao.ProjectTaskInfoDao{}).GetListByDefaultType(param)
 	if err != nil {
 		return result, err
 	}
 	for _, projectTaskInfo := range projectTaskInfos {
 		talentId := projectTaskInfo.TalentID
+		talentPhone, _ := dao.TalentInfoDao{}.SelectTalentPhone(talentId)
+		platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.SelectUserInfo(talentId)
 		reTalentDefault := &vo.ReTalentDefault{
-			TalentId:     talentId,
-			DraftFee:     projectTaskInfo.DraftFee,
-			SettleAmount: projectTaskInfo.SettleAmount,
-			DefaultTime:  projectTaskInfo.SketchMissingTime,
+			TalentId:    talentId,
+			TalentPhone: *talentPhone,
+			DraftFee:    projectTaskInfo.DraftFee,
+			OpenId:      platformKuaishouUserInfo.OpenId,
+			NickName:    platformKuaishouUserInfo.NickName,
+			HeadUri:     platformKuaishouUserInfo.HeadUri,
+			City:        "-",
+		}
+		if defaultType == 4 {
+			reTalentDefault.DefaultTime = projectTaskInfo.TerminateTime.Format("2006-01-02 15:04:05")
+			reTalentDefault.Reason = projectTaskInfo.TerminateReason
+			terminateOperatorType := projectTaskInfo.TerminateOperatorType
+			if terminateOperatorType == 1 {
+				enterprise, _ := dao.EnterpriseDao{}.GetEnterprise(projectTaskInfo.TerminateOperator)
+				reTalentDefault.OperatorName = enterprise.BusinessName
+			} else if terminateOperatorType == 2 {
+				operatorId, _ := strconv.ParseInt(projectTaskInfo.TerminateOperator, 10, 64)
+				subAccount, _ := dao.SubAccountDao{}.GetSubAccount(operatorId)
+				reTalentDefault.OperatorName = subAccount.SubAccountName
+			} else if terminateOperatorType == 3 {
+				operatorId, _ := strconv.ParseInt(projectTaskInfo.TerminateOperator, 10, 64)
+				userName, _ := dao.UserDao{}.GetNameByUserId(operatorId)
+				reTalentDefault.OperatorName = userName
+			}
+		} else if defaultType == 5 {
+			reTalentDefault.DefaultTime = projectTaskInfo.CancelTime.Format("2006-01-02 15:04:05")
+			reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
+			cancelOperatorType := projectTaskInfo.CancelOperatorType
+			if cancelOperatorType == 1 {
+				enterprise, _ := dao.EnterpriseDao{}.GetEnterprise(projectTaskInfo.CancelOperator)
+				reTalentDefault.OperatorName = enterprise.BusinessName
+			} else if cancelOperatorType == 2 {
+				operatorId, _ := strconv.ParseInt(projectTaskInfo.CancelOperator, 10, 64)
+				subAccount, _ := dao.SubAccountDao{}.GetSubAccount(operatorId)
+				reTalentDefault.OperatorName = subAccount.SubAccountName
+			} else if cancelOperatorType == 3 {
+				operatorId, _ := strconv.ParseInt(projectTaskInfo.CancelOperator, 10, 64)
+				userName, _ := dao.UserDao{}.GetNameByUserId(operatorId)
+				reTalentDefault.OperatorName = userName
+			}
 		}
-		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{
@@ -171,3 +312,35 @@ func (s DefaultService) GetPublicDefaultTalentList(param *vo.DefaultSearchParam)
 	}
 	return result, nil
 }
+
+// 违约管理——达人解约
+func (s DefaultService) CancelTalent(param *vo.TalentCancelParam) error {
+	updateData := map[string]interface{}{
+		"task_stage":    16,
+		"settle_amount": param.RealPayment,
+		"real_payment":  param.RealPayment,
+		"cancel_reason": param.CancelReason,
+		"cancel_time":   time.Now(),
+	}
+	err := dao.ProjectTaskInfoDao{}.UpdateField(param.TaskId, updateData)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 违约管理——达人批量解约
+func (s DefaultService) CancelTalentList(param *vo.TalentCancelParam) error {
+	updateData := map[string]interface{}{
+		"task_stage":    16,
+		"settle_amount": param.RealPayment,
+		"real_payment":  param.RealPayment,
+		"cancel_reason": param.CancelReason,
+		"cancel_time":   time.Now(),
+	}
+	err := dao.ProjectTaskInfoDao{}.UpdateFieldBatch(param.TaskIds, updateData)
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 1 - 1
app/service/product_service.go

@@ -47,7 +47,7 @@ func (p ProductService) GetTaskProductsByUserId(param vo.GetAllProductParam) (vo
 			ProductCategory: product.ProductCategory,
 			ProductPrice:    product.ProductPrice,
 			ProductDetail:   product.ProductDetail,
-			CreatedAt:       product.CreatedAt,
+			CreatedAt:       product.CreatedAt.Format("2006-01-02 15:04:05"),
 			PhotoUrl:        photoUrl,
 		}
 		reProducts = append(reProducts, reProduct)

+ 19 - 3
app/service/project_service.go

@@ -386,7 +386,7 @@ func (s ProjectService) GetProjectDetail(projectId string) (*vo.ReProjectDetail,
 	reProjectDetail.ProjectId = projectId
 	reProjectDetail.ProjectStatus = project.ProjectStatus
 	reProjectDetail.ProjectPlatform = project.ProjectPlatform
-	reProjectDetail.CreatedAt = project.CreatedAt
+	reProjectDetail.CreatedAt = project.CreatedAt.Format("2006-01-02 15:04:05")
 	reProjectDetail.EstimatedCost = project.EstimatedCost
 	reProjectDetail.ServiceChargeRate = project.ServiceChargeRate
 	var creatorName, phone string
@@ -420,14 +420,14 @@ func (s ProjectService) GetProjectDetail(projectId string) (*vo.ReProjectDetail,
 			ProductCategory: product.ProductCategory,
 			ProductPrice:    product.ProductPrice,
 			ProductDetail:   product.ProductDetail,
-			CreatedAt:       product.CreatedAt,
+			CreatedAt:       product.CreatedAt.Format("2006-01-02 15:04:05"),
 			PhotoUrl:        photoUrl,
 		}
 	}
 	reProjectDetail.ProductInfo = &reProduct
 	// 招募要求
 	reProjectDetail.TalentType = project.TalentType
-	reProjectDetail.RecruitDdl = project.RecruitDdl
+	reProjectDetail.RecruitDdl = project.RecruitDdl.Format("2006-01-02 15:04:05")
 	reProjectDetail.ProjectForm = project.ProjectForm
 	reProjectDetail.ContentType = project.ContentType
 	reProjectDetail.ProjectDetail = project.ProjectDetail
@@ -471,6 +471,22 @@ func (s ProjectService) GetProjectDetail(projectId string) (*vo.ReProjectDetail,
 	return &reProjectDetail, nil
 }
 
+// 种草提交审核
+func (s ProjectService) ProjectToReview(projectUpdateParam *vo.ProjectUpdateParam) (*string, error) {
+	projectId := projectUpdateParam.ProjectID
+	t := time.Now()
+	updateProject := entity.Project{
+		ProjectId:     projectId,
+		ProjectStatus: 2,
+		UpdatedAt:     t,
+	}
+	err := dao.ProjectDAO{}.UpdateProject(updateProject)
+	if err != nil {
+		return nil, err
+	}
+	return &projectId, nil
+}
+
 // 公开种草任务列表
 func (s ProjectService) GetProjectTaskList(param *vo.ProjectSearchParam) (vo.ResultVO, error) {
 	if param.Page == 0 {

+ 20 - 4
app/service/selection_info_service.go

@@ -303,8 +303,8 @@ func (s SelectionInfoService) GetSelectionDetail(selectionId string) (*vo.ReSele
 	reSelectionDetail.SelectionId = selectionId
 	reSelectionDetail.SelectionStatus = selection.SelectionStatus
 	reSelectionDetail.SelectionPlatform = selection.Platform
-	reSelectionDetail.CreatedAt = selection.CreatedAt
-	reSelectionDetail.SubmitAt = selection.SubmitAt
+	reSelectionDetail.CreatedAt = selection.CreatedAt.Format("2006-01-02 15:04:05")
+	reSelectionDetail.SubmitAt = selection.SubmitAt.Format("2006-01-02 15:04:05")
 	var creatorName, phone string
 	var rewardSum float64
 	if selection.SubAccountId == 0 {
@@ -337,13 +337,13 @@ func (s SelectionInfoService) GetSelectionDetail(selectionId string) (*vo.ReSele
 			ProductCategory: product.ProductCategory,
 			ProductPrice:    product.ProductPrice,
 			ProductDetail:   product.ProductDetail,
-			CreatedAt:       product.CreatedAt,
+			CreatedAt:       product.CreatedAt.Format("2006-01-02 15:04:05"),
 			PhotoUrl:        photoUrl,
 		}
 	}
 	reSelectionDetail.ProductInfo = &reProduct
 	// 样品奖励
-	reSelectionDetail.TaskDdl = selection.TaskDdl
+	reSelectionDetail.TaskDdl = selection.TaskDdl.Format("2006-01-02 15:04:05")
 	reSelectionDetail.SampleNum = selection.SampleNum
 	var freeStrategyPreviews []*vo.FreeStrategyPreview // 领样策略
 	freeStrategys, err := dao.FreeStrategyDao{}.GetFreeStrategyBySelectionId(selectionId)
@@ -399,6 +399,22 @@ func (s SelectionInfoService) GetSelectionDetail(selectionId string) (*vo.ReSele
 	return &reSelectionDetail, nil
 }
 
+// 电商带货提交审核
+func (s SelectionInfoService) SelectionToReview(selectionUpdateParam *vo.SelectionInfoUpdateParam) (*string, error) {
+	selectionId := selectionUpdateParam.SelectionID
+	t := time.Now()
+	updateSelection := entity.SelectionInfo{
+		SelectionID:     selectionId,
+		SelectionStatus: 2,
+		UpdatedAt:       t,
+	}
+	err := dao.SelectionInfoDAO{}.UpdateSelectionInfo(updateSelection)
+	if err != nil {
+		return nil, err
+	}
+	return &selectionId, nil
+}
+
 // 电商带货任务列表
 func (s SelectionInfoService) GetSelectionTaskList(param *vo.SelectionSearchParam) (vo.ResultVO, error) {
 	if param.Page == 0 {

+ 8 - 0
app/vo/TalentCancelParam.go

@@ -0,0 +1,8 @@
+package vo
+
+type TalentCancelParam struct {
+	TaskId       string   `json:"task_id"`
+	TaskIds      []string `json:"task_ids"`
+	RealPayment  float64  `json:"real_payment"`
+	CancelReason string   `json:"cancel_reason"`
+}

+ 1 - 1
app/vo/default_search_param.go

@@ -7,7 +7,7 @@ type DefaultSearchParam struct {
 	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已解约
+	DefaultType  int64  `json:"default_type"` // 违约类型 1未传初稿 2未发作品 3未传数据 4终止合作 5已解约
 
 	TaskId string `json:"task_id"` // 任务ID
 	//ProjectName string `json:"project_name"` // 任务标题

+ 9 - 10
app/vo/re_project_detail.go

@@ -1,26 +1,25 @@
 package vo
 
 import (
-	"time"
 	"youngee_b_api/app/entity"
 )
 
 type ReProjectDetail struct {
 	// 系统信息
-	ProjectId         string    `json:"projectId"`           // 项目id 生成规则:年(2位)+一年中的第几天(3位)+5位数随机数,雪花算法也可,生成10位订单号
-	ProjectStatus     int64     `json:"projectStatus"`       // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、失效、执行中、已结案
-	ProjectPlatform   int64     `json:"projectPlatform"`     //  项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
-	CreatedAt         time.Time `json:"createdAt"`           // 创建时间
-	CreatorName       string    `json:"creatorName"`         // 创建者
-	Phone             string    `json:"phone"`               // 联系方式
-	EstimatedCost     float64   `json:"estimatedCost"`       // 成本预估
-	ServiceChargeRate float64   `json:"service_charge_rate"` // 公开服务费率
+	ProjectId         string  `json:"projectId"`           // 项目id 生成规则:年(2位)+一年中的第几天(3位)+5位数随机数,雪花算法也可,生成10位订单号
+	ProjectStatus     int64   `json:"projectStatus"`       // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、失效、执行中、已结案
+	ProjectPlatform   int64   `json:"projectPlatform"`     //  项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
+	CreatedAt         string  `json:"createdAt"`           // 创建时间
+	CreatorName       string  `json:"creatorName"`         // 创建者
+	Phone             string  `json:"phone"`               // 联系方式
+	EstimatedCost     float64 `json:"estimatedCost"`       // 成本预估
+	ServiceChargeRate float64 `json:"service_charge_rate"` // 公开服务费率
 	// 支付方式参数待定
 	// 关联商品
 	ProductInfo *ReTaskProduct `json:"productInfo"`
 	// 招募要求
 	TalentType       string                    `json:"talentType"`
-	RecruitDdl       time.Time                 `json:"recruitDdl"`
+	RecruitDdl       string                    `json:"recruitDdl"`
 	ProjectForm      int64                     `json:"projectForm"`
 	ContentType      int64                     `json:"contentType"`
 	ProjectDetail    string                    `json:"projectDetail"`

+ 14 - 16
app/vo/re_project_task_preview.go

@@ -1,25 +1,23 @@
 package vo
 
-import "time"
-
 type ReProjectTaskPreview struct {
 	ProductId    int64   `json:"productId"`
 	MainImage    string  `json:"mainImage"`
 	ProductName  string  `json:"productName"`
 	ProductPrice float64 `json:"productPrice"`
 
-	EnterpriseId    string    `json:"enterpriseId"`
-	SubAccountId    int64     `json:"subAccountId"`
-	ProjectId       string    `json:"projectId"`
-	ProjectPlatform int64     `json:"projectPlatform"`
-	ProjectStatus   int64     `json:"projectStatus"`
-	EstimatedCost   float64   `json:"estimatedCost"`
-	ProjectForm     int64     `json:"projectForm"`
-	ContentType     int64     `json:"contentType"`
-	NeedReview      int64     `json:"needReview"`
-	NeedQuality     int64     `json:"needQuality"`
-	NeedCalculate   int64     `json:"needCalculate"`
-	CreatorName     string    `json:"creatorName"`
-	ProjectType     int64     `json:"projectType"`
-	CreatedAt       time.Time `json:"createdAt"`
+	EnterpriseId    string  `json:"enterpriseId"`
+	SubAccountId    int64   `json:"subAccountId"`
+	ProjectId       string  `json:"projectId"`
+	ProjectPlatform int64   `json:"projectPlatform"`
+	ProjectStatus   int64   `json:"projectStatus"`
+	EstimatedCost   float64 `json:"estimatedCost"`
+	ProjectForm     int64   `json:"projectForm"`
+	ContentType     int64   `json:"contentType"`
+	NeedReview      int64   `json:"needReview"`
+	NeedQuality     int64   `json:"needQuality"`
+	NeedCalculate   int64   `json:"needCalculate"`
+	CreatorName     string  `json:"creatorName"`
+	ProjectType     int64   `json:"projectType"`
+	CreatedAt       string  `json:"createdAt"`
 }

+ 9 - 10
app/vo/re_selection_detail.go

@@ -1,25 +1,24 @@
 package vo
 
 import (
-	"time"
 	"youngee_b_api/app/entity"
 )
 
 type ReSelectionDetail struct {
 	// 系统信息
-	SelectionId       string    `json:"selectionId"`       // 项目id 生成规则:年(2位)+一年中的第几天(3位)+5位数随机数,雪花算法也可,生成10位订单号
-	SelectionStatus   int64     `json:"selectionStatus"`   // 项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
-	SelectionPlatform int64     `json:"selectionPlatform"` //  项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
-	CreatedAt         time.Time `json:"createdAt"`         // 创建时间
-	CreatorName       string    `json:"creatorName"`       // 创建者
-	Phone             string    `json:"phone"`             // 联系方式
-	RewardSum         float64   `json:"rewardSum"`         // 悬赏池总金额
-	SubmitAt          time.Time `json:"submitAt"`          // 提交审核时间
+	SelectionId       string  `json:"selectionId"`       // 项目id 生成规则:年(2位)+一年中的第几天(3位)+5位数随机数,雪花算法也可,生成10位订单号
+	SelectionStatus   int64   `json:"selectionStatus"`   // 项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
+	SelectionPlatform int64   `json:"selectionPlatform"` //  项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
+	CreatedAt         string  `json:"createdAt"`         // 创建时间
+	CreatorName       string  `json:"creatorName"`       // 创建者
+	Phone             string  `json:"phone"`             // 联系方式
+	RewardSum         float64 `json:"rewardSum"`         // 悬赏池总金额
+	SubmitAt          string  `json:"submitAt"`          // 提交审核时间
 	// 支付方式参数待定
 	// 关联商品
 	ProductInfo *ReTaskProduct `json:"productInfo"`
 	// 样品奖励
-	TaskDdl         time.Time                `json:"taskDdl"`
+	TaskDdl         string                   `json:"taskDdl"`
 	SampleNum       int64                    `json:"sampleNum"` // 样品数量
 	FreeStrategys   []*FreeStrategyPreview   // 领样策略
 	RewardStrategys []*RewardStrategyPreview // 悬赏策略

+ 12 - 14
app/vo/re_selection_task_preview.go

@@ -1,23 +1,21 @@
 package vo
 
-import "time"
-
 type ReSelectionTaskPreview struct {
 	ProductId    int64   `json:"productId"`
 	MainImage    string  `json:"mainImage"`
 	ProductName  string  `json:"productName"`
 	ProductPrice float64 `json:"productPrice"`
 
-	EnterpriseId      string    `json:"enterpriseId"`
-	SubAccountId      int64     `json:"subAccountId"`
-	SelectionId       string    `json:"selectionId"`
-	SelectionPlatform int64     `json:"selectionPlatform"`
-	SelectionStatus   int64     `json:"selectionStatus"`
-	CreatedAt         time.Time `json:"createdAt"`
-	TaskDdl           time.Time `json:"taskDdl"`
-	SampleNum         int64     `json:"sampleNum"` // 样品数量
-	Reward            float64   `json:"reward"`    // 悬赏池总金额
-	EnrollNum         int64     `json:"enrollNum"` // 报名数量
-	ChooseNum         int64     `json:"chooseNum"` // 已选数量
-	CreatorName       string    `json:"creatorName"`
+	EnterpriseId      string  `json:"enterpriseId"`
+	SubAccountId      int64   `json:"subAccountId"`
+	SelectionId       string  `json:"selectionId"`
+	SelectionPlatform int64   `json:"selectionPlatform"`
+	SelectionStatus   int64   `json:"selectionStatus"`
+	CreatedAt         string  `json:"createdAt"`
+	TaskDdl           string  `json:"taskDdl"`
+	SampleNum         int64   `json:"sampleNum"` // 样品数量
+	Reward            float64 `json:"reward"`    // 悬赏池总金额
+	EnrollNum         int64   `json:"enrollNum"` // 报名数量
+	ChooseNum         int64   `json:"chooseNum"` // 已选数量
+	CreatorName       string  `json:"creatorName"`
 }

+ 12 - 12
app/vo/re_talent_default.go

@@ -1,16 +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"`  // 违约时间
-
+	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
+	TaskId       string  `json:"taskId"`       // 任务id
+	DraftFee     float64 `json:"draftFee"`     // 稿费价格
+	SettleAmount float64 `json:"settleAmount"` // 结算金额
+	DefaultTime  string  `json:"defaultTime"`  // 违约时间
+	Reason       string  `json:"reason"`       // 终止理由或解约原因
+	OperatorName string  `json:"operatorName"` // 操作人
 }

+ 8 - 10
app/vo/re_task_product.go

@@ -1,14 +1,12 @@
 package vo
 
-import "time"
-
 type ReTaskProduct struct {
-	ProductID       int64     `json:"productId"`
-	ProductName     string    `json:"productName"`
-	ProductType     int64     `json:"productType"`
-	ProductCategory string    `json:"productCategory"`
-	ProductPrice    float64   `json:"productPrice"`
-	ProductDetail   string    `json:"productDetail"`
-	CreatedAt       time.Time `json:"createdAt"`
-	PhotoUrl        string    `json:"photoUrl"`
+	ProductID       int64   `json:"productId"`
+	ProductName     string  `json:"productName"`
+	ProductType     int64   `json:"productType"`
+	ProductCategory string  `json:"productCategory"`
+	ProductPrice    float64 `json:"productPrice"`
+	ProductDetail   string  `json:"productDetail"`
+	CreatedAt       string  `json:"createdAt"`
+	PhotoUrl        string  `json:"photoUrl"`
 }

+ 9 - 9
route/init.go

@@ -170,12 +170,14 @@ func InitRoute(r *gin.Engine) {
 	task := r.Group("/youngee/b/task")
 	{
 		task.Use(middleware.LoginAuthMiddleware)
+
 		task.POST("/product/findAll", controller.TaskController{}.GetAllProduct) // 关联商品-已有商品展示
 		task.POST("/product/create", controller.TaskController{}.CreateProduct)  // 关联商品-新建商品
 
 		task.POST("/selection/create", controller.TaskController{}.CreateSelection)      // 创建带货任务
 		task.POST("/selection/update", controller.TaskController{}.UpdateSelection)      // 更新带货任务(样品奖励、补充信息)
 		task.POST("/selection/detail", controller.TaskController{}.GetSelectionDetail)   // 电商带货任务预览
+		task.POST("/selection/toReview", controller.TaskController{}.SelectionToReview)  // 电商带货提交审核
 		task.POST("/selection/task/list", controller.TaskController{}.SelectionTaskList) // 电商带货任务列表
 		task.POST("/selection/del", controller.TaskController{}.SelectionDel)            // 删除带货任务
 		task.POST("/selection/check", controller.TaskController{}.CheckSelectionInfo)    // 电商带货任务审核
@@ -184,21 +186,19 @@ func InitRoute(r *gin.Engine) {
 		task.POST("/project/update", controller.TaskController{}.UpdateProject)              // 更新种草任务
 		task.POST("/project/target/update", controller.TaskController{}.UpdateProjectTarget) // 更新定向种草任务
 		task.POST("/project/detail", controller.TaskController{}.GetProjectDetail)           // 品牌种草任务预览
+		task.POST("/project/toReview", controller.TaskController{}.ProjectToReview)          // 种草提交审核
 		task.POST("/project/task/list", controller.TaskController{}.ProjectTaskList)         // 公开种草任务列表
 		task.POST("/project/del", controller.TaskController{}.ProjectDel)                    // 删除种草任务
 
 		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)     // 违约管理——定向任务-已解约
+		task.POST("/default/public/list", controller.TaskController{}.GetPublicDefaultList)              // 违约管理——公开任务列表
+		task.POST("/default/public/talent/list", controller.TaskController{}.GetPublicDefaultTalentList) // 违约管理——公开任务-违约达人列表
+		task.POST("/default/target/list", controller.TaskController{}.GetTargetDefaultList)              // 违约管理——定向任务列表
+		task.POST("/default/target/talent/list", controller.TaskController{}.GetTargetDefaultTalentList) // 违约管理——定向任务-违约达人列表
+		task.POST("/default/talent/cancel", controller.TaskController{}.CancelTalent)                    // 违约管理——达人解约
+		task.POST("/default/talent/cancel/list", controller.TaskController{}.CancelTalentList)           // 违约管理——达人批量解约
 
 	}