2 Commits 56bddb9e0d ... b1d9e3e0da

Autor SHA1 Mensagem Data
  lin-jim-leon b1d9e3e0da [20250509]迁移修改 há 2 meses atrás
  lin-jim-leon d8347000ab [20250508]运营中心修改 há 2 meses atrás
100 ficheiros alterados com 4954 adições e 2962 exclusões
  1. 137 137
      db/Settle.go
  2. 22 22
      db/auto_task.go
  3. 34 51
      db/data.go
  4. 859 859
      db/default.go
  5. 4 4
      db/finance.go
  6. 299 299
      db/finish.go
  7. 43 0
      db/job.go
  8. 40 37
      db/link.go
  9. 666 66
      db/locallife_task.go
  10. 4 4
      db/logistics.go
  11. 3 3
      db/message.go
  12. 34 34
      db/operate.go
  13. 603 108
      db/project_task.go
  14. 274 274
      db/script.go
  15. 10 0
      db/set_serveratio.go
  16. 194 210
      db/sketch.go
  17. 17 5
      db/subaccount.go
  18. 8 8
      db/talent.go
  19. 353 364
      db/task.go
  20. 1 0
      handler/create_job.go
  21. 2 5
      handler/create_sub_account.go
  22. 1 0
      handler/delete_job.go
  23. 1 0
      handler/delete_ks.go
  24. 1 0
      handler/delete_subaccount.go
  25. 53 0
      handler/get_serveraio.go
  26. 1 0
      handler/getauthorization.go
  27. 60 0
      handler/getlocalrecruittime.go
  28. 60 0
      handler/getlocaltalentstatuscountnum.go
  29. 60 0
      handler/getlocaltalentstatusnum.go
  30. 60 0
      handler/getrecruittime.go
  31. 60 0
      handler/getsketchrecordlist.go
  32. 60 0
      handler/gettalentstatuscountnum.go
  33. 60 0
      handler/gettalentstatusnum.go
  34. 60 0
      handler/joblist.go
  35. 52 0
      handler/jobshow.go
  36. 1 0
      handler/kuaishouauthorization.go
  37. 59 89
      handler/link_opinion.go
  38. 1 1
      handler/reject_sketch.go
  39. 1 0
      handler/send_code.go
  40. 1 0
      handler/set_serveratio.go
  41. 59 58
      handler/sketch_info.go
  42. 1 0
      handler/stop_subaccount.go
  43. 3 0
      handler/sub_account_detail.go
  44. 52 0
      handler/subaccshow.go
  45. 1 0
      handler/update_job_info.go
  46. 2 0
      handler/update_subaccount_info.go
  47. 39 15
      model/gorm_model/auto_task.go
  48. 10 2
      model/gorm_model/local_task.go
  49. 4 2
      model/gorm_model/locallife_info.go
  50. 45 50
      model/gorm_model/project.go
  51. 45 48
      model/gorm_model/project_task.go
  52. 2 0
      model/gorm_model/s_project.go
  53. 2 2
      model/gorm_model/supplier.go
  54. 9 8
      model/http_model/LocalPrelinkList.go
  55. 4 6
      model/http_model/PassLocalTaskCoopRequest.go
  56. 4 6
      model/http_model/PassproTaskCoopRequest.go
  57. 9 8
      model/http_model/PreLinkList.go
  58. 2 3
      model/http_model/RefuseproTaskCoopRequest.go
  59. 5 6
      model/http_model/SubAccountDetail.go
  60. 6 5
      model/http_model/data_accept.go
  61. 5 5
      model/http_model/data_localaccept.go
  62. 0 1
      model/http_model/data_opinion.go
  63. 13 0
      model/http_model/get_serveratio.go
  64. 19 0
      model/http_model/getlocalrecruittimerequest.go
  65. 22 0
      model/http_model/getlocaltalentstatuscountrequest.go
  66. 21 0
      model/http_model/getlocaltalentstatusnumrequest.go
  67. 22 16
      model/http_model/getlocaltasklist.go
  68. 19 0
      model/http_model/getrecruittimerequest.go
  69. 18 0
      model/http_model/getsketchrecordlistrequest.go
  70. 22 0
      model/http_model/gettalentstatuscountnum.go
  71. 23 0
      model/http_model/gettalentstatusnumrequest.go
  72. 21 15
      model/http_model/gettasklist.go
  73. 23 0
      model/http_model/joblistrequest.go
  74. 26 0
      model/http_model/jobshow.go
  75. 4 5
      model/http_model/link_accept.go
  76. 4 5
      model/http_model/link_localaccept.go
  77. 0 1
      model/http_model/link_opinion.go
  78. 0 1
      model/http_model/localdata_opinion.go
  79. 0 1
      model/http_model/locallink_opinion.go
  80. 9 8
      model/http_model/localpredatalist.go
  81. 9 8
      model/http_model/localpresketchlistrequest.go
  82. 3 4
      model/http_model/localreject_data.go
  83. 3 4
      model/http_model/localreject_link.go
  84. 0 1
      model/http_model/localsketch_opinion.go
  85. 10 9
      model/http_model/localtaskdatalist.go
  86. 10 9
      model/http_model/localtasklinklist.go
  87. 13 11
      model/http_model/localtasksketchlist.go
  88. 9 8
      model/http_model/predatalist.go
  89. 9 8
      model/http_model/presketchlist.go
  90. 2 3
      model/http_model/refuselocaltaskcooprequest.go
  91. 3 4
      model/http_model/reject_data.go
  92. 3 4
      model/http_model/reject_link.go
  93. 4 5
      model/http_model/sketch_accept.go
  94. 4 5
      model/http_model/sketch_loaclaccept.go
  95. 3 4
      model/http_model/sketch_localreject.go
  96. 0 1
      model/http_model/sketch_opinion.go
  97. 3 4
      model/http_model/sketch_reject.go
  98. 2 4
      model/http_model/sktech_info.go
  99. 20 0
      model/http_model/subaccshowrequest.go
  100. 10 9
      model/http_model/taskdatalist.go

+ 137 - 137
db/Settle.go

@@ -1,137 +1,137 @@
-package db
-
-import (
-	"context"
-	"fmt"
-	"reflect"
-	"strings"
-
-	"youngee_m_api/model/common_model"
-	"youngee_m_api/model/gorm_model"
-	"youngee_m_api/model/http_model"
-	"youngee_m_api/pack"
-	"youngee_m_api/util"
-
-	"github.com/caixw/lib.go/conv"
-	"github.com/sirupsen/logrus"
-)
-
-// GetSpecialTaskSettleList 专项任务-查询上传链接的task list
-func GetSpecialTaskSettleList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.SpecialTaskSettleInfo, int64, error) {
-	db := GetReadDB(ctx)
-	// 查询Task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	var platform_nickname string = ""
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-
-		if tag == "settle_status" {
-			fmt.Printf("Data %+v", value.Interface() == int64(0))
-			if value.Interface() == int64(0) {
-				db = db.Where("task_stage = 15 and settle_status = 1")
-			} else {
-				db = db.Where("task_stage = 15 and settle_status = 2")
-			}
-			continue
-		} else if !util.IsBlank(value) {
-			if tag == "platform_nickname" {
-				platform_nickname = fmt.Sprintf("%v", value.Interface())
-				continue
-			} else if tag == "project_id" {
-				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-			}
-		}
-	}
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	db = db.Model(gorm_model.YoungeeTaskInfo{})
-	// 查询总数
-	var totalTask int64
-	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetTaskSettleList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	db.Order("task_id").Find(&taskInfos)
-
-	// 查询任务id
-	var taskIds []string
-	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
-	}
-
-	// 查询链接
-	db1 := GetReadDB(ctx)
-	// db1 = db1.Debug().Model(gorm_model.YounggeeDataInfo{})
-	var LinkInfos []gorm_model.YounggeeLinkInfo
-	db1 = db1.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id IN ? AND is_submit= 1 AND is_ok = 1", taskIds)
-	err := db1.Find(&LinkInfos).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	LinkMap := make(map[string]gorm_model.YounggeeLinkInfo)
-	for _, LinkInfo := range LinkInfos {
-		LinkMap[LinkInfo.TaskID] = LinkInfo
-	}
-
-	// 查询数据
-	db2 := GetReadDB(ctx)
-	var DataInfos []gorm_model.YounggeeDataInfo
-	db2 = db2.Model(gorm_model.YounggeeDataInfo{}).Where("task_id IN ? AND is_submit= 1 AND is_ok = 1", taskIds)
-	err = db2.Find(&DataInfos).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	DataMap := make(map[string]gorm_model.YounggeeDataInfo)
-	for _, DataInfo := range DataInfos {
-		DataMap[DataInfo.TaskID] = DataInfo
-	}
-	// 查询总数
-	var totalData int64
-	if err := db2.Count(&totalData).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	// 查询该页数据
-	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetTaskSettleList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	var TaskSettles []*http_model.SpecialTaskSettle
-	var taskSettles []*http_model.SpecialTaskSettleInfo
-	var newTaskSettles []*http_model.SpecialTaskSettleInfo
-	for _, taskId := range taskIds {
-		TaskSettle := new(http_model.SpecialTaskSettle)
-		TaskSettle.Talent = taskMap[taskId]
-		TaskSettle.Data = DataMap[taskId]
-		TaskSettle.Link = LinkMap[taskId]
-		TaskSettles = append(TaskSettles, TaskSettle)
-	}
-
-	taskSettles = pack.SpecialTaskSettleToTaskInfo(TaskSettles)
-
-	for _, v := range taskSettles {
-		if platform_nickname == "" {
-			newTaskSettles = append(newTaskSettles, v)
-		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
-			newTaskSettles = append(newTaskSettles, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
-			newTaskSettles = append(newTaskSettles, v)
-		} else {
-			totalTask--
-		}
-	}
-	return newTaskSettles, totalTask, nil
-}
+package db
+
+import (
+	"context"
+	"fmt"
+	"reflect"
+	"strings"
+
+	"youngee_m_api/model/common_model"
+	"youngee_m_api/model/gorm_model"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/pack"
+	"youngee_m_api/util"
+
+	"github.com/caixw/lib.go/conv"
+	"github.com/sirupsen/logrus"
+)
+
+// GetSpecialTaskSettleList 专项任务-查询上传链接的task list
+func GetSpecialTaskSettleList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.SpecialTaskSettleInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platform_nickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+
+		if tag == "settle_status" {
+			fmt.Printf("Data %+v", value.Interface() == int64(0))
+			if value.Interface() == int64(0) {
+				db = db.Where("task_stage = 15 and settle_status = 1")
+			} else {
+				db = db.Where("task_stage = 15 and settle_status = 2")
+			}
+			continue
+		} else if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platform_nickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskSettleList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+
+	// 查询链接
+	db1 := GetReadDB(ctx)
+	// db1 = db1.Debug().Model(gorm_model.YounggeeDataInfo{})
+	var LinkInfos []gorm_model.YounggeeLinkInfo
+	db1 = db1.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id IN ? AND is_submit= 1 AND is_ok = 1", taskIds)
+	err := db1.Find(&LinkInfos).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	LinkMap := make(map[string]gorm_model.YounggeeLinkInfo)
+	for _, LinkInfo := range LinkInfos {
+		LinkMap[LinkInfo.TaskID] = LinkInfo
+	}
+
+	// 查询数据
+	db2 := GetReadDB(ctx)
+	var DataInfos []gorm_model.YounggeeDataInfo
+	db2 = db2.Model(gorm_model.YounggeeDataInfo{}).Where("task_id IN ? AND is_submit= 1 AND is_ok = 1", taskIds)
+	err = db2.Find(&DataInfos).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	DataMap := make(map[string]gorm_model.YounggeeDataInfo)
+	for _, DataInfo := range DataInfos {
+		DataMap[DataInfo.TaskID] = DataInfo
+	}
+	// 查询总数
+	var totalData int64
+	if err := db2.Count(&totalData).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	// 查询该页数据
+	limit := pageSize
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskSettleList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskSettles []*http_model.SpecialTaskSettle
+	var taskSettles []*http_model.SpecialTaskSettleInfo
+	var newTaskSettles []*http_model.SpecialTaskSettleInfo
+	for _, taskId := range taskIds {
+		TaskSettle := new(http_model.SpecialTaskSettle)
+		TaskSettle.Talent = taskMap[taskId]
+		TaskSettle.Data = DataMap[taskId]
+		TaskSettle.Link = LinkMap[taskId]
+		TaskSettles = append(TaskSettles, TaskSettle)
+	}
+
+	taskSettles = pack.SpecialTaskSettleToTaskInfo(TaskSettles)
+
+	for _, v := range taskSettles {
+		if platform_nickname == "" {
+			newTaskSettles = append(newTaskSettles, v)
+		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
+			newTaskSettles = append(newTaskSettles, v)
+		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+			newTaskSettles = append(newTaskSettles, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskSettles, totalTask, nil
+}

+ 22 - 22
db/auto_task.go

@@ -1,22 +1,22 @@
-package db
-
-import (
-	"context"
-	"youngee_m_api/model/gorm_model"
-
-	log "github.com/sirupsen/logrus"
-)
-
-func GetLastAutoTaskID() (int32, error) {
-	db := GetReadDB(context.Background())
-	// 查找最后一个
-	LastTask := gorm_model.InfoAutoTask{}
-	result := db.Last(&LastTask)
-	err := result.Error
-	if err != nil {
-		log.Println("DB GetLastAutoTaskID:", err)
-		return 0, err
-	}
-	//fmt.Printf("auto task %+v %+v", result, LastTask)
-	return LastTask.AutoTaskID, nil
-}
+package db
+
+import (
+	"context"
+	"youngee_m_api/model/gorm_model"
+
+	log "github.com/sirupsen/logrus"
+)
+
+func GetLastAutoTaskID() (int, error) {
+	db := GetReadDB(context.Background())
+	// 查找最后一个
+	LastTask := gorm_model.InfoAutoTask{}
+	result := db.Last(&LastTask)
+	err := result.Error
+	if err != nil {
+		log.Println("DB GetLastAutoTaskID:", err)
+		return 0, err
+	}
+	//fmt.Printf("auto task %+v %+v", result, LastTask)
+	return LastTask.AutoTaskID, nil
+}

+ 34 - 51
db/data.go

@@ -60,8 +60,8 @@ func GetTaskDataList(ctx context.Context, projectID string, pageSize, pageNum in
 	var taskIds []string
 	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
 	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
 	}
 
 	// 查询链接
@@ -150,31 +150,14 @@ func GetTaskDataList(ctx context.Context, projectID string, pageSize, pageNum in
 	return newTaskDatas, totalTask, nil
 }
 
-//// DataOpinion 提交意见
-//func DataOpinion(ctx context.Context, TaskID string, ReviseOpinion string) error {
-//	db := GetReadDB(ctx)
-//	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Data db] Update YounggeeDataInfo error,err:%+v", err)
-//		return err
-//	}
-//	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeTaskInfo{DataStatus: 3}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Data db] Update YoungeeTaskInfo error,err:%+v", err)
-//		return err
-//	}
-//	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeTaskInfo{TaskStage: 13}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Data db] Update YoungeeTaskInfo error,err:%+v", err)
-//		return err
-//	}
-//	return nil
-//}
-
 // DataOpinion 提交意见
-func DataOpinion(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, operatetype int, projectid string) error {
+func DataOpinion(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, projectid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Data db] Update YounggeeDataInfo error,err:%+v", err)
 		return err
@@ -205,26 +188,14 @@ func DataOpinion(ctx context.Context, TaskID string, ReviseOpinion string, opera
 	return nil
 }
 
-//// AcceptData 同意数据-结案
-//func AcceptData(ctx context.Context, TaskIDs []string) error {
-//	db := GetReadDB(ctx)
-//	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now()}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Data db] Update YounggeeDataInfo error,err:%+v", err)
-//		return err
-//	}
-//	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeTaskInfo{DataStatus: 5, TaskStage: 15, CompleteStatus: 2}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Data db] Update YoungeeTaskInfo error,err:%+v", err)
-//		return err
-//	}
-//	return nil
-//}
-
 // AcceptData 同意数据-结案
-func AcceptData(ctx context.Context, TaskIDs []string, operatorid string, operatetype int) error {
+func AcceptData(ctx context.Context, TaskIDs []string, operatorid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Data db] Update YounggeeDataInfo error,err:%+v", err)
 		return err
@@ -233,9 +204,13 @@ func AcceptData(ctx context.Context, TaskIDs []string, operatorid string, operat
 }
 
 // RejectData 拒绝数据-结案
-func LocalRejectData(ctx context.Context, TaskIDs []string, operatorid string, operatetype int, projectid string) error {
+func LocalRejectData(ctx context.Context, TaskIDs []string, operatorid string, projectid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"reject_at": time.Now(), "is_review": 1, "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"reject_at": time.Now(), "is_review": 1, "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Data db] Update YounggeeDataInfo error,err:%+v", err)
 		return err
@@ -311,8 +286,8 @@ func GetSpecialTaskDataList(ctx context.Context, projectID string, pageSize, pag
 	var taskIds []string
 	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
 	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
 	}
 
 	// 查询链接
@@ -399,9 +374,13 @@ func GetSpecialTaskDataList(ctx context.Context, projectID string, pageSize, pag
 }
 
 // RejectData 拒绝数据-结案
-func RejectData(ctx context.Context, TaskIDs []string, operatorid string, operatetype int, projectid string) error {
+func RejectData(ctx context.Context, TaskIDs []string, operatorid string, projectid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"reject_at": time.Now(), "is_review": 1, "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"reject_at": time.Now(), "is_review": 1, "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Data db] Update YounggeeDataInfo error,err:%+v", err)
 		return err
@@ -433,9 +412,13 @@ func RejectData(ctx context.Context, TaskIDs []string, operatorid string, operat
 }
 
 // DataOpinion 提交意见
-func LocalDataOpinion(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, operatetype int, projectid string) error {
+func LocalDataOpinion(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, projectid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Data db] Update YounggeeDataInfo error,err:%+v", err)
 		return err

+ 859 - 859
db/default.go

@@ -1,859 +1,859 @@
-package db
-
-import (
-	"context"
-	"fmt"
-	"reflect"
-	"strings"
-	"time"
-	"youngee_m_api/consts"
-	"youngee_m_api/model/common_model"
-	"youngee_m_api/model/gorm_model"
-	"youngee_m_api/model/http_model"
-	"youngee_m_api/pack"
-	"youngee_m_api/util"
-
-	"github.com/caixw/lib.go/conv"
-	"github.com/sirupsen/logrus"
-	"gorm.io/gorm"
-)
-
-func CountDefaultNum(ctx context.Context) (error, *http_model.CountNumOfDefaultsResponse) {
-	db := GetReadDB(ctx)
-	var contractInfos []gorm_model.YoungeeContractInfo
-	err := db.Debug().Model(gorm_model.YoungeeContractInfo{}).Where("default_status = 3").Find(&contractInfos).Error
-	if err != nil {
-		return err, nil
-	}
-	DraftDefaultNum, ScriptDefaultNum, LinkDefaultNum, DataDefaultNum := 0, 0, 0, 0
-	for _, contractInfo := range contractInfos {
-		if contractInfo.BreakType == 1 {
-			ScriptDefaultNum++
-		} else if contractInfo.BreakType == 2 {
-			DraftDefaultNum++
-		} else if contractInfo.BreakType == 3 {
-			LinkDefaultNum++
-		} else {
-			DataDefaultNum++
-		}
-	}
-	data := &http_model.CountNumOfDefaultsResponse{}
-	data.ScriptDefaultNum = int32(ScriptDefaultNum)
-	data.DraftDefaultNum = int32(DraftDefaultNum)
-	data.LinkDefaultNum = int32(LinkDefaultNum)
-	data.DataDefaultNum = int32(DataDefaultNum)
-	return nil, data
-}
-
-func BreachPending(ctx context.Context, pageSize, pageNum int32, req *http_model.BreachPendingRequest) (*http_model.BreachPendingData, error) {
-	db := GetReadDB(ctx)
-	var contractInfos []*gorm_model.YoungeeContractInfo
-	db = db.Model(gorm_model.YoungeeContractInfo{}).Where("default_status = 3")
-	if req.DefaultType != 0 {
-		db = db.Where("break_type = ?", req.DefaultType)
-	}
-	if req.TaskId != "" {
-		db = db.Debug().Where("task_id = ?", req.TaskId)
-	}
-	var findProjectIds []int64
-	if req.ProjectName != "" {
-		db1 := GetReadDB(ctx)
-		db1.Model(gorm_model.ProjectInfo{}).Select("project_id").Where("project_name = ?", req.ProjectName).Find(&findProjectIds)
-		var findTaskIds []int
-		db2 := GetReadDB(ctx)
-		db2.Model(gorm_model.YoungeeTaskInfo{}).Select("task_id").Where("project_id IN ?", findProjectIds).Find(&findTaskIds)
-		db = db.Where("task_id IN ?", findTaskIds)
-	}
-	// 查询总数
-	var total int64
-	if err := db.Count(&total).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[BreachPending] error query mysql total, err:%+v", err)
-		return nil, err
-	}
-	// 查询该页数据
-	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err := db.Order("terminate_at").Limit(int(limit)).Offset(int(offset)).Find(&contractInfos).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[BreachPending] error query mysql total, err:%+v", err)
-		return nil, err
-	}
-	var taskIds []string
-	for _, contractInfo := range contractInfos {
-		taskIds = append(taskIds, contractInfo.TaskID)
-	}
-	taskIds = util.RemoveStrRepByMap(taskIds)
-	taskIdToProjectMap := make(map[string]string)
-	taskIdToTalentIdMap := make(map[string]string)
-	taskIdToTaskInfoMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	var projectIds []string
-	for _, taskId := range taskIds {
-		db1 := GetReadDB(ctx)
-		var taskInfo gorm_model.YoungeeTaskInfo
-		db1.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Find(&taskInfo)
-		taskIdToProjectMap[taskId] = taskInfo.ProjectId
-		taskIdToTalentIdMap[taskId] = taskInfo.TalentId
-		taskIdToTaskInfoMap[taskId] = taskInfo
-		projectIds = append(projectIds, taskInfo.ProjectId)
-	}
-	projectIds = util.RemoveStrRepByMap(projectIds)
-	var enterpriseIds []string
-	projectIdToProjectInfoMap := make(map[string]gorm_model.ProjectInfo)
-	for _, projectId := range projectIds {
-		db1 := GetReadDB(ctx)
-		projectInfo := gorm_model.ProjectInfo{}
-		db1.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", projectId).Find(&projectInfo)
-		projectIdToProjectInfoMap[projectInfo.ProjectID] = projectInfo
-		enterpriseIds = append(enterpriseIds, projectInfo.EnterpriseID)
-	}
-	enterpriseIds = util.RemoveStrRepByMap(enterpriseIds)
-	enterpriseIdToUserId := make(map[string]int64)
-	var userIds []int64
-	for _, enterpriseId := range enterpriseIds {
-		db1 := GetReadDB(ctx)
-		var userId int64
-		db1.Model(gorm_model.Enterprise{}).Select("user_id").Where("enterprise_id = ?", enterpriseId).Find(&userId)
-		enterpriseIdToUserId[enterpriseId] = userId
-		userIds = append(userIds, userId)
-	}
-	userIdToUserPhone := make(map[int64]string)
-	for _, userId := range userIds {
-		db1 := GetReadDB(ctx)
-		var userPhone string
-		db1.Model(gorm_model.YounggeeUser{}).Select("phone").Where("id = ?", userId).Find(&userPhone)
-		userIdToUserPhone[userId] = userPhone
-	}
-	talentIdToTalentPhoneMap := make(map[string]string)
-	for _, v := range taskIdToTalentIdMap {
-		if len(talentIdToTalentPhoneMap) == 0 {
-			db1 := GetReadDB(ctx)
-			var talentPhoneNumber string
-			db1.Model(gorm_model.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", v).Find(&talentPhoneNumber)
-			talentIdToTalentPhoneMap[v] = talentPhoneNumber
-		}
-		if _, ok := talentIdToTalentPhoneMap[v]; !ok {
-			db1 := GetReadDB(ctx)
-			var talentPhoneNumber string
-			db1.Model(gorm_model.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", v).Find(&talentPhoneNumber)
-			talentIdToTalentPhoneMap[v] = talentPhoneNumber
-		}
-	}
-	taskIdToDefaultInfo := make(map[string]string)
-	if req.DefaultType == 4 {
-		for _, taskId := range taskIds {
-			db1 := GetReadDB(ctx)
-			var link string
-			db1.Debug().Model(gorm_model.YounggeeLinkInfo{}).Select("link_url").Where("task_id = ? AND is_ok = 1", taskId).Find(&link)
-			taskIdToDefaultInfo[taskId] = link
-		}
-	}
-	var BreachPendingPreviews []*http_model.BreachPendingPreview
-	for _, contractInfo := range contractInfos {
-		fmt.Println(contractInfo.TerminateAt)
-		BreachPendingPreview := new(http_model.BreachPendingPreview)
-		BreachPendingPreview.ContractId = int32(contractInfo.ContractID)
-		BreachPendingPreview.ProjectId = taskIdToProjectMap[contractInfo.TaskID]
-		BreachPendingPreview.UserId = projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].EnterpriseID
-		BreachPendingPreview.ProjectName = projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].ProjectName
-		BreachPendingPreview.UserPhone = userIdToUserPhone[enterpriseIdToUserId[projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].EnterpriseID]]
-		BreachPendingPreview.TaskId = contractInfo.TaskID
-		BreachPendingPreview.TalentId = taskIdToTalentIdMap[contractInfo.TaskID]
-		BreachPendingPreview.TalentPhone = talentIdToTalentPhoneMap[taskIdToTalentIdMap[contractInfo.TaskID]]
-		BreachPendingPreview.LinkInfo = taskIdToDefaultInfo[contractInfo.TaskID]
-		BreachPendingPreview.Price = taskIdToTaskInfoMap[contractInfo.TaskID].AllPayment
-		BreachPendingPreview.SettlementAmount = taskIdToTaskInfoMap[contractInfo.TaskID].RealPayment
-		BreachPendingPreview.DefaultAt = conv.MustString(contractInfo.BreakAt, "")[0:19]
-		BreachPendingPreview.TerminateAt = conv.MustString(contractInfo.TerminateAt, "")[0:19]
-		BreachPendingPreviews = append(BreachPendingPreviews, BreachPendingPreview)
-	}
-	var BreachPendingData http_model.BreachPendingData
-	BreachPendingData.BreachPendingPreview = BreachPendingPreviews
-	BreachPendingData.Total = total
-	return &BreachPendingData, nil
-}
-
-func ContractBreach(ctx context.Context, req *http_model.ContractBreachRequest) error {
-	db := GetReadDB(ctx)
-	var breakType int
-	db.Model(gorm_model.YoungeeContractInfo{}).Select("break_type").Where("contract_id IN ?", req.ContractIds).Find(&breakType)
-	t := time.Now()
-	err := db.Debug().Where("contract_id IN ?", req.ContractIds).Updates(&gorm_model.YoungeeContractInfo{DefaultStatus: int(req.DefaultStatus), HandleAt: &t}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[ContractBreach] error query mysql total, err:%+v", err)
-		return err
-	}
-	var taskIds []string
-	db.Model(gorm_model.YoungeeContractInfo{}).Select("task_id").Where("contract_id IN ?", req.ContractIds).Find(&taskIds)
-	for _, taskId := range taskIds {
-		if req.DefaultStatus == 5 {
-			var taskInfo gorm_model.YoungeeTaskInfo
-			var enterpriseId string
-
-			db1 := GetReadDB(ctx)
-			db1.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Find(&taskInfo)
-
-			db2 := GetReadDB(ctx)
-			db2.Model(gorm_model.ProjectInfo{}).Select("enterprise_id").Where("project_id = ?", taskInfo.ProjectId).Find(&enterpriseId)
-
-			db3 := GetReadDB(ctx)
-			err := db3.Model(gorm_model.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Updates(
-				map[string]interface{}{
-					"frozen_balance":    gorm.Expr("frozen_balance - ?", taskInfo.RealPayment),
-					"available_balance": gorm.Expr("available_balance + ?", taskInfo.RealPayment)}).Error
-			if err != nil {
-				logrus.WithContext(ctx).Errorf("[ContractBreach] error update Enterprise, err:%+v", err)
-				return err
-			}
-
-			db = GetReadDB(ctx)
-			db = db.Model(gorm_model.RecruitStrategy{}).Where("project_id = ? and strategy_id = ?", taskInfo.ProjectId, taskInfo.StrategyId)
-			err = db.Updates(map[string]interface{}{
-				"total_offer": gorm.Expr("total_offer + ?", taskInfo.RealPayment)}).Error
-			if err != nil {
-				logrus.WithContext(ctx).Errorf("[ContractBreach] error update RecruitStrategy, err:%+v", err)
-				return err
-			}
-
-			err = CreateTaskLog(context.Background(), taskInfo.TaskId, "解约时间")
-			if err != nil {
-				logrus.WithContext(context.Background()).Errorf("[ContractBreach] call CreateTaskLog error,err:%+v", err)
-			}
-
-			db4 := GetReadDB(ctx)
-			if breakType == 1 {
-				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
-					map[string]interface{}{
-						"cur_default_type":  2,
-						"task_stage":        16,
-						"script_break_rate": 0}).Error
-				taskInfo.ScriptBreakRate = 0
-			} else if breakType == 2 {
-				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
-					map[string]interface{}{
-						"cur_default_type":  4,
-						"task_stage":        16,
-						"sketch_break_rate": 0}).Error
-				taskInfo.SketchBreakRate = 0
-			} else if breakType == 3 {
-				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
-					map[string]interface{}{
-						"cur_default_type": 6,
-						"task_stage":       16,
-						"link_break_rate":  0}).Error
-				taskInfo.LinkBreakRate = 0
-			} else if breakType == 4 {
-				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
-					map[string]interface{}{
-						"cur_default_type": 8,
-						"task_stage":       16,
-						"data_break_rate":  0}).Error
-				taskInfo.DataBreakRate = 0
-			}
-			if err != nil {
-				logrus.WithContext(ctx).Errorf("[ContractBreach] error update YoungeeTaskInfo, err:%+v", err)
-				return err
-			}
-			settleAmount := taskInfo.TaskReward * (1.0 - float64(taskInfo.LinkBreakRate+taskInfo.DataBreakRate+taskInfo.SketchBreakRate+taskInfo.ScriptBreakRate+taskInfo.ErrBreakRate)/100)
-			if settleAmount <= 0 {
-				settleAmount = 0.0
-			}
-			db5 := GetReadDB(ctx)
-			err = db5.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
-				map[string]interface{}{"settle_amount": settleAmount, "withdraw_status": 2, "complete_status": 4, "complete_date": time.Now()}).Error
-			if err != nil {
-				logrus.WithContext(ctx).Errorf("[ContractBreach] error update YoungeeTaskInfo, err:%+v", err)
-				return err
-			}
-
-			err = SetProjectFinish(context.Background(), taskInfo.ProjectId)
-			if err != nil {
-				logrus.WithContext(ctx).Errorf("[ContractBreach] call SetProjectFinish error, err:%+v", err)
-				return err
-			}
-		} else {
-			db4 := GetReadDB(ctx)
-			if breakType == 1 {
-				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(gorm_model.YoungeeTaskInfo{CurDefaultType: 1}).Error
-			} else if breakType == 2 {
-				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(gorm_model.YoungeeTaskInfo{CurDefaultType: 3}).Error
-			} else if breakType == 3 {
-				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(gorm_model.YoungeeTaskInfo{CurDefaultType: 5}).Error
-			} else if breakType == 4 {
-				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(gorm_model.YoungeeTaskInfo{CurDefaultType: 7}).Error
-			}
-			if err != nil {
-				logrus.WithContext(ctx).Errorf("[ContractBreach] error update YoungeeTaskInfo, err:%+v", err)
-				return err
-			}
-		}
-	}
-	if req.DefaultStatus == 5 {
-		err = SetTalentIncome(context.Background(), taskIds)
-		if err != nil {
-			logrus.WithContext(ctx).Errorf("[ContractBreach] call SetTalentIncome error, err:%+v", err)
-			return err
-		}
-	}
-	return nil
-}
-
-func GetSketchInfoByTaskId(ctx context.Context, request *http_model.GetSketchInfoByTaskIdRequest) (*http_model.SketchInfoResponse, error) {
-	db := GetReadDB(ctx)
-	var sketchInfo gorm_model.YounggeeSketchInfo
-	db.Debug().Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? AND is_ok = 1", request.TaskId).Find(&sketchInfo)
-	db2 := GetReadDB(ctx)
-	sketchPhotoInfo := gorm_model.YounggeeSketchPhoto{}
-	db2.Debug().Model(gorm_model.YounggeeSketchPhoto{}).Where("sketch_id = ?", sketchInfo.SketchID).Find(&sketchPhotoInfo)
-	data := new(http_model.SketchInfoResponse)
-	data.Type = int32(sketchPhotoInfo.Symbol)
-	data.PhotoUrl = sketchPhotoInfo.PhotoUrl
-	data.Content = sketchInfo.Content
-	data.Title = sketchInfo.Title
-	return data, nil
-}
-
-func BreachHandled(ctx context.Context, pageSize, pageNum int32, req *http_model.BreachHandledRequest, conditions *common_model.BreachHandledConditions) (*http_model.BreachHandledData, error) {
-	db := GetReadDB(ctx)
-	var contractInfos []*gorm_model.YoungeeContractInfo
-	db = db.Model(gorm_model.YoungeeContractInfo{}).Where("default_status = 4 OR default_status = 5")
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-		if !util.IsBlank(value) {
-			db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-		}
-	}
-	if req.TaskId != "" {
-		db = db.Where("task_id = ?", req.TaskId)
-	}
-	var findProjectIds []string
-	if req.ProjectName != "" {
-		db1 := GetReadDB(ctx)
-		db1.Model(gorm_model.ProjectInfo{}).Select("project_id").Where("project_name = ?", req.ProjectName).Find(&findProjectIds)
-		var findTaskIds []string
-		db2 := GetReadDB(ctx)
-		db2.Model(gorm_model.YoungeeTaskInfo{}).Select("task_id").Where("project_id IN ?", findProjectIds).Find(&findTaskIds)
-		db = db.Where("task_id IN ?", findTaskIds)
-	}
-	// 查询总数
-	var total int64
-	if err := db.Count(&total).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[BreachHandled] error query mysql total, err:%+v", err)
-		return nil, err
-	}
-	// 查询该页数据
-	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err := db.Order("terminate_at").Limit(int(limit)).Offset(int(offset)).Find(&contractInfos).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[BreachHandled] error query mysql total, err:%+v", err)
-		return nil, err
-	}
-
-	var taskIds []string
-	for _, contractInfo := range contractInfos {
-		taskIds = append(taskIds, contractInfo.TaskID)
-	}
-	taskIds = util.RemoveStrRepByMap(taskIds)
-	taskIdToProjectMap := make(map[string]string)
-	taskIdToTalentIdMap := make(map[string]string)
-	taskIdToTaskInfoMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	var projectIds []string
-	for _, taskId := range taskIds {
-		db1 := GetReadDB(ctx)
-		var taskInfo gorm_model.YoungeeTaskInfo
-		db1.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Find(&taskInfo)
-		taskIdToProjectMap[taskId] = taskInfo.ProjectId
-		taskIdToTalentIdMap[taskId] = taskInfo.TalentId
-		taskIdToTaskInfoMap[taskId] = taskInfo
-		projectIds = append(projectIds, taskInfo.ProjectId)
-	}
-	projectIds = util.RemoveStrRepByMap(projectIds)
-	var enterpriseIds []string
-	projectIdToProjectInfoMap := make(map[string]gorm_model.ProjectInfo)
-	for _, projectId := range projectIds {
-		db1 := GetReadDB(ctx)
-		projectInfo := gorm_model.ProjectInfo{}
-		db1.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", projectId).Find(&projectInfo)
-		projectIdToProjectInfoMap[projectInfo.ProjectID] = projectInfo
-		enterpriseIds = append(enterpriseIds, projectInfo.EnterpriseID)
-	}
-	enterpriseIds = util.RemoveStrRepByMap(enterpriseIds)
-	enterpriseIdToUserId := make(map[string]int64)
-	var userIds []int64
-	for _, enterpriseId := range enterpriseIds {
-		db1 := GetReadDB(ctx)
-		var userId int64
-		db1.Model(gorm_model.Enterprise{}).Select("user_id").Where("enterprise_id = ?", enterpriseId).Find(&userId)
-		enterpriseIdToUserId[enterpriseId] = userId
-		userIds = append(userIds, userId)
-	}
-	userIdToUserPhone := make(map[int64]string)
-	for _, userId := range userIds {
-		db1 := GetReadDB(ctx)
-		var userPhone string
-		db1.Model(gorm_model.YounggeeUser{}).Select("phone").Where("id = ?", userId).Find(&userPhone)
-		userIdToUserPhone[userId] = userPhone
-	}
-	talentIdToTalentPhoneMap := make(map[string]string)
-	for _, v := range taskIdToTalentIdMap {
-		if len(talentIdToTalentPhoneMap) == 0 {
-			db1 := GetReadDB(ctx)
-			var talentPhoneNumber string
-			db1.Model(gorm_model.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", v).Find(&talentPhoneNumber)
-			talentIdToTalentPhoneMap[v] = talentPhoneNumber
-		}
-		if _, ok := talentIdToTalentPhoneMap[v]; !ok {
-			db1 := GetReadDB(ctx)
-			var talentPhoneNumber string
-			db1.Model(gorm_model.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", v).Find(&talentPhoneNumber)
-			talentIdToTalentPhoneMap[v] = talentPhoneNumber
-		}
-	}
-	var BreachHandledPreviews []*http_model.BreachHandledPreview
-	for _, contractInfo := range contractInfos {
-		BreachHandledPreview := new(http_model.BreachHandledPreview)
-		BreachHandledPreview.ContractId = int32(contractInfo.ContractID)
-		BreachHandledPreview.ProjectId = taskIdToProjectMap[contractInfo.TaskID]
-		BreachHandledPreview.UserId = projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].EnterpriseID
-		BreachHandledPreview.ProjectName = projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].ProjectName
-		BreachHandledPreview.UserPhone = userIdToUserPhone[enterpriseIdToUserId[projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].EnterpriseID]]
-		BreachHandledPreview.TaskId = contractInfo.TaskID
-		BreachHandledPreview.TalentId = taskIdToTalentIdMap[contractInfo.TaskID]
-		BreachHandledPreview.TalentPhone = talentIdToTalentPhoneMap[taskIdToTalentIdMap[contractInfo.TaskID]]
-		BreachHandledPreview.TerminateReason = consts.GetBreakType(contractInfo.BreakType)
-		BreachHandledPreview.HandleResult = consts.GetHandleResult(contractInfo.DefaultStatus)
-		BreachHandledPreview.HandleAt = conv.MustString(contractInfo.HandleAt, "")[0:19]
-		BreachHandledPreviews = append(BreachHandledPreviews, BreachHandledPreview)
-	}
-	var BreachHandledData http_model.BreachHandledData
-	BreachHandledData.BreachHandledPreview = BreachHandledPreviews
-	BreachHandledData.Total = total
-	return &BreachHandledData, nil
-}
-
-func GetTaskDefaultReviewList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskDefaultReviewInfo, int64, error) {
-	db := GetReadDB(ctx)
-	// 查询Task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	var platform_nickname string = ""
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-		if tag == "default_status" {
-			fmt.Printf("default %+v", value.Interface() == int64(0))
-			if value.Interface() == int64(0) {
-				db = db.Where("cur_default_type = 1")
-			} else if value.Interface() == int64(1) {
-				db = db.Where("cur_default_type = 3")
-			} else if value.Interface() == int64(2) {
-				db = db.Where("cur_default_type = 5")
-			}
-			continue
-		} else if !util.IsBlank(value) {
-			if tag == "platform_nickname" {
-				platform_nickname = fmt.Sprintf("%v", value.Interface())
-				continue
-			} else if tag == "project_id" || tag == "strategy_id" {
-				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-			}
-		}
-	}
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	db = db.Model(gorm_model.YoungeeTaskInfo{})
-	// 查询总数
-	var totalTask int64
-	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	db.Order("task_id").Find(&taskInfos)
-
-	// 查询任务id
-	var taskIds []string
-	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
-	}
-	db1 := GetReadDB(ctx)
-	db1 = db1.Debug().Model(gorm_model.YoungeeContractInfo{})
-
-	var DefaultReviewInfos []gorm_model.YoungeeContractInfo
-	db1 = db1.Model(gorm_model.YoungeeContractInfo{}).Where("task_id IN ? AND (default_status = 1 OR default_status = 4)", taskIds)
-	err := db1.Find(&DefaultReviewInfos).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	DefaultReviewMap := make(map[string]gorm_model.YoungeeContractInfo)
-	for _, DefaultReviewInfo := range DefaultReviewInfos {
-		DefaultReviewMap[DefaultReviewInfo.TaskID] = DefaultReviewInfo
-	}
-	// 查询总数
-	var totalDefaultReview int64
-	if err := db1.Count(&totalDefaultReview).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	// 查询该页数据
-	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
-
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	var TaskDefaultReviews []*http_model.TaskDefaultReview
-	var taskDefaultReviews []*http_model.TaskDefaultReviewInfo
-	var newTaskDefaultReviews []*http_model.TaskDefaultReviewInfo
-	for _, taskId := range taskIds {
-		TaskDefaultReview := new(http_model.TaskDefaultReview)
-		TaskDefaultReview.Talent = taskMap[taskId]
-		TaskDefaultReview.Default = DefaultReviewMap[taskId]
-		TaskDefaultReviews = append(TaskDefaultReviews, TaskDefaultReview)
-	}
-
-	taskDefaultReviews = pack.TaskDefaultReviewToTaskInfo(TaskDefaultReviews)
-
-	for _, v := range taskDefaultReviews {
-		if platform_nickname == "" {
-			newTaskDefaultReviews = append(newTaskDefaultReviews, v)
-		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
-			newTaskDefaultReviews = append(newTaskDefaultReviews, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
-			newTaskDefaultReviews = append(newTaskDefaultReviews, v)
-		} else {
-			totalTask--
-		}
-	}
-	return newTaskDefaultReviews, totalTask, nil
-}
-
-func GetTaskDefaultDataList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskDefaultDataInfo, int64, error) {
-	db := GetReadDB(ctx)
-	// 查询Task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	var platform_nickname string = ""
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-		if tag == "default_status" {
-			if value.Interface() == int64(3) {
-				db = db.Where("cur_default_type = 7")
-			}
-			continue
-		} else if !util.IsBlank(value) {
-			if tag == "platform_nickname" {
-				platform_nickname = fmt.Sprintf("%v", value.Interface())
-				continue
-			} else if tag == "project_id" || tag == "strategy_id" {
-				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-			}
-		}
-	}
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	db = db.Model(gorm_model.YoungeeTaskInfo{})
-	// 查询总数
-	var totalTask int64
-	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	db.Order("task_id").Find(&taskInfos)
-
-	// 查询任务id
-	var taskIds []string
-	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
-	}
-	db1 := GetReadDB(ctx)
-	db1 = db1.Debug().Model(gorm_model.YoungeeContractInfo{})
-
-	var DefaultDataInfos []gorm_model.YoungeeContractInfo
-	db1 = db1.Model(gorm_model.YoungeeContractInfo{}).Where("task_id IN ? AND (default_status = 1 OR default_status = 4)", taskIds)
-	err := db1.Find(&DefaultDataInfos).Error
-	DefaultDataMap := make(map[string]gorm_model.YoungeeContractInfo)
-	for _, DefaultDataInfo := range DefaultDataInfos {
-		DefaultDataMap[DefaultDataInfo.TaskID] = DefaultDataInfo
-	}
-
-	var LinkInfos []gorm_model.YounggeeLinkInfo
-	db2 := GetReadDB(ctx)
-	db2 = db2.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds).Find(&LinkInfos)
-	LinkMap := make(map[string]gorm_model.YounggeeLinkInfo)
-	for _, LinkInfo := range LinkInfos {
-		LinkMap[LinkInfo.TaskID] = LinkInfo
-	}
-
-	// 查询总数
-	var totalDefaultData int64
-	if err := db2.Count(&totalDefaultData).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	// 查询该页数据
-	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
-
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	var TaskDefaultDatas []*http_model.TaskDefaultData
-	var taskDefaultDatas []*http_model.TaskDefaultDataInfo
-	var newTaskDefaultDatas []*http_model.TaskDefaultDataInfo
-	for _, taskId := range taskIds {
-		TaskDefaultData := new(http_model.TaskDefaultData)
-		TaskDefaultData.Talent = taskMap[taskId]
-		TaskDefaultData.Default = DefaultDataMap[taskId]
-		TaskDefaultData.Link = LinkMap[taskId]
-		TaskDefaultDatas = append(TaskDefaultDatas, TaskDefaultData)
-	}
-
-	taskDefaultDatas = pack.TaskDefaultDataToTaskInfo(TaskDefaultDatas)
-
-	for _, v := range taskDefaultDatas {
-		if platform_nickname == "" {
-			newTaskDefaultDatas = append(newTaskDefaultDatas, v)
-		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
-			newTaskDefaultDatas = append(newTaskDefaultDatas, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
-			newTaskDefaultDatas = append(newTaskDefaultDatas, v)
-		} else {
-			totalTask--
-		}
-	}
-	return newTaskDefaultDatas, totalTask, nil
-}
-
-func GetTaskTerminatingList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskTerminatingInfo, int64, error) {
-	db := GetReadDB(ctx)
-	var taskIds1 []string
-	var totalTerminating int64
-	var TerminatingInfos []gorm_model.YoungeeContractInfo
-	db = db.Model(gorm_model.YoungeeContractInfo{})
-	err := db.Where("default_status = 3 AND project_id = ?", projectID).Find(&TerminatingInfos).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetTaskTerminatingList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	TerminatingMap := make(map[string]gorm_model.YoungeeContractInfo)
-	for _, TerminatingInfo := range TerminatingInfos {
-		taskIds1 = append(taskIds1, TerminatingInfo.TaskID)
-		TerminatingMap[TerminatingInfo.TaskID] = TerminatingInfo
-	}
-
-	if err := db.Count(&totalTerminating).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetTaskTerminatingList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	db1 := GetReadDB(ctx)
-	// 查询Task表信息
-	db1 = db1.Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 and task_id in ?", taskIds1)
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	var platform_nickname string = ""
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-		if tag == "default_status" {
-			if value.Interface() == int64(4) {
-				db1 = db1.Where("cur_default_type = 9")
-			}
-			continue
-		} else if !util.IsBlank(value) {
-			if tag == "platform_nickname" {
-				platform_nickname = fmt.Sprintf("%v", value.Interface())
-				continue
-			} else if tag == "project_id" || tag == "strategy_id" {
-				if tag == "strategy_id" {
-					fmt.Println("strategy_id:", value.Interface())
-				}
-				db1 = db1.Debug().Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-			}
-		}
-	}
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	// db1 = db1.Model(gorm_model.YoungeeTaskInfo{})
-	// 查询总数
-	var totalTask int64
-	if err := db1.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetTaskTerminatingList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	db1.Order("task_id").Find(&taskInfos)
-
-	// 查询任务id
-	var taskIds []string
-	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
-	}
-	var misNum int64
-	if totalTerminating > totalTask {
-		misNum = totalTerminating - totalTask
-	} else {
-		misNum = totalTask - totalTerminating
-	}
-	//logrus.Println("totalTerminating,totalTalent,misNum:", totalTerminating, totalTask, misNum)
-
-	// 查询该页数据
-	limit := pageSize + misNum
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err = db1.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
-
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetTaskTerminatingList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	var TaskTerminatings []*http_model.TaskTerminating
-	var taskTerminatings []*http_model.TaskTerminatingInfo
-	var newTaskTerminatings []*http_model.TaskTerminatingInfo
-	for _, taskId := range taskIds {
-		TaskTerminating := new(http_model.TaskTerminating)
-		TaskTerminating.Talent = taskMap[taskId]
-		TaskTerminating.Default = TerminatingMap[taskId]
-		TaskTerminatings = append(TaskTerminatings, TaskTerminating)
-	}
-
-	taskTerminatings = pack.TaskTerminatingToTaskInfo(TaskTerminatings)
-
-	for _, v := range taskTerminatings {
-		if platform_nickname == "" {
-			newTaskTerminatings = append(newTaskTerminatings, v)
-		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
-			newTaskTerminatings = append(newTaskTerminatings, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
-			newTaskTerminatings = append(newTaskTerminatings, v)
-		} else {
-			totalTask--
-		}
-	}
-	return newTaskTerminatings, totalTask, nil
-}
-
-func GetTaskTerminatedList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskTerminatedInfo, int64, error) {
-	db := GetReadDB(ctx)
-	// 查询Task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	var platformNickname string = ""
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-		if tag == "default_status" {
-			fmt.Printf("default %+v", value.Interface() == int64(0))
-			if value.Interface() == int64(5) {
-				db = db.Where("complete_status = 4")
-			}
-			continue
-		} else if !util.IsBlank(value) {
-			if tag == "platform_nickname" {
-				platformNickname = fmt.Sprintf("%v", value.Interface())
-				continue
-			} else if tag == "project_id" || tag == "strategy_id" {
-				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-			}
-		}
-	}
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	db = db.Model(gorm_model.YoungeeTaskInfo{})
-	// 查询总数
-	var totalTask int64
-	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetTaskTerminatedList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	db.Order("task_id").Find(&taskInfos)
-
-	// 查询任务id
-	var taskIds []string
-	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
-	}
-	db1 := GetReadDB(ctx)
-	db1 = db1.Debug().Model(gorm_model.YoungeeContractInfo{})
-	var TerminatedInfos []gorm_model.YoungeeContractInfo
-	db1 = db1.Model(gorm_model.YoungeeContractInfo{}).Where("task_id IN ? AND (default_status = 1 OR default_status = 5)", taskIds)
-	err1 := db1.Find(&TerminatedInfos).Error
-	if err1 != nil {
-		logrus.WithContext(ctx).Errorf("[GetTaskTerminatedList] error query mysql find, err:%+v", err1)
-		return nil, 0, err1
-	}
-	TerminatedMap := make(map[string]gorm_model.YoungeeContractInfo)
-	for _, TerminatedInfo := range TerminatedInfos {
-		fmt.Printf("TerminatedInfo%#v", TerminatedInfo)
-		TerminatedMap[TerminatedInfo.TaskID] = TerminatedInfo
-	}
-	// 查询总数
-	var totalTerminated int64
-	if err := db1.Count(&totalTerminated).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetTaskTerminatedList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	// 查询该页数据
-	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
-
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetTaskTerminatedList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	var TaskTerminateds []*http_model.TaskTerminated
-	var taskTerminateds []*http_model.TaskTerminatedInfo
-	var newTaskTerminateds []*http_model.TaskTerminatedInfo
-	for _, taskId := range taskIds {
-		TaskTerminated := new(http_model.TaskTerminated)
-		TaskTerminated.Talent = taskMap[taskId]
-		TaskTerminated.Default = TerminatedMap[taskId]
-		TaskTerminateds = append(TaskTerminateds, TaskTerminated)
-	}
-
-	taskTerminateds = pack.TaskTerminatedToTaskInfo(TaskTerminateds)
-
-	for _, v := range taskTerminateds {
-		if platformNickname == "" {
-			newTaskTerminateds = append(newTaskTerminateds, v)
-		} else if strings.Contains(v.PlatformNickname, platformNickname) {
-			newTaskTerminateds = append(newTaskTerminateds, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platformNickname) {
-			newTaskTerminateds = append(newTaskTerminateds, v)
-		} else {
-			totalTask--
-		}
-	}
-	return newTaskTerminateds, totalTask, nil
-}
+package db
+
+import (
+	"context"
+	"fmt"
+	"reflect"
+	"strings"
+	"time"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/common_model"
+	"youngee_m_api/model/gorm_model"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/pack"
+	"youngee_m_api/util"
+
+	"github.com/caixw/lib.go/conv"
+	"github.com/sirupsen/logrus"
+	"gorm.io/gorm"
+)
+
+func CountDefaultNum(ctx context.Context) (error, *http_model.CountNumOfDefaultsResponse) {
+	db := GetReadDB(ctx)
+	var contractInfos []gorm_model.YoungeeContractInfo
+	err := db.Debug().Model(gorm_model.YoungeeContractInfo{}).Where("default_status = 3").Find(&contractInfos).Error
+	if err != nil {
+		return err, nil
+	}
+	DraftDefaultNum, ScriptDefaultNum, LinkDefaultNum, DataDefaultNum := 0, 0, 0, 0
+	for _, contractInfo := range contractInfos {
+		if contractInfo.BreakType == 1 {
+			ScriptDefaultNum++
+		} else if contractInfo.BreakType == 2 {
+			DraftDefaultNum++
+		} else if contractInfo.BreakType == 3 {
+			LinkDefaultNum++
+		} else {
+			DataDefaultNum++
+		}
+	}
+	data := &http_model.CountNumOfDefaultsResponse{}
+	data.ScriptDefaultNum = int32(ScriptDefaultNum)
+	data.DraftDefaultNum = int32(DraftDefaultNum)
+	data.LinkDefaultNum = int32(LinkDefaultNum)
+	data.DataDefaultNum = int32(DataDefaultNum)
+	return nil, data
+}
+
+func BreachPending(ctx context.Context, pageSize, pageNum int32, req *http_model.BreachPendingRequest) (*http_model.BreachPendingData, error) {
+	db := GetReadDB(ctx)
+	var contractInfos []*gorm_model.YoungeeContractInfo
+	db = db.Model(gorm_model.YoungeeContractInfo{}).Where("default_status = 3")
+	if req.DefaultType != 0 {
+		db = db.Where("break_type = ?", req.DefaultType)
+	}
+	if req.TaskId != "" {
+		db = db.Debug().Where("task_id = ?", req.TaskId)
+	}
+	var findProjectIds []int64
+	if req.ProjectName != "" {
+		db1 := GetReadDB(ctx)
+		db1.Model(gorm_model.ProjectInfo{}).Select("project_id").Where("project_name = ?", req.ProjectName).Find(&findProjectIds)
+		var findTaskIds []int
+		db2 := GetReadDB(ctx)
+		db2.Model(gorm_model.YoungeeTaskInfo{}).Select("task_id").Where("project_id IN ?", findProjectIds).Find(&findTaskIds)
+		db = db.Where("task_id IN ?", findTaskIds)
+	}
+	// 查询总数
+	var total int64
+	if err := db.Count(&total).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[BreachPending] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	// 查询该页数据
+	limit := pageSize
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err := db.Order("terminate_at").Limit(int(limit)).Offset(int(offset)).Find(&contractInfos).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[BreachPending] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	var taskIds []string
+	for _, contractInfo := range contractInfos {
+		taskIds = append(taskIds, contractInfo.TaskID)
+	}
+	taskIds = util.RemoveStrRepByMap(taskIds)
+	taskIdToProjectMap := make(map[string]string)
+	taskIdToTalentIdMap := make(map[string]string)
+	taskIdToTaskInfoMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	var projectIds []string
+	for _, taskId := range taskIds {
+		db1 := GetReadDB(ctx)
+		var taskInfo gorm_model.YoungeeTaskInfo
+		db1.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Find(&taskInfo)
+		taskIdToProjectMap[taskId] = taskInfo.ProjectID
+		taskIdToTalentIdMap[taskId] = taskInfo.TalentID
+		taskIdToTaskInfoMap[taskId] = taskInfo
+		projectIds = append(projectIds, taskInfo.ProjectID)
+	}
+	projectIds = util.RemoveStrRepByMap(projectIds)
+	var enterpriseIds []string
+	projectIdToProjectInfoMap := make(map[string]gorm_model.ProjectInfo)
+	for _, projectId := range projectIds {
+		db1 := GetReadDB(ctx)
+		projectInfo := gorm_model.ProjectInfo{}
+		db1.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", projectId).Find(&projectInfo)
+		projectIdToProjectInfoMap[projectInfo.ProjectID] = projectInfo
+		enterpriseIds = append(enterpriseIds, projectInfo.EnterpriseID)
+	}
+	enterpriseIds = util.RemoveStrRepByMap(enterpriseIds)
+	enterpriseIdToUserId := make(map[string]int64)
+	var userIds []int64
+	for _, enterpriseId := range enterpriseIds {
+		db1 := GetReadDB(ctx)
+		var userId int64
+		db1.Model(gorm_model.Enterprise{}).Select("user_id").Where("enterprise_id = ?", enterpriseId).Find(&userId)
+		enterpriseIdToUserId[enterpriseId] = userId
+		userIds = append(userIds, userId)
+	}
+	userIdToUserPhone := make(map[int64]string)
+	for _, userId := range userIds {
+		db1 := GetReadDB(ctx)
+		var userPhone string
+		db1.Model(gorm_model.YounggeeUser{}).Select("phone").Where("id = ?", userId).Find(&userPhone)
+		userIdToUserPhone[userId] = userPhone
+	}
+	talentIdToTalentPhoneMap := make(map[string]string)
+	for _, v := range taskIdToTalentIdMap {
+		if len(talentIdToTalentPhoneMap) == 0 {
+			db1 := GetReadDB(ctx)
+			var talentPhoneNumber string
+			db1.Model(gorm_model.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", v).Find(&talentPhoneNumber)
+			talentIdToTalentPhoneMap[v] = talentPhoneNumber
+		}
+		if _, ok := talentIdToTalentPhoneMap[v]; !ok {
+			db1 := GetReadDB(ctx)
+			var talentPhoneNumber string
+			db1.Model(gorm_model.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", v).Find(&talentPhoneNumber)
+			talentIdToTalentPhoneMap[v] = talentPhoneNumber
+		}
+	}
+	taskIdToDefaultInfo := make(map[string]string)
+	if req.DefaultType == 4 {
+		for _, taskId := range taskIds {
+			db1 := GetReadDB(ctx)
+			var link string
+			db1.Debug().Model(gorm_model.YounggeeLinkInfo{}).Select("link_url").Where("task_id = ? AND is_ok = 1", taskId).Find(&link)
+			taskIdToDefaultInfo[taskId] = link
+		}
+	}
+	var BreachPendingPreviews []*http_model.BreachPendingPreview
+	for _, contractInfo := range contractInfos {
+		fmt.Println(contractInfo.TerminateAt)
+		BreachPendingPreview := new(http_model.BreachPendingPreview)
+		BreachPendingPreview.ContractId = int32(contractInfo.ContractID)
+		BreachPendingPreview.ProjectId = taskIdToProjectMap[contractInfo.TaskID]
+		BreachPendingPreview.UserId = projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].EnterpriseID
+		BreachPendingPreview.ProjectName = projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].ProjectName
+		BreachPendingPreview.UserPhone = userIdToUserPhone[enterpriseIdToUserId[projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].EnterpriseID]]
+		BreachPendingPreview.TaskId = contractInfo.TaskID
+		BreachPendingPreview.TalentId = taskIdToTalentIdMap[contractInfo.TaskID]
+		BreachPendingPreview.TalentPhone = talentIdToTalentPhoneMap[taskIdToTalentIdMap[contractInfo.TaskID]]
+		BreachPendingPreview.LinkInfo = taskIdToDefaultInfo[contractInfo.TaskID]
+		BreachPendingPreview.Price = taskIdToTaskInfoMap[contractInfo.TaskID].AllPayment
+		BreachPendingPreview.SettlementAmount = taskIdToTaskInfoMap[contractInfo.TaskID].RealPayment
+		BreachPendingPreview.DefaultAt = conv.MustString(contractInfo.BreakAt, "")[0:19]
+		BreachPendingPreview.TerminateAt = conv.MustString(contractInfo.TerminateAt, "")[0:19]
+		BreachPendingPreviews = append(BreachPendingPreviews, BreachPendingPreview)
+	}
+	var BreachPendingData http_model.BreachPendingData
+	BreachPendingData.BreachPendingPreview = BreachPendingPreviews
+	BreachPendingData.Total = total
+	return &BreachPendingData, nil
+}
+
+func ContractBreach(ctx context.Context, req *http_model.ContractBreachRequest) error {
+	db := GetReadDB(ctx)
+	var breakType int
+	db.Model(gorm_model.YoungeeContractInfo{}).Select("break_type").Where("contract_id IN ?", req.ContractIds).Find(&breakType)
+	t := time.Now()
+	err := db.Debug().Where("contract_id IN ?", req.ContractIds).Updates(&gorm_model.YoungeeContractInfo{DefaultStatus: int(req.DefaultStatus), HandleAt: &t}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[ContractBreach] error query mysql total, err:%+v", err)
+		return err
+	}
+	var taskIds []string
+	db.Model(gorm_model.YoungeeContractInfo{}).Select("task_id").Where("contract_id IN ?", req.ContractIds).Find(&taskIds)
+	for _, taskId := range taskIds {
+		if req.DefaultStatus == 5 {
+			var taskInfo gorm_model.YoungeeTaskInfo
+			var enterpriseId string
+
+			db1 := GetReadDB(ctx)
+			db1.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Find(&taskInfo)
+
+			db2 := GetReadDB(ctx)
+			db2.Model(gorm_model.ProjectInfo{}).Select("enterprise_id").Where("project_id = ?", taskInfo.ProjectID).Find(&enterpriseId)
+
+			db3 := GetReadDB(ctx)
+			err := db3.Model(gorm_model.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Updates(
+				map[string]interface{}{
+					"frozen_balance":    gorm.Expr("frozen_balance - ?", taskInfo.RealPayment),
+					"available_balance": gorm.Expr("available_balance + ?", taskInfo.RealPayment)}).Error
+			if err != nil {
+				logrus.WithContext(ctx).Errorf("[ContractBreach] error update Enterprise, err:%+v", err)
+				return err
+			}
+
+			db = GetReadDB(ctx)
+			db = db.Model(gorm_model.RecruitStrategy{}).Where("project_id = ? and strategy_id = ?", taskInfo.ProjectID, taskInfo.StrategyID)
+			err = db.Updates(map[string]interface{}{
+				"total_offer": gorm.Expr("total_offer + ?", taskInfo.RealPayment)}).Error
+			if err != nil {
+				logrus.WithContext(ctx).Errorf("[ContractBreach] error update RecruitStrategy, err:%+v", err)
+				return err
+			}
+
+			err = CreateTaskLog(context.Background(), taskInfo.TaskID, "解约时间")
+			if err != nil {
+				logrus.WithContext(context.Background()).Errorf("[ContractBreach] call CreateTaskLog error,err:%+v", err)
+			}
+
+			db4 := GetReadDB(ctx)
+			if breakType == 1 {
+				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
+					map[string]interface{}{
+						"cur_default_type":  2,
+						"task_stage":        16,
+						"script_break_rate": 0}).Error
+				taskInfo.ScriptBreakRate = 0
+			} else if breakType == 2 {
+				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
+					map[string]interface{}{
+						"cur_default_type":  4,
+						"task_stage":        16,
+						"sketch_break_rate": 0}).Error
+				taskInfo.SketchBreakRate = 0
+			} else if breakType == 3 {
+				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
+					map[string]interface{}{
+						"cur_default_type": 6,
+						"task_stage":       16,
+						"link_break_rate":  0}).Error
+				taskInfo.LinkBreakRate = 0
+			} else if breakType == 4 {
+				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
+					map[string]interface{}{
+						"cur_default_type": 8,
+						"task_stage":       16,
+						"data_break_rate":  0}).Error
+				taskInfo.DataBreakRate = 0
+			}
+			if err != nil {
+				logrus.WithContext(ctx).Errorf("[ContractBreach] error update YoungeeTaskInfo, err:%+v", err)
+				return err
+			}
+			settleAmount := taskInfo.TaskReward * (1.0 - float64(taskInfo.LinkBreakRate+taskInfo.DataBreakRate+taskInfo.SketchBreakRate+taskInfo.ScriptBreakRate+taskInfo.ErrBreakRate)/100)
+			if settleAmount <= 0 {
+				settleAmount = 0.0
+			}
+			db5 := GetReadDB(ctx)
+			err = db5.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(
+				map[string]interface{}{"settle_amount": settleAmount, "withdraw_status": 2, "complete_status": 4, "complete_date": time.Now()}).Error
+			if err != nil {
+				logrus.WithContext(ctx).Errorf("[ContractBreach] error update YoungeeTaskInfo, err:%+v", err)
+				return err
+			}
+
+			err = SetProjectFinish(context.Background(), taskInfo.ProjectID)
+			if err != nil {
+				logrus.WithContext(ctx).Errorf("[ContractBreach] call SetProjectFinish error, err:%+v", err)
+				return err
+			}
+		} else {
+			db4 := GetReadDB(ctx)
+			if breakType == 1 {
+				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(gorm_model.YoungeeTaskInfo{CurDefaultType: 1}).Error
+			} else if breakType == 2 {
+				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(gorm_model.YoungeeTaskInfo{CurDefaultType: 3}).Error
+			} else if breakType == 3 {
+				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(gorm_model.YoungeeTaskInfo{CurDefaultType: 5}).Error
+			} else if breakType == 4 {
+				err = db4.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Updates(gorm_model.YoungeeTaskInfo{CurDefaultType: 7}).Error
+			}
+			if err != nil {
+				logrus.WithContext(ctx).Errorf("[ContractBreach] error update YoungeeTaskInfo, err:%+v", err)
+				return err
+			}
+		}
+	}
+	if req.DefaultStatus == 5 {
+		err = SetTalentIncome(context.Background(), taskIds)
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[ContractBreach] call SetTalentIncome error, err:%+v", err)
+			return err
+		}
+	}
+	return nil
+}
+
+func GetSketchInfoByTaskId(ctx context.Context, request *http_model.GetSketchInfoByTaskIdRequest) (*http_model.SketchInfoResponse, error) {
+	db := GetReadDB(ctx)
+	var sketchInfo gorm_model.YounggeeSketchInfo
+	db.Debug().Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? AND is_ok = 1", request.TaskId).Find(&sketchInfo)
+	db2 := GetReadDB(ctx)
+	sketchPhotoInfo := gorm_model.YounggeeSketchPhoto{}
+	db2.Debug().Model(gorm_model.YounggeeSketchPhoto{}).Where("sketch_id = ?", sketchInfo.SketchID).Find(&sketchPhotoInfo)
+	data := new(http_model.SketchInfoResponse)
+	data.Type = int32(sketchPhotoInfo.Symbol)
+	data.PhotoUrl = sketchPhotoInfo.PhotoUrl
+	data.Content = sketchInfo.Content
+	data.Title = sketchInfo.Title
+	return data, nil
+}
+
+func BreachHandled(ctx context.Context, pageSize, pageNum int32, req *http_model.BreachHandledRequest, conditions *common_model.BreachHandledConditions) (*http_model.BreachHandledData, error) {
+	db := GetReadDB(ctx)
+	var contractInfos []*gorm_model.YoungeeContractInfo
+	db = db.Model(gorm_model.YoungeeContractInfo{}).Where("default_status = 4 OR default_status = 5")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if !util.IsBlank(value) {
+			db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+		}
+	}
+	if req.TaskId != "" {
+		db = db.Where("task_id = ?", req.TaskId)
+	}
+	var findProjectIds []string
+	if req.ProjectName != "" {
+		db1 := GetReadDB(ctx)
+		db1.Model(gorm_model.ProjectInfo{}).Select("project_id").Where("project_name = ?", req.ProjectName).Find(&findProjectIds)
+		var findTaskIds []string
+		db2 := GetReadDB(ctx)
+		db2.Model(gorm_model.YoungeeTaskInfo{}).Select("task_id").Where("project_id IN ?", findProjectIds).Find(&findTaskIds)
+		db = db.Where("task_id IN ?", findTaskIds)
+	}
+	// 查询总数
+	var total int64
+	if err := db.Count(&total).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[BreachHandled] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	// 查询该页数据
+	limit := pageSize
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err := db.Order("terminate_at").Limit(int(limit)).Offset(int(offset)).Find(&contractInfos).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[BreachHandled] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+
+	var taskIds []string
+	for _, contractInfo := range contractInfos {
+		taskIds = append(taskIds, contractInfo.TaskID)
+	}
+	taskIds = util.RemoveStrRepByMap(taskIds)
+	taskIdToProjectMap := make(map[string]string)
+	taskIdToTalentIdMap := make(map[string]string)
+	taskIdToTaskInfoMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	var projectIds []string
+	for _, taskId := range taskIds {
+		db1 := GetReadDB(ctx)
+		var taskInfo gorm_model.YoungeeTaskInfo
+		db1.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskId).Find(&taskInfo)
+		taskIdToProjectMap[taskId] = taskInfo.ProjectID
+		taskIdToTalentIdMap[taskId] = taskInfo.TalentID
+		taskIdToTaskInfoMap[taskId] = taskInfo
+		projectIds = append(projectIds, taskInfo.ProjectID)
+	}
+	projectIds = util.RemoveStrRepByMap(projectIds)
+	var enterpriseIds []string
+	projectIdToProjectInfoMap := make(map[string]gorm_model.ProjectInfo)
+	for _, projectId := range projectIds {
+		db1 := GetReadDB(ctx)
+		projectInfo := gorm_model.ProjectInfo{}
+		db1.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", projectId).Find(&projectInfo)
+		projectIdToProjectInfoMap[projectInfo.ProjectID] = projectInfo
+		enterpriseIds = append(enterpriseIds, projectInfo.EnterpriseID)
+	}
+	enterpriseIds = util.RemoveStrRepByMap(enterpriseIds)
+	enterpriseIdToUserId := make(map[string]int64)
+	var userIds []int64
+	for _, enterpriseId := range enterpriseIds {
+		db1 := GetReadDB(ctx)
+		var userId int64
+		db1.Model(gorm_model.Enterprise{}).Select("user_id").Where("enterprise_id = ?", enterpriseId).Find(&userId)
+		enterpriseIdToUserId[enterpriseId] = userId
+		userIds = append(userIds, userId)
+	}
+	userIdToUserPhone := make(map[int64]string)
+	for _, userId := range userIds {
+		db1 := GetReadDB(ctx)
+		var userPhone string
+		db1.Model(gorm_model.YounggeeUser{}).Select("phone").Where("id = ?", userId).Find(&userPhone)
+		userIdToUserPhone[userId] = userPhone
+	}
+	talentIdToTalentPhoneMap := make(map[string]string)
+	for _, v := range taskIdToTalentIdMap {
+		if len(talentIdToTalentPhoneMap) == 0 {
+			db1 := GetReadDB(ctx)
+			var talentPhoneNumber string
+			db1.Model(gorm_model.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", v).Find(&talentPhoneNumber)
+			talentIdToTalentPhoneMap[v] = talentPhoneNumber
+		}
+		if _, ok := talentIdToTalentPhoneMap[v]; !ok {
+			db1 := GetReadDB(ctx)
+			var talentPhoneNumber string
+			db1.Model(gorm_model.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", v).Find(&talentPhoneNumber)
+			talentIdToTalentPhoneMap[v] = talentPhoneNumber
+		}
+	}
+	var BreachHandledPreviews []*http_model.BreachHandledPreview
+	for _, contractInfo := range contractInfos {
+		BreachHandledPreview := new(http_model.BreachHandledPreview)
+		BreachHandledPreview.ContractId = int32(contractInfo.ContractID)
+		BreachHandledPreview.ProjectId = taskIdToProjectMap[contractInfo.TaskID]
+		BreachHandledPreview.UserId = projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].EnterpriseID
+		BreachHandledPreview.ProjectName = projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].ProjectName
+		BreachHandledPreview.UserPhone = userIdToUserPhone[enterpriseIdToUserId[projectIdToProjectInfoMap[taskIdToProjectMap[contractInfo.TaskID]].EnterpriseID]]
+		BreachHandledPreview.TaskId = contractInfo.TaskID
+		BreachHandledPreview.TalentId = taskIdToTalentIdMap[contractInfo.TaskID]
+		BreachHandledPreview.TalentPhone = talentIdToTalentPhoneMap[taskIdToTalentIdMap[contractInfo.TaskID]]
+		BreachHandledPreview.TerminateReason = consts.GetBreakType(contractInfo.BreakType)
+		BreachHandledPreview.HandleResult = consts.GetHandleResult(contractInfo.DefaultStatus)
+		BreachHandledPreview.HandleAt = conv.MustString(contractInfo.HandleAt, "")[0:19]
+		BreachHandledPreviews = append(BreachHandledPreviews, BreachHandledPreview)
+	}
+	var BreachHandledData http_model.BreachHandledData
+	BreachHandledData.BreachHandledPreview = BreachHandledPreviews
+	BreachHandledData.Total = total
+	return &BreachHandledData, nil
+}
+
+func GetTaskDefaultReviewList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskDefaultReviewInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platform_nickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if tag == "default_status" {
+			fmt.Printf("default %+v", value.Interface() == int64(0))
+			if value.Interface() == int64(0) {
+				db = db.Where("cur_default_type = 1")
+			} else if value.Interface() == int64(1) {
+				db = db.Where("cur_default_type = 3")
+			} else if value.Interface() == int64(2) {
+				db = db.Where("cur_default_type = 5")
+			}
+			continue
+		} else if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platform_nickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" || tag == "strategy_id" {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+	db1 := GetReadDB(ctx)
+	db1 = db1.Debug().Model(gorm_model.YoungeeContractInfo{})
+
+	var DefaultReviewInfos []gorm_model.YoungeeContractInfo
+	db1 = db1.Model(gorm_model.YoungeeContractInfo{}).Where("task_id IN ? AND (default_status = 1 OR default_status = 4)", taskIds)
+	err := db1.Find(&DefaultReviewInfos).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	DefaultReviewMap := make(map[string]gorm_model.YoungeeContractInfo)
+	for _, DefaultReviewInfo := range DefaultReviewInfos {
+		DefaultReviewMap[DefaultReviewInfo.TaskID] = DefaultReviewInfo
+	}
+	// 查询总数
+	var totalDefaultReview int64
+	if err := db1.Count(&totalDefaultReview).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	// 查询该页数据
+	limit := pageSize
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskDefaultReviews []*http_model.TaskDefaultReview
+	var taskDefaultReviews []*http_model.TaskDefaultReviewInfo
+	var newTaskDefaultReviews []*http_model.TaskDefaultReviewInfo
+	for _, taskId := range taskIds {
+		TaskDefaultReview := new(http_model.TaskDefaultReview)
+		TaskDefaultReview.Talent = taskMap[taskId]
+		TaskDefaultReview.Default = DefaultReviewMap[taskId]
+		TaskDefaultReviews = append(TaskDefaultReviews, TaskDefaultReview)
+	}
+
+	taskDefaultReviews = pack.TaskDefaultReviewToTaskInfo(TaskDefaultReviews)
+
+	for _, v := range taskDefaultReviews {
+		if platform_nickname == "" {
+			newTaskDefaultReviews = append(newTaskDefaultReviews, v)
+		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
+			newTaskDefaultReviews = append(newTaskDefaultReviews, v)
+		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+			newTaskDefaultReviews = append(newTaskDefaultReviews, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskDefaultReviews, totalTask, nil
+}
+
+func GetTaskDefaultDataList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskDefaultDataInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platform_nickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if tag == "default_status" {
+			if value.Interface() == int64(3) {
+				db = db.Where("cur_default_type = 7")
+			}
+			continue
+		} else if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platform_nickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" || tag == "strategy_id" {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+	db1 := GetReadDB(ctx)
+	db1 = db1.Debug().Model(gorm_model.YoungeeContractInfo{})
+
+	var DefaultDataInfos []gorm_model.YoungeeContractInfo
+	db1 = db1.Model(gorm_model.YoungeeContractInfo{}).Where("task_id IN ? AND (default_status = 1 OR default_status = 4)", taskIds)
+	err := db1.Find(&DefaultDataInfos).Error
+	DefaultDataMap := make(map[string]gorm_model.YoungeeContractInfo)
+	for _, DefaultDataInfo := range DefaultDataInfos {
+		DefaultDataMap[DefaultDataInfo.TaskID] = DefaultDataInfo
+	}
+
+	var LinkInfos []gorm_model.YounggeeLinkInfo
+	db2 := GetReadDB(ctx)
+	db2 = db2.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds).Find(&LinkInfos)
+	LinkMap := make(map[string]gorm_model.YounggeeLinkInfo)
+	for _, LinkInfo := range LinkInfos {
+		LinkMap[LinkInfo.TaskID] = LinkInfo
+	}
+
+	// 查询总数
+	var totalDefaultData int64
+	if err := db2.Count(&totalDefaultData).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	// 查询该页数据
+	limit := pageSize
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskDefaultDatas []*http_model.TaskDefaultData
+	var taskDefaultDatas []*http_model.TaskDefaultDataInfo
+	var newTaskDefaultDatas []*http_model.TaskDefaultDataInfo
+	for _, taskId := range taskIds {
+		TaskDefaultData := new(http_model.TaskDefaultData)
+		TaskDefaultData.Talent = taskMap[taskId]
+		TaskDefaultData.Default = DefaultDataMap[taskId]
+		TaskDefaultData.Link = LinkMap[taskId]
+		TaskDefaultDatas = append(TaskDefaultDatas, TaskDefaultData)
+	}
+
+	taskDefaultDatas = pack.TaskDefaultDataToTaskInfo(TaskDefaultDatas)
+
+	for _, v := range taskDefaultDatas {
+		if platform_nickname == "" {
+			newTaskDefaultDatas = append(newTaskDefaultDatas, v)
+		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
+			newTaskDefaultDatas = append(newTaskDefaultDatas, v)
+		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+			newTaskDefaultDatas = append(newTaskDefaultDatas, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskDefaultDatas, totalTask, nil
+}
+
+func GetTaskTerminatingList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskTerminatingInfo, int64, error) {
+	db := GetReadDB(ctx)
+	var taskIds1 []string
+	var totalTerminating int64
+	var TerminatingInfos []gorm_model.YoungeeContractInfo
+	db = db.Model(gorm_model.YoungeeContractInfo{})
+	err := db.Where("default_status = 3 AND project_id = ?", projectID).Find(&TerminatingInfos).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskTerminatingList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	TerminatingMap := make(map[string]gorm_model.YoungeeContractInfo)
+	for _, TerminatingInfo := range TerminatingInfos {
+		taskIds1 = append(taskIds1, TerminatingInfo.TaskID)
+		TerminatingMap[TerminatingInfo.TaskID] = TerminatingInfo
+	}
+
+	if err := db.Count(&totalTerminating).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskTerminatingList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	db1 := GetReadDB(ctx)
+	// 查询Task表信息
+	db1 = db1.Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 and task_id in ?", taskIds1)
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platform_nickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if tag == "default_status" {
+			if value.Interface() == int64(4) {
+				db1 = db1.Where("cur_default_type = 9")
+			}
+			continue
+		} else if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platform_nickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" || tag == "strategy_id" {
+				if tag == "strategy_id" {
+					fmt.Println("strategy_id:", value.Interface())
+				}
+				db1 = db1.Debug().Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	// db1 = db1.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db1.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskTerminatingList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db1.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+	var misNum int64
+	if totalTerminating > totalTask {
+		misNum = totalTerminating - totalTask
+	} else {
+		misNum = totalTask - totalTerminating
+	}
+	//logrus.Println("totalTerminating,totalTalent,misNum:", totalTerminating, totalTask, misNum)
+
+	// 查询该页数据
+	limit := pageSize + misNum
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err = db1.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskTerminatingList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskTerminatings []*http_model.TaskTerminating
+	var taskTerminatings []*http_model.TaskTerminatingInfo
+	var newTaskTerminatings []*http_model.TaskTerminatingInfo
+	for _, taskId := range taskIds {
+		TaskTerminating := new(http_model.TaskTerminating)
+		TaskTerminating.Talent = taskMap[taskId]
+		TaskTerminating.Default = TerminatingMap[taskId]
+		TaskTerminatings = append(TaskTerminatings, TaskTerminating)
+	}
+
+	taskTerminatings = pack.TaskTerminatingToTaskInfo(TaskTerminatings)
+
+	for _, v := range taskTerminatings {
+		if platform_nickname == "" {
+			newTaskTerminatings = append(newTaskTerminatings, v)
+		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
+			newTaskTerminatings = append(newTaskTerminatings, v)
+		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+			newTaskTerminatings = append(newTaskTerminatings, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskTerminatings, totalTask, nil
+}
+
+func GetTaskTerminatedList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskTerminatedInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platformNickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if tag == "default_status" {
+			fmt.Printf("default %+v", value.Interface() == int64(0))
+			if value.Interface() == int64(5) {
+				db = db.Where("complete_status = 4")
+			}
+			continue
+		} else if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platformNickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" || tag == "strategy_id" {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskTerminatedList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+	db1 := GetReadDB(ctx)
+	db1 = db1.Debug().Model(gorm_model.YoungeeContractInfo{})
+	var TerminatedInfos []gorm_model.YoungeeContractInfo
+	db1 = db1.Model(gorm_model.YoungeeContractInfo{}).Where("task_id IN ? AND (default_status = 1 OR default_status = 5)", taskIds)
+	err1 := db1.Find(&TerminatedInfos).Error
+	if err1 != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskTerminatedList] error query mysql find, err:%+v", err1)
+		return nil, 0, err1
+	}
+	TerminatedMap := make(map[string]gorm_model.YoungeeContractInfo)
+	for _, TerminatedInfo := range TerminatedInfos {
+		fmt.Printf("TerminatedInfo%#v", TerminatedInfo)
+		TerminatedMap[TerminatedInfo.TaskID] = TerminatedInfo
+	}
+	// 查询总数
+	var totalTerminated int64
+	if err := db1.Count(&totalTerminated).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskTerminatedList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	// 查询该页数据
+	limit := pageSize
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetTaskTerminatedList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskTerminateds []*http_model.TaskTerminated
+	var taskTerminateds []*http_model.TaskTerminatedInfo
+	var newTaskTerminateds []*http_model.TaskTerminatedInfo
+	for _, taskId := range taskIds {
+		TaskTerminated := new(http_model.TaskTerminated)
+		TaskTerminated.Talent = taskMap[taskId]
+		TaskTerminated.Default = TerminatedMap[taskId]
+		TaskTerminateds = append(TaskTerminateds, TaskTerminated)
+	}
+
+	taskTerminateds = pack.TaskTerminatedToTaskInfo(TaskTerminateds)
+
+	for _, v := range taskTerminateds {
+		if platformNickname == "" {
+			newTaskTerminateds = append(newTaskTerminateds, v)
+		} else if strings.Contains(v.PlatformNickname, platformNickname) {
+			newTaskTerminateds = append(newTaskTerminateds, v)
+		} else if strings.Contains(conv.MustString(v.TaskID, ""), platformNickname) {
+			newTaskTerminateds = append(newTaskTerminateds, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskTerminateds, totalTask, nil
+}

+ 4 - 4
db/finance.go

@@ -773,8 +773,8 @@ func GetSupplierWithdrawList(ctx context.Context, req http_model.GetSupplierWith
 
 	withdrawPointers := make([]*http_model.SupplierWithdrawListResponse, 0, len(withdrawlist))
 	for _, withdraw := range withdrawlist {
-		var supplier gorm_model.YounggeeSupplier
-		err = db.Model(gorm_model.YounggeeSupplier{}).Where("supplier_id = ?", withdraw.SupplierId).First(&supplier).Error
+		var supplier gorm_model.Supplier
+		err = db.Model(gorm_model.Supplier{}).Where("supplier_id = ?", withdraw.SupplierId).First(&supplier).Error
 		if err != nil {
 			return &http_model.SupplierWithdrawListData{}, err
 		}
@@ -892,8 +892,8 @@ func GetSupplierInvoiceList(ctx context.Context, req http_model.GetSupplierInvoi
 
 	invoicePointers := make([]*http_model.SupplierInvoiceListResponse, 0, len(invoicelist))
 	for _, invoice := range invoicelist {
-		var supplier gorm_model.YounggeeSupplier
-		err = db.Model(gorm_model.YounggeeSupplier{}).Where("supplier_id = ?", invoice.SupplierId).First(&supplier).Error
+		var supplier gorm_model.Supplier
+		err = db.Model(gorm_model.Supplier{}).Where("supplier_id = ?", invoice.SupplierId).First(&supplier).Error
 		if err != nil {
 			return &http_model.SupplierInvoiceListData{}, err
 		}

+ 299 - 299
db/finish.go

@@ -1,299 +1,299 @@
-package db
-
-import (
-	"context"
-	"fmt"
-	"github.com/tidwall/gjson"
-	"reflect"
-	"strings"
-	"youngee_m_api/model/common_model"
-	"youngee_m_api/model/gorm_model"
-	"youngee_m_api/model/http_model"
-	"youngee_m_api/pack"
-	"youngee_m_api/util"
-
-	"github.com/caixw/lib.go/conv"
-	"github.com/sirupsen/logrus"
-)
-
-func GetTaskFinishList(ctx context.Context, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskFinishInfo, int64, error) {
-	db := GetReadDB(ctx)
-	// 查询Task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 and task_stage = 15")
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	var platform_nickname string = ""
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-		if !util.IsBlank(value) {
-			if tag == "platform_nickname" {
-				platform_nickname = fmt.Sprintf("%v", value.Interface())
-				continue
-			} else if tag == "project_id" || tag == "strategy_id" {
-				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-			}
-		}
-	}
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	db = db.Model(gorm_model.YoungeeTaskInfo{})
-	// 查询总数
-	var totalTask int64
-	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	db.Order("task_id").Find(&taskInfos)
-
-	// 查询任务id
-	var taskIds []string
-	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
-	}
-	db1 := GetReadDB(ctx)
-	db1 = db1.Debug().Model(gorm_model.YounggeeDataInfo{})
-
-	var DataInfos []gorm_model.YounggeeDataInfo
-	db1 = db1.Model(gorm_model.YounggeeDataInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds)
-	err := db1.Find(&DataInfos).Error
-	DataMap := make(map[string]gorm_model.YounggeeDataInfo)
-	for _, DataInfo := range DataInfos {
-		DataMap[DataInfo.TaskID] = DataInfo
-	}
-
-	var LinkInfos []gorm_model.YounggeeLinkInfo
-	db2 := GetReadDB(ctx)
-	db2 = db2.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds).Find(&LinkInfos)
-	LinkMap := make(map[string]gorm_model.YounggeeLinkInfo)
-	for _, LinkInfo := range LinkInfos {
-		LinkMap[LinkInfo.TaskID] = LinkInfo
-	}
-
-	// 查询总数
-	var totalData int64
-	if err := db2.Count(&totalData).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	var misNum int64
-	if totalData > totalTask {
-		misNum = totalData - totalTask
-	} else {
-		misNum = totalTask - totalData
-	}
-	logrus.Println("totalData,totalTalent,misNum:", totalData, totalTask, misNum)
-
-	// 查询该页数据
-	limit := pageSize + misNum
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
-
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	var TaskFinishs []*http_model.TaskFinish
-	var taskDatas []*http_model.TaskFinishInfo
-	var newTaskFinishs []*http_model.TaskFinishInfo
-	for _, taskId := range taskIds {
-		TaskFinish := new(http_model.TaskFinish)
-		TaskFinish.Talent = taskMap[taskId]
-		TaskFinish.Data = DataMap[taskId]
-		TaskFinish.Link = LinkMap[taskId]
-		TaskFinishs = append(TaskFinishs, TaskFinish)
-	}
-
-	taskDatas = pack.TaskFinishToTaskInfo(TaskFinishs)
-
-	for _, v := range taskDatas {
-		if platform_nickname == "" {
-			newTaskFinishs = append(newTaskFinishs, v)
-		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
-			newTaskFinishs = append(newTaskFinishs, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
-			newTaskFinishs = append(newTaskFinishs, v)
-		} else {
-			totalTask--
-		}
-	}
-	return newTaskFinishs, totalTask, nil
-}
-
-func GetFinishData(ctx context.Context, projectID string) ([]*gorm_model.RecruitStrategy, error) {
-	var finishRecruitStrategy []*gorm_model.RecruitStrategy
-	db := GetReadDB(ctx)
-	// 查询Task表信息
-	err := db.Debug().Model(gorm_model.RecruitStrategy{}).Where("project_id = ?", projectID).Scan(&finishRecruitStrategy).Order("strategy_id").Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, err
-	}
-	return finishRecruitStrategy, nil
-}
-
-func GetSpecialTaskFinishList(ctx context.Context, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.SpecialTaskFinishDataInfo, int64, error) {
-	db := GetReadDB(ctx)
-	// 查询Task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 and task_stage = 15")
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	var platform_nickname string = ""
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-		if !util.IsBlank(value) {
-			if tag == "platform_nickname" {
-				platform_nickname = fmt.Sprintf("%v", value.Interface())
-				continue
-			} else if tag == "project_id" || tag == "strategy_id" {
-				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-			}
-		}
-	}
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	db = db.Model(gorm_model.YoungeeTaskInfo{})
-	// 查询总数
-	var totalTask int64
-	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	db.Order("task_id").Find(&taskInfos)
-
-	// 查询任务id
-	var taskIds []string
-	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
-	}
-	db1 := GetReadDB(ctx)
-	db1 = db1.Debug().Model(gorm_model.YounggeeDataInfo{})
-
-	var DataInfos []gorm_model.YounggeeDataInfo
-	db1 = db1.Model(gorm_model.YounggeeDataInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds)
-	err := db1.Find(&DataInfos).Error
-	DataMap := make(map[string]gorm_model.YounggeeDataInfo)
-	for _, DataInfo := range DataInfos {
-		DataMap[DataInfo.TaskID] = DataInfo
-	}
-
-	var LinkInfos []gorm_model.YounggeeLinkInfo
-	db2 := GetReadDB(ctx)
-	db2 = db2.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds).Find(&LinkInfos)
-	LinkMap := make(map[string]gorm_model.YounggeeLinkInfo)
-	for _, LinkInfo := range LinkInfos {
-		LinkMap[LinkInfo.TaskID] = LinkInfo
-	}
-
-	// 查询总数
-	var totalData int64
-	if err := db2.Count(&totalData).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	var misNum int64
-	if totalData > totalTask {
-		misNum = totalData - totalTask
-	} else {
-		misNum = totalTask - totalData
-	}
-	logrus.Println("totalData,totalTalent,misNum:", totalData, totalTask, misNum)
-
-	// 查询该页数据
-	limit := pageSize + misNum
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
-
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	var TaskFinishs []*http_model.SpecialTaskFinishData
-	var taskDatas []*http_model.SpecialTaskFinishDataInfo
-	var newTaskFinishs []*http_model.SpecialTaskFinishDataInfo
-	for _, taskId := range taskIds {
-		TaskFinish := new(http_model.SpecialTaskFinishData)
-		TaskFinish.Talent = taskMap[taskId]
-		TaskFinish.Data = DataMap[taskId]
-		TaskFinish.Link = LinkMap[taskId]
-		TaskFinishs = append(TaskFinishs, TaskFinish)
-	}
-
-	taskDatas = pack.SpecialTaskFinishDataToTaskInfo(TaskFinishs)
-
-	for _, v := range taskDatas {
-		if platform_nickname == "" {
-			newTaskFinishs = append(newTaskFinishs, v)
-		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
-			newTaskFinishs = append(newTaskFinishs, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
-			newTaskFinishs = append(newTaskFinishs, v)
-		} else {
-			totalTask--
-		}
-	}
-	return newTaskFinishs, totalTask, nil
-}
-
-func GetSpecialFinishDataNumber(ctx context.Context, projectId string) (*http_model.GetSpecialFinishDataData, error) {
-	db := GetReadDB(ctx)
-	// 查询Task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 and task_stage = 15 and project_id = ?", projectId)
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	// 查询总数
-	var totalTask int64
-	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetSpecialFinishDataNumber] error query mysql total, err:%+v", err)
-		return nil, err
-	}
-	db.Order("task_id").Find(&taskInfos)
-
-	// 查询任务id
-	var taskIds []string
-	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
-	}
-	db1 := GetReadDB(ctx)
-	db1 = db1.Debug().Model(gorm_model.YounggeeDataInfo{})
-
-	var DataInfos []gorm_model.YounggeeDataInfo
-	db1 = db1.Model(gorm_model.YounggeeDataInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds)
-	err := db1.Find(&DataInfos).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetSpecialFinishDataNumber] error query mysql total, err:%+v", err)
-		return nil, err
-	}
-	DataMap := make(map[string]gorm_model.YounggeeDataInfo)
-	for _, DataInfo := range DataInfos {
-		DataMap[DataInfo.TaskID] = DataInfo
-	}
-
-	taskFinishData := http_model.GetSpecialFinishDataData{
-		FinishNumber:  totalTask,
-		FanNumber:     0,
-		PlayNumber:    0,
-		LikeNumber:    0,
-		CommentNumber: 0,
-		CollectNumber: 0,
-	}
-	for _, taskId := range taskIds {
-		fans := conv.MustString(gjson.Get(taskMap[taskId].TalentPlatformInfoSnap, "fans_count"), "")
-		taskFinishData.FanNumber += conv.MustInt(fans, 0)
-		taskFinishData.PlayNumber += DataMap[taskId].PlayNumber
-		taskFinishData.LikeNumber += DataMap[taskId].LikeNumber
-		taskFinishData.CollectNumber += DataMap[taskId].CollectNumber
-		taskFinishData.CommentNumber += DataMap[taskId].CommentNumber
-	}
-	return &taskFinishData, nil
-}
+package db
+
+import (
+	"context"
+	"fmt"
+	"github.com/tidwall/gjson"
+	"reflect"
+	"strings"
+	"youngee_m_api/model/common_model"
+	"youngee_m_api/model/gorm_model"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/pack"
+	"youngee_m_api/util"
+
+	"github.com/caixw/lib.go/conv"
+	"github.com/sirupsen/logrus"
+)
+
+func GetTaskFinishList(ctx context.Context, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskFinishInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 and task_stage = 15")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platform_nickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platform_nickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" || tag == "strategy_id" {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+	db1 := GetReadDB(ctx)
+	db1 = db1.Debug().Model(gorm_model.YounggeeDataInfo{})
+
+	var DataInfos []gorm_model.YounggeeDataInfo
+	db1 = db1.Model(gorm_model.YounggeeDataInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds)
+	err := db1.Find(&DataInfos).Error
+	DataMap := make(map[string]gorm_model.YounggeeDataInfo)
+	for _, DataInfo := range DataInfos {
+		DataMap[DataInfo.TaskID] = DataInfo
+	}
+
+	var LinkInfos []gorm_model.YounggeeLinkInfo
+	db2 := GetReadDB(ctx)
+	db2 = db2.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds).Find(&LinkInfos)
+	LinkMap := make(map[string]gorm_model.YounggeeLinkInfo)
+	for _, LinkInfo := range LinkInfos {
+		LinkMap[LinkInfo.TaskID] = LinkInfo
+	}
+
+	// 查询总数
+	var totalData int64
+	if err := db2.Count(&totalData).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	var misNum int64
+	if totalData > totalTask {
+		misNum = totalData - totalTask
+	} else {
+		misNum = totalTask - totalData
+	}
+	logrus.Println("totalData,totalTalent,misNum:", totalData, totalTask, misNum)
+
+	// 查询该页数据
+	limit := pageSize + misNum
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskFinishs []*http_model.TaskFinish
+	var taskDatas []*http_model.TaskFinishInfo
+	var newTaskFinishs []*http_model.TaskFinishInfo
+	for _, taskId := range taskIds {
+		TaskFinish := new(http_model.TaskFinish)
+		TaskFinish.Talent = taskMap[taskId]
+		TaskFinish.Data = DataMap[taskId]
+		TaskFinish.Link = LinkMap[taskId]
+		TaskFinishs = append(TaskFinishs, TaskFinish)
+	}
+
+	taskDatas = pack.TaskFinishToTaskInfo(TaskFinishs)
+
+	for _, v := range taskDatas {
+		if platform_nickname == "" {
+			newTaskFinishs = append(newTaskFinishs, v)
+		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
+			newTaskFinishs = append(newTaskFinishs, v)
+		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+			newTaskFinishs = append(newTaskFinishs, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskFinishs, totalTask, nil
+}
+
+func GetFinishData(ctx context.Context, projectID string) ([]*gorm_model.RecruitStrategy, error) {
+	var finishRecruitStrategy []*gorm_model.RecruitStrategy
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	err := db.Debug().Model(gorm_model.RecruitStrategy{}).Where("project_id = ?", projectID).Scan(&finishRecruitStrategy).Order("strategy_id").Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	return finishRecruitStrategy, nil
+}
+
+func GetSpecialTaskFinishList(ctx context.Context, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.SpecialTaskFinishDataInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 and task_stage = 15")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platform_nickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platform_nickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" || tag == "strategy_id" {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+	db1 := GetReadDB(ctx)
+	db1 = db1.Debug().Model(gorm_model.YounggeeDataInfo{})
+
+	var DataInfos []gorm_model.YounggeeDataInfo
+	db1 = db1.Model(gorm_model.YounggeeDataInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds)
+	err := db1.Find(&DataInfos).Error
+	DataMap := make(map[string]gorm_model.YounggeeDataInfo)
+	for _, DataInfo := range DataInfos {
+		DataMap[DataInfo.TaskID] = DataInfo
+	}
+
+	var LinkInfos []gorm_model.YounggeeLinkInfo
+	db2 := GetReadDB(ctx)
+	db2 = db2.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds).Find(&LinkInfos)
+	LinkMap := make(map[string]gorm_model.YounggeeLinkInfo)
+	for _, LinkInfo := range LinkInfos {
+		LinkMap[LinkInfo.TaskID] = LinkInfo
+	}
+
+	// 查询总数
+	var totalData int64
+	if err := db2.Count(&totalData).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	var misNum int64
+	if totalData > totalTask {
+		misNum = totalData - totalTask
+	} else {
+		misNum = totalTask - totalData
+	}
+	logrus.Println("totalData,totalTalent,misNum:", totalData, totalTask, misNum)
+
+	// 查询该页数据
+	limit := pageSize + misNum
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err = db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskFinishs []*http_model.SpecialTaskFinishData
+	var taskDatas []*http_model.SpecialTaskFinishDataInfo
+	var newTaskFinishs []*http_model.SpecialTaskFinishDataInfo
+	for _, taskId := range taskIds {
+		TaskFinish := new(http_model.SpecialTaskFinishData)
+		TaskFinish.Talent = taskMap[taskId]
+		TaskFinish.Data = DataMap[taskId]
+		TaskFinish.Link = LinkMap[taskId]
+		TaskFinishs = append(TaskFinishs, TaskFinish)
+	}
+
+	taskDatas = pack.SpecialTaskFinishDataToTaskInfo(TaskFinishs)
+
+	for _, v := range taskDatas {
+		if platform_nickname == "" {
+			newTaskFinishs = append(newTaskFinishs, v)
+		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
+			newTaskFinishs = append(newTaskFinishs, v)
+		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+			newTaskFinishs = append(newTaskFinishs, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskFinishs, totalTask, nil
+}
+
+func GetSpecialFinishDataNumber(ctx context.Context, projectId string) (*http_model.GetSpecialFinishDataData, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 and task_stage = 15 and project_id = ?", projectId)
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialFinishDataNumber] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+	db1 := GetReadDB(ctx)
+	db1 = db1.Debug().Model(gorm_model.YounggeeDataInfo{})
+
+	var DataInfos []gorm_model.YounggeeDataInfo
+	db1 = db1.Model(gorm_model.YounggeeDataInfo{}).Where("task_id IN ? AND is_ok = 1", taskIds)
+	err := db1.Find(&DataInfos).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetSpecialFinishDataNumber] error query mysql total, err:%+v", err)
+		return nil, err
+	}
+	DataMap := make(map[string]gorm_model.YounggeeDataInfo)
+	for _, DataInfo := range DataInfos {
+		DataMap[DataInfo.TaskID] = DataInfo
+	}
+
+	taskFinishData := http_model.GetSpecialFinishDataData{
+		FinishNumber:  totalTask,
+		FanNumber:     0,
+		PlayNumber:    0,
+		LikeNumber:    0,
+		CommentNumber: 0,
+		CollectNumber: 0,
+	}
+	for _, taskId := range taskIds {
+		fans := conv.MustString(gjson.Get(taskMap[taskId].TalentPlatformInfoSnap, "fans_count"), "")
+		taskFinishData.FanNumber += conv.MustInt(fans, 0)
+		taskFinishData.PlayNumber += DataMap[taskId].PlayNumber
+		taskFinishData.LikeNumber += DataMap[taskId].LikeNumber
+		taskFinishData.CollectNumber += DataMap[taskId].CollectNumber
+		taskFinishData.CommentNumber += DataMap[taskId].CommentNumber
+	}
+	return &taskFinishData, nil
+}

+ 43 - 0
db/job.go

@@ -128,3 +128,46 @@ func GetJobDetail(ctx context.Context, req *http_model.JobDetailRequest) (*http_
 	}
 	return subaccountInfolist, nil
 }
+
+func GetJobdDetail(ctx context.Context, req *http_model.JobShowRequest) (*http_model.GetJobshowData, error) {
+	db := GetReadDB(ctx)
+	var jobdetail gorm_model.YounggeeJob
+	err := db.Model(gorm_model.YounggeeJob{}).Where("job_id = ?", req.JobId).Find(&jobdetail).Error
+	if err != nil {
+		return nil, err
+	}
+	response := &http_model.GetJobshowData{
+		JobId:                jobdetail.JobId,
+		JobName:              jobdetail.JobName,
+		JobDetail:            jobdetail.JobDetail,
+		WorkshopPermission:   jobdetail.WorkshopPermission,
+		TaskcenterPermission: jobdetail.TaskcenterPermission,
+		SectaskPermisson:     jobdetail.SectaskPermisson,
+		FinancialPermission:  jobdetail.FinancialPermission,
+		UsercenterPermission: jobdetail.UsercenterPermission,
+		OperatePermission:    jobdetail.OperatePermission,
+	}
+	return response, nil
+}
+
+func GetJobList(ctx context.Context, req *http_model.JobListRequest) (*http_model.JobListResponse, error) {
+	db := GetReadDB(ctx)
+	var jobs []gorm_model.YounggeeJob
+	if err := db.Find(&jobs).Error; err != nil {
+		return nil, err
+	}
+
+	response := &http_model.JobListResponse{
+		Jobs: make([]http_model.JoBInfo, 0, len(jobs)), // 预分配空间
+	}
+
+	// 遍历并映射每个 Job
+	for _, job := range jobs {
+		response.Jobs = append(response.Jobs, http_model.JoBInfo{
+			JobId:   job.JobId,
+			JobName: job.JobName,
+		})
+	}
+
+	return response, nil
+}

+ 40 - 37
db/link.go

@@ -61,8 +61,8 @@ func GetTaskLinkList(ctx context.Context, projectID string, pageSize, pageNum in
 	var taskIds []string
 	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
 	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
 	}
 	db1 := GetReadDB(ctx)
 	db1 = db1.Debug().Model(gorm_model.YounggeeLinkInfo{})
@@ -127,31 +127,14 @@ func GetTaskLinkList(ctx context.Context, projectID string, pageSize, pageNum in
 	return newTaskLinks, totalTask, nil
 }
 
-//// LinkOpinion 提交意见
-//func LinkOpinion(ctx context.Context, TaskID string, ReviseOpinion string) error {
-//	db := GetReadDB(ctx)
-//	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Link db] Update YounggeeLinkInfo error,err:%+v", err)
-//		return err
-//	}
-//	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeTaskInfo{LinkStatus: 3}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Link db] Update YoungeeTaskInfo error,err:%+v", err)
-//		return err
-//	}
-//	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeTaskInfo{TaskStage: 11}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Link db] Update YoungeeTaskInfo error,err:%+v", err)
-//		return err
-//	}
-//	return nil
-//}
-
 // LinkOpinion 提交意见
-func LinkOpinion(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, operatetype int, projectid string) error {
+func LinkOpinion(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, projectid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Link db] Update YounggeeLinkInfo error,err:%+v", err)
 		return err
@@ -183,9 +166,13 @@ func LinkOpinion(ctx context.Context, TaskID string, ReviseOpinion string, opera
 }
 
 // LinkOpinion 提交意见
-func LocalLinkOpinion(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, operatetype int, projectid string) error {
+func LocalLinkOpinion(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, projectid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Link db] Update YounggeeLinkInfo error,err:%+v", err)
 		return err
@@ -238,9 +225,13 @@ func LocalLinkOpinion(ctx context.Context, TaskID string, ReviseOpinion string,
 //}
 
 // AcceptLink 同意链接
-func AcceptLink(ctx context.Context, TaskIDs []string, operatorid string, operatetype int, projectid string, isspecial int) error {
+func AcceptLink(ctx context.Context, TaskIDs []string, operatorid string, projectid string, isspecial int) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Link db] Update YounggeeLinkInfo error,err:%+v", err)
 		return err
@@ -295,9 +286,13 @@ func AcceptLink(ctx context.Context, TaskIDs []string, operatorid string, operat
 }
 
 // AcceptLink 同意链接
-func LocalAcceptLink(ctx context.Context, TaskIDs []string, operatorid string, operatetype int, projectid string, isspecial int) error {
+func LocalAcceptLink(ctx context.Context, TaskIDs []string, operatorid string, projectid string, isspecial int) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Link db] Update YounggeeLinkInfo error,err:%+v", err)
 		return err
@@ -353,9 +348,13 @@ func LocalAcceptLink(ctx context.Context, TaskIDs []string, operatorid string, o
 }
 
 // RejectLink 不同意链接
-func RejectLink(ctx context.Context, TaskIDs []string, operatorid string, operatetype int, projectid string) error {
+func RejectLink(ctx context.Context, TaskIDs []string, operatorid string, projectid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 0, "is_review": 1, "reject_at": time.Now(), "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 0, "is_review": 1, "reject_at": time.Now(), "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Link db] Update YounggeeLinkInfo error,err:%+v", err)
 		return err
@@ -387,9 +386,13 @@ func RejectLink(ctx context.Context, TaskIDs []string, operatorid string, operat
 }
 
 // RejectLink 不同意链接
-func LocalRejectLink(ctx context.Context, TaskIDs []string, operatorid string, operatetype int, projectid string) error {
+func LocalRejectLink(ctx context.Context, TaskIDs []string, operatorid string, projectid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 0, "is_review": 1, "reject_at": time.Now(), "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 0, "is_review": 1, "reject_at": time.Now(), "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Link db] Update YounggeeLinkInfo error,err:%+v", err)
 		return err
@@ -464,8 +467,8 @@ func GetSpecialTaskLinkList(ctx context.Context, projectID string, pageSize, pag
 	var taskIds []string
 	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
 	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
 	}
 	db1 := GetReadDB(ctx)
 	db1 = db1.Debug().Model(gorm_model.YounggeeLinkInfo{})

Diff do ficheiro suprimidas por serem muito extensas
+ 666 - 66
db/locallife_task.go


+ 4 - 4
db/logistics.go

@@ -91,8 +91,8 @@ func GetTaskLogisticsList(ctx context.Context, projectID string, pageSize, pageN
 	var taskIds []string
 	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
 	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
 	}
 	db1 := GetReadDB(ctx)
 	db1 = db1.Debug().Model(gorm_model.YoungeeTaskLogistics{})
@@ -194,8 +194,8 @@ func GetSpecialTaskLogisticsList(ctx context.Context, projectID string, pageSize
 	var taskIds []string
 	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
 	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
 	}
 	db1 := GetReadDB(ctx)
 	db1 = db1.Debug().Model(gorm_model.YoungeeTaskLogistics{})

+ 3 - 3
db/message.go

@@ -56,17 +56,17 @@ func CreateMessageByTaskId(ctx context.Context, messageId int, messageType int,
 
 	db1 := GetReadDB(ctx)
 	var projectName string
-	err = db1.Model(gorm_model.ProjectInfo{}).Select("project_name").Where("project_id = ?", taskInfo.ProjectId).Find(&projectName).Error
+	err = db1.Model(gorm_model.ProjectInfo{}).Select("project_name").Where("project_id = ?", taskInfo.ProjectID).Find(&projectName).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[CreateMessageByTask] error read mysql, err:%+v", err)
 		return err
 	}
-	fmt.Printf("project_name: %+v, project_id: %+v\n", projectName, taskInfo.ProjectId)
+	fmt.Printf("project_name: %+v, project_id: %+v\n", projectName, taskInfo.ProjectID)
 	messageInfo := gorm_model.YounggeeMessageInfo{
 		MessageID:   messageId,
 		MessageType: messageType,
 		CreatedAt:   time.Now(),
-		TalentID:    taskInfo.TalentId,
+		TalentID:    taskInfo.TalentID,
 		ProjectName: projectName,
 		IsReaded:    0,
 		IsDeleted:   0,

+ 34 - 34
db/operate.go

@@ -269,10 +269,10 @@ func UpdateAutoTaskTime(ctx context.Context, time int32, num int32) error {
 		autoTaskInfo.CaseClose = time
 	case 7:
 		autoTaskInfo.Invalid = time
-	case 8:
-		autoTaskInfo.DraftDefaultInPic = time
-	case 9:
-		autoTaskInfo.DraftDefaultInMv = time
+	//case 8:
+	//	autoTaskInfo.DraftDefaultInPic = time
+	//case 9:
+	//	autoTaskInfo.DraftDefaultInMv = time
 	case 10:
 		autoTaskInfo.ScriptDefault = time
 	case 11:
@@ -374,12 +374,12 @@ func GetSignInOfflineTask(projectForm int32) error {
 			//fmt.Println("taskInfos", taskInfos)
 			for _, taskInfo := range taskInfos {
 				//fmt.Println("TaskId", taskInfo.TaskId)
-				if _, ok1 := taskIDs[taskInfo.TaskId]; !ok1 {
-					taskIds = append(taskIds, taskInfo.TaskId)
-					taskIDs[taskInfo.TaskId] = taskInfo.ProjectId
+				if _, ok1 := taskIDs[taskInfo.TaskID]; !ok1 {
+					taskIds = append(taskIds, taskInfo.TaskID)
+					taskIDs[taskInfo.TaskID] = taskInfo.ProjectID
 					var logisticInfo gorm_model.YoungeeTaskLogistics
 					db2 := GetReadDB(context.Background())
-					db2.Model(gorm_model.YoungeeTaskLogistics{}).Where("task_id = ?", taskInfo.TaskId).Find(&logisticInfo)
+					db2.Model(gorm_model.YoungeeTaskLogistics{}).Where("task_id = ?", taskInfo.TaskID).Find(&logisticInfo)
 					dd, _ := time.ParseDuration(conv.MustString(t, "") + "h")
 					if logisticInfo.AutoSignAt == nil || logisticInfo.AutoSignAt.IsZero() {
 						var t1 time.Time
@@ -485,11 +485,11 @@ func GetAutoReviewTask(contentType int32) error {
 				//fmt.Println("TaskID:", taskInfo.TaskId)
 				db2 := GetReadDB(context.Background())
 				var scriptInfos gorm_model.YounggeeScriptInfo
-				db2.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id = ? AND is_submit = ? AND is_review = ? ", taskInfo.TaskId, 1, 0).Find(&scriptInfos)
+				db2.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id = ? AND is_submit = ? AND is_review = ? ", taskInfo.TaskID, 1, 0).Find(&scriptInfos)
 				dd, _ := time.ParseDuration(conv.MustString(ReviewInMv, "") + "h")
 				if scriptInfos.AutoAgreeAt.IsZero() {
 					db3 := GetReadDB(context.Background())
-					db3.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id = ?", taskInfo.TaskId).
+					db3.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id = ?", taskInfo.TaskID).
 						Updates(&gorm_model.YounggeeScriptInfo{AutoAgreeAt: scriptInfos.SubmitAt.Add(dd)})
 					fmt.Println("已添加脚本自动审核时间")
 				}
@@ -575,7 +575,7 @@ func GetAutoReviewTask(contentType int32) error {
 			for _, taskInfo := range taskInfos {
 				db2 := GetReadDB(context.Background())
 				var sketchInfo gorm_model.YounggeeSketchInfo
-				db2.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? AND is_submit = ? AND is_review = ? ", taskInfo.TaskId, 1, 0).Find(&sketchInfo)
+				db2.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? AND is_submit = ? AND is_review = ? ", taskInfo.TaskID, 1, 0).Find(&sketchInfo)
 				dd, _ := time.ParseDuration(conv.MustString(ReviewUnlimited, "") + "h")
 				if sketchInfo.AutoAgreeAt.IsZero() {
 					db3 := GetReadDB(context.Background())
@@ -667,7 +667,7 @@ func GetAutoPostReviewTask() error {
 		for _, taskInfo := range taskInfos {
 			db2 := GetReadDB(context.Background())
 			var linkInfos gorm_model.YounggeeLinkInfo
-			db2.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? AND is_submit = ? AND is_review = ? ", taskInfo.TaskId, 1, 0).Find(&linkInfos)
+			db2.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? AND is_submit = ? AND is_review = ? ", taskInfo.TaskID, 1, 0).Find(&linkInfos)
 			dd, _ := time.ParseDuration(conv.MustString(Postreview, "") + "h")
 			if linkInfos.AutoAgreeAt.IsZero() && linkInfos.IsSubmit == 1 {
 				db3 := GetReadDB(context.Background())
@@ -758,7 +758,7 @@ func GetAutoCaseCloseTask() error {
 		for _, taskInfo := range taskInfos {
 			db2 := GetReadDB(context.Background())
 			var dataInfos gorm_model.YounggeeDataInfo
-			db2.Model(gorm_model.YounggeeDataInfo{}).Where("task_id = ? AND is_submit = ? AND is_review = ? ", taskInfo.TaskId, 1, 0).Find(&dataInfos)
+			db2.Model(gorm_model.YounggeeDataInfo{}).Where("task_id = ? AND is_submit = ? AND is_review = ? ", taskInfo.TaskID, 1, 0).Find(&dataInfos)
 			dd, _ := time.ParseDuration(conv.MustString(CaseClose, "") + "h")
 			if dataInfos.AutoAgreeAt.IsZero() && dataInfos.IsSubmit == 1 {
 				db3 := GetReadDB(context.Background())
@@ -841,7 +841,7 @@ func GetAutoCaseCloseTask() error {
 
 		//查询project_info
 		projectInfo := gorm_model.ProjectInfo{}
-		err1 := db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", taskInfo.ProjectId).Scan(&projectInfo).Error
+		err1 := db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", taskInfo.ProjectID).Scan(&projectInfo).Error
 		if err1 != nil {
 			log.Println("DB GetAutoCaseCloseTask error in data:", err)
 			return err1
@@ -854,9 +854,9 @@ func GetAutoCaseCloseTask() error {
 		}
 		t := time.Now()
 		income := gorm_model.YounggeeTalentIncome{
-			TalentID:       taskInfo.TalentId,
-			ProjectID:      taskInfo.ProjectId,
-			SectaskID:      taskInfo.TaskId,
+			TalentID:       taskInfo.TalentID,
+			ProjectID:      taskInfo.ProjectID,
+			SectaskID:      taskInfo.TaskID,
 			BrandName:      productStruct.BrandName,
 			TaskName:       projectInfo.ProjectName,
 			Income:         strconv.FormatFloat(taskInfo.SettleAmount, 'f', 10, 32),
@@ -872,7 +872,7 @@ func GetAutoCaseCloseTask() error {
 		}
 
 		// 更新招募策略
-		db7 = db7.Model(gorm_model.RecruitStrategy{}).Where("project_id = ? and strategy_id = ?", taskInfo.ProjectId, taskInfo.StrategyId)
+		db7 = db7.Model(gorm_model.RecruitStrategy{}).Where("project_id = ? and strategy_id = ?", taskInfo.ProjectID, taskInfo.StrategyID)
 		fansCount, _ := strconv.Atoi(conv.MustString(gjson.Get(taskInfo.TalentPlatformInfoSnap, "fans_count"), ""))
 		err = db7.Updates(map[string]interface{}{
 			"fan_number":     gorm.Expr("fan_number + ?", fansCount),
@@ -1100,17 +1100,17 @@ func GetAutoDraftDefaultInPicTask() error {
 		var taskInfos []gorm_model.YoungeeTaskInfo
 		db1.Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_status = ? AND task_stage = ? AND cur_default_type = ? AND logistics_status = 3", projectId, 2, 9, 0).Find(&taskInfos)
 		for _, taskInfo := range taskInfos {
-			TaskIdToProjectId[taskInfo.TaskId] = projectId
+			TaskIdToProjectId[taskInfo.TaskID] = projectId
 			taskNeedMod := gorm_model.YoungeeTaskInfo{}
 			db2 := GetReadDB(context.Background())
 			// 保存所有满足物流状态为 3 且 初稿上传状态为 1或 3 的任务记录的id
-			db2.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskInfo.TaskId).First(&taskNeedMod)
-			taskIdToFeeFormMap[taskInfo.TaskId] = taskInfo.FeeForm
+			db2.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskInfo.TaskID).First(&taskNeedMod)
+			taskIdToFeeFormMap[taskInfo.TaskID] = taskInfo.FeeForm
 			if taskNeedMod.TaskStage == 9 && taskNeedMod.SketchStatus == 1 {
-				taskNeedModIds = append(taskNeedModIds, taskInfo.TaskId)
+				taskNeedModIds = append(taskNeedModIds, taskInfo.TaskID)
 			}
 			if taskNeedMod.TaskStage == 9 && taskNeedMod.SketchStatus == 3 {
-				submitTaskNeedModIds = append(submitTaskNeedModIds, taskInfo.TaskId)
+				submitTaskNeedModIds = append(submitTaskNeedModIds, taskInfo.TaskID)
 			}
 		}
 	}
@@ -1317,9 +1317,9 @@ func GetAutoDraftDefaultInMvTask() error {
 		db1.Model(&gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_status = ? AND task_stage = ? AND cur_default_type = ? AND logistics_status = 3",
 			projectInfo.ProjectID, 2, 9, 0).Find(&videoTaskInfos)
 		for _, videoTaskInfo := range videoTaskInfos {
-			taskIdToProjectIdMap[videoTaskInfo.TaskId] = projectInfo.ProjectID
-			taskIdToFeeFormMap[videoTaskInfo.TaskId] = videoTaskInfo.FeeForm
-			videoTaskIds = append(videoTaskIds, videoTaskInfo.TaskId)
+			taskIdToProjectIdMap[videoTaskInfo.TaskID] = projectInfo.ProjectID
+			taskIdToFeeFormMap[videoTaskInfo.TaskID] = videoTaskInfo.FeeForm
+			videoTaskIds = append(videoTaskIds, videoTaskInfo.TaskID)
 		}
 	}
 
@@ -1533,9 +1533,9 @@ func GetAutoScriptDefaultTask() error {
 		db1.Model(&gorm_model.YoungeeTaskInfo{}).
 			Where("project_id = ?  AND task_status = ? AND task_stage = ? AND cur_default_type = ? AND logistics_status = 3", projectInfo.ProjectID, 2, 7, 0).Find(&videoTaskInfos)
 		for _, videoTaskInfo := range videoTaskInfos {
-			taskIdToProjectIdMap[videoTaskInfo.TaskId] = projectInfo.ProjectID
-			taskIdToFeeFormMap[videoTaskInfo.TaskId] = videoTaskInfo.FeeForm
-			videoTaskIds = append(videoTaskIds, videoTaskInfo.TaskId)
+			taskIdToProjectIdMap[videoTaskInfo.TaskID] = projectInfo.ProjectID
+			taskIdToFeeFormMap[videoTaskInfo.TaskID] = videoTaskInfo.FeeForm
+			videoTaskIds = append(videoTaskIds, videoTaskInfo.TaskID)
 		}
 	}
 	for _, videoTaskId := range videoTaskIds {
@@ -1824,9 +1824,9 @@ func GetAutoLinkBreachTask() error {
 		db1 := GetReadDB(context.Background())
 		db1.Model(&gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_status = ? AND task_stage = ? AND cur_default_type = ? ", projectInfo.ProjectID, 2, 11, 0).Find(&taskInfos)
 		for _, taskInfo := range taskInfos {
-			taskIdToProjectIdMap[taskInfo.TaskId] = projectInfo.ProjectID
-			taskIds = append(taskIds, taskInfo.TaskId)
-			taskIdToFeeFormMap[taskInfo.TaskId] = taskInfo.FeeForm
+			taskIdToProjectIdMap[taskInfo.TaskID] = projectInfo.ProjectID
+			taskIds = append(taskIds, taskInfo.TaskID)
+			taskIdToFeeFormMap[taskInfo.TaskID] = taskInfo.FeeForm
 		}
 	}
 	// 首次提交链接的任务记录id
@@ -2391,8 +2391,8 @@ func GetHours(ctx context.Context) (*http_model.Hours, error) {
 		return nil, err
 	}
 	Hours := http_model.Hours{}
-	Hours.DraftDefaultInPic = infoAuto.DraftDefaultInPic
-	Hours.DraftDefaultInMv = infoAuto.DraftDefaultInMv
+	//Hours.DraftDefaultInPic = infoAuto.DraftDefaultInPic
+	//Hours.DraftDefaultInMv = infoAuto.DraftDefaultInMv
 	Hours.ScriptDefault = infoAuto.ScriptDefault
 	Hours.Invalid = infoAuto.Invalid
 	Hours.LinkBreach = infoAuto.LinkBreach

Diff do ficheiro suprimidas por serem muito extensas
+ 603 - 108
db/project_task.go


+ 274 - 274
db/script.go

@@ -1,274 +1,274 @@
-package db
-
-import (
-	"context"
-	"fmt"
-	"reflect"
-	"strings"
-	"time"
-	"youngee_m_api/model/common_model"
-	"youngee_m_api/model/gorm_model"
-	"youngee_m_api/model/http_model"
-	"youngee_m_api/pack"
-	"youngee_m_api/util"
-
-	"github.com/caixw/lib.go/conv"
-	"github.com/sirupsen/logrus"
-)
-
-// GetTaskScriptList 查询上传脚本的task list
-func GetTaskScriptList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskScriptInfo, int64, error) {
-	db := GetReadDB(ctx)
-	// 查询Task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 ")
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	var platform_nickname string = ""
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-		if tag == "script_status" {
-			fmt.Printf("script %+v", value.Interface() == int64(2))
-			if value.Interface() == int64(2) {
-				db = db.Where("task_stage = 8")
-			} else {
-				db = db.Where("task_stage > 8 and task_stage <> 16")
-			}
-			continue
-		} else if !util.IsBlank(value) {
-			if tag == "platform_nickname" {
-				platform_nickname = fmt.Sprintf("%v", value.Interface())
-				continue
-			} else if tag == "project_id" || tag == "strategy_id" {
-				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-			}
-		}
-	}
-
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	db = db.Model(gorm_model.YoungeeTaskInfo{})
-	// 查询总数
-	var totalTask int64
-	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	db.Order("task_id").Find(&taskInfos)
-
-	// 查询任务id
-	var taskIds []string
-	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
-	}
-	db1 := GetReadDB(ctx)
-	db1 = db1.Debug().Model(gorm_model.YounggeeScriptInfo{})
-
-	var ScriptInfos []gorm_model.YounggeeScriptInfo
-	db1 = db1.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id IN ? AND is_submit=? ", taskIds, 1)
-	if conditions.ScriptStatus == int64(2) {
-		db1 = db1.Where("is_review = 0").Find(&ScriptInfos)
-	} else {
-		db1 = db1.Where("is_ok = 1").Find(&ScriptInfos)
-	}
-	ScriptMap := make(map[string]gorm_model.YounggeeScriptInfo)
-	for _, ScriptInfo := range ScriptInfos {
-		ScriptMap[ScriptInfo.TaskID] = ScriptInfo
-	}
-	// 查询总数
-	var totalScript int64
-	if err := db1.Count(&totalScript).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	// 查询该页数据
-	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
-
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	var TaskScripts []*http_model.TaskScript
-	var taskScripts []*http_model.TaskScriptInfo
-	var newTaskScripts []*http_model.TaskScriptInfo
-	for _, taskId := range taskIds {
-		TaskScript := new(http_model.TaskScript)
-		TaskScript.Talent = taskMap[taskId]
-		TaskScript.Script = ScriptMap[taskId]
-		TaskScripts = append(TaskScripts, TaskScript)
-	}
-
-	taskScripts = pack.TaskScriptToTaskInfo(TaskScripts)
-
-	for _, v := range taskScripts {
-		if platform_nickname == "" {
-			newTaskScripts = append(newTaskScripts, v)
-		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
-			newTaskScripts = append(newTaskScripts, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
-			newTaskScripts = append(newTaskScripts, v)
-		} else {
-			totalTask--
-		}
-	}
-	return newTaskScripts, totalTask, nil
-}
-
-// ScriptOpinion 提交意见
-func ScriptOpinion(ctx context.Context, TaskID string, ReviseOpinion string) error {
-	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Script db] Update YounggeeScriptInfo error,err:%+v", err)
-		return err
-	}
-	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeTaskInfo{ScriptStatus: 3}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Script db] Update YoungeeTaskInfo error,err:%+v", err)
-		return err
-	}
-	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeTaskInfo{TaskStage: 7}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Script db] Update YoungeeTaskInfo error,err:%+v", err)
-		return err
-	}
-	return nil
-}
-
-// AcceptScript 同意脚本
-func AcceptScript(ctx context.Context, TaskIDs []string) error {
-	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now()}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Script db] Update YounggeeScriptInfo error,err:%+v", err)
-		return err
-	}
-	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeTaskInfo{ScriptStatus: 5}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Script db] Update YoungeeTaskInfo error,err:%+v", err)
-		return err
-	}
-	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeTaskInfo{TaskStage: 9}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Script db] Update YoungeeTaskInfo error,err:%+v", err)
-		return err
-	}
-	return nil
-}
-
-// GetSpecialTaskScriptList 专项任务-查询上传脚本的task list
-func GetSpecialTaskScriptList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.SpecialTaskScriptInfo, int64, error) {
-	db := GetReadDB(ctx)
-	// 查询Task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	var platform_nickname string = ""
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-		if tag == "script_status" {
-			fmt.Printf("script %+v", value.Interface() == int64(2))
-			if value.Interface() == int64(2) {
-				db = db.Where("task_stage = 8")
-			} else {
-				db = db.Where("task_stage > 8 and task_stage <> 16")
-			}
-			continue
-		} else if !util.IsBlank(value) {
-			if tag == "platform_nickname" {
-				platform_nickname = fmt.Sprintf("%v", value.Interface())
-				continue
-			} else if tag == "project_id" {
-				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-			}
-		}
-	}
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	db = db.Model(gorm_model.YoungeeTaskInfo{})
-	// 查询总数
-	var totalTask int64
-	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	db.Order("task_id").Find(&taskInfos)
-
-	// 查询任务id
-	var taskIds []string
-	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
-	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
-	}
-	db1 := GetReadDB(ctx)
-	db1 = db1.Debug().Model(gorm_model.YounggeeScriptInfo{})
-
-	var ScriptInfos []gorm_model.YounggeeScriptInfo
-	db1 = db1.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id IN ? AND is_submit=? ", taskIds, 1)
-	if conditions.ScriptStatus == int64(2) {
-		db1 = db1.Where("is_review = 0").Find(&ScriptInfos)
-	} else {
-		db1 = db1.Where("is_ok = 1").Find(&ScriptInfos)
-	}
-	ScriptMap := make(map[string]gorm_model.YounggeeScriptInfo)
-	for _, ScriptInfo := range ScriptInfos {
-		ScriptMap[ScriptInfo.TaskID] = ScriptInfo
-	}
-	// 查询总数
-	var totalScript int64
-	if err := db1.Count(&totalScript).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	var misNum int64
-	if totalScript > totalTask {
-		misNum = totalScript - totalTask
-	} else {
-		misNum = totalTask - totalScript
-	}
-	//logrus.Println("totalScript,totalTalent,misNum:", totalScript, totalTask, misNum)
-
-	// 查询该页数据
-	limit := pageSize + misNum
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
-
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-
-	var TaskScripts []*http_model.SpecialTaskScript
-	var taskScripts []*http_model.SpecialTaskScriptInfo
-	var newTaskScripts []*http_model.SpecialTaskScriptInfo
-	for _, taskId := range taskIds {
-		TaskScript := new(http_model.SpecialTaskScript)
-		TaskScript.Talent = taskMap[taskId]
-		TaskScript.Script = ScriptMap[taskId]
-		TaskScripts = append(TaskScripts, TaskScript)
-	}
-
-	taskScripts = pack.SpecialTaskScriptToTaskInfo(TaskScripts)
-
-	for _, v := range taskScripts {
-		if platform_nickname == "" {
-			newTaskScripts = append(newTaskScripts, v)
-		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
-			newTaskScripts = append(newTaskScripts, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
-			newTaskScripts = append(newTaskScripts, v)
-		} else {
-			totalTask--
-		}
-	}
-	return newTaskScripts, totalTask, nil
-}
+package db
+
+import (
+	"context"
+	"fmt"
+	"reflect"
+	"strings"
+	"time"
+	"youngee_m_api/model/common_model"
+	"youngee_m_api/model/gorm_model"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/pack"
+	"youngee_m_api/util"
+
+	"github.com/caixw/lib.go/conv"
+	"github.com/sirupsen/logrus"
+)
+
+// GetTaskScriptList 查询上传脚本的task list
+func GetTaskScriptList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.TaskScriptInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2 ")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platform_nickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if tag == "script_status" {
+			fmt.Printf("script %+v", value.Interface() == int64(2))
+			if value.Interface() == int64(2) {
+				db = db.Where("task_stage = 8")
+			} else {
+				db = db.Where("task_stage > 8 and task_stage <> 16")
+			}
+			continue
+		} else if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platform_nickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" || tag == "strategy_id" {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+	db1 := GetReadDB(ctx)
+	db1 = db1.Debug().Model(gorm_model.YounggeeScriptInfo{})
+
+	var ScriptInfos []gorm_model.YounggeeScriptInfo
+	db1 = db1.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id IN ? AND is_submit=? ", taskIds, 1)
+	if conditions.ScriptStatus == int64(2) {
+		db1 = db1.Where("is_review = 0").Find(&ScriptInfos)
+	} else {
+		db1 = db1.Where("is_ok = 1").Find(&ScriptInfos)
+	}
+	ScriptMap := make(map[string]gorm_model.YounggeeScriptInfo)
+	for _, ScriptInfo := range ScriptInfos {
+		ScriptMap[ScriptInfo.TaskID] = ScriptInfo
+	}
+	// 查询总数
+	var totalScript int64
+	if err := db1.Count(&totalScript).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	// 查询该页数据
+	limit := pageSize
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskScripts []*http_model.TaskScript
+	var taskScripts []*http_model.TaskScriptInfo
+	var newTaskScripts []*http_model.TaskScriptInfo
+	for _, taskId := range taskIds {
+		TaskScript := new(http_model.TaskScript)
+		TaskScript.Talent = taskMap[taskId]
+		TaskScript.Script = ScriptMap[taskId]
+		TaskScripts = append(TaskScripts, TaskScript)
+	}
+
+	taskScripts = pack.TaskScriptToTaskInfo(TaskScripts)
+
+	for _, v := range taskScripts {
+		if platform_nickname == "" {
+			newTaskScripts = append(newTaskScripts, v)
+		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
+			newTaskScripts = append(newTaskScripts, v)
+		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+			newTaskScripts = append(newTaskScripts, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskScripts, totalTask, nil
+}
+
+// ScriptOpinion 提交意见
+func ScriptOpinion(ctx context.Context, TaskID string, ReviseOpinion string) error {
+	db := GetReadDB(ctx)
+	err := db.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Script db] Update YounggeeScriptInfo error,err:%+v", err)
+		return err
+	}
+	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeTaskInfo{ScriptStatus: 3}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Script db] Update YoungeeTaskInfo error,err:%+v", err)
+		return err
+	}
+	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeTaskInfo{TaskStage: 7}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Script db] Update YoungeeTaskInfo error,err:%+v", err)
+		return err
+	}
+	return nil
+}
+
+// AcceptScript 同意脚本
+func AcceptScript(ctx context.Context, TaskIDs []string) error {
+	db := GetReadDB(ctx)
+	err := db.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id in ?  and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now()}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Script db] Update YounggeeScriptInfo error,err:%+v", err)
+		return err
+	}
+	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeTaskInfo{ScriptStatus: 5}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Script db] Update YoungeeTaskInfo error,err:%+v", err)
+		return err
+	}
+	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeTaskInfo{TaskStage: 9}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Script db] Update YoungeeTaskInfo error,err:%+v", err)
+		return err
+	}
+	return nil
+}
+
+// GetSpecialTaskScriptList 专项任务-查询上传脚本的task list
+func GetSpecialTaskScriptList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.SpecialTaskScriptInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询Task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_status = 2")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platform_nickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if tag == "script_status" {
+			fmt.Printf("script %+v", value.Interface() == int64(2))
+			if value.Interface() == int64(2) {
+				db = db.Where("task_stage = 8")
+			} else {
+				db = db.Where("task_stage > 8 and task_stage <> 16")
+			}
+			continue
+		} else if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platform_nickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	// 查询任务id
+	var taskIds []string
+	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
+	for _, taskInfo := range taskInfos {
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
+	}
+	db1 := GetReadDB(ctx)
+	db1 = db1.Debug().Model(gorm_model.YounggeeScriptInfo{})
+
+	var ScriptInfos []gorm_model.YounggeeScriptInfo
+	db1 = db1.Model(gorm_model.YounggeeScriptInfo{}).Where("task_id IN ? AND is_submit=? ", taskIds, 1)
+	if conditions.ScriptStatus == int64(2) {
+		db1 = db1.Where("is_review = 0").Find(&ScriptInfos)
+	} else {
+		db1 = db1.Where("is_ok = 1").Find(&ScriptInfos)
+	}
+	ScriptMap := make(map[string]gorm_model.YounggeeScriptInfo)
+	for _, ScriptInfo := range ScriptInfos {
+		ScriptMap[ScriptInfo.TaskID] = ScriptInfo
+	}
+	// 查询总数
+	var totalScript int64
+	if err := db1.Count(&totalScript).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	var misNum int64
+	if totalScript > totalTask {
+		misNum = totalScript - totalTask
+	} else {
+		misNum = totalTask - totalScript
+	}
+	//logrus.Println("totalScript,totalTalent,misNum:", totalScript, totalTask, misNum)
+
+	// 查询该页数据
+	limit := pageSize + misNum
+	offset := pageSize * pageNum // assert pageNum start with 0
+	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+
+	var TaskScripts []*http_model.SpecialTaskScript
+	var taskScripts []*http_model.SpecialTaskScriptInfo
+	var newTaskScripts []*http_model.SpecialTaskScriptInfo
+	for _, taskId := range taskIds {
+		TaskScript := new(http_model.SpecialTaskScript)
+		TaskScript.Talent = taskMap[taskId]
+		TaskScript.Script = ScriptMap[taskId]
+		TaskScripts = append(TaskScripts, TaskScript)
+	}
+
+	taskScripts = pack.SpecialTaskScriptToTaskInfo(TaskScripts)
+
+	for _, v := range taskScripts {
+		if platform_nickname == "" {
+			newTaskScripts = append(newTaskScripts, v)
+		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
+			newTaskScripts = append(newTaskScripts, v)
+		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+			newTaskScripts = append(newTaskScripts, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskScripts, totalTask, nil
+}

+ 10 - 0
db/set_serveratio.go

@@ -14,3 +14,13 @@ func SetServeratio(ctx context.Context, req *http_model.SetServeratioRequest) er
 	}
 	return nil
 }
+
+func GetServeratio(ctx context.Context, req *http_model.GetServeratioRequest) (*http_model.GetServeratioResponse, error) {
+	db := GetReadDB(ctx)
+	var serve_ratio gorm_model.YounggeeServeRatio
+	err := db.First(&serve_ratio).Error
+	if err != nil {
+		return nil, err
+	}
+	return &http_model.GetServeratioResponse{Ratio: serve_ratio.Ratio}, nil
+}

+ 194 - 210
db/sketch.go

@@ -13,7 +13,7 @@ import (
 	"youngee_m_api/pack"
 	"youngee_m_api/util"
 
-	"github.com/caixw/lib.go/conv"
+	"github.com/issue9/conv"
 	"github.com/sirupsen/logrus"
 )
 
@@ -61,8 +61,8 @@ func GetTaskSketchList(ctx context.Context, projectID string, pageSize, pageNum
 	var taskIds []string
 	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
 	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
 	}
 	db1 := GetReadDB(ctx)
 	db1 = db1.Debug().Model(gorm_model.YounggeeSketchInfo{})
@@ -74,7 +74,7 @@ func GetTaskSketchList(ctx context.Context, projectID string, pageSize, pageNum
 	} else {
 		db1 = db1.Where("is_ok = 1").Find(&SketchInfos)
 	}
-	//fmt.Printf("初稿查询:%+v", SketchInfos)
+	fmt.Printf("初稿查询:%+v", SketchInfos)
 	SketchMap := make(map[string]gorm_model.YounggeeSketchInfo)
 	for _, SketchInfo := range SketchInfos {
 		SketchMap[SketchInfo.TaskID] = SketchInfo
@@ -91,7 +91,7 @@ func GetTaskSketchList(ctx context.Context, projectID string, pageSize, pageNum
 	} else {
 		misNum = totalTask - totalSketch
 	}
-	//logrus.Println("totalSketch,totalTalent,misNum:", totalSketch, totalTask, misNum)
+	logrus.Println("totalSketch,totalTalent,misNum:", totalSketch, totalTask, misNum)
 
 	// 查询该页数据
 	limit := pageSize + misNum
@@ -121,7 +121,7 @@ func GetTaskSketchList(ctx context.Context, projectID string, pageSize, pageNum
 			newTaskSketches = append(newTaskSketches, v)
 		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
 			newTaskSketches = append(newTaskSketches, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+		} else if strings.Contains(conv.MustString(v.TaskID), platform_nickname) {
 			newTaskSketches = append(newTaskSketches, v)
 		} else {
 			totalTask--
@@ -130,33 +130,14 @@ func GetTaskSketchList(ctx context.Context, projectID string, pageSize, pageNum
 	return newTaskSketches, totalTask, nil
 }
 
-//// SketchOption 提交意见
-//func SketchOption(ctx context.Context, TaskID string, ReviseOpinion string) error {
-//	db := GetReadDB(ctx)
-//	//fmt.Printf("初稿意见 %d %+v", TaskID, ReviseOpinion)
-//	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Sketch db] call RevisieOption error,err:%+v", err)
-//		return err
-//	}
-//	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeTaskInfo{SketchStatus: 3}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
-//		return err
-//	}
-//	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeTaskInfo{TaskStage: 9}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
-//		return err
-//	}
-//	return nil
-//}
-
 // SketchOption 提交意见
-func SketchOption(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, operatetype int, projectid string) error {
+func SketchOption(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, projectid string) error {
 	db := GetReadDB(ctx)
-	fmt.Printf("初稿意见 %d %+v", TaskID, ReviseOpinion)
-	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
+	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Sketch db] call RevisieOption error,err:%+v", err)
 		return err
@@ -188,32 +169,53 @@ func SketchOption(ctx context.Context, TaskID string, ReviseOpinion string, oper
 	return nil
 }
 
-//// AcceptSketch 同意初稿
-//func AcceptSketch(ctx context.Context, TaskIDs []string) error {
-//	db := GetReadDB(ctx)
-//	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now()}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeSketchInfo error,err:%+v", err)
-//		return err
-//	}
-//	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeTaskInfo{SketchStatus: 5}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
-//		return err
-//	}
-//
-//	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeTaskInfo{TaskStage: 11}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
-//		return err
-//	}
-//	return nil
-//}
+// SketchOption 提交意见
+func LocalSketchOption(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, projectid string) error {
+	db := GetReadDB(ctx)
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
+	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": opid, "b_operator_type": optype}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] call RevisieOption error,err:%+v", err)
+		return err
+	}
+	var project gorm_model.YounggeeLocalLifeInfo
+	err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ?", projectid).Find(&project).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Find ProjectInfo error,err:%+v", err)
+		return err
+	}
+
+	var draft_default gorm_model.InfoAutoTask
+	err = db.Model(gorm_model.InfoAutoTask{}).Where("auto_task_id = ?", project.AutoTaskId).Find(&draft_default).Error
+	if err != nil {
+		return err
+	}
+
+	duration := time.Duration(draft_default.DraftDefault) * time.Hour
+	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeLocalTaskInfo{SketchStatus: 3, CurBreakAt: time.Now().Add(duration)}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
+		return err
+	}
+	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeLocalTaskInfo{TaskStage: 9}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
+		return err
+	}
+	return nil
+}
 
 // AcceptSketch 同意初稿
-func AcceptSketch(ctx context.Context, TaskIDs []string, operatorid string, operatetype int, projectid string, isspecial int) error {
+func AcceptSketch(ctx context.Context, TaskIDs []string, operatorid string, projectid string, isspecial int) error {
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
+	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": opid, "b_operator_type": optype, "revise_opinion": "初稿通过"}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeSketchInfo error,err:%+v", err)
 		return err
@@ -250,6 +252,7 @@ func AcceptSketch(ctx context.Context, TaskIDs []string, operatorid string, oper
 			}
 		}
 	}
+
 	var link_default gorm_model.InfoAutoTask
 	err = db.Model(gorm_model.InfoAutoTask{}).Where("auto_task_id = ?", project.AutoTaskID).Find(&link_default).Error
 	if err != nil {
@@ -270,10 +273,78 @@ func AcceptSketch(ctx context.Context, TaskIDs []string, operatorid string, oper
 	return nil
 }
 
+// AcceptSketch 同意初稿
+func LocalAcceptSketch(ctx context.Context, TaskIDs []string, operatorid string, projectid string, isspecial int) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
+	db := GetReadDB(ctx)
+	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": opid, "b_operator_type": optype}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeSketchInfo error,err:%+v", err)
+		return err
+	}
+
+	var project gorm_model.YounggeeLocalLifeInfo
+	err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ?", projectid).Find(&project).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Find ProjectInfo error,err:%+v", err)
+		return err
+	}
+	taskstages := 11
+	nextstage := [6]int{0, 0, 0, 0, 0, 0} // 数组长度为6,表示6种工具 4,9,11,13
+	if isspecial == 1 {
+
+		toolList := strings.Split(project.Tools, ",")
+		for _, tool := range toolList {
+			// 将 tool 转换为整数
+			if t, err := strconv.Atoi(tool); err == nil && t >= 0 && t <= len(nextstage) {
+				nextstage[t-1] = 1
+			}
+		}
+		for i := 3; i < len(nextstage); i++ { // 从位置1开始
+			if nextstage[i] == 1 {
+				switch i {
+				case 3:
+					taskstages = 11
+				case 4:
+					taskstages = 13
+				case 5:
+					taskstages = 15
+				}
+				break
+			}
+		}
+	}
+	var link_default gorm_model.InfoAutoTask
+	err = db.Model(gorm_model.InfoAutoTask{}).Where("auto_task_id = ?", project.AutoTaskId).Find(&link_default).Error //待确认
+	if err != nil {
+		return err
+	}
+	duration := time.Duration(link_default.LinkBreach) * time.Hour
+	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeLocalTaskInfo{SketchStatus: 5, CurBreakAt: time.Now().Add(duration)}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
+		return err
+	}
+
+	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeLocalTaskInfo{TaskStage: taskstages}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
+		return err
+	}
+	return nil
+}
+
 // RejectSketch 不同意初稿
-func RejectSketch(ctx context.Context, TaskIDs []string, operatorid string, operatetype int, projectid string) error {
+func RejectSketch(ctx context.Context, TaskIDs []string, operatorid string, projectid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 0, "is_review": 1, "reject_at": time.Now(), "b_operator": operatorid, "b_operator_type": operatetype}).Error
+	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 0, "is_review": 1, "reject_at": time.Now(), "b_operator": opid, "b_operator_type": optype}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeSketchInfo error,err:%+v", err)
 		return err
@@ -306,17 +377,67 @@ func RejectSketch(ctx context.Context, TaskIDs []string, operatorid string, oper
 	return nil
 }
 
+// RejectSketch 不同意初稿
+func LocalRejectSketch(ctx context.Context, TaskIDs []string, operatorid string, projectid string) error {
+	var opid string
+	var optype int
+	opid = operatorid
+	optype = 3
+	db := GetReadDB(ctx)
+	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 0, "is_review": 1, "reject_at": time.Now(), "b_operator": opid, "b_operator_type": optype}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeSketchInfo error,err:%+v", err)
+		return err
+	}
+
+	var project gorm_model.YounggeeLocalLifeInfo
+	err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ?", projectid).Find(&project).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeLocalLifeInfo error,err:%+v", err)
+		return err
+	}
+
+	var draft_default gorm_model.InfoAutoTask
+	err = db.Model(gorm_model.InfoAutoTask{}).Where("auto_task_id = ?", project.AutoTaskId).Find(&draft_default).Error
+	if err != nil {
+		return err
+	}
+	duration := time.Duration(draft_default.DraftDefault) * time.Hour
+	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeLocalTaskInfo{SketchStatus: 3, CurBreakAt: time.Now().Add(duration)}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeLocalLifeInfo error,err:%+v", err)
+		return err
+	}
+
+	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeLocalTaskInfo{TaskStage: 9}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeLocalLifeInfo error,err:%+v", err)
+		return err
+	}
+	return nil
+}
+
 // FindPhoto
 func FindSketchInfo(ctx context.Context, TaskID string) (*gorm_model.YounggeeSketchInfo, error) {
 	db := GetReadDB(ctx)
 	var SketchInfo gorm_model.YounggeeSketchInfo
-	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_ok = 1", TaskID).Find(&SketchInfo).Error
+	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_review = 0", TaskID).Find(&SketchInfo).Error
 	if err != nil {
 		return nil, err
 	}
 	return &SketchInfo, nil
 }
 
+func FindAllSketchInfo(ctx context.Context, taskid string) ([]gorm_model.YounggeeSketchInfo, error) {
+	db := GetReadDB(ctx)
+	var SketchInfo []gorm_model.YounggeeSketchInfo
+	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_review = 1", taskid).Find(&SketchInfo).Error
+	if err != nil {
+		return nil, err
+	}
+	return SketchInfo, nil
+}
+
 // FindPhoto
 func FindPhoto(ctx context.Context, SketchID int64) ([]gorm_model.YounggeeSketchPhoto, error) {
 	db := GetReadDB(ctx)
@@ -326,6 +447,7 @@ func FindPhoto(ctx context.Context, SketchID int64) ([]gorm_model.YounggeeSketch
 		return nil, err
 	}
 	return SketchPhotos, nil
+
 }
 
 // GetSpecialTaskSketchList 专项任务-查询上传初稿的task list
@@ -344,9 +466,9 @@ func GetSpecialTaskSketchList(ctx context.Context, projectID string, pageSize, p
 		if tag == "sketch_status" {
 			fmt.Printf("sketch %+v", value.Interface() == int64(0))
 			if value.Interface() == int64(0) {
-				db = db.Where("task_stage = ?", 10)
+				db = db.Where("task_stage = 10")
 			} else {
-				db = db.Where("task_stage > ?", 10)
+				db = db.Where("task_stage > 10 and task_stage <> 16")
 			}
 			continue
 		} else if !util.IsBlank(value) {
@@ -372,8 +494,8 @@ func GetSpecialTaskSketchList(ctx context.Context, projectID string, pageSize, p
 	var taskIds []string
 	taskMap := make(map[string]gorm_model.YoungeeTaskInfo)
 	for _, taskInfo := range taskInfos {
-		taskIds = append(taskIds, taskInfo.TaskId)
-		taskMap[taskInfo.TaskId] = taskInfo
+		taskIds = append(taskIds, taskInfo.TaskID)
+		taskMap[taskInfo.TaskID] = taskInfo
 	}
 	db1 := GetReadDB(ctx)
 	db1 = db1.Debug().Model(gorm_model.YounggeeSketchInfo{})
@@ -385,6 +507,7 @@ func GetSpecialTaskSketchList(ctx context.Context, projectID string, pageSize, p
 	} else {
 		db1 = db1.Where("is_ok = 1").Find(&SketchInfos)
 	}
+	//fmt.Printf("初稿查询:%+v", SketchInfos)
 	SketchMap := make(map[string]gorm_model.YounggeeSketchInfo)
 	for _, SketchInfo := range SketchInfos {
 		SketchMap[SketchInfo.TaskID] = SketchInfo
@@ -395,23 +518,16 @@ func GetSpecialTaskSketchList(ctx context.Context, projectID string, pageSize, p
 		logrus.WithContext(ctx).Errorf("[GetProjectTalentList] error query mysql total, err:%+v", err)
 		return nil, 0, err
 	}
-	var misNum int64
-	if totalSketch > totalTask {
-		misNum = totalSketch - totalTask
-	} else {
-		misNum = totalTask - totalSketch
-	}
-	//logrus.Println("totalSketch,totalTalent,misNum:", totalSketch, totalTask, misNum)
-
-	// 查询该页数据
-	limit := pageSize + misNum
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
 
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
+	//// 查询该页数据
+	//limit := pageSize
+	//offset := pageSize * pageNum // assert pageNum start with 0
+	//err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+	//
+	//if err != nil {
+	//	logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+	//	return nil, 0, err
+	//}
 
 	var TaskSketches []*http_model.SpecialTaskSketch
 	var taskSketches []*http_model.SpecialTaskSketchInfo
@@ -430,7 +546,7 @@ func GetSpecialTaskSketchList(ctx context.Context, projectID string, pageSize, p
 			newTaskSketches = append(newTaskSketches, v)
 		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
 			newTaskSketches = append(newTaskSketches, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
+		} else if strings.Contains(conv.MustString(v.TaskID), platform_nickname) {
 			newTaskSketches = append(newTaskSketches, v)
 		} else {
 			totalTask--
@@ -438,135 +554,3 @@ func GetSpecialTaskSketchList(ctx context.Context, projectID string, pageSize, p
 	}
 	return newTaskSketches, totalTask, nil
 }
-
-// SketchOption 提交意见
-func LocalSketchOption(ctx context.Context, TaskID string, ReviseOpinion string, operatorid string, operatetype int, projectid string) error {
-	db := GetReadDB(ctx)
-	fmt.Printf("初稿意见 %d %+v", TaskID, ReviseOpinion)
-	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_review = 0", TaskID).Updates(map[string]interface{}{"revise_opinion": ReviseOpinion, "reject_at": time.Now(), "is_review": 1, "b_operator": operatorid, "b_operator_type": operatetype}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] call RevisieOption error,err:%+v", err)
-		return err
-	}
-	var project gorm_model.YounggeeLocalLifeInfo
-	err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ?", projectid).Find(&project).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Find ProjectInfo error,err:%+v", err)
-		return err
-	}
-
-	var draft_default gorm_model.InfoAutoTask
-	err = db.Model(gorm_model.InfoAutoTask{}).Where("auto_task_id = ?", project.AutoTaskId).Find(&draft_default).Error
-	if err != nil {
-		return err
-	}
-
-	duration := time.Duration(draft_default.DraftDefault) * time.Hour
-	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeLocalTaskInfo{SketchStatus: 3, CurBreakAt: time.Now().Add(duration)}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
-		return err
-	}
-	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id = ?", TaskID).Updates(gorm_model.YoungeeLocalTaskInfo{TaskStage: 9}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
-		return err
-	}
-	return nil
-}
-
-// AcceptSketch 同意初稿
-func LocalAcceptSketch(ctx context.Context, TaskIDs []string, operatorid string, operatetype int, projectid string, isspecial int) error {
-	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": operatorid, "b_operator_type": operatetype}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeSketchInfo error,err:%+v", err)
-		return err
-	}
-
-	var project gorm_model.YounggeeLocalLifeInfo
-	err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("LocalId = ?", projectid).Find(&project).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Find ProjectInfo error,err:%+v", err)
-		return err
-	}
-	taskstages := 11
-	nextstage := [6]int{0, 0, 0, 0, 0, 0} // 数组长度为6,表示6种工具 4,9,11,13
-	if isspecial == 1 {
-
-		toolList := strings.Split(project.Tools, ",")
-		for _, tool := range toolList {
-			// 将 tool 转换为整数
-			if t, err := strconv.Atoi(tool); err == nil && t >= 0 && t <= len(nextstage) {
-				nextstage[t-1] = 1
-			}
-		}
-		for i := 3; i < len(nextstage); i++ { // 从位置1开始
-			if nextstage[i] == 1 {
-				switch i {
-				case 3:
-					taskstages = 11
-				case 4:
-					taskstages = 13
-				case 5:
-					taskstages = 15
-				}
-				break
-			}
-		}
-	}
-	var link_default gorm_model.InfoAutoTask
-	err = db.Model(gorm_model.InfoAutoTask{}).Where("auto_task_id = ?", project.AutoTaskId).Find(&link_default).Error //待确认
-	if err != nil {
-		return err
-	}
-	duration := time.Duration(link_default.LinkBreach) * time.Hour
-	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeLocalTaskInfo{SketchStatus: 5, CurBreakAt: time.Now().Add(duration)}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
-		return err
-	}
-
-	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeLocalTaskInfo{TaskStage: taskstages}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Update YoungeeTaskInfo error,err:%+v", err)
-		return err
-	}
-	return nil
-}
-
-// RejectSketch 不同意初稿
-func LocalRejectSketch(ctx context.Context, TaskIDs []string, operatorid string, operatetype int, projectid string) error {
-	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 0, "is_review": 1, "reject_at": time.Now(), "b_operator": operatorid, "b_operator_type": operatetype}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeSketchInfo error,err:%+v", err)
-		return err
-	}
-
-	var project gorm_model.YounggeeLocalLifeInfo
-	err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("LocalId = ?", projectid).Find(&project).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeLocalLifeInfo error,err:%+v", err)
-		return err
-	}
-
-	var draft_default gorm_model.InfoAutoTask
-	err = db.Model(gorm_model.InfoAutoTask{}).Where("auto_task_id = ?", project.AutoTaskId).Find(&draft_default).Error
-	if err != nil {
-		return err
-	}
-	duration := time.Duration(draft_default.DraftDefault) * time.Hour
-	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeLocalTaskInfo{SketchStatus: 3, CurBreakAt: time.Now().Add(duration)}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeLocalLifeInfo error,err:%+v", err)
-		return err
-	}
-
-	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeLocalTaskInfo{TaskStage: 9}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeLocalLifeInfo error,err:%+v", err)
-		return err
-	}
-	return nil
-}

+ 17 - 5
db/subaccount.go

@@ -103,11 +103,8 @@ func GetSubAccountDetail(ctx context.Context, req *http_model.SubAccountDetailRe
 	if req.AccountStatus != nil {
 		query = query.Where("account_status = ?", *req.AccountStatus)
 	}
-	if req.PhoneNumber != nil {
-		query = query.Where("phone_number = ?", *req.PhoneNumber)
-	}
-	if req.SubAccountName != nil {
-		query = query.Where("account_name = ?", *req.SubAccountName)
+	if req.Others != "" {
+		query = query.Where("phone_number LIKE ? OR sub_account_name LIKE ?", "%"+req.Others+"%", "%"+req.Others+"%")
 	}
 
 	// 查询总数
@@ -224,3 +221,18 @@ func DeleteSubAccount(ctx context.Context, req *http_model.DeleteSubAccountReque
 	tx.Commit()
 	return nil
 }
+
+func GetSubAccdDetail(ctx context.Context, req *http_model.SubAccShowRequest) (*http_model.GetSubAccountData, error) {
+	db := GetReadDB(ctx)
+	var subaccount gorm_model.YounggeeSubAccount
+	err := db.Model(gorm_model.YounggeeSubAccount{}).Where("sub_account_id = ?", req.SubaccountId).Find(&subaccount).Error
+	if err != nil {
+		return nil, err
+	}
+	response := &http_model.GetSubAccountData{
+		SubAccountName: subaccount.SubAccountName,
+		Phonenumber:    subaccount.PhoneNumber,
+		JobId:          subaccount.JobId,
+	}
+	return response, nil
+}

+ 8 - 8
db/talent.go

@@ -153,11 +153,11 @@ func GetTaskRecord(ctx context.Context, talentId string) (*http_model.GetTaskRec
 	}
 	projectIdMap := map[string]gorm_model.ProjectInfo{}
 	for _, taskInfo := range taskInfos {
-		if _, ok := projectIdMap[taskInfo.ProjectId]; !ok {
+		if _, ok := projectIdMap[taskInfo.ProjectID]; !ok {
 			db1 := GetReadDB(ctx)
 			projectInfo := gorm_model.ProjectInfo{}
-			db1.Where("project_id = ?", taskInfo.ProjectId).First(&projectInfo)
-			projectIdMap[taskInfo.ProjectId] = projectInfo
+			db1.Where("project_id = ?", taskInfo.ProjectID).First(&projectInfo)
+			projectIdMap[taskInfo.ProjectID] = projectInfo
 		}
 	}
 	var taskRecordDatas []*http_model.TaskRecordData
@@ -165,11 +165,11 @@ func GetTaskRecord(ctx context.Context, talentId string) (*http_model.GetTaskRec
 		updateAt := conv.MustString(taskInfo.UpdateAt, "")
 		updateAt = updateAt[0:19]
 		taskRecordData := http_model.TaskRecordData{
-			ProjectId:       conv.MustString(taskInfo.ProjectId, ""),
-			ProjectName:     projectIdMap[taskInfo.ProjectId].ProjectName,
-			ProjectType:     consts.GetProjectType(projectIdMap[taskInfo.ProjectId].ProjectType),
-			ProjectPlatform: consts.GetProjectPlatform(projectIdMap[taskInfo.ProjectId].ProjectPlatform),
-			TaskId:          conv.MustString(taskInfo.TaskId, ""),
+			ProjectId:       conv.MustString(taskInfo.ProjectID, ""),
+			ProjectName:     projectIdMap[taskInfo.ProjectID].ProjectName,
+			ProjectType:     consts.GetProjectType(projectIdMap[taskInfo.ProjectID].ProjectType),
+			ProjectPlatform: consts.GetProjectPlatform(projectIdMap[taskInfo.ProjectID].ProjectPlatform),
+			TaskId:          conv.MustString(taskInfo.TaskID, ""),
 			TaskStage:       consts.GetTaskStage(taskInfo.TaskStage),
 			UpdatedAt:       updateAt,
 		}

+ 353 - 364
db/task.go

@@ -3,7 +3,6 @@ package db
 import (
 	"context"
 	"fmt"
-	"github.com/tidwall/gjson"
 	"reflect"
 	"strconv"
 	"strings"
@@ -14,16 +13,17 @@ import (
 	"youngee_m_api/pack"
 	"youngee_m_api/util"
 
-	"github.com/caixw/lib.go/conv"
-	"gorm.io/gorm"
-
+	"github.com/issue9/conv"
 	"github.com/sirupsen/logrus"
+	"github.com/tidwall/gjson"
+	"gorm.io/gorm"
 )
 
 func GetTaskList(ctx context.Context, projectID string) ([]gorm_model.YoungeeTaskInfo, error) {
 	db := GetReadDB(ctx)
-	var tasks []gorm_model.YoungeeTaskInfo
-	err := db.Where("project_id = ? AND task_status = 2", projectID).Find(&tasks).Error
+	tasks := []gorm_model.YoungeeTaskInfo{}
+
+	err := db.Where("project_id=? and task_status = 2", projectID).Find(&tasks).Error
 	if err != nil {
 		return nil, err
 	}
@@ -31,6 +31,7 @@ func GetTaskList(ctx context.Context, projectID string) ([]gorm_model.YoungeeTas
 }
 
 func UpdateLogisticsStatus(ctx context.Context, taskID string, status int64) error {
+
 	db := GetReadDB(ctx)
 	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskID).Update("logistics_status", status).Error
 	if err != nil {
@@ -41,6 +42,7 @@ func UpdateLogisticsStatus(ctx context.Context, taskID string, status int64) err
 }
 
 func UpdateLogisticsDate(ctx context.Context, taskID string) error {
+
 	db := GetReadDB(ctx)
 	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", taskID).Update("delivery_date", time.Now()).Error
 	if err != nil {
@@ -58,13 +60,16 @@ func GetProjectIdByTaskId(ctx context.Context, taskID string) (*string, error) {
 		logrus.WithContext(ctx).Errorf("[task db] call UpdateLogisticsStatus error,err:%+v", err)
 		return nil, err
 	}
-	return &task.ProjectId, nil
+	return &task.ProjectID, nil
 }
 
 func ChangeTaskStatus(ctx context.Context, taskIds []string, taskStatus string) ([]int64, error) {
 	db := GetReadDB(ctx)
-
-	taskSta := conv.MustInt(taskStatus, 0)
+	taskSta, err := strconv.Atoi(taskStatus)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[ChangeTaskStatus]1 error query mysql total, err:%+v", err)
+		return nil, err
+	}
 	if err := db.Debug().Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", taskIds).
 		Updates(gorm_model.YoungeeTaskInfo{TaskStatus: taskSta}).Error; err != nil {
 		logrus.WithContext(ctx).Errorf("[ChangeTaskStatus]2 error query mysql total, err:%+v", err)
@@ -72,7 +77,7 @@ func ChangeTaskStatus(ctx context.Context, taskIds []string, taskStatus string)
 	}
 
 	var taskInfos []gorm_model.YoungeeTaskInfo
-	err := db.Debug().Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", taskIds).Find(&taskInfos).Error
+	err = db.Debug().Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", taskIds).Find(&taskInfos).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[ChangeTaskStatus]3 error query mysql total, err:%+v", err)
 		return nil, err
@@ -80,7 +85,7 @@ func ChangeTaskStatus(ctx context.Context, taskIds []string, taskStatus string)
 	var recruitStrategysIDs []int64
 	recruitStrategys := gorm_model.RecruitStrategy{}
 	for _, taskInfo := range taskInfos {
-		err2 := db.Debug().Model(gorm_model.RecruitStrategy{}).Where("project_id=? AND strategy_id=?", taskInfo.ProjectId, taskInfo.StrategyId).Scan(&recruitStrategys).Error
+		err2 := db.Debug().Model(gorm_model.RecruitStrategy{}).Where("project_id=? AND strategy_id=?", taskInfo.ProjectID, taskInfo.StrategyID).Scan(&recruitStrategys).Error
 		if err2 != nil {
 			logrus.WithContext(ctx).Errorf("[ChangeTaskStatus]4 error query mysql total, err:%+v", err2)
 			return nil, err2
@@ -98,30 +103,9 @@ func ChangeSpecialTaskStatus(ctx context.Context, taskIds []string, taskStatus s
 		logrus.WithContext(ctx).Errorf("[ChangeTaskStatus]1 error query mysql total, err:%+v", err)
 		return err
 	}
-	err = db.Transaction(func(tx *gorm.DB) error {
-		if err := tx.Debug().Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", taskIds).
-			Updates(gorm_model.YoungeeTaskInfo{TaskStatus: status, TaskStage: stage, SelectDate: time.Now()}).Error; err != nil {
-			logrus.WithContext(ctx).Errorf("[ChangeTaskStatus]2 error query mysql total, err:%+v", err)
-			return err
-		}
-		return nil
-	})
-	if err != nil {
-		return err
-	}
-	//if err := db.Debug().Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", taskIds).
-	//	Updates(gorm_model.YoungeeTaskInfo{TaskStatus: status, TaskStage: stage, SelectDate: time.Now()}).Error; err != nil {
-	//	logrus.WithContext(ctx).Errorf("[ChangeTaskStatus]2 error query mysql total, err:%+v", err)
-	//	return err
-	//}
-	return nil
-}
-
-func UpdateTaskStage(ctx context.Context, projectID string, taskStatus int64, taskStage int64) error {
-	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("project_id=? and task_status = ?", projectID, taskStatus).Update("task_stage", taskStage).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[UpdateTaskStatusPaying]2 error query mysql total, err:%+v", err)
+	if err := db.Debug().Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", taskIds).
+		Updates(gorm_model.YoungeeTaskInfo{TaskStatus: status, TaskStage: stage, SelectDate: time.Now()}).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[ChangeTaskStatus]2 error query mysql total, err:%+v", err)
 		return err
 	}
 	return nil
@@ -146,156 +130,27 @@ func UpdateTaskStageByProjectId(ctx context.Context, projectID string, taskStatu
 	}
 	return nil
 }
-
-func GetSpecialTaskInviteList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.SpecialTaskInviteInfo, int64, error) {
+func UpdateTaskStageByTaskId(ctx context.Context, taskID string, taskStatus int64, taskStage int64) error {
 	db := GetReadDB(ctx)
-	// 查询task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_stage != 3")
-	// 根据Project条件过滤
-	conditionType := reflect.TypeOf(conditions).Elem()
-	conditionValue := reflect.ValueOf(conditions).Elem()
-	var platform_nickname string = ""
-	for i := 0; i < conditionType.NumField(); i++ {
-		field := conditionType.Field(i)
-		tag := field.Tag.Get("condition")
-		value := conditionValue.FieldByName(field.Name)
-		if tag == "task_status" {
-			fmt.Printf("link %+v", value.Interface() == int64(0))
-			if value.Interface() == int64(0) {
-				db = db.Where("task_status <> 2")
-			} else {
-				db = db.Where("task_status = 2")
-			}
-			continue
-		} else if !util.IsBlank(value) {
-			if tag == "platform_nickname" {
-				platform_nickname = fmt.Sprintf("%v", value.Interface())
-				continue
-			} else if tag == "project_id" {
-				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
-			}
-		}
-	}
-	var taskInfos []gorm_model.YoungeeTaskInfo
-	db = db.Model(gorm_model.YoungeeTaskInfo{})
-	// 查询总数
-	var totalTask int64
-	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
-	}
-	db.Order("task_id").Find(&taskInfos)
-
-	// 查询该页数据
-	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id=? and task_status = ?", taskID, taskStatus).Update("task_stage", taskStage).Error
 	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
-		return nil, 0, err
+		logrus.WithContext(ctx).Errorf("[UpdateTaskStageByTaskId]2 error query mysql total, err:%+v", err)
+		return err
 	}
+	return nil
+}
 
-	var taskDatas []*http_model.SpecialTaskInviteInfo
-	var newTaskDatas []*http_model.SpecialTaskInviteInfo
-
-	taskDatas = pack.YoungeeTaskInfoToSpecialTaskInviteInfo(taskInfos)
-
-	for _, v := range taskDatas {
-		if platform_nickname == "" {
-			newTaskDatas = append(newTaskDatas, v)
-		} else if strings.Contains(v.PlatformNickname, platform_nickname) {
-			newTaskDatas = append(newTaskDatas, v)
-		} else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
-			newTaskDatas = append(newTaskDatas, v)
-		} else {
-			totalTask--
-		}
+func GetUnfinishedTaskNumber(ctx context.Context, projectID string) (*int64, error) {
+	var unFinishedTaskNumber int64
+	db := GetReadDB(ctx)
+	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? and task_status = 2 and task_stage < 15", projectID).Count(&unFinishedTaskNumber).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Data db] Find YounggeeTaskInfo error,err:%+v", err)
+		return nil, err
 	}
-	return newTaskDatas, totalTask, nil
+	return &unFinishedTaskNumber, nil
 }
 
-//// SetTaskFinish 任务结案
-//func SetTaskFinish(ctx context.Context, TaskIDs []string) error {
-//	db := GetReadDB(ctx)
-//	// 1. 修改任务表,更新任务阶段为已结案,结案方式为正常结束,数据状态为已通过,
-//	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).
-//		Updates(gorm_model.YoungeeTaskInfo{DataStatus: 5, TaskStage: 15, CompleteStatus: 2, WithdrawStatus: 2, CompleteDate: time.Now()}).Error
-//	if err != nil {
-//		logrus.WithContext(ctx).Errorf("[Task db] Update YoungeeTaskInfo error,err:%+v", err)
-//		return err
-//	}
-//
-//	// 2. 修改招募策略表,更新粉丝量、播放量、点赞数、收藏数、评论数、总支付、结案数量
-//	for _, v := range TaskIDs {
-//		// 查询task_info
-//		db = GetReadDB(ctx)
-//		taskInfo := gorm_model.YoungeeTaskInfo{}
-//		err1 := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", v).Scan(&taskInfo).Error
-//		if err1 != nil {
-//			logrus.WithContext(ctx).Errorf("[Task db] Find YoungeeTaskInfo error,err:%+v", err)
-//			return err1
-//		}
-//		//查询project_info
-//		projectInfo := gorm_model.ProjectInfo{}
-//		err1 = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", taskInfo.ProjectId).Scan(&projectInfo).Error
-//		if err1 != nil {
-//			logrus.WithContext(ctx).Errorf("[Task db] Find ProjectInfo error,err:%+v", err)
-//			return err1
-//		}
-//		// 查询data_info
-//		db = GetReadDB(ctx)
-//		dataInfo := gorm_model.YounggeeDataInfo{}
-//		err1 = db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id = ? and is_ok = 1", v).Scan(&dataInfo).Error
-//		if err1 != nil {
-//			logrus.WithContext(ctx).Errorf("[Task db] Find YounggeeDataInfo error,err:%+v", err)
-//			return err1
-//		}
-//
-//		// 2. 创建任务收益
-//		var productStruct gorm_model.YounggeeProduct
-//		if err = json.Unmarshal([]byte(projectInfo.ProductSnap), &productStruct); err != nil {
-//			fmt.Println("Error:", err)
-//			return err
-//		}
-//		t := time.Now()
-//		income := gorm_model.YounggeeTalentIncome{
-//			TalentID:       taskInfo.TalentId,
-//			ProjectID:      taskInfo.ProjectId,
-//			SectaskID:      taskInfo.TaskId,
-//			BrandName:      productStruct.BrandName,
-//			TaskName:       projectInfo.ProjectName,
-//			Income:         strconv.FormatFloat(taskInfo.SettleAmount, 'f', 10, 32),
-//			IncomeType:     1,
-//			WithdrawStatus: 1,
-//			IncomeAt:       &t,
-//			WithdrawAt:     nil,
-//		}
-//		err = CreateIncome(ctx, income, nil)
-//		if err != nil {
-//			logrus.WithContext(ctx).Errorf("[projectPay service] call SpecialSettlePay error,err:%+v", err)
-//			return err
-//		}
-//
-//		// 更新招募策略
-//		db = GetReadDB(ctx)
-//		db = db.Model(gorm_model.RecruitStrategy{}).Where("project_id = ? and strategy_id = ?", taskInfo.ProjectId, taskInfo.StrategyId)
-//		fansCount, _ := strconv.Atoi(conv.MustString(gjson.Get(taskInfo.TalentPlatformInfoSnap, "fans_count"), ""))
-//		err = db.Updates(map[string]interface{}{
-//			"fan_number":     gorm.Expr("fan_number + ?", fansCount),
-//			"play_number":    gorm.Expr("play_number + ?", dataInfo.PlayNumber),
-//			"like_number":    gorm.Expr("like_number + ?", dataInfo.LikeNumber),
-//			"collect_number": gorm.Expr("collect_number + ?", dataInfo.CollectNumber),
-//			"comment_number": gorm.Expr("comment_number + ?", dataInfo.CommentNumber),
-//			"finish_number":  gorm.Expr("finish_number + 1"),
-//			"total_offer":    gorm.Expr("total_offer + ?", taskInfo.RealPayment)}).Error
-//		if err != nil {
-//			logrus.WithContext(ctx).Errorf("[Task db] Update YounggeeDataInfo error,err:%+v", err)
-//			return err
-//		}
-//	}
-//	return nil
-//}
-
 // SetTaskFinish 任务结案
 func SetTaskFinish(ctx context.Context, TaskIDs []string) error {
 	db := GetReadDB(ctx)
@@ -317,7 +172,7 @@ func SetTaskFinish(ctx context.Context, TaskIDs []string) error {
 		}
 		//查询project_info
 		projectInfo := gorm_model.ProjectInfo{}
-		err1 = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", taskInfo.ProjectId).Scan(&projectInfo).Error
+		err1 = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", taskInfo.ProjectID).Scan(&projectInfo).Error
 		if err1 != nil {
 			logrus.WithContext(ctx).Errorf("[Task db] Find ProjectInfo error,err:%+v", err)
 			return err1
@@ -333,9 +188,9 @@ func SetTaskFinish(ctx context.Context, TaskIDs []string) error {
 
 		t := time.Now()
 		income := gorm_model.YounggeeTalentIncome{
-			TalentID:  taskInfo.TalentId,
-			ProjectID: taskInfo.ProjectId,
-			TaskID:    taskInfo.TaskId,
+			TalentID:  taskInfo.TalentID,
+			ProjectID: taskInfo.ProjectID,
+			TaskID:    taskInfo.TaskID,
 			Type:      1,
 			//BrandName:      productStruct.BrandName,
 			TaskName: projectInfo.ProjectName,
@@ -355,8 +210,8 @@ func SetTaskFinish(ctx context.Context, TaskIDs []string) error {
 		// 3. 修改招募策略表,更新粉丝量、播放量、点赞数、收藏数、评论数、总支付、结案数量
 		// 更新招募策略
 		db = GetReadDB(ctx)
-		db = db.Model(gorm_model.RecruitStrategy{}).Where("project_id = ? and strategy_id = ?", taskInfo.ProjectId, taskInfo.StrategyId)
-		fansCount, _ := strconv.Atoi(conv.MustString(gjson.Get(taskInfo.TalentPlatformInfoSnap, "fans_count"), ""))
+		db = db.Model(gorm_model.RecruitStrategy{}).Where("project_id = ? and strategy_id = ?", taskInfo.ProjectID, taskInfo.StrategyID)
+		fansCount, _ := strconv.Atoi(conv.MustString(gjson.Get(taskInfo.TalentPlatformInfoSnap, "fans_count")))
 		err = db.Updates(map[string]interface{}{
 			"fan_number":     gorm.Expr("fan_number + ?", fansCount),
 			"play_number":    gorm.Expr("play_number + ?", dataInfo.PlayNumber),
@@ -373,102 +228,6 @@ func SetTaskFinish(ctx context.Context, TaskIDs []string) error {
 	return nil
 }
 
-// SetTaskFinish 专项任务结案
-func SetSpecialTaskFinish(ctx context.Context, TaskIDs []string) error {
-	db := GetReadDB(ctx)
-	// 1. 修改任务表,更新任务阶段为已结案,结案方式为正常结束,数据状态为已通过,
-	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeTaskInfo{DataStatus: 5, TaskStage: 15, CompleteStatus: 2, WithdrawStatus: 2, CompleteDate: time.Now()}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Task db] Update YoungeeTaskInfo error,err:%+v", err)
-		return err
-	}
-	return nil
-}
-
-// SetTaskFinish 专项任务结案
-func SetSpecialLocalTaskFinish(ctx context.Context, TaskIDs []string) error {
-	db := GetReadDB(ctx)
-	// 1. 修改任务表,更新任务阶段为已结案,结案方式为正常结束,数据状态为已通过,
-	err := db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeLocalTaskInfo{DataStatus: 5, TaskStage: 15, CompleteStatus: 2, WithdrawStatus: 2, CompleteDate: time.Now()}).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Task db] Update YoungeeTaskInfo error,err:%+v", err)
-		return err
-	}
-	return nil
-}
-
-// SetSpecialTaskSettleNum 结案人数+1
-func SetSpecialLocalTaskSettleNum(ctx context.Context, TaskIDs []string) error {
-	db := GetReadDB(ctx)
-	//4.根据达人来源改变状态、阶段、数目
-	var tasks []gorm_model.YoungeeLocalTaskInfo
-	err := db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id IN ? ", TaskIDs).Find(&tasks).Error
-	if err != nil {
-		return err
-	}
-	for _, taskInfo := range tasks {
-		if taskInfo.SupplierId != 0 && taskInfo.SupplierStatus == 2 {
-			//project招募数+1,预估成本+服务商价格
-			var projectinfo gorm_model.YounggeeLocalLifeInfo
-			err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ?", taskInfo.LocalId).Find(&projectinfo).Error
-			if err != nil {
-				return err
-			}
-			projectinfo.SettleNum += 1
-			err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ? ", taskInfo.LocalId).Updates(projectinfo).Error
-			if err != nil {
-				return err
-			}
-			//服务商s_project已招募人数+1
-			var sprojectinfo gorm_model.YounggeeSLocalLifeInfo
-			err = db.Model(gorm_model.YounggeeSLocalLifeInfo{}).Where(" s_local_life_id =?", taskInfo.SLocalLifeId).Find(&sprojectinfo).Error
-			if err != nil {
-				return err
-			}
-			sprojectinfo.RecruitNum += 1
-			fmt.Println("......", projectinfo.RecruitNum)
-			err = db.Model(gorm_model.YounggeeSLocalLifeInfo{}).Where(" s_local_life_id =?", taskInfo.SLocalLifeId).Updates(sprojectinfo).Error
-			if err != nil {
-				return err
-			}
-		}
-		if taskInfo.SupplierId == 0 && taskInfo.SupplierStatus == 0 {
-			//project招募数+1
-			var projectinfo gorm_model.YounggeeLocalLifeInfo
-			err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ?", taskInfo.LocalId).Find(&projectinfo).Error
-			if err != nil {
-				return err
-			}
-			projectinfo.SettleNum += 1
-			err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ? ", taskInfo.LocalId).Updates(projectinfo).Error
-			if err != nil {
-				return err
-			}
-		}
-	}
-	return nil
-}
-
-func SetTalentIncome(ctx context.Context, TaskIDs []string) error {
-	db := GetReadDB(ctx)
-	var TaskInfoList []gorm_model.YoungeeTaskInfo
-	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Scan(&TaskInfoList).Error
-	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Task db] Update SetTalentIncome error,err:%+v", err)
-		return err
-	}
-	for _, taskInfo := range TaskInfoList {
-		err := db.Model(gorm_model.YoungeeTalentInfo{}).Where("id = ?", taskInfo.TalentId).Updates(map[string]interface{}{
-			"income":      gorm.Expr("income + ?", taskInfo.SettleAmount),
-			"canwithdraw": gorm.Expr("canwithdraw + ?", taskInfo.SettleAmount)}).Error
-		if err != nil {
-			logrus.WithContext(ctx).Errorf("[Task db] Update SetTalentIncome error,err:%+v", err)
-			return err
-		}
-	}
-	return nil
-}
-
 // SetTaskFinish 任务结案
 func SetLocalTaskFinish(ctx context.Context, TaskIDs []string) error {
 	db := GetReadDB(ctx)
@@ -490,7 +249,7 @@ func SetLocalTaskFinish(ctx context.Context, TaskIDs []string) error {
 		}
 		//查询project_info
 		projectInfo := gorm_model.YounggeeLocalLifeInfo{}
-		err1 = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("project_id = ?", taskInfo.LocalId).Scan(&projectInfo).Error
+		err1 = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ?", taskInfo.LocalId).Scan(&projectInfo).Error
 		if err1 != nil {
 			logrus.WithContext(ctx).Errorf("[Task db] Find ProjectInfo error,err:%+v", err)
 			return err1
@@ -504,24 +263,6 @@ func SetLocalTaskFinish(ctx context.Context, TaskIDs []string) error {
 			return err1
 		}
 
-		// 2. 创建任务收益
-		//var productStruct gorm_model.YounggeeProduct
-		//if err = json.Unmarshal([]byte(projectInfo.ProductSnap), &productStruct); err != nil {
-		//	fmt.Println("Error:", err)
-		//	return err
-		//}
-		//var productPhotoStruct []gorm_model.YounggeeProductPhoto
-		//if err = json.Unmarshal([]byte(projectInfo.ProductPhotoSnap), &productPhotoStruct); err != nil {
-		//	fmt.Println("Error:", err)
-		//	return err
-		//}
-		//var mainPhoto = ""
-		//for _, w := range productPhotoStruct {
-		//	if w.Symbol == 1 {
-		//		mainPhoto = w.PhotoUrl
-		//	}
-		//}
-
 		t := time.Now()
 		income := gorm_model.YounggeeTalentIncome{
 			TalentID:  taskInfo.TalentId,
@@ -547,7 +288,7 @@ func SetLocalTaskFinish(ctx context.Context, TaskIDs []string) error {
 		// 更新招募策略
 		db = GetReadDB(ctx)
 		db = db.Model(gorm_model.RecruitStrategy{}).Where("project_id = ? and strategy_id = ?", taskInfo.LocalId, taskInfo.StrategyId)
-		fansCount, _ := strconv.Atoi(conv.MustString(gjson.Get(taskInfo.TalentPlatformInfoSnap, "fans_count"), ""))
+		fansCount, _ := strconv.Atoi(conv.MustString(gjson.Get(taskInfo.TalentPlatformInfoSnap, "fans_count")))
 		err = db.Updates(map[string]interface{}{
 			"fan_number":     gorm.Expr("fan_number + ?", fansCount),
 			"play_number":    gorm.Expr("play_number + ?", dataInfo.PlayNumber),
@@ -564,78 +305,89 @@ func SetLocalTaskFinish(ctx context.Context, TaskIDs []string) error {
 	return nil
 }
 
-func SetLocalTalentIncome(ctx context.Context, TaskIDs []string) error {
+// SetTaskFinish 专项任务结案
+func SetSpecialTaskFinish(ctx context.Context, TaskIDs []string) error {
 	db := GetReadDB(ctx)
-	var TaskInfoList []gorm_model.YoungeeLocalTaskInfo
-	fmt.Println("收入", TaskIDs)
-	err := db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Scan(&TaskInfoList).Error
+	// 1. 修改任务表,更新任务阶段为已结案,结案方式为正常结束,数据状态为已通过,
+	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeTaskInfo{DataStatus: 5, TaskStage: 15, CompleteStatus: 2, WithdrawStatus: 2, CompleteDate: time.Now()}).Error
 	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Task db] Update SetTalentIncome error,err:%+v", err)
+		logrus.WithContext(ctx).Errorf("[Task db] Update YoungeeTaskInfo error,err:%+v", err)
 		return err
 	}
-	for _, taskInfo := range TaskInfoList {
-		err := db.Model(gorm_model.YoungeeTalentInfo{}).Where("id = ?", taskInfo.TalentId).Updates(map[string]interface{}{
-			"income":      gorm.Expr("income + ?", taskInfo.SettleAmount),
-			"canwithdraw": gorm.Expr("canwithdraw + ?", taskInfo.SettleAmount)}).Error
-		if err != nil {
-			logrus.WithContext(ctx).Errorf("[Task db] Update SetTalentIncome error,err:%+v", err)
-			return err
-		}
-	}
 	return nil
 }
-func GetUnfinishedTaskNumber(ctx context.Context, projectID string) (*int64, error) {
-	var unFinishedTaskNumber int64
+
+func SetProjectSettleFlag(ctx context.Context, projectid string) error {
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("project_id = ? and task_status = 2 and task_stage < 15", projectID).Count(&unFinishedTaskNumber).Error
+	var tasks []gorm_model.YoungeeTaskInfo
+	err := db.Where("project_id = ?", projectid).Find(&tasks).Error
 	if err != nil {
-		logrus.WithContext(ctx).Errorf("[Data db] Find YounggeeTaskInfo error,err:%+v", err)
-		return nil, err
+		return err
 	}
-	return &unFinishedTaskNumber, nil
+	settleflag := 1
+	for _, task := range tasks {
+		if task.TaskStage != 15 && task.TaskStage != 16 {
+			settleflag = 0
+		}
+	}
+	err = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", projectid).Update("settle_flag", settleflag).Error
+	if err != nil {
+		return err
+	}
+	return nil
 }
 
-func UpdateTaskStageByTaskId(ctx context.Context, taskID string, taskStatus int64, taskStage int64) error {
+func SetSettleAmount(ctx context.Context, settleamount *string, TaskIDs []string) error {
 	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id=? and task_status = ?", taskID, taskStatus).Update("task_stage", taskStage).Error
+	// 2. 转换 *string → float64
+	amount, err := strconv.ParseFloat(*settleamount, 64)
+	if err != nil {
+		return fmt.Errorf("invalid settleamount: %v", err)
+	}
+
+	// 3. 查询任务列表
+	var tasks []gorm_model.YoungeeTaskInfo
+	err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", TaskIDs).Find(&tasks).Error
 	if err != nil {
-		logrus.WithContext(ctx).Errorf("[UpdateTaskStageByTaskId]2 error query mysql total, err:%+v", err)
 		return err
 	}
+
+	// 4. 更新 SettleAmount
+	for _, taskInfo := range tasks {
+		taskInfo.SettleAmount = amount
+		if err := db.Save(&taskInfo).Error; err != nil {
+			logrus.WithContext(ctx).Errorf("failed to update task SettleAmount")
+			return fmt.Errorf("failed to update task %s: %v", taskInfo.TaskID, err)
+		}
+	}
+
 	return nil
 }
 
-// 获取任务ids
-func GetTaskIds(ctx context.Context, projectId string) ([]string, error) {
+func SetLocalSettleAmount(ctx context.Context, settleamount *string, TaskIDs []string) error {
 	db := GetReadDB(ctx)
-	var taskIds []string
-	err := db.Model(gorm_model.YoungeeTaskInfo{}).Select("task_id").Where("project_id = ? and task_status = 2", projectId).Find(&taskIds).Error
+	// 2. 转换 *string → float64
+	amount, err := strconv.ParseFloat(*settleamount, 64)
 	if err != nil {
-		logrus.WithContext(ctx).Errorf("[CreateMessageByTask] error read mysql, err:%+v", err)
-		return nil, err
+		return fmt.Errorf("invalid settleamount: %v", err)
 	}
 
-	return taskIds, nil
-}
-
-func UpdateTask(ctx context.Context, updateData gorm_model.YoungeeTaskInfo, tx *gorm.DB) (bool, error) {
-	db := GetWriteDB(ctx)
-	whereCondition := gorm_model.YoungeeTaskInfo{
-		TaskId: updateData.TaskId,
+	// 3. 查询任务列表
+	var tasks []gorm_model.YoungeeLocalTaskInfo
+	err = db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id IN ?", TaskIDs).Find(&tasks).Error
+	if err != nil {
+		return err
 	}
-	if tx != nil {
-		err := tx.Where(whereCondition).Updates(&updateData).Error
-		if err != nil {
-			return false, err
-		}
-	} else {
-		err := db.Where(whereCondition).Updates(&updateData).Error
-		if err != nil {
-			return false, err
+
+	// 4. 更新 SettleAmount
+	for _, taskInfo := range tasks {
+		taskInfo.SettleAmount = amount
+		if err := db.Save(&taskInfo).Error; err != nil {
+			logrus.WithContext(ctx).Errorf("failed to update task SettleAmount")
+			return fmt.Errorf("failed to update task %s: %v", taskInfo.TaskId, err)
 		}
 	}
-
-	return true, nil
+	return nil
 }
 
 // SetSpecialTaskSettleNum 结案人数+1
@@ -649,39 +401,107 @@ func SetSpecialTaskSettleNum(ctx context.Context, TaskIDs []string) error {
 	}
 	for _, taskInfo := range tasks {
 		if taskInfo.SupplierId != 0 && taskInfo.SupplierStatus == 2 {
-			//project招募数+1,预估成本+服务商价格
-			var projectinfo gorm_model.ProjectInfo
-			err = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", taskInfo.ProjectId).Find(&projectinfo).Error
+			// 在事务中更新
+			err = db.Transaction(func(tx *gorm.DB) error {
+				// 更新 ProjectInfo
+				if err := tx.Model(gorm_model.ProjectInfo{}).
+					Where("project_id = ?", taskInfo.ProjectID).
+					Update("settle_num", gorm.Expr("settle_num + ?", 1)).
+					Error; err != nil {
+					return err
+				}
+				// 更新 YounggeeSProjectInfo
+				if err := tx.Model(gorm_model.YounggeeSProjectInfo{}).
+					Where("project_id = ?", taskInfo.SprojectId).
+					Update("settle_num", gorm.Expr("settle_num + ?", 1)).
+					Error; err != nil {
+					return err
+				}
+				return nil
+			})
 			if err != nil {
-				return err
+				return fmt.Errorf("failed to update settle_num: %v", err)
 			}
-			projectinfo.SettleNum += 1
-			err = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ? ", taskInfo.ProjectId).Updates(projectinfo).Error
+		}
+		if taskInfo.SupplierId == 0 && taskInfo.SupplierStatus == 0 {
+			//project招募数+1
+			var projectinfo gorm_model.ProjectInfo
+			err = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", taskInfo.ProjectID).Find(&projectinfo).Error
 			if err != nil {
 				return err
 			}
-			//服务商s_project已招募人数+1
-			var sprojectinfo gorm_model.YounggeeSProjectInfo
-			err = db.Model(gorm_model.YounggeeSProjectInfo{}).Where(" s_project_id =?", taskInfo.SProjectId).Find(&sprojectinfo).Error
+			projectinfo.SettleNum += 1
+			err = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ? ", taskInfo.ProjectID).Updates(projectinfo).Error
 			if err != nil {
 				return err
 			}
-			sprojectinfo.RecruitNum += 1
-			fmt.Println("......", projectinfo.RecruitNum)
-			err = db.Model(gorm_model.YounggeeSProjectInfo{}).Where(" s_project_id =?", taskInfo.SProjectId).Updates(sprojectinfo).Error
+		}
+	}
+	return nil
+}
+func SetLocalLifeSettleFlag(ctx context.Context, localid string) error {
+	db := GetReadDB(ctx)
+	var tasks []gorm_model.YoungeeLocalTaskInfo
+	err := db.Where("local_id = ?", localid).Find(&tasks).Error
+	if err != nil {
+		return err
+	}
+	settleflag := 1
+	for _, taskInfo := range tasks {
+		if taskInfo.TaskStage != 15 && taskInfo.TaskStage != 16 {
+			settleflag = 0
+		}
+	}
+	err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ?", localid).Update("settle_flag", settleflag).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// SetSpecialTaskSettleNum 结案人数+1
+func SetSpecialLocalTaskSettleNum(ctx context.Context, TaskIDs []string) error {
+	db := GetReadDB(ctx)
+	//4.根据达人来源改变状态、阶段、数目
+	var tasks []gorm_model.YoungeeLocalTaskInfo
+	err := db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id IN ? ", TaskIDs).Find(&tasks).Error
+	if err != nil {
+		return err
+	}
+	for _, taskInfo := range tasks {
+		if taskInfo.SupplierId != 0 && taskInfo.SupplierStatus == 2 {
+			// 在事务中更新
+			err = db.Transaction(func(tx *gorm.DB) error {
+				// 更新 YounggeeLocalLifeInfo
+				if err := tx.Model(gorm_model.YounggeeLocalLifeInfo{}).
+					Where("local_id = ?", taskInfo.LocalId).
+					Update("settle_num", gorm.Expr("settle_num + ?", 1)).
+					Error; err != nil {
+					return err
+				}
+				// 更新 YounggeeSLocalLifeInfo
+				if err := tx.Model(gorm_model.YounggeeSLocalLifeInfo{}).
+					Where("s_local_life_id = ?", taskInfo.SLocalLifeId).
+					Update("settle_num", gorm.Expr("settle_num + ?", 1)).
+					Error; err != nil {
+					return err
+				}
+				return nil
+			})
 			if err != nil {
-				return err
+				return fmt.Errorf("failed to update settle_num: %v", err)
 			}
+
 		}
 		if taskInfo.SupplierId == 0 && taskInfo.SupplierStatus == 0 {
-			//project招募数+1
-			var projectinfo gorm_model.ProjectInfo
-			err = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", taskInfo.ProjectId).Find(&projectinfo).Error
+			//project结案人数+1
+			var projectinfo gorm_model.YounggeeLocalLifeInfo
+			err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ?", taskInfo.LocalId).Find(&projectinfo).Error
 			if err != nil {
 				return err
 			}
 			projectinfo.SettleNum += 1
-			err = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ? ", taskInfo.ProjectId).Updates(projectinfo).Error
+			err = db.Model(gorm_model.YounggeeLocalLifeInfo{}).Where("local_id = ? ", taskInfo.LocalId).Updates(projectinfo).Error
 			if err != nil {
 				return err
 			}
@@ -689,3 +509,172 @@ func SetSpecialTaskSettleNum(ctx context.Context, TaskIDs []string) error {
 	}
 	return nil
 }
+
+// SetTaskFinish 专项任务结案
+func SetSpecialLocalTaskFinish(ctx context.Context, TaskIDs []string) error {
+	db := GetReadDB(ctx)
+	// 1. 修改任务表,更新任务阶段为已结案,结案方式为正常结束,数据状态为已通过,
+	err := db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Updates(gorm_model.YoungeeLocalTaskInfo{DataStatus: 5, TaskStage: 15, CompleteStatus: 2, WithdrawStatus: 2, CompleteDate: time.Now()}).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Task db] Update YoungeeTaskInfo error,err:%+v", err)
+		return err
+	}
+	return nil
+}
+
+func GetSpecialTaskInviteList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TalentConditions) ([]*http_model.SpecialTaskInviteInfo, int64, error) {
+	db := GetReadDB(ctx)
+	// 查询task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("task_stage != 3")
+	// 根据Project条件过滤
+	conditionType := reflect.TypeOf(conditions).Elem()
+	conditionValue := reflect.ValueOf(conditions).Elem()
+	var platformNickname string = ""
+	for i := 0; i < conditionType.NumField(); i++ {
+		field := conditionType.Field(i)
+		tag := field.Tag.Get("condition")
+		value := conditionValue.FieldByName(field.Name)
+		if tag == "task_status" {
+			fmt.Printf("link %+v", value.Interface() == int64(0))
+			if value.Interface() == int64(0) {
+				db = db.Where("task_status <> 2")
+			} else {
+				db = db.Where("task_status = 2")
+			}
+			continue
+		} else if !util.IsBlank(value) {
+			if tag == "platform_nickname" {
+				platformNickname = fmt.Sprintf("%v", value.Interface())
+				continue
+			} else if tag == "project_id" {
+				db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
+			}
+		}
+	}
+	var taskInfos []gorm_model.YoungeeTaskInfo
+	db = db.Model(gorm_model.YoungeeTaskInfo{})
+	// 查询总数
+	var totalTask int64
+	if err := db.Count(&totalTask).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		return nil, 0, err
+	}
+	db.Order("task_id").Find(&taskInfos)
+
+	talentInfoTophoneMap := make(map[string]string)
+	for _, taskInfo := range taskInfos {
+		if _, ok := talentInfoTophoneMap[taskInfo.TalentID]; !ok {
+			phone := GetPhoneFromTalentId(ctx, taskInfo.TalentID)
+			talentInfoTophoneMap[taskInfo.TalentID] = phone
+		}
+	}
+
+	//// 查询该页数据
+	//limit := pageSize
+	//offset := pageSize * pageNum // assert pageNum start with 0
+	//err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+	//if err != nil {
+	//	logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+	//	return nil, 0, err
+	//}
+
+	var taskDatas []*http_model.SpecialTaskInviteInfo
+	var newTaskDatas []*http_model.SpecialTaskInviteInfo
+
+	taskDatas = pack.YoungeeTaskInfoToSpecialTaskInviteInfo(taskInfos)
+
+	for _, v := range taskDatas {
+		if platformNickname == "" {
+			newTaskDatas = append(newTaskDatas, v)
+		} else if strings.Contains(v.PlatformNickname, platformNickname) {
+			newTaskDatas = append(newTaskDatas, v)
+		} else if strings.Contains(conv.MustString(v.TaskID), platformNickname) {
+			newTaskDatas = append(newTaskDatas, v)
+		} else {
+			totalTask--
+		}
+	}
+	return newTaskDatas, totalTask, nil
+}
+
+func GetPhoneFromTalentId(ctx context.Context, talentId string) string {
+	db := GetReadDB(ctx)
+	var Phone string
+	db.Model(&gorm_model.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", talentId).Find(&Phone)
+	return Phone
+}
+
+func SetTalentIncome(ctx context.Context, TaskIDs []string) error {
+	db := GetReadDB(ctx)
+	var TaskInfoList []gorm_model.YoungeeTaskInfo
+	fmt.Println("收入", TaskIDs)
+	err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id in ?", TaskIDs).Scan(&TaskInfoList).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Task db] Update SetTalentIncome error,err:%+v", err)
+		return err
+	}
+	for _, taskInfo := range TaskInfoList {
+		err := db.Model(gorm_model.YoungeeTalentInfo{}).Where("id = ?", taskInfo.TalentID).Updates(map[string]interface{}{
+			"income":      gorm.Expr("income + ?", taskInfo.SettleAmount),
+			"canwithdraw": gorm.Expr("canwithdraw + ?", taskInfo.SettleAmount)}).Error
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[Task db] Update SetTalentIncome error,err:%+v", err)
+			return err
+		}
+	}
+	return nil
+}
+
+func SetLocalTalentIncome(ctx context.Context, TaskIDs []string) error {
+	db := GetReadDB(ctx)
+	var TaskInfoList []gorm_model.YoungeeLocalTaskInfo
+	fmt.Println("收入", TaskIDs)
+	err := db.Model(gorm_model.YoungeeLocalTaskInfo{}).Where("task_id in ?", TaskIDs).Scan(&TaskInfoList).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[Task db] Update SetTalentIncome error,err:%+v", err)
+		return err
+	}
+	for _, taskInfo := range TaskInfoList {
+		err := db.Model(gorm_model.YoungeeTalentInfo{}).Where("id = ?", taskInfo.TalentId).Updates(map[string]interface{}{
+			"income":      gorm.Expr("income + ?", taskInfo.SettleAmount),
+			"canwithdraw": gorm.Expr("canwithdraw + ?", taskInfo.SettleAmount)}).Error
+		if err != nil {
+			logrus.WithContext(ctx).Errorf("[Task db] Update SetTalentIncome error,err:%+v", err)
+			return err
+		}
+	}
+	return nil
+}
+
+// 获取任务ids
+func GetTaskIds(ctx context.Context, projectId string) ([]string, error) {
+	db := GetReadDB(ctx)
+	var taskIds []string
+	err := db.Model(gorm_model.YoungeeTaskInfo{}).Select("task_id").Where("project_id = ? and task_status = 2", projectId).Find(&taskIds).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[CreateMessageByTask] error read mysql, err:%+v", err)
+		return nil, err
+	}
+
+	return taskIds, nil
+}
+
+func UpdateTask(ctx context.Context, updateData gorm_model.YoungeeTaskInfo, tx *gorm.DB) (bool, error) {
+	db := GetWriteDB(ctx)
+	whereCondition := gorm_model.YoungeeTaskInfo{
+		TaskID: updateData.TaskID,
+	}
+	if tx != nil {
+		err := tx.Where(whereCondition).Updates(&updateData).Error
+		if err != nil {
+			return false, err
+		}
+	} else {
+		err := db.Where(whereCondition).Updates(&updateData).Error
+		if err != nil {
+			return false, err
+		}
+	}
+
+	return true, nil
+}

+ 1 - 0
handler/create_job.go

@@ -37,6 +37,7 @@ func (c CreateJobHandler) run() {
 	}
 	c.resp.Message = "成功创建岗位"
 	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
 
 }
 func (c CreateJobHandler) checkParam() error {

+ 2 - 5
handler/create_sub_account.go

@@ -49,12 +49,9 @@ func (c CreateSubAccountHandler) run() {
 		c.resp.Message = "创建成功"
 		// 4. 返回ok
 		c.resp.Data = res
+		c.resp.Status = consts.ErrorSuccess
 	} else if message == "手机号已存在" {
-		c.resp.Message = message
-		c.resp.Status = 1
-	} else {
-		c.resp.Message = message
-		c.resp.Status = 2
+		c.resp.Status = consts.ErrorInternal
 	}
 
 }

+ 1 - 0
handler/delete_job.go

@@ -36,6 +36,7 @@ func (c DeleteJobHandler) run() {
 		return
 	}
 	c.resp.Message = "成功删除岗位"
+	c.resp.Status = consts.ErrorSuccess
 }
 func (c DeleteJobHandler) checkParam() error {
 	return nil

+ 1 - 0
handler/delete_ks.go

@@ -36,6 +36,7 @@ func (c DeleteKsauthorizationHandler) run() {
 		return
 	}
 	c.resp.Message = "成功删除授权"
+	c.resp.Status = consts.ErrorSuccess
 }
 func (c DeleteKsauthorizationHandler) checkParam() error {
 	return nil

+ 1 - 0
handler/delete_subaccount.go

@@ -41,6 +41,7 @@ func (d DeleteSubAccount) run() {
 		return
 	}
 	d.resp.Message = "删除成功"
+	d.resp.Status = consts.ErrorSuccess
 }
 
 func (d DeleteSubAccount) checkParam() error {

+ 53 - 0
handler/get_serveraio.go

@@ -0,0 +1,53 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/db"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/util"
+)
+
+func WrapGetServeratioHandler(ctx *gin.Context) {
+	handler := newGetServeratioHandler(ctx)
+	BaseRun(handler)
+}
+
+type GetServeratioHandler struct {
+	ctx  *gin.Context
+	req  *http_model.GetServeratioRequest
+	resp *http_model.CommonResponse
+}
+
+func (c GetServeratioHandler) getContext() *gin.Context { return c.ctx }
+func (c GetServeratioHandler) getResponse() interface{} { return c.resp }
+func (c GetServeratioHandler) getRequest() interface{} {
+	return c.req
+}
+func (c GetServeratioHandler) run() {
+	data := http_model.GetServeratioRequest{}
+	data = *c.req
+	res, err := db.GetServeratio(c.ctx, &data)
+	if err != nil {
+		logrus.Errorf("[GetServeratioHandler] call GetServeratio err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+		logrus.Info("GetServeratioHandler fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功获取服务费率"
+	c.resp.Status = consts.ErrorSuccess
+	c.resp.Data = res
+
+}
+func (c GetServeratioHandler) checkParam() error {
+	return nil
+}
+
+func newGetServeratioHandler(ctx *gin.Context) *GetServeratioHandler {
+	return &GetServeratioHandler{
+		ctx:  ctx,
+		req:  http_model.NewGetServeratioRequest(),
+		resp: http_model.NewGetServeratioResponse(),
+	}
+}

+ 1 - 0
handler/getauthorization.go

@@ -37,6 +37,7 @@ func (c GetAuthorizationHandler) run() {
 	}
 	c.resp.Message = "成功查询"
 	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
 }
 func (c GetAuthorizationHandler) checkParam() error {
 	return nil

+ 60 - 0
handler/getlocalrecruittime.go

@@ -0,0 +1,60 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+func WrapGetLocalRecruitTimeHandler(ctx *gin.Context) {
+	handler := newGetLocalRecruitTimeHandler(ctx)
+	BaseRun(handler)
+}
+
+type GetLocalRecruitTime struct {
+	ctx  *gin.Context
+	req  *http_model.GetLocalRecruitTimeRequest
+	resp *http_model.CommonResponse
+}
+
+func (c GetLocalRecruitTime) getContext() *gin.Context {
+	return c.ctx
+}
+
+func (c GetLocalRecruitTime) getResponse() interface{} {
+	return c.resp
+}
+
+func (c GetLocalRecruitTime) getRequest() interface{} {
+	return c.req
+}
+
+func (c GetLocalRecruitTime) run() {
+	data := http_model.GetLocalRecruitTimeRequest{}
+	data = *c.req
+	res, err := service.LocalTask.GetLocalRecruitTime(c.ctx, data)
+	if err != nil {
+		logrus.Errorf("[GetLocalRecruitTime] call GetLocalRecruitTime err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+		logrus.Info("GetLocalRecruitTime fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功查询招募截止时间"
+	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
+}
+
+func (c GetLocalRecruitTime) checkParam() error {
+	return nil
+}
+
+func newGetLocalRecruitTimeHandler(ctx *gin.Context) *GetLocalRecruitTime {
+	return &GetLocalRecruitTime{
+		ctx:  ctx,
+		req:  http_model.NewGetLocalRecruitTimeRequest(),
+		resp: http_model.NewGetLocalRecruitTimeResponse(),
+	}
+}

+ 60 - 0
handler/getlocaltalentstatuscountnum.go

@@ -0,0 +1,60 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+func WrapGetLocalTalentstatusCountHandler(ctx *gin.Context) {
+	handler := newGetLocalTalentstatusCountHandler(ctx)
+	BaseRun(handler)
+}
+
+type GetLocalTalentstatusCount struct {
+	ctx  *gin.Context
+	req  *http_model.GetLocalTalentstatusCountRequest
+	resp *http_model.CommonResponse
+}
+
+func (c GetLocalTalentstatusCount) getContext() *gin.Context {
+	return c.ctx
+}
+
+func (c GetLocalTalentstatusCount) getResponse() interface{} {
+	return c.resp
+}
+
+func (c GetLocalTalentstatusCount) getRequest() interface{} {
+	return c.req
+}
+
+func (c GetLocalTalentstatusCount) run() {
+	data := http_model.GetLocalTalentstatusCountRequest{}
+	data = *c.req
+	res, err := service.LocalTask.GetLocalTalentstatusCount(c.ctx, data)
+	if err != nil {
+		logrus.Errorf("[GetLocalTalentstatusCount] call GetLocalTalentstatusCount err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+		logrus.Info("GetLocalTalentstatusCount fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功查询达人状态数量"
+	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
+}
+
+func (c GetLocalTalentstatusCount) checkParam() error {
+	return nil
+}
+
+func newGetLocalTalentstatusCountHandler(ctx *gin.Context) *GetLocalTalentstatusCount {
+	return &GetLocalTalentstatusCount{
+		ctx:  ctx,
+		req:  http_model.NewGetLocalTalentstatusCountRequest(),
+		resp: http_model.NewGetLocalTalentstatusCountResponse(),
+	}
+}

+ 60 - 0
handler/getlocaltalentstatusnum.go

@@ -0,0 +1,60 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+func WrapGetLocalTalentstatusNumHandler(ctx *gin.Context) {
+	handler := newGetLocalTalentstatusNumHandler(ctx)
+	BaseRun(handler)
+}
+
+type GetLocalTalentstatusNum struct {
+	ctx  *gin.Context
+	req  *http_model.GetLocalTalentstatusNumRequest
+	resp *http_model.CommonResponse
+}
+
+func (c GetLocalTalentstatusNum) getContext() *gin.Context {
+	return c.ctx
+}
+
+func (c GetLocalTalentstatusNum) getResponse() interface{} {
+	return c.resp
+}
+
+func (c GetLocalTalentstatusNum) getRequest() interface{} {
+	return c.req
+}
+
+func (c GetLocalTalentstatusNum) run() {
+	data := http_model.GetLocalTalentstatusNumRequest{}
+	data = *c.req
+	res, err := service.LocalTask.GetLocalTalentstatusNum(c.ctx, data)
+	if err != nil {
+		logrus.Errorf("[GetLocalTalentstatusNum] call GetLocalTalentstatusNum err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+		logrus.Info("GetLocalTalentstatusNum fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功查询达人状态数量"
+	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
+}
+
+func (c GetLocalTalentstatusNum) checkParam() error {
+	return nil
+}
+
+func newGetLocalTalentstatusNumHandler(ctx *gin.Context) *GetLocalTalentstatusNum {
+	return &GetLocalTalentstatusNum{
+		ctx:  ctx,
+		req:  http_model.NewGetLocalTalentstatusNumRequest(),
+		resp: http_model.NewGetLocalTalentstatusNumResponse(),
+	}
+}

+ 60 - 0
handler/getrecruittime.go

@@ -0,0 +1,60 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+func WrapGetRecruitTimeHandler(ctx *gin.Context) {
+	handler := newGetRecruitTimeHandler(ctx)
+	BaseRun(handler)
+}
+
+type GetRecruitTime struct {
+	ctx  *gin.Context
+	req  *http_model.GetRecruitTimeRequest
+	resp *http_model.CommonResponse
+}
+
+func (c GetRecruitTime) getContext() *gin.Context {
+	return c.ctx
+}
+
+func (c GetRecruitTime) getResponse() interface{} {
+	return c.resp
+}
+
+func (c GetRecruitTime) getRequest() interface{} {
+	return c.req
+}
+
+func (c GetRecruitTime) run() {
+	data := http_model.GetRecruitTimeRequest{}
+	data = *c.req
+	res, err := service.Task.GetRecruitTime(c.ctx, data)
+	if err != nil {
+		logrus.Errorf("[GetRecruitTime] call GetRecruitTime err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+		logrus.Info("GetRecruitTime fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功查询招募截止时间"
+	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
+}
+
+func (c GetRecruitTime) checkParam() error {
+	return nil
+}
+
+func newGetRecruitTimeHandler(ctx *gin.Context) *GetRecruitTime {
+	return &GetRecruitTime{
+		ctx:  ctx,
+		req:  http_model.NewGetRecruitTimeRequest(),
+		resp: http_model.NewGetRecruitTimeResponse(),
+	}
+}

+ 60 - 0
handler/getsketchrecordlist.go

@@ -0,0 +1,60 @@
+package handler
+
+import (
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+)
+
+// WrapGetSketchRecordListHandler
+
+func WrapGetSketchRecordListHandler(ctx *gin.Context) {
+	handler := newGetSketchRecordListHandler(ctx)
+	BaseRun(handler)
+}
+
+func newGetSketchRecordListHandler(ctx *gin.Context) *GetSketchRecordListHandler {
+	return &GetSketchRecordListHandler{
+		req:  http_model.NewGetSketchRecordListRequest(),
+		resp: http_model.NewGetSketchRecordListResponse(),
+		ctx:  ctx,
+	}
+}
+
+type GetSketchRecordListHandler struct {
+	req  *http_model.GetSketchRecordListRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *GetSketchRecordListHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *GetSketchRecordListHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *GetSketchRecordListHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *GetSketchRecordListHandler) run() {
+	data := *&http_model.GetSketchRecordListRequest{}
+	data = *h.req
+	res, err := service.Sketch.GetSketchRecordList(h.ctx, data)
+	if err != nil {
+		// 数据库查询失败,返回5001
+		logrus.Errorf("[GetSketchRecordListHandler] call GetByID err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorParamCheck, "")
+		log.Info("GetProduct fail,req:%+v", h.req)
+		return
+	}
+	h.resp.Data = res
+	h.resp.Status = consts.ErrorSuccess
+}
+func (h *GetSketchRecordListHandler) checkParam() error {
+	return nil
+}

+ 60 - 0
handler/gettalentstatuscountnum.go

@@ -0,0 +1,60 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+func WrapGetTalentstatusCountHandler(ctx *gin.Context) {
+	handler := newGetTalentstatusCountHandler(ctx)
+	BaseRun(handler)
+}
+
+type GetTalentstatusCount struct {
+	ctx  *gin.Context
+	req  *http_model.GetTalentstatusCountRequest
+	resp *http_model.CommonResponse
+}
+
+func (c GetTalentstatusCount) getContext() *gin.Context {
+	return c.ctx
+}
+
+func (c GetTalentstatusCount) getResponse() interface{} {
+	return c.resp
+}
+
+func (c GetTalentstatusCount) getRequest() interface{} {
+	return c.req
+}
+
+func (c GetTalentstatusCount) run() {
+	data := http_model.GetTalentstatusCountRequest{}
+	data = *c.req
+	res, err := service.Task.GetTalentstatusCount(c.ctx, data)
+	if err != nil {
+		logrus.Errorf("[GetTalentstatusCount] call GetTalentstatusCount err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+		logrus.Info("GetTalentstatusCount fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功查询达人状态数量"
+	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
+}
+
+func (c GetTalentstatusCount) checkParam() error {
+	return nil
+}
+
+func newGetTalentstatusCountHandler(ctx *gin.Context) *GetTalentstatusCount {
+	return &GetTalentstatusCount{
+		ctx:  ctx,
+		req:  http_model.NewGetTalentstatusCountRequest(),
+		resp: http_model.NewGetTalentstatusCountResponse(),
+	}
+}

+ 60 - 0
handler/gettalentstatusnum.go

@@ -0,0 +1,60 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+func WrapGetTalentstatusNumHandler(ctx *gin.Context) {
+	handler := newGetTalentstatusNumHandler(ctx)
+	BaseRun(handler)
+}
+
+type GetTalentstatusNum struct {
+	ctx  *gin.Context
+	req  *http_model.GetTalentstatusNumRequest
+	resp *http_model.CommonResponse
+}
+
+func (c GetTalentstatusNum) getContext() *gin.Context {
+	return c.ctx
+}
+
+func (c GetTalentstatusNum) getResponse() interface{} {
+	return c.resp
+}
+
+func (c GetTalentstatusNum) getRequest() interface{} {
+	return c.req
+}
+
+func (c GetTalentstatusNum) run() {
+	data := http_model.GetTalentstatusNumRequest{}
+	data = *c.req
+	res, err := service.Task.GetTalentstatusNum(c.ctx, data)
+	if err != nil {
+		logrus.Errorf("[GetTalentstatusNum] call GetTalentstatusNum err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+		logrus.Info("GetTalentstatusNum fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功查询达人状态数量"
+	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
+}
+
+func (c GetTalentstatusNum) checkParam() error {
+	return nil
+}
+
+func newGetTalentstatusNumHandler(ctx *gin.Context) *GetTalentstatusNum {
+	return &GetTalentstatusNum{
+		ctx:  ctx,
+		req:  http_model.NewGetTalentstatusNumRequest(),
+		resp: http_model.NewGetTalentStatusNumResponse(),
+	}
+}

+ 60 - 0
handler/joblist.go

@@ -0,0 +1,60 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/db"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/util"
+)
+
+func WrapJobListHandler(ctx *gin.Context) {
+	handler := newJobListHandler(ctx)
+	BaseRun(handler)
+}
+
+type JobList struct {
+	ctx  *gin.Context
+	req  *http_model.JobListRequest
+	resp *http_model.CommonResponse
+}
+
+func (c JobList) getContext() *gin.Context {
+	return c.ctx
+}
+
+func (c JobList) getResponse() interface{} {
+	return c.resp
+}
+
+func (c JobList) getRequest() interface{} {
+	return c.req
+}
+
+func (c JobList) run() {
+	data := http_model.JobListRequest{}
+	data = *c.req
+	res, err := db.GetJobList(c.ctx, &data)
+	if err != nil {
+		logrus.Errorf("[JobList] call JobList err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorParamCheck, "")
+		logrus.Info("JobList fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功查询岗位"
+	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
+}
+
+func (c JobList) checkParam() error {
+	return nil
+}
+
+func newJobListHandler(ctx *gin.Context) *JobList {
+	return &JobList{
+		ctx:  ctx,
+		req:  http_model.NewJobListRequest(),
+		resp: http_model.NewJobListResponse(),
+	}
+}

+ 52 - 0
handler/jobshow.go

@@ -0,0 +1,52 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/db"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/util"
+)
+
+func WrapJobShowHandler(ctx *gin.Context) {
+	handler := newJobShowHandler(ctx)
+	BaseRun(handler)
+}
+
+type JobShowHandler struct {
+	ctx  *gin.Context
+	req  *http_model.JobShowRequest
+	resp *http_model.CommonResponse
+}
+
+func (c JobShowHandler) getContext() *gin.Context { return c.ctx }
+func (c JobShowHandler) getResponse() interface{} { return c.resp }
+func (c JobShowHandler) getRequest() interface{} {
+	return c.req
+}
+func (c JobShowHandler) run() {
+	data := http_model.JobShowRequest{}
+	data = *c.req
+	res, err := db.GetJobdDetail(c.ctx, &data)
+	if err != nil {
+		logrus.Errorf("[JobShowHandler] call JobShow err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+		logrus.Info("JobShowHandler fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功查询"
+	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
+}
+func (c JobShowHandler) checkParam() error {
+	return nil
+}
+
+func newJobShowHandler(ctx *gin.Context) *JobShowHandler {
+	return &JobShowHandler{
+		ctx:  ctx,
+		req:  http_model.NewJobShowRequest(),
+		resp: http_model.NewJobShowResponse(),
+	}
+}

+ 1 - 0
handler/kuaishouauthorization.go

@@ -36,6 +36,7 @@ func (c AuthkuaishouHandler) run() {
 		return
 	}
 	c.resp.Message = "成功创建授权账号"
+	c.resp.Status = consts.ErrorSuccess
 
 }
 func (c AuthkuaishouHandler) checkParam() error {

+ 59 - 89
handler/link_opinion.go

@@ -1,89 +1,59 @@
-package handler
-
-import (
-	"github.com/gin-gonic/gin"
-	"github.com/sirupsen/logrus"
-	log "github.com/sirupsen/logrus"
-	"youngee_m_api/consts"
-	"youngee_m_api/model/http_model"
-	"youngee_m_api/service"
-	"youngee_m_api/util"
-)
-
-func WrapLinkOpinionHandler(ctx *gin.Context) {
-	handler := newLinkOpinionHandler(ctx)
-	BaseRun(handler)
-}
-
-func newLinkOpinionHandler(ctx *gin.Context) *LinkOpinionHandler {
-	return &LinkOpinionHandler{
-		req:  http_model.NewLinkOpinionRequest(),
-		resp: http_model.NewLinkOpinionResponse(),
-		ctx:  ctx,
-	}
-}
-
-type LinkOpinionHandler struct {
-	req  *http_model.LinkOpinionRequest
-	resp *http_model.CommonResponse
-	ctx  *gin.Context
-}
-
-func (h *LinkOpinionHandler) getRequest() interface{} {
-	return h.req
-}
-func (h *LinkOpinionHandler) getContext() *gin.Context {
-	return h.ctx
-}
-func (h *LinkOpinionHandler) getResponse() interface{} {
-	return h.resp
-}
-
-func (h *LinkOpinionHandler) run() {
-	data := http_model.LinkOpinionRequest{}
-	data = *h.req
-	res, err := service.Link.LinkOpinion(h.ctx, data)
-	if err != nil {
-		logrus.Errorf("[LinkOpinionHandler] call Create err:%+v\n", err)
-		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
-		log.Info("CreateProject fail,req:%+v", h.req)
-		return
-	}
-	h.resp.Message = "提交脚本修改意见成功"
-	h.resp.Data = res
-	h.resp.Data = data
-}
-
-/***
-func (h *LinkOpinionHandler) run() {
-	data := http_model.LinkOpinionRequest{}
-	data = *h.req
-	isRefuse := data.IsRefuse
-	if isRefuse== 0 {
-		fmt.Println("Create in")
-		res, err := service.Project.Create(h.ctx, data)
-		if err != nil {
-			logrus.Errorf("[LinkOpinionHandler] call Create err:%+v\n", err)
-			util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
-			log.Info("CreateProject fail,req:%+v", h.req)
-			return
-		}
-		h.resp.Message = "成功添加修改意见"
-		h.resp.Data = res
-	} else {
-		res, err := service.Logistics.Update(h.ctx, data)
-		if err != nil {
-			logrus.Errorf("[LinkOpinionHandler] call Create err:%+v\n", err)
-			util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
-			log.Info("CreateProject fail,req:%+v", h.req)
-			return
-		}
-		h.resp.Message = "成功修改物流信息"
-		h.resp.Data = res
-	}
-
-}
-***/
-func (h *LinkOpinionHandler) checkParam() error {
-	return nil
-}
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+func WrapLinkOpinionHandler(ctx *gin.Context) {
+	handler := newLinkOpinionHandler(ctx)
+	BaseRun(handler)
+}
+
+func newLinkOpinionHandler(ctx *gin.Context) *LinkOpinionHandler {
+	return &LinkOpinionHandler{
+		req:  http_model.NewLinkOpinionRequest(),
+		resp: http_model.NewLinkOpinionResponse(),
+		ctx:  ctx,
+	}
+}
+
+type LinkOpinionHandler struct {
+	req  *http_model.LinkOpinionRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *LinkOpinionHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *LinkOpinionHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *LinkOpinionHandler) getResponse() interface{} {
+	return h.resp
+}
+
+func (h *LinkOpinionHandler) run() {
+	data := http_model.LinkOpinionRequest{}
+	data = *h.req
+	res, err := service.Link.LinkOpinion(h.ctx, data)
+	if err != nil {
+		logrus.Errorf("[LinkOpinionHandler] call Create err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
+		log.Info("CreateProject fail,req:%+v", h.req)
+		return
+	}
+	h.resp.Message = "提交脚本修改意见成功"
+	h.resp.Data = res
+	h.resp.Status = consts.ErrorSuccess
+}
+
+func (h *LinkOpinionHandler) checkParam() error {
+	return nil
+}

+ 1 - 1
handler/reject_sketch.go

@@ -45,7 +45,7 @@ func (h *RejectSketchHandler) run() {
 	res, err := service.Sketch.RejectSketch(h.ctx, data)
 	if err != nil {
 		logrus.Errorf("[ReviseOpinionHandler] call Create err:%+v\n", err)
-		util.HandlerPackErrorResp(h.resp, consts.ErrorParamCheck, "")
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
 		log.Info("CreateProject fail,req:%+v", h.req)
 		return
 	}

+ 1 - 0
handler/send_code.go

@@ -72,6 +72,7 @@ func (h *SendCodeHandler) run() {
 		return
 	}
 	h.resp.Message = "验证码发送成功,请注意查收"
+	h.resp.Status = consts.ErrorSuccess
 }
 func (h *SendCodeHandler) checkParam() error {
 	return nil

+ 1 - 0
handler/set_serveratio.go

@@ -36,6 +36,7 @@ func (c SetServeratioHandler) run() {
 		return
 	}
 	c.resp.Message = "成功设置服务费率"
+	c.resp.Status = consts.ErrorSuccess
 
 }
 func (c SetServeratioHandler) checkParam() error {

+ 59 - 58
handler/sketch_info.go

@@ -1,58 +1,59 @@
-package handler
-
-import (
-	"github.com/gin-gonic/gin"
-	"github.com/sirupsen/logrus"
-	log "github.com/sirupsen/logrus"
-	"youngee_m_api/consts"
-	"youngee_m_api/model/http_model"
-	"youngee_m_api/service"
-	"youngee_m_api/util"
-)
-
-// WrapGetSketchInfoHandler
-
-func WrapGetSketchInfoHandler(ctx *gin.Context) {
-	handler := newGetSketchInfoHandler(ctx)
-	BaseRun(handler)
-}
-
-func newGetSketchInfoHandler(ctx *gin.Context) *GetSketchInfoHandler {
-	return &GetSketchInfoHandler{
-		req:  http_model.NewGetSketchInfoRequest(),
-		resp: http_model.NewGetSketchInfoResponse(),
-		ctx:  ctx,
-	}
-}
-
-type GetSketchInfoHandler struct {
-	req  *http_model.GetSketchInfoRequest
-	resp *http_model.CommonResponse
-	ctx  *gin.Context
-}
-
-func (h *GetSketchInfoHandler) getRequest() interface{} {
-	return h.req
-}
-func (h *GetSketchInfoHandler) getContext() *gin.Context {
-	return h.ctx
-}
-func (h *GetSketchInfoHandler) getResponse() interface{} {
-	return h.resp
-}
-func (h *GetSketchInfoHandler) run() {
-	data := *&http_model.GetSketchInfoRequest{}
-	data = *h.req
-	res, err := service.Sketch.GetSketchInfo(h.ctx, data)
-	if err != nil {
-		// 数据库查询失败,返回5001
-		logrus.Errorf("[GetSketchInfoHandler] call GetByID err:%+v\n", err)
-		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
-		log.Info("GetProduct fail,req:%+v", h.req)
-		return
-	}
-	h.resp.Data = res
-}
-func (h *GetSketchInfoHandler) checkParam() error {
-	return nil
-}
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/service"
+	"youngee_m_api/util"
+)
+
+// WrapGetSketchInfoHandler
+
+func WrapGetSketchInfoHandler(ctx *gin.Context) {
+	handler := newGetSketchInfoHandler(ctx)
+	BaseRun(handler)
+}
+
+func newGetSketchInfoHandler(ctx *gin.Context) *GetSketchInfoHandler {
+	return &GetSketchInfoHandler{
+		req:  http_model.NewGetSketchInfoRequest(),
+		resp: http_model.NewGetSketchInfoResponse(),
+		ctx:  ctx,
+	}
+}
+
+type GetSketchInfoHandler struct {
+	req  *http_model.GetSketchInfoRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *GetSketchInfoHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *GetSketchInfoHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *GetSketchInfoHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *GetSketchInfoHandler) run() {
+	data := *&http_model.GetSketchInfoRequest{}
+	data = *h.req
+	res, err := service.Sketch.GetSketchInfo(h.ctx, data)
+	if err != nil {
+		// 数据库查询失败,返回5001
+		logrus.Errorf("[GetSketchInfoHandler] call GetByID err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
+		log.Info("GetProduct fail,req:%+v", h.req)
+		return
+	}
+	h.resp.Data = res
+	h.resp.Status = consts.ErrorSuccess
+}
+func (h *GetSketchInfoHandler) checkParam() error {
+	return nil
+}

+ 1 - 0
handler/stop_subaccount.go

@@ -44,6 +44,7 @@ func (s StopSubAccountHandler) run() {
 	}
 	s.resp.Message = "成功停用岗位"
 	s.resp.Data = res
+	s.resp.Status = consts.ErrorSuccess
 
 }
 

+ 3 - 0
handler/sub_account_detail.go

@@ -43,6 +43,9 @@ func (s SubAccountDetailHandler) run() {
 		return
 	}
 	s.resp.Data = res
+	s.resp.Status = consts.ErrorSuccess
+	s.resp.Message = "成功查询子账号列表" +
+		""
 
 }
 

+ 52 - 0
handler/subaccshow.go

@@ -0,0 +1,52 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_m_api/consts"
+	"youngee_m_api/db"
+	"youngee_m_api/model/http_model"
+	"youngee_m_api/util"
+)
+
+func WrapSubAccShowHandler(ctx *gin.Context) {
+	handler := newSubAccShowHandler(ctx)
+	BaseRun(handler)
+}
+
+type SubAccShowHandler struct {
+	ctx  *gin.Context
+	req  *http_model.SubAccShowRequest
+	resp *http_model.CommonResponse
+}
+
+func (c SubAccShowHandler) getContext() *gin.Context { return c.ctx }
+func (c SubAccShowHandler) getResponse() interface{} { return c.resp }
+func (c SubAccShowHandler) getRequest() interface{} {
+	return c.req
+}
+func (c SubAccShowHandler) run() {
+	data := http_model.SubAccShowRequest{}
+	data = *c.req
+	res, err := db.GetSubAccdDetail(c.ctx, &data)
+	if err != nil {
+		logrus.Errorf("[SubAccShowHandler] call SubAccShow err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+		logrus.Info("SubAccShowHandler fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功查询"
+	c.resp.Data = res
+	c.resp.Status = consts.ErrorSuccess
+}
+func (c SubAccShowHandler) checkParam() error {
+	return nil
+}
+
+func newSubAccShowHandler(ctx *gin.Context) *SubAccShowHandler {
+	return &SubAccShowHandler{
+		ctx:  ctx,
+		req:  http_model.NewSubAccShowRequest(),
+		resp: http_model.NewSubAccShowResponse(),
+	}
+}

+ 1 - 0
handler/update_job_info.go

@@ -47,6 +47,7 @@ func (u UpdateJobInfoHandler) run() {
 	}
 	u.resp.Message = "编辑创建岗位"
 	u.resp.Data = res
+	u.resp.Status = consts.ErrorSuccess
 }
 func (u UpdateJobInfoHandler) checkParam() error {
 	return nil

+ 2 - 0
handler/update_subaccount_info.go

@@ -57,8 +57,10 @@ func (u UpdateSubAccountInfoHandler) run() {
 		}
 		u.resp.Message = "编辑成功"
 		u.resp.Data = res
+		u.resp.Status = consts.ErrorSuccess
 	} else {
 		u.resp.Message = message
+		u.resp.Status = consts.ErrorInternal
 	}
 }
 func (u UpdateSubAccountInfoHandler) checkParam() error {

+ 39 - 15
model/gorm_model/auto_task.go

@@ -3,21 +3,45 @@ package gorm_model
 // Code generated by sql2gorm. DO NOT EDIT.
 
 type InfoAutoTask struct {
-	AutoTaskID        int32 `gorm:"column:auto_task_id;primary_key;AUTO_INCREMENT"` // 自动处理规则id
-	SignInOffline     int32 `gorm:"column:sign_in_offline"`                         // 线下探店自动签收时间
-	SignInVirtual     int32 `gorm:"column:sign_in_virtual"`                         // 虚拟产品测评自动签收时间
-	ReviewInMv        int32 `gorm:"column:review_in_mv"`                            // 视频形式的审稿处理
-	ReviewUnlimited   int32 `gorm:"column:review_unlimited"`                        // 不限形式的审稿处理
-	Postreview        int32 `gorm:"column:postreview"`                              // 发布审核自动处理
-	CaseClose         int32 `gorm:"column:case_close"`                              // 结案自动处理
-	Invalid           int32 `gorm:"column:invalid"`                                 // 全流程项目失效自动处理
-	DraftDefaultInPic int32 `gorm:"column:draft_default_in_pic"`                    // 图片初稿违约自动处理
-	DraftDefaultInMv  int32 `gorm:"column:draft_default_in_mv"`                     // 视频初稿违约自动处理
-	ScriptDefault     int32 `gorm:"column:script_default"`                          // 脚本违约自动处理
-	LinkBreach        int32 `gorm:"column:link_breach"`                             // 链接违约自动处理
-	CaseCloseDefault  int32 `gorm:"column:case_close_default"`                      // 结案违约自动处理
-	SelectionInvalid  int32 `gorm:"column:selectioninvalid"`
-	DraftDefault      int   `gorm:"column:draft_default;NOT NULL"` // 选品项目失效自动处理
+	AutoTaskID   int    `gorm:"column:auto_task_id;primary_key;AUTO_INCREMENT"`
+	EnterpriseId string `gorm:"column:enterprise_id"`
+
+	// 新增字段
+	ReviewAuto                   int   `gorm:"column:review_auto"`                     // (审稿自动执行)
+	LinkReviewAuto               int   `gorm:"column:link_review_auto"`                // (链接质检自动执行)
+	TaskFinishAuto               int   `gorm:"column:task_finish_auto"`                // (任务结算自动执行)
+	SelectionInvalid             int32 `gorm:"column:selection_invalid"`               // 选品项目失效自动处理
+	DraftCooperateProjectDefault int   `gorm:"column:draft_cooperate_project_default"` // 初稿违约2
+	DraftStoreDefault            int   `gorm:"column:draft_store_default"`             // 初稿违约3
+	DraftCooperateLocalDefault   int   `gorm:"column:draft_cooperate_local_default"`   // 初稿违约4
+
+	// 已有字段
+	Invalid         int32 `gorm:"column:invalid"`
+	SignInOffline   int32 `gorm:"column:sign_in_offline"`
+	SignInVirtual   int32 `gorm:"column:sign_in_virtual"`
+	ReviewInMv      int32 `gorm:"column:review_in_mv"`
+	ReviewUnlimited int32 `gorm:"column:review_unlimited"`
+	Postreview      int32 `gorm:"column:post_review"` // 注意列名映射
+	CaseClose       int32 `gorm:"column:case_close"`
+	//DraftDefaultInPic                   int    `gorm:"column:draft_default_in_pic"`                    // 需确认表中是否存在该列
+	//DraftDefaultInMv                    int    `gorm:"column:draft_default_in_mv"`                     // 需确认表中是否存在该列
+	ScriptDefault    int32 `gorm:"column:script_default"`
+	LinkBreach       int32 `gorm:"column:link_breach"`
+	CaseCloseDefault int32 `gorm:"column:case_close_default"`
+	DraftDefault     int32 `gorm:"column:draft_default"`
+
+	// 新增 operator 字段
+	ReviewAutoOperator                   string `gorm:"column:review_auto_operator"`
+	LinkReviewAutoOperator               string `gorm:"column:link_review_auto_operator"`
+	TaskFinishAutoOperator               string `gorm:"column:task_finish_auto_operator"`
+	InvalidOperator                      string `gorm:"column:invalid_operator"`
+	SelectionInvalidOperator             string `gorm:"column:selection_invalid_operator"`
+	DraftDefaultOperator                 string `gorm:"column:draft_default_operator"`
+	DraftCooperateProjectDefaultOperator string `gorm:"column:draft_cooperate_project_default_operator"`
+	DraftStoreDefaultOperator            string `gorm:"column:draft_store_default_operator"`
+	DraftCooperateLocalDefaultOperator   string `gorm:"column:draft_cooperate_local_default_operator"`
+	LinkBreachOperator                   string `gorm:"column:link_breach_operator"`
+	CaseCloseDefaultOperator             string `gorm:"column:case_close_default_operator"`
 }
 
 func (m *InfoAutoTask) TableName() string {

+ 10 - 2
model/gorm_model/local_task.go

@@ -4,7 +4,7 @@ import (
 	"time"
 )
 
-// 种草子任务
+// 本地生活子任务
 type YoungeeLocalTaskInfo struct {
 	TaskId                 string    `gorm:"column:task_id;type:char(15);primary_key;comment:任务id" json:"task_id"`
 	LocalId                string    `gorm:"column:local_id;type:char(10);comment:项目id;NOT NULL" json:"local_id"`
@@ -56,12 +56,13 @@ type YoungeeLocalTaskInfo struct {
 	FansNum                int       `gorm:"column:fans_num;type:int(11);comment:粉丝数" json:"fans_num"`
 	VoteAvg                int       `gorm:"column:vote_avg;type:int(11);comment:平均点赞数" json:"vote_avg"`
 	CommitAvg              int       `gorm:"column:commit_avg;type:int(11);comment:平均评论数" json:"commit_avg"`
+	CollectNum             int       `gorm:"collect_num;type:int(11);comment:平均收藏数" json:"collect_num"`
 	BOperator              string    `gorm:"column:b_operator;type:varchar(255);comment:商家确定达人操作人ID" json:"b_operator"`
 	BOperatorType          int       `gorm:"column:b_operator_type;type:int(11);default:0;comment:商家操作人类型,1商家用户,2商家子账号,3管理后台" json:"b_operator_type"`
 	SOperator              int       `gorm:"column:s_operator;type:int(11);default:0;comment:服务商提报达人操作人ID" json:"s_operator"`
 	SOperatorType          int       `gorm:"column:s_operator_type;type:int(11);default:0;comment:服务商操作人类型,1服务商主账号,2服务商子账号,3管理后台" json:"s_operator_type"`
 	OpenId                 string    `gorm:"column:open_id;type:varchar(255);comment:达人报名的快手唯一标识" json:"open_id"`
-	SLocalLifeId           int       `gorm:"column:s_local_life_id;type:int(11);comment:服务商种草任务ID" json:"s_local_life_id"`
+	SLocalLifeId           int       `gorm:"column:s_local_id;type:int(11);comment:服务商本地生活任务ID" json:"s_local_life_id"`
 	SupportFee             float64   `gorm:"column:support_fee;type:decimal(10,2);comment:提报价格(达人自报价经过计算后,)" json:"support_fee"`
 	SketchMissingTime      time.Time `gorm:"column:sketch_missing_time;type:datetime;comment:未传初稿违约时间" json:"sketch_missing_time"`
 	SketchMissingStatus    int       `gorm:"column:sketch_missing_status;type:int(11);default:0;comment:未传初稿违约状态,0无违约,1有违约" json:"sketch_missing_status"`
@@ -79,6 +80,13 @@ type YoungeeLocalTaskInfo struct {
 	CancelTime             time.Time `gorm:"column:cancel_time;type:datetime;comment:解约时间" json:"cancel_time"`
 	PlatformId             int       `gorm:"column:platform_id;type:int(11);comment:平台" json:"platform_id"`
 	City                   string    `gorm:"column:city;type:varchar(255);comment:城市" json:"city"`
+	SOperatename           string    `gorm:"column:s_operate_name;type:varchar(255);comment:提报达人服务商名称" json:"s_operate_name"` //提报达人服务商名称
+	ReserveTime            time.Time `gorm:"column:reserve_time;type:datetime;comment:预约探店时间" json:"reserve_time"`
+	ExploreTime            time.Time `gorm:"column:explore_time;type:datetime;comment:探店时间" json:"explore_time"`
+	FinishExploreTime      time.Time `gorm:"column:finish_explore_time;type:datetime;comment:完成探店时间" json:"finish_explore_time"`
+	WxNum                  string    `gorm:"column:wx_num;type:varchar(255);comment:报名时填写的微信号" json:"wx_num"`
+	SLocalId               int       `gorm:"column:s_local_id;type:int(11);comment:服务商本地生活任务ID" json:"s_local_id"`
+	TalentName             string    `gorm:"column:talent_name;type:varchar(255);comment:达人名称" json:"talent_name"`
 }
 
 func (m *YoungeeLocalTaskInfo) TableName() string {

+ 4 - 2
model/gorm_model/locallife_info.go

@@ -7,7 +7,7 @@ import (
 type YounggeeLocalLifeInfo struct {
 	Id                  int        `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:本地生活表主键ID" json:"id"`
 	LocalId             string     `gorm:"column:local_id;type:varchar(10);comment:项目id;NOT NULL" json:"local_id"`
-	LocalType           int        `gorm:"column:local_type;type:tinyint(4);comment:项目类型,1代表公开项目,2代表定向项目" json:"local_type"`
+	LocalType           int64      `gorm:"column:local_type;type:tinyint(4);comment:项目类型,1代表公开项目,2代表定向项目" json:"local_type"`
 	LocalPlatform       int        `gorm:"column:local_platform;type:tinyint(4);comment:项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎" json:"local_platform"`
 	ServiceChargeRate   float64    `gorm:"column:service_charge_rate;type:decimal(10,2);default:0.00;comment:公开服务费率;NOT NULL" json:"service_charge_rate"`
 	StoreId             int        `gorm:"column:store_id;type:int(11);comment:关联门店id" json:"store_id"`
@@ -34,7 +34,6 @@ type YounggeeLocalLifeInfo struct {
 	AutoFailAt          *time.Time `gorm:"column:auto_fail_at;type:timestamp;comment:失效自动处理时间" json:"auto_fail_at"`
 	AutoTaskId          int        `gorm:"column:auto_task_id;type:int(11);default:0;comment:定时任务id;NOT NULL" json:"auto_task_id"`
 	AutoDefaultId       int        `gorm:"column:auto_default_id;type:int(11);default:0;comment:违约状态id;NOT NULL" json:"auto_default_id"`
-	FailReason          int64      `gorm:"column:fail_reason"` // 失效原因,1、2分别表示逾期未支付、项目存在风险
 	PaymentAmount       float64    `gorm:"column:payment_amount;type:float;comment:支付金额" json:"payment_amount"`
 	PayAt               *time.Time `gorm:"column:pay_at;type:timestamp;comment:支付时间" json:"pay_at"`
 	SubmitAt            *time.Time `gorm:"column:submit_at;type:timestamp;comment:提交审核时间" json:"submit_at"`
@@ -48,6 +47,9 @@ type YounggeeLocalLifeInfo struct {
 	NeedQuality         int        `gorm:"column:need_quality;type:int(11);default:0;comment:待质检;NOT NULL" json:"need_quality"`
 	NeedCalculate       int        `gorm:"column:need_calculate;type:int(11);default:0;comment:待结算;NOT NULL" json:"need_calculate"`
 	InvoiceStatus       int        `gorm:"column:invoice_status;type:int(11);default:0;comment:开票状态(1开票中 2已开票);NOT NULL" json:"invoice_status"`
+	NeedPay             float64    `gorm:"column:need_pay"`
+	SettleFlag          int        `gorm:"column:settle_flag"`
+	FailReason          int64      `gorm:"column:fail_reason"` // 失效原因,1、2分别表示逾期未支付、项目存在风险
 }
 
 func (m *YounggeeLocalLifeInfo) TableName() string {

+ 45 - 50
model/gorm_model/project.go

@@ -1,4 +1,3 @@
-// Code generated by sql2gorm. DO NOT EDIT.
 package gorm_model
 
 import (
@@ -6,56 +5,52 @@ import (
 )
 
 type ProjectInfo struct {
-	ID                int64      `gorm:"column:id;primary_key;auto_increment"`           // 自增id
-	ProjectID         string     `gorm:"column:project_id;type:varchar(10);not null"`    // 项目id
-	ProjectName       string     `gorm:"column:project_name;type:varchar(100)"`          // 项目名称
-	ProjectStatus     int64      `gorm:"column:project_status;type:tinyint"`             // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、执行中、失效、已结案
-	ProjectType       int64      `gorm:"column:project_type;type:tinyint"`               // 项目类型,1代表公开,2代表定向
-	ProjectPlatform   int64      `gorm:"column:project_platform;type:tinyint"`           // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
-	ProjectForm       int64      `gorm:"column:project_form;type:tinyint"`               // 项目形式,1-3分别代表商品寄拍、素材分发、虚拟产品测评
-	TalentType        string     `gorm:"column:talent_type;type:text"`                   // 达人类型(,分隔)
-	RecruitDdl        *time.Time `gorm:"column:recruit_ddl;type:timestamp"`              // 招募截止时间
-	ContentType       int64      `gorm:"column:content_type;type:tinyint"`               // 内容形式,1代表图文,2代表视频
-	ProjectDetail     string     `gorm:"column:project_detail;type:varchar(1000)"`       // 项目详情
-	ApplyNum          int64      `gorm:"column:apply_num;type:int;default:0;not null"`   // 报名人数
-	RecruitNum        int64      `gorm:"column:recruit_num;type:int;default:0;not null"` // 已招募人数
+	ProjectID         string     `gorm:"column:project_id;primary_key;"`        // 项目id 项目ID生成规则:年(2位)+一年中的第几天(3位)+5位数随机数,雪花算法也可,生成10位订单号
+	ProjectName       string     `gorm:"column:project_name"`                   // 项目名称
+	ProjectStatus     int64      `gorm:"column:project_status"`                 // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、失效、执行中、已结案
+	ProjectType       int64      `gorm:"column:project_type"`                   // 项目类型,1代表全流程项目,2代表专项项目
+	ProjectPlatform   int64      `gorm:"column:project_platform"`               // 项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
+	ProjectForm       int64      `gorm:"column:project_form"`                   // 项目形式,1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创
+	TalentType        string     `gorm:"column:talent_type"`                    // 达人类型
+	RecruitDdl        *time.Time `gorm:"column:recruit_ddl"`                    // 招募截止时间
+	ContentType       int64      `gorm:"column:content_type"`                   // 内容形式,1代表图文,2代表视频
+	ProjectDetail     string     `gorm:"column:project_detail"`                 // 项目详情
+	ApplyNum          int64      `gorm:"column:apply_num;default:0;NOT NULL"`   // 报名人数
+	RecruitNum        int64      `gorm:"column:recruit_num;default:0;NOT NULL"` // 已招募人数
 	SettleNum         int64      `gorm:"column:settle_num;type:int(11);default:0;comment:结案人数;NOT NULL" json:"settle_num"`
-	EnterpriseID      string     `gorm:"column:enterprise_id;type:varchar(10)"`                                                  // 所属企业id
-	SubAccountID      int64      `gorm:"column:sub_account_id;type:int;default:0;not null"`                                      // 子账号id
-	ProductID         int64      `gorm:"column:product_id;type:int"`                                                             // 关联商品id
-	ProductCategory   string     `gorm:"column:product_category;type:varchar(10);default:'0'"`                                   // 商品类目1--20
-	CreatedAt         *time.Time `gorm:"column:created_at;type:timestamp"`                                                       // 创建时间
-	UpdatedAt         *time.Time `gorm:"column:updated_at;type:timestamp;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"` // 修改时间
-	FeeForm           string     `gorm:"column:fee_form;type:varchar(20)"`                                                       // 稿费形式列表(3.0暂未用)
-	AutoFailAt        *time.Time `gorm:"column:auto_fail_at;type:timestamp"`                                                     // 失效自动处理时间
-	AutoTaskID        int64      `gorm:"column:auto_task_id;type:int;default:0;not null"`                                        // 定时任务id
-	AutoDefaultID     int64      `gorm:"column:auto_default_id;type:int;default:0;not null"`                                     // 违约状态id
-	PaymentAmount     float64    `gorm:"column:payment_amount;type:decimal(10,2)"`                                               // 支付金额
-	PayAt             *time.Time `gorm:"column:pay_at;type:timestamp"`                                                           // 支付时间
-	AutoScriptBreakAt *time.Time `gorm:"column:auto_script_break_at;type:timestamp"`                                             // 脚本违约自动处理时间
-	AutoSketchBreakAt *time.Time `gorm:"column:auto_sketch_break_at;type:timestamp"`                                             // 初稿违约自动处理时间
-	FailReason        int64      `gorm:"column:fail_reason;type:tinyint"`                                                        // 失效原因,1、2分别表示逾期未支付、项目存在风险
-	PassAt            *time.Time `gorm:"column:pass_at;type:timestamp"`                                                          // 审核通过时间
-	FinishAt          *time.Time `gorm:"column:finish_at;type:timestamp"`                                                        // 结案时间
-	EstimatedCost     float64    `gorm:"column:estimated_cost;type:decimal(10,2)"`                                               // 预估成本
-	IsRead            int64      `gorm:"column:is_read;type:int"`                                                                // 是否已读
-	SettlementAmount  float64    `gorm:"column:settlement_amount;type:decimal(10,2)"`                                            // 结算金额
-	ProductSnap       string     `gorm:"column:product_snap;type:json"`                                                          // 商品信息快照
-	ProductPhotoSnap  string     `gorm:"column:product_photo_snap;type:json"`                                                    // 商品图片快照
-	SubmitAt          *time.Time `gorm:"column:submit_at;type:timestamp"`                                                        // 提交审核时间
-	NeedReview        int64      `gorm:"column:need_review;type:int;default:0;not null"`                                         // 待审稿
-	NeedQuality       int64      `gorm:"column:need_quality;type:int;default:0;not null"`                                        // 待质检
-	NeedCalculate     int64      `gorm:"column:need_calculate;type:int;default:0;not null"`                                      // 待结算
-	ServiceChargeRate float64    `gorm:"column:service_charge_rate;type:decimal(10,2);default:0.00;not null"`                    // 公开服务费率
-	OperatorType      *int64     `gorm:"column:operator_type;type:int"`                                                          // 创建者类型,1商家主账号,2商家子账号
-	TotalRecruitNum   *int64     `gorm:"column:total_recruit_num;type:int"`                                                      // 此任务各策略招募人数总和
-	ViewNum           int64      `gorm:"column:view_num;type:int;default:0"`                                                     // 浏览量
-	Tools             string     `gorm:"column:tools;type:varchar(255);default:'';not null"`                                     // 工具选择,1邀约招募 2样品物流 3审稿工具 4作品审查 5数据巡检 6结算账单(,分隔)
-	InvoiceStatus     int64      `gorm:"column:invoice_status;type:int;default:0;not null"`                                      // 开票状态(1开票中 2已开票)
-	CreateTime        *time.Time `gorm:"column:create_time;type:datetime"`                                                       // 创建时间
-	BeforeDeliveryNum int64      `gorm:"column:before_delivery_num;type:int;default:0;not null"`                                 // 待发货数量
-	DeliveryNum       int64      `gorm:"column:delivery_num;type:int;default:0;not null"`                                        // 已发货数量
-	AfterDeliveryNum  int64      `gorm:"column:after_delivery_num;type:int;default:0;not null"`                                  // 已签收数量
+	EnterpriseID      string     `gorm:"column:enterprise_id"`            // 所属企业id
+	ProductID         int64      `gorm:"column:product_id"`               // 关联商品id
+	CreatedAt         *time.Time `gorm:"column:created_at"`               // 创建时间
+	UpdatedAt         *time.Time `gorm:"column:updated_at"`               // 修改时间
+	FeeForm           string     `gorm:"column:fee_form"`                 // 稿费形式列表
+	AutoFailAt        *time.Time `gorm:"column:auto_fail_at"`             // 失效自动处理时间
+	AutoTaskID        int64      `gorm:"column:auto_task_id;NOT NULL"`    // 定时任务id
+	AutoDefaultID     int64      `gorm:"column:auto_default_id;NOT NULL"` // 违约状态id
+	PaymentAmount     float64    `gorm:"column:payment_amount"`           // 支付金额
+	PayAt             *time.Time `gorm:"column:pay_at"`                   // 支付时间
+	AutoScriptBreakAt *time.Time `gorm:"column:auto_script_break_at"`     // 脚本违约自动处理时间
+	AutoSketchBreakAt *time.Time `gorm:"column:auto_sketch_break_at"`     // 初稿违约自动处理时间
+	FailReason        int64      `gorm:"column:fail_reason"`              // 失效原因,1、2分别表示逾期未支付、项目存在风险
+	PassAt            *time.Time `gorm:"column:pass_at"`                  // 审核通过时间
+	FinishAt          *time.Time `gorm:"column:finish_at"`                // 结案时间
+	SubmitAt          *time.Time `gorm:"column:submit_at"`                // 结案时间
+	EstimatedCost     float64    `gorm:"column:estimated_cost"`           // 预估成本
+	IsRead            int64      `gorm:"column:is_read"`                  // 是否已读
+	SettlementAmount  float64    `gorm:"column:settlement_amount"`        // 结算金额
+	ProductSnap       string     `gorm:"column:product_snap"`             // 商品信息快照
+	ProductPhotoSnap  string     `gorm:"column:product_photo_snap"`       // 商品图片快照
+	NeedReview        int64      `gorm:"column:need_review"`              // 待审稿
+	NeedQuality       int64      `gorm:"column:need_quality"`             // 待质检
+	NeedCalculate     int64      `gorm:"column:need_calculate"`           // 待结算
+	ServiceChargeRate float64    `gorm:"column:service_charge_rate"`      // 公开服务费率
+	OperatorType      *int64     `gorm:"column:operator_type"`            // 创建者类型,1商家主账号,2商家子账号
+	TotalRecruitNum   *int64     `gorm:"column:total_recruit_num"`        // 此任务各策略招募人数总和
+	ViewNum           int64      `gorm:"column:view_num"`                 // 浏览量
+	Tools             string     `gorm:"column:tools"`                    // 工具选择,1邀约招募 2结算账单 3样品物流 4审稿工具 5作品审查 6数据巡检(,分隔)
+	InvoiceStatus     int64      `gorm:"column:invoice_status"`           // 开票状态(1开票中 2已开票)
+	NeedPay           float64    `gorm:"column:need_pay"`
+	SettleFlag        int        `gorm:"column:settle_flag"`
+	SubAccountID      int        `gorm:"column:sub_account_id"`
 }
 
 func (m *ProjectInfo) TableName() string {

+ 45 - 48
model/gorm_model/project_task.go

@@ -1,4 +1,3 @@
-// Code generated by sql2gorm. DO NOT EDIT.
 package gorm_model
 
 import (
@@ -6,14 +5,14 @@ import (
 )
 
 type YoungeeTaskInfo struct {
-	TaskId                 string    `gorm:"column:task_id;primary_key;AUTO_INCREMENT"`   // 任务id
-	ProjectId              string    `gorm:"column:project_id;NOT NULL"`                  // 项目id
-	TalentId               string    `gorm:"column:talent_id;NOT NULL"`                   // 达人id
-	AccountId              int       `gorm:"column:account_id;NOT NULL"`                  // 账号id
+	TaskID                 string    `gorm:"column:task_id;primary_key;AUTO_INCREMENT"`   // 任务id
+	ProjectID              string    `gorm:"column:project_id;NOT NULL"`                  // 项目id
+	TalentID               string    `gorm:"column:talent_id;NOT NULL"`                   // 达人id
+	AccountID              int       `gorm:"column:account_id;NOT NULL"`                  // 账号id
 	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap;NOT NULL"`   // 达人平台信息快照
 	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap;NOT NULL"`   // 达人个人信息快照
 	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap;NOT NULL"`       // 收货地址快照
-	StrategyId             int       `gorm:"column:strategy_id"`                          // 报名选择的招募策略id
+	StrategyID             int       `gorm:"column:strategy_id"`                          // 报名选择的招募策略id
 	TaskReward             float64   `gorm:"column:task_reward;NOT NULL"`                 // 达人报酬
 	SettleAmount           float64   `gorm:"column:settle_amount;NOT NULL"`               // 达人实际所得(扣除违约扣款)
 	AllPayment             float64   `gorm:"column:all_payment;NOT NULL"`                 // 企业支付
@@ -23,48 +22,42 @@ type YoungeeTaskInfo struct {
 	SketchBreakRate        int       `gorm:"column:sketch_break_rate;default:0;NOT NULL"` // 初稿上传超时违约扣款比例,百分之
 	LinkBreakRate          int       `gorm:"column:link_break_rate;default:0;NOT NULL"`   // 链接上传超时违约扣款比例,百分之
 	DataBreakRate          int       `gorm:"column:data_break_rate;default:0;NOT NULL"`   // 数据上传超时违约扣款比例,百分之
-	FeeForm                int       `gorm:"column:fee_form;NOT NULL"`
-	RealServiceCharge      float64   `gorm:"column:real_service_charge;type:decimal(10,2);comment:服务商实际所得服务费(扣除违约)" json:"real_service_charge"` // 稿费形式,1,2,3分别代表产品置换、固定稿费、自报价
-	ServiceCharge          float64   `gorm:"column:service_charge"`                                                                             // 服务费
-	ServiceRate            int       `gorm:"column:service_rate"`                                                                               // 服务费率,千分之
-	TaskStatus             int       `gorm:"column:task_status;default:1;NOT NULL"`                                                             // 任务状态 1待选 2已选 3落选
-	TaskStage              int       `gorm:"column:task_stage;NOT NULL"`                                                                        // 任务阶段,详情见info_task_stage表
-	CreateDate             time.Time `gorm:"column:create_date;default:CURRENT_TIMESTAMP;NOT NULL"`                                             // 创建时间
-	SelectDate             time.Time `gorm:"column:select_date"`                                                                                // 反选时间
-	DeliveryDate           time.Time `gorm:"column:delivery_date"`                                                                              // 发货时间
-	CompleteStatus         int       `gorm:"column:complete_status;default:1;NOT NULL"`                                                         // 结束方式 1未结束 2正常结束 3反选失败 4被解约
-	CompleteDate           time.Time `gorm:"column:complete_date"`                                                                              // 结束时间
-	LogisticsStatus        int       `gorm:"column:logistics_status;default:1"`                                                                 // 发货状态 1 待发货 2已发货 3 已签收
-	ScriptStatus           uint      `gorm:"column:script_status;default:1"`                                                                    // 脚本上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	SketchStatus           uint      `gorm:"column:sketch_status;default:1"`                                                                    // 初稿上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	UpdateAt               time.Time `gorm:"column:update_at"`                                                                                  // 更新时间
-	LinkStatus             uint      `gorm:"column:link_status;default:1"`                                                                      // 链接上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	DataStatus             uint      `gorm:"column:data_status;default:1"`                                                                      // 数据上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	CurDefaultType         int       `gorm:"column:cur_default_type"`                                                                           // 任务当前处于的违约类型 0-8分别表示未违约、脚本超时违约、脚本未上传违约、初稿超时违约、初稿未上传违约、链接超时违约、链接未上传违约、数据超时违约、数据未上传违约
-	WithdrawStatus         int       `gorm:"column:withdraw_status;default:1"`
-	WithdrawDate           time.Time `gorm:"column:withdraw_date;type:datetime;comment:提现时间" json:"withdraw_date"` // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
-	SettleStatus           int       `gorm:"column:settle_status;default:1"`
-	LeadTeamId             string    `gorm:"column:lead_team_id;type:char(10);comment:作为团长的young之团id,对应younggee_talent_team中的team_id字段" json:"lead_team_id"`
-	TeamId                 string    `gorm:"column:team_id;type:char(10);comment:作为团员的young之团id,对应younggee_talent_team中的team_id字段" json:"team_id"`
-	TeamIncome             float64   `gorm:"column:team_income;type:decimal(10,2);comment:young之团团长现金收益" json:"team_income"`
-	TeamPoint              int       `gorm:"column:team_point;type:int(11);comment:young之团团长积分收益" json:"team_point"`
+	FeeForm                int       `gorm:"column:fee_form;NOT NULL"`                    // 稿费形式,1,2,3分别代表产品置换、固定稿费、自报价
+	ServiceCharge          float64   `gorm:"column:service_charge"`                       // 服务费
+	RealServiceCharge      float64   `gorm:"column:real_service_charge"`                  // 服务商实际所得服务费(扣除违约)
+	ServiceRate            int       `gorm:"column:service_rate"`                         // 服务费率,千分之
+	TaskStatus             int       `gorm:"column:task_status;default:1;NOT NULL"`       // 任务状态 1待选 2已选 3落选
+	TaskStage              int       `gorm:"column:task_stage;NOT NULL"`                  // 任务阶段,详情见info_task_stage表
+	CreateDate             time.Time `gorm:"column:create_date;NOT NULL"`                 // 创建时间
+	SelectDate             time.Time `gorm:"column:select_date"`                          // 反选时间
+	DeliveryDate           time.Time `gorm:"column:delivery_date"`                        // 发货时间
+	CompleteStatus         int       `gorm:"column:complete_status;default:1;NOT NULL"`   // 结束方式 1未结束 2正常结束 3反选失败 4被解约
+	CompleteDate           time.Time `gorm:"column:complete_date"`                        // 结束时间
+	LogisticsStatus        int       `gorm:"column:logistics_status;default:1"`           // 发货状态 1 待发货 2已发货 3 已签收
+	ScriptStatus           uint      `gorm:"column:script_status;default:1"`              // 脚本上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	SketchStatus           uint      `gorm:"column:sketch_status;default:1"`              // 初稿上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	UpdateAt               time.Time `gorm:"column:update_at"`                            // 更新时间
+	LinkStatus             uint      `gorm:"column:link_status;default:1"`                // 链接上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	DataStatus             uint      `gorm:"column:data_status;default:1"`                // 数据上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	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分别表示待结算、已结算
+	SupplierId             int       `gorm:"column:supplier_id;default:0"`                // 服务商ID
+	SupplierStatus         int       `gorm:"column:supplier_status;default:0"`            // 服务商任务状态 0表示达人来源非服务商 1待选 2已选 3落选
+	DraftFee               float64   `gorm:"column:draft_fee"`                            // 达人稿费
+	SignedTime             time.Time `gorm:"column:signed_time"`                          // 签收时间
+	FansNum                int       `gorm:"column:fans_num"`                             // 粉丝数
+	VoteAvg                int       `gorm:"column:vote_avg"`                             // 平均点赞数
+	CommitAvg              int       `gorm:"column:commit_avg"`                           // 平均评论数
+	CollectNum             int       `gorm:"column:collect_num"`
+	BOperator              string    `gorm:"column:b_operator"`      // 商家确定达人操作人ID
+	BOperatorType          int       `gorm:"column:b_operator_type"` // 商家操作人类型,1商家用户,2商家子账号,3管理后台
+	SOperator              int       `gorm:"column:s_operator"`      // 服务商提报达人操作人ID
+	SOperatorType          int       `gorm:"column:s_operator_type"` // 服务商操作人类型,1服务商主账号,2服务商子账号,3管理后台
+	OpenId                 string    `gorm:"column:open_id"`         // 达人报名的快手唯一标识
+	SupportFee             float64   `gorm:"column:support_fee"`     //提报价格
+	SprojectId             int       `gorm:"column:s_project_id"`    //服务商种草任务ID
 	CurBreakAt             time.Time `gorm:"column:cur_break_at;type:datetime;comment:当前阶段截止时间" json:"cur_break_at"`
-	SupplierId             int       `gorm:"column:supplier_id;type:int(11);default:0;comment:服务商ID" json:"supplier_id"`
-	SupplierStatus         int       `gorm:"column:supplier_status;type:int(11);default:0;comment:服务商任务状态 0表示达人来源非服务商 1待选 2已选 3落选" json:"supplier_status"`
-	DraftFee               float64   `gorm:"column:draft_fee;type:decimal(10,2);default:0.00;comment:达人稿费,达人所见的稿费金额" json:"draft_fee"`
-	SignedTime             time.Time `gorm:"column:signed_time;type:datetime;comment:签收时间" json:"signed_time"`
-	FansNum                int       `gorm:"column:fans_num;type:int(11);comment:粉丝数" json:"fans_num"`
-	VoteAvg                int       `gorm:"column:vote_avg;type:int(11);comment:总点赞数" json:"vote_avg"`
-	CommitAvg              int       `gorm:"column:commit_avg;type:int(11);comment:总评论数" json:"commit_avg"`
-	ViewNum                int       `gorm:"column:view_num;type:int(11);comment:作品总浏览量" json:"view_num"`
-	PlatformId             int       `gorm:"column:platform_id;type:int(11);comment:平台id;NOT NULL" json:"platform_id"`
-	BOperator              string    `gorm:"column:b_operator;type:varchar(255);comment:商家确定达人操作人ID" json:"b_operator"`
-	BOperatorType          int       `gorm:"column:b_operator_type;type:int(11);default:0;comment:商家操作人类型,1商家用户,2商家子账号,3管理后台" json:"b_operator_type"`
-	SOperator              int       `gorm:"column:s_operator;type:int(11);default:0;comment:服务商提报达人操作人ID" json:"s_operator"`
-	SOperatorType          int       `gorm:"column:s_operator_type;type:int(11);default:0;comment:服务商操作人类型,1服务商主账号,2服务商子账号,3管理后台" json:"s_operator_type"`
-	OpenId                 string    `gorm:"column:open_id;type:varchar(255);comment:达人报名的快手唯一标识" json:"open_id"`
-	SProjectId             int       `gorm:"column:s_project_id;type:int(11);comment:服务商种草任务ID" json:"s_project_id"`
-	SupportFee             float64   `gorm:"column:support_fee;type:decimal(10,2);comment:提报价格(达人自报价经过计算后,)" json:"support_fee"`
 	SketchMissingTime      time.Time `gorm:"column:sketch_missing_time;type:datetime;comment:未传初稿违约时间" json:"sketch_missing_time"`
 	SketchMissingStatus    int       `gorm:"column:sketch_missing_status;type:int(11);default:0;comment:未传初稿违约状态,0无违约,1有违约" json:"sketch_missing_status"`
 	LinkMissingTime        time.Time `gorm:"column:link_missing_time;type:datetime;comment:未发作品违约时间" json:"link_missing_time"`
@@ -79,7 +72,11 @@ type YoungeeTaskInfo struct {
 	CancelOperator         string    `gorm:"column:cancel_operator;type:varchar(255);comment:解约操作人ID" json:"cancel_operator"`
 	CancelReason           string    `gorm:"column:cancel_reason;type:varchar(255);comment:解约原因" json:"cancel_reason"`
 	CancelTime             time.Time `gorm:"column:cancel_time;type:datetime;comment:解约时间" json:"cancel_time"`
-	City                   string    `gorm:"column:city;type:varchar(255);comment:报名达人的所在城市" json:"city"` // 结算状态,1、2分别表示待结算、已结算
+	City                   string    `gorm:"column:city"`                                                                     //报名达人的所在城市
+	SOperatename           string    `gorm:"column:s_operate_name;type:varchar(255);comment:提报达人服务商名称" json:"s_operate_name"` //提报达人服务商名称
+	TalentName             string    `gorm:"column:talent_name"`                                                              //达人昵称
+	CreateLogisticUserId   string    `gorm:"column:create_logistic_user_id"`                                                  //创建快递单ID
+	CreateLogisticUserType int       `gorm:"column:create_logistic_user_type"`                                                //创建快递单用户类型,1商家,2子账号,3管理后台
 }
 
 func (m *YoungeeTaskInfo) TableName() string {

+ 2 - 0
model/gorm_model/s_project.go

@@ -20,6 +20,8 @@ type YounggeeSProjectInfo struct {
 	ServiceCharge       float64 `gorm:"column:service_charge;type:decimal(10,2);default:0.00;comment:服务商预估可赚服务费" json:"service_charge"`
 	ServiceChargeActual float64 `gorm:"column:service_charge_actual;type:decimal(10,2);default:0.00;comment:服务商实际可赚服务费" json:"service_charge_actual"`
 	OperatorType        int     `gorm:"column:operator_type;type:int(11);default:0;comment:添加商单操作人类型,1为服务商主账号,2为服务商子账号" json:"operator_type"`
+	EstimateDraftFee    float64 `gorm:"column:estimate_draft_fee;type:decimal(10,2);comment:预估稿费" json:"estimate_draft_fee"`
+	EstimateSupportFee  float64 `gorm:"column:estimate_support_fee;type:decimal(10,2);comment:预估支持费" json:"estimate_support_fee"`
 }
 
 func (m *YounggeeSProjectInfo) TableName() string {

+ 2 - 2
model/gorm_model/supplier.go

@@ -1,6 +1,6 @@
 package gorm_model
 
-type YounggeeSupplier struct {
+type Supplier struct {
 	SupplierId      int    `gorm:"column:supplier_id;type:int(11);primary_key;AUTO_INCREMENT;comment:服务商ID" json:"supplier_id"`
 	SupplierName    string `gorm:"column:supplier_name;type:varchar(255);comment:服务商名称" json:"supplier_name"`
 	PhoneNumber     string `gorm:"column:phone_number;type:varchar(255);comment:手机号" json:"phone_number"`
@@ -18,6 +18,6 @@ type YounggeeSupplier struct {
 	Avater          string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avater"`
 }
 
-func (m *YounggeeSupplier) TableName() string {
+func (Supplier) TableName() string {
 	return "younggee_supplier"
 }

+ 9 - 8
model/http_model/LocalPrelinkList.go

@@ -1,13 +1,14 @@
 package http_model
 
-import "time"
-
 type LocalPreLinkListRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	ProjectId    string `json:"project_id"`  // 项目ID
-	LinkStatus   string `json:"link_status"` // 链接状态,11待传链接
-	EnterpriseId string `json:"enterprise_id"`
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page_num"`
+	ProjectId    string   `json:"project_id"`  // 项目ID
+	LinkStatus   string   `json:"link_status"` // 链接状态,11待传链接
+	EnterpriseId string   `json:"enterprise_id"`
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetLocalPreLinkListData struct {
@@ -17,7 +18,7 @@ type GetLocalPreLinkListData struct {
 
 type LocalTasklinkinfo struct {
 	Task *LocaLTaskInfo `json:"task_info"`
-	DDl  time.Time      `json:"ddl"` // 提交时间
+	DDl  string         `json:"ddl"` // 提交时间
 }
 
 func NewLocalPreLinkListRequest() *LocalPreLinkListRequest {

+ 4 - 6
model/http_model/PassLocalTaskCoopRequest.go

@@ -1,12 +1,10 @@
 package http_model
 
 type PasslocalTaskCoopRequest struct {
-	ProjectId   string   `json:"project_id"`
-	TaskIds     []string `json:"task_ids"`
-	SProjectId  *int     `json:"s_project_id"`
-	OperatorId  string   `json:"operator_id"`
-	OperateType int      `json:"operate_type"`
-	IsSpecial   int      `json:"is_special"`
+	ProjectId  string   `json:"project_id"`
+	TaskIds    []string `json:"task_ids"`
+	OperatorId string   `json:"operator_id"`
+	IsSpecial  int      `json:"is_special"`
 }
 
 type PasslocalTaskCoopData struct {

+ 4 - 6
model/http_model/PassproTaskCoopRequest.go

@@ -1,12 +1,10 @@
 package http_model
 
 type PassproTaskCoopRequest struct {
-	ProjectId   string   `json:"project_id"`
-	TaskIds     []string `json:"task_ids"`
-	SProjectId  *int     `json:"s_project_id"`
-	OperatorId  string   `json:"operator_id"`
-	OperateType int      `json:"operate_type"`
-	IsSpecial   int      `json:"is_special"`
+	ProjectId  string   `json:"project_id"`
+	TaskIds    []string `json:"task_ids"`
+	OperatorId string   `json:"operator_id"`
+	IsSpecial  int      `json:"is_special"`
 }
 
 type PassproTaskCoopData struct {

+ 9 - 8
model/http_model/PreLinkList.go

@@ -1,13 +1,14 @@
 package http_model
 
-import "time"
-
 type PreLinkListRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	ProjectId    string `json:"project_id"`  // 项目ID
-	LinkStatus   string `json:"link_status"` // 链接状态,11待传链接
-	EnterpriseId string `json:"enterprise_id"`
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page"`
+	ProjectId    string   `json:"project_id"`  // 项目ID
+	LinkStatus   string   `json:"link_status"` // 链接状态,11待传链接
+	EnterpriseId string   `json:"enterprise_id"`
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetprelinkListData struct {
@@ -17,7 +18,7 @@ type GetprelinkListData struct {
 
 type Tasklinkinfo struct {
 	Task *TaskInfo `json:"task_info"`
-	DDl  time.Time `json:"ddl"` // 提交时间
+	DDl  string    `json:"ddl"` // 提交时间
 }
 
 func NewPreLinkListRequest() *PreLinkListRequest {

+ 2 - 3
model/http_model/RefuseproTaskCoopRequest.go

@@ -1,9 +1,8 @@
 package http_model
 
 type RefuseproTaskCoopRequest struct {
-	TaskIds     []string `json:"task_ids"`
-	OperatorId  string   `json:"operator_id"`
-	OperateType int      `json:"operate_type"`
+	TaskIds    []string `json:"task_ids"`
+	OperatorId string   `json:"operator_id"`
 }
 
 type RefuseproTaskCoopData struct {

+ 5 - 6
model/http_model/SubAccountDetail.go

@@ -3,12 +3,11 @@ package http_model
 import "youngee_m_api/model/gorm_model"
 
 type SubAccountDetailRequest struct {
-	PageSize       int     `json:"page_size"`
-	PageNum        int     `json:"page_num"`
-	JobId          *int    `json:"job_id,omitempty"`           // 可选的岗位类型
-	AccountStatus  *int    `json:"account_status,omitempty"`   // 可选的账号状态
-	PhoneNumber    *string `json:"phone_number,omitempty"`     // 可选的手机号
-	SubAccountName *string `json:"sub_account_name,omitempty"` // 可选的账号名称
+	PageSize      int    `json:"page_size"`
+	PageNum       int    `json:"page_num"`
+	JobId         *int   `json:"job_id,omitempty"`         // 可选的岗位类型
+	AccountStatus *int   `json:"account_status,omitempty"` // 可选的账号状态
+	Others        string `json:"others,omitempty"`         //手机号或账号名称
 }
 
 type SubAccountDetailResponse struct {

+ 6 - 5
model/http_model/data_accept.go

@@ -1,11 +1,12 @@
 package http_model
 
 type AcceptDataRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`   //项目id
-	IsSpecial   int    `json:"is_special"`   // 是否为专项项目
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
+	//Payment   float64 `json:"payment"`      //招募策略id
+	TaskIds      string  `json:"task_id_list"` //任务id列表
+	ProjectId    string  `json:"project_id"`   //项目id
+	IsSpecial    int     `json:"is_special"`   // 是否为专项项目
+	OperatorId   string  `json:"operator_id"`
+	SettleAmount *string `json:"settle_amount"`
 }
 
 type AcceptDataData struct {

+ 5 - 5
model/http_model/data_localaccept.go

@@ -2,11 +2,11 @@ package http_model
 
 type LocalAcceptDataRequest struct {
 	//Payment   float64 `json:"payment"`      //招募策略id
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`   //项目id
-	IsSpecial   int    `json:"is_special"`   // 是否为专项项目
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
+	TaskIds      string  `json:"task_id_list"` //任务id列表
+	ProjectId    string  `json:"project_id"`   //项目id
+	IsSpecial    int     `json:"is_special"`   // 是否为专项项目
+	OperatorId   string  `json:"operator_id"`
+	SettleAmount *string `json:"settle_amount"`
 }
 
 type LocalAcceptDataData struct {

+ 0 - 1
model/http_model/data_opinion.go

@@ -4,7 +4,6 @@ type DataOpinionRequest struct {
 	TaskID      string `json:"task_id"`      //任务-id
 	DataOpinion string `json:"Data_opinion"` //数据审核意见
 	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
 	ProjectId   string `json:"project_id"`
 }
 

+ 13 - 0
model/http_model/get_serveratio.go

@@ -0,0 +1,13 @@
+package http_model
+
+type GetServeratioRequest struct {
+}
+
+type GetServeratioResponse struct {
+	Ratio string `json:"ratio"`
+}
+
+func NewGetServeratioRequest() *GetServeratioRequest { return new(GetServeratioRequest) }
+func NewGetServeratioResponse() *CommonResponse {
+	return new(CommonResponse)
+}

+ 19 - 0
model/http_model/getlocalrecruittimerequest.go

@@ -0,0 +1,19 @@
+package http_model
+
+type GetLocalRecruitTimeRequest struct {
+	ProjectId string `json:"project_id"`
+}
+
+type GetLocalRecruitTimeResponse struct {
+	RecruitTime string `json:"recruit_time"`
+}
+
+func NewGetLocalRecruitTimeRequest() *GetLocalRecruitTimeRequest {
+	return new(GetLocalRecruitTimeRequest)
+}
+
+func NewGetLocalRecruitTimeResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetLocalRecruitTimeResponse)
+	return resp
+}

+ 22 - 0
model/http_model/getlocaltalentstatuscountrequest.go

@@ -0,0 +1,22 @@
+package http_model
+
+type GetLocalTalentstatusCountRequest struct {
+	ProjectId string `json:"project_id"`
+	TaskStage int    `json:"task_stage"`
+}
+
+type GetLocalTalentstatusCountResponse struct {
+	UnoperateTalentnum int64 `json:"unoperate_talentnum"`
+	AgreeTalentnum     int64 `json:"agree_talentnum"`
+	RefuseTalentnum    int64 `json:"refuse_talentnum"`
+}
+
+func NewGetLocalTalentstatusCountRequest() *GetLocalTalentstatusCountRequest {
+	return new(GetLocalTalentstatusCountRequest)
+}
+
+func NewGetLocalTalentstatusCountResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetLocalTalentstatusCountResponse)
+	return resp
+}

+ 21 - 0
model/http_model/getlocaltalentstatusnumrequest.go

@@ -0,0 +1,21 @@
+package http_model
+
+type GetLocalTalentstatusNumRequest struct {
+	ProjectId string `json:"project_id"`
+}
+
+type GetLocalTalentstatusNumResponse struct {
+	UnoperateTalentnum int64 `json:"unoperate_talentnum"`
+	AgreeTalentnum     int64 `json:"agree_talentnum"`
+	RefuseTalentnum    int64 `json:"refuse_talentnum"`
+}
+
+func NewGetLocalTalentstatusNumRequest() *GetLocalTalentstatusNumRequest {
+	return new(GetLocalTalentstatusNumRequest)
+}
+
+func NewGetLocalTalentstatusNumResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetLocalTalentstatusNumResponse)
+	return resp
+}

+ 22 - 16
model/http_model/getlocaltasklist.go

@@ -1,16 +1,17 @@
 package http_model
 
-import "time"
-
 type GetLocalTaskListRequest struct {
-	PageSize       int    `json:"page_size"`
-	PageNum        int    `json:"page_num"`
-	TalentFromList string `json:"talent_from_list"`
-	FeeFrom        *int   `json:"fee_from,omitempty"`
-	Type           *int   `json:"type,omitempty"` // 查询类型,1、2分别表示达人来源于公海(商家端),服务商
-	ProjectId      string `json:"project_id"`
-	CoopType       int    `json:"coop_type"` //1未处理,2同意,3拒绝
-	EnterPriseId   string `json:"enterprise_id"`
+	PageSize       int      `json:"page_size"`
+	PageNum        int      `json:"page"`
+	TalentFromList string   `json:"talent_from_list"`
+	FeeFrom        *int     `json:"fee_from,omitempty"`
+	Type           *int     `json:"type,omitempty"` // 查询类型,1、2分别表示达人来源于公海(商家端),服务商
+	ProjectId      string   `json:"project_id"`
+	CoopType       int      `json:"coop_type"` //1未处理,2同意,3拒绝
+	EnterPriseId   string   `json:"enterprise_id"`
+	SortField      []string `json:"sort_field,omitempty"`
+	SortOrder      []string `json:"sort_order,omitempty"`
+	Others         string   `json:"others,omitempty"`
 }
 
 type GetLocalTaskListData struct {
@@ -28,17 +29,22 @@ type LocaLTaskInfo struct {
 	TaskStage          int     `json:"task_stage"`
 	Voteavg            int     `json:"vote_avg"`
 	Commentavg         int     `json:"commit_avg"`
+	CollectNum         int     `json:"collect_num"`
 	CurrentDefaultType int     `json:"current_default_type"`
 	From               int     `json:"from"`   //1公海,2服务商
 	SType              int     `json:"s_type"` //1个人,2机构
+	SName              string  `json:"sname"`
 	Boperator          string  `json:"b_operator"`
 	//SettleAmount       float64   `json:"settle_amount"`
-	CreateAt   time.Time `json:"create_time"`
-	ISCoop     int       `json:"is_coop"`
-	NickName   string    `json:"nick_name"`
-	HeadUrl    string    `json:"head_url"`
-	Sprojectid int       `json:"sprojectid"`
-	City       string    `json:"city"`
+	CreateAt   string `json:"create_time"`
+	ISCoop     int    `json:"is_coop"`
+	Gender     string `json:"gender"`
+	NickName   string `json:"nick_name"`
+	HeadUrl    string `json:"head_url"`
+	Sprojectid int    `json:"sprojectid"`
+	City       string `json:"city"`
+	ListTime   string `json:"list_time"`
+	StageIntro string `json:"stage_intro"`
 }
 
 func NewGetLocalTaskListRequest() *GetLocalTaskListRequest {

+ 19 - 0
model/http_model/getrecruittimerequest.go

@@ -0,0 +1,19 @@
+package http_model
+
+type GetRecruitTimeRequest struct {
+	ProjectId string `json:"project_id"`
+}
+
+type GetRecruitTimeResponse struct {
+	RecruitTime string `json:"recruit_time"`
+}
+
+func NewGetRecruitTimeRequest() *GetRecruitTimeRequest {
+	return new(GetRecruitTimeRequest)
+}
+
+func NewGetRecruitTimeResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetRecruitTimeResponse)
+	return resp
+}

+ 18 - 0
model/http_model/getsketchrecordlistrequest.go

@@ -0,0 +1,18 @@
+package http_model
+
+type GetSketchRecordListRequest struct {
+	TaskID string `json:"task_id"`
+}
+
+type GetSketchRecordListResponse struct {
+	SketchData []GetSketchInfoData `json:"sketch_data"`
+}
+
+func NewGetSketchRecordListRequest() *GetSketchRecordListRequest {
+	return new(GetSketchRecordListRequest)
+}
+func NewGetSketchRecordListResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetSketchRecordListResponse)
+	return resp
+}

+ 22 - 0
model/http_model/gettalentstatuscountnum.go

@@ -0,0 +1,22 @@
+package http_model
+
+type GetTalentstatusCountRequest struct {
+	ProjectId string `json:"project_id"`
+	TaskStage int    `json:"task_stage"`
+}
+
+type GetTalentstatusCountResponse struct {
+	UnoperateTalentnum int64 `json:"unoperate_talentnum"`
+	AgreeTalentnum     int64 `json:"agree_talentnum"`
+	RefuseTalentnum    int64 `json:"refuse_talentnum"`
+}
+
+func NewGetTalentstatusCountRequest() *GetTalentstatusCountRequest {
+	return new(GetTalentstatusCountRequest)
+}
+
+func NewGetTalentstatusCountResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetTalentstatusCountResponse)
+	return resp
+}

+ 23 - 0
model/http_model/gettalentstatusnumrequest.go

@@ -0,0 +1,23 @@
+package http_model
+
+type GetTalentstatusNumRequest struct {
+	ProjectId string `json:"project_id"`
+	//FeeFrom   *int   `json:"fee_from,omitempty"`
+	//Type      *int   `json:"type,omitempty"` // 查询类型,1、2分别表示达人来源于公海(商家端),服务商
+}
+
+type GetTalentStatusNumResponse struct {
+	UnoperateTalentnum int64 `json:"unoperate_talentnum"`
+	AgreeTalentnum     int64 `json:"agree_talentnum"`
+	RefuseTalentnum    int64 `json:"refuse_talentnum"`
+}
+
+func NewGetTalentstatusNumRequest() *GetTalentstatusNumRequest {
+	return new(GetTalentstatusNumRequest)
+}
+
+func NewGetTalentStatusNumResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetTalentStatusNumResponse)
+	return resp
+}

+ 21 - 15
model/http_model/gettasklist.go

@@ -1,15 +1,16 @@
 package http_model
 
-import "time"
-
 type GetTaskListRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	FeeFrom      *int   `json:"fee_from,omitempty"`
-	Type         *int   `json:"type,omitempty"` // 查询类型,1、2分别表示达人来源于公海(商家端),服务商
-	ProjectId    string `json:"project_id"`
-	CoopType     int    `json:"coop_type"` //1未处理,2同意,3拒绝
-	EnterPriseId string `json:"enterprise_id"`
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page"`
+	FeeFrom      *int     `json:"fee_from,omitempty"`
+	Type         *int     `json:"type,omitempty"` // 查询类型,1、2分别表示达人来源于公海(商家端),服务商
+	ProjectId    string   `json:"project_id"`
+	CoopType     int      `json:"coop_type"` //1未处理,2同意,3拒绝
+	EnterPriseId string   `json:"enterprise_id"`
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetTaskListData struct {
@@ -27,17 +28,22 @@ type TaskInfo struct {
 	TaskStage          int     `json:"task_stage"`
 	Voteavg            int     `json:"vote_avg"`
 	Commentavg         int     `json:"commit_avg"`
+	CollectNum         int     `json:"collect_num"`
 	CurrentDefaultType int     `json:"current_default_type"`
 	From               int     `json:"from"`   //1公海,2服务商
 	SType              int     `json:"s_type"` //1个人,2机构
+	SName              string  `json:"sname"`
 	Boperator          string  `json:"b_operator"`
 	//SettleAmount       float64   `json:"settle_amount"`
-	CreateAt   time.Time `json:"create_time"`
-	ISCoop     int       `json:"is_coop"`
-	NickName   string    `json:"nick_name"`
-	HeadUrl    string    `json:"head_url"`
-	City       string    `json:"city"`
-	Sprojectid int       `json:"sprojectid"`
+	CreateAt   string `json:"create_time"`
+	ISCoop     int    `json:"is_coop"`
+	NickName   string `json:"nick_name"`
+	Gender     string `json:"gender"`
+	HeadUrl    string `json:"head_url"`
+	City       string `json:"city"`
+	Sprojectid int    `json:"sprojectid"`
+	ListTime   string `json:"list_time"`
+	StageIntro string `json:"stage_intro"`
 }
 
 func NewGetTaskListRequest() *GetTaskListRequest {

+ 23 - 0
model/http_model/joblistrequest.go

@@ -0,0 +1,23 @@
+package http_model
+
+type JobListRequest struct {
+}
+
+type JobListResponse struct {
+	Jobs []JoBInfo `json:"Jobs"`
+}
+
+type JoBInfo struct {
+	JobId   int    `json:"job_id"`
+	JobName string `json:"job_name"`
+}
+
+func NewJobListRequest() *JobListRequest {
+	return new(JobListRequest)
+}
+
+func NewJobListResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(JobListResponse)
+	return resp
+}

+ 26 - 0
model/http_model/jobshow.go

@@ -0,0 +1,26 @@
+package http_model
+
+type JobShowRequest struct {
+	JobId string `json:"job_id"`
+}
+
+type GetJobshowData struct {
+	JobId                int    `json:"job_id"`                //岗位ID
+	JobName              string `json:"job_name"`              //岗位名称
+	JobDetail            string `json:"ob_detail"`             //岗位描述
+	WorkshopPermission   string `json:"workshop_permission"`   //工作台权限
+	TaskcenterPermission string `json:"taskcenter_permission"` //任务中心权限
+	SectaskPermisson     string `json:"sectask_permisson"`     //商单中心权限
+	FinancialPermission  string `json:"financial_permission"`  //财务结算权限
+	UsercenterPermission string `json:"usercenter_permission"` //用户中心权限
+	OperatePermission    string `json:"operate_permission"`    //运营中心权限
+}
+
+func NewJobShowRequest() *JobShowRequest {
+	return new(JobShowRequest)
+}
+func NewJobShowResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetJobshowData)
+	return resp
+}

+ 4 - 5
model/http_model/link_accept.go

@@ -1,11 +1,10 @@
 package http_model
 
 type AcceptLinkRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
-	Isspecial   int    `json:"is_special"`
+	TaskIds    string `json:"task_id_list"` //任务id列表
+	ProjectId  string `json:"project_id"`
+	OperatorId string `json:"operator_id"`
+	Isspecial  int    `json:"is_special"`
 }
 
 type AcceptLinkData struct {

+ 4 - 5
model/http_model/link_localaccept.go

@@ -1,11 +1,10 @@
 package http_model
 
 type LocalAcceptLinkRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
-	Isspecial   int    `json:"is_special"`
+	TaskIds    string `json:"task_id_list"` //任务id列表
+	ProjectId  string `json:"project_id"`
+	OperatorId string `json:"operator_id"`
+	Isspecial  int    `json:"is_special"`
 }
 
 type LocalAcceptLinkData struct {

+ 0 - 1
model/http_model/link_opinion.go

@@ -5,7 +5,6 @@ type LinkOpinionRequest struct {
 	ProjectId   string `json:"project_id"`
 	LinkOpinion string `json:"Link_opinion"` //链接审核意见
 	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
 }
 
 type LinkOpinionData struct {

+ 0 - 1
model/http_model/localdata_opinion.go

@@ -5,7 +5,6 @@ type LocalDataOpinionRequest struct {
 	ProjectId        string `json:"project_id"`
 	LocalDataOpinion string `json:"Data_opinion"` //数据审核意见
 	OperatorId       string `json:"operator_id"`
-	OperateType      int    `json:"operate_type"`
 }
 
 type LocalDataOpinionData struct {

+ 0 - 1
model/http_model/locallink_opinion.go

@@ -5,7 +5,6 @@ type LocalLinkOpinionRequest struct {
 	ProjectId        string `json:"project_id"`
 	LocalLinkOpinion string `json:"Link_opinion"` //链接审核意见
 	OperatorId       string `json:"operator_id"`
-	OperateType      int    `json:"operate_type"`
 }
 
 type LocalLinkOpinionData struct {

+ 9 - 8
model/http_model/localpredatalist.go

@@ -1,13 +1,14 @@
 package http_model
 
-import "time"
-
 type LocalPreDataListRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	ProjectId    string `json:"project_id"`  // 项目ID
-	DataStatus   string `json:"data_status"` // 数据状态,13待传数据
-	EnterpriseId string `json:"enterprise_id"`
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page"`
+	ProjectId    string   `json:"project_id"`  // 项目ID
+	DataStatus   string   `json:"data_status"` // 数据状态,13待传数据
+	EnterpriseId string   `json:"enterprise_id"`
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetLocalPreDataListData struct {
@@ -17,7 +18,7 @@ type GetLocalPreDataListData struct {
 
 type LocalTaskdatainfo struct {
 	Task *LocaLTaskInfo `json:"task_info"`
-	DDl  time.Time      `json:"ddl"` // 截止时间
+	DDl  string         `json:"ddl"` // 截止时间
 }
 
 func NewLocalPreDataListRequest() *LocalPreDataListRequest {

+ 9 - 8
model/http_model/localpresketchlistrequest.go

@@ -1,13 +1,14 @@
 package http_model
 
-import "time"
-
 type LocalPreSketchListRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	ProjectId    string `json:"project_id"`    // 项目ID
-	ScriptStatus int    `json:"script_status"` // 稿件状态,10初稿待审
-	EnterpriseId string `json:"enterprise_id"`
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page_num"`
+	ProjectId    string   `json:"project_id"`    // 项目ID
+	ScriptStatus int      `json:"script_status"` // 稿件状态,10初稿待审
+	EnterpriseId string   `json:"enterprise_id"`
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetLocalSketchTaskListData struct {
@@ -17,7 +18,7 @@ type GetLocalSketchTaskListData struct {
 
 type LocalTasksketchInfo struct {
 	Task *LocaLTaskInfo `json:"task_info"`
-	DDl  time.Time      `json:"ddl"`
+	DDl  string         `json:"ddl"`
 }
 
 func NewLocalPreSketchListRequest() *LocalPreSketchListRequest {

+ 3 - 4
model/http_model/localreject_data.go

@@ -1,10 +1,9 @@
 package http_model
 
 type LocalRejectDataRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
+	TaskIds    string `json:"task_id_list"` //任务id列表
+	ProjectId  string `json:"project_id"`
+	OperatorId string `json:"operator_id"`
 }
 
 type LocalRejectDataData struct {

+ 3 - 4
model/http_model/localreject_link.go

@@ -1,10 +1,9 @@
 package http_model
 
 type LocalRejectLinkRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
+	TaskIds    string `json:"task_id_list"` //任务id列表
+	ProjectId  string `json:"project_id"`
+	OperatorId string `json:"operator_id"`
 }
 
 type LocalRejectLinkData struct {

+ 0 - 1
model/http_model/localsketch_opinion.go

@@ -5,7 +5,6 @@ type LocalSketchOpinionRequest struct {
 	ProjectId          string `json:"project_id"`
 	LocalSketchOpinion string `json:"sketch_opinion"` //初稿意见
 	OperatorId         string `json:"operator_id"`
-	OperateType        int    `json:"operate_type"`
 }
 
 type LocalSketchOpinionData struct {

+ 10 - 9
model/http_model/localtaskdatalist.go

@@ -1,13 +1,14 @@
 package http_model
 
-import "time"
-
 type LocalTaskDatalistRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	ProjectId    string `json:"project_id"`  // 项目ID
-	DataStatus   string `json:"data_status"` // 链接状态,14
-	EnterpriseId string `json:"enterprise_id"`
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page"`
+	ProjectId    string   `json:"project_id"`  // 项目ID
+	DataStatus   string   `json:"data_status"` // 链接状态,14
+	EnterpriseId string   `json:"enterprise_id"`
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetLocalTaskDatalistData struct {
@@ -17,8 +18,8 @@ type GetLocalTaskDatalistData struct {
 
 type LocalTaskDatainfo struct {
 	Task          *LocaLTaskInfo `json:"task_info"`
-	SubmitAt      time.Time      `json:"submit_at"` // 提交时间
-	AgreeAt       time.Time      `json:"agree_at"`
+	SubmitAt      string         `json:"submit_at"` // 提交时间
+	AgreeAt       string         `json:"agree_at"`
 	DataId        int            `json:"data_id"` //初稿ID
 	PhotoUrl      string         `json:"photo_url"`
 	PlayNumber    int            `json:"play_number"`

+ 10 - 9
model/http_model/localtasklinklist.go

@@ -1,13 +1,14 @@
 package http_model
 
-import "time"
-
 type LocalTaskLinklistRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	ProjectId    string `json:"project_id"`  // 项目ID
-	LinkStatus   string `json:"link_status"` // 链接状态,12待审
-	EnterpriseId string `json:"enterprise_id"`
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page"`
+	ProjectId    string   `json:"project_id"`  // 项目ID
+	LinkStatus   string   `json:"link_status"` // 链接状态,12待审
+	EnterpriseId string   `json:"enterprise_id"`
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetLocalTaskLinkListData struct {
@@ -17,8 +18,8 @@ type GetLocalTaskLinkListData struct {
 
 type LocalTaskLinkinfo struct {
 	Task     *LocaLTaskInfo `json:"task_info"`
-	SubmitAt time.Time      `json:"submit_at"` // 提交时间
-	AgreeAt  time.Time      `json:"agree_at"`
+	SubmitAt string         `json:"submit_at"` // 提交时间
+	AgreeAt  string         `json:"agree_at"`
 	LinkId   int            `json:"link_id"` //初稿ID
 	LinkUrl  string         `json:"link_url"`
 	PhotoUrl string         `json:"photo_url"`

+ 13 - 11
model/http_model/localtasksketchlist.go

@@ -1,12 +1,13 @@
 package http_model
 
-import "time"
-
 type LocalTasksketchlistRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	ProjectId    string `json:"project_id"`    // 项目ID
-	ScriptStatus int    `json:"script_status"` // 稿件状态
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page"`
+	ProjectId    string   `json:"project_id"`    // 项目ID
+	ScriptStatus int      `json:"script_status"` // 稿件状态
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetsketchlocaltaskListData struct {
@@ -15,11 +16,12 @@ type GetsketchlocaltaskListData struct {
 }
 
 type LocalTasksketchinfo struct {
-	Task     *LocaLTaskInfo `json:"task_info"`
-	SubmitAt time.Time      `json:"submit_at"` // 提交时间
-	AgreeAt  time.Time      `json:"agree_at"`
-	Operator string         `json:"operator"`
-	SketchId int            `json:"sketch_id"` //初稿ID
+	Task       *LocaLTaskInfo `json:"task_info"`
+	SubmitAt   string         `json:"submit_at"` // 提交时间
+	AgreeAt    string         `json:"agree_at"`
+	Operator   string         `json:"operator"`
+	SketchId   int            `json:"sketch_id"` //初稿ID
+	SketchType int            `json:"sketch_type"`
 }
 
 func NewLocalTasksketchlistRequest() *LocalTasksketchlistRequest {

+ 9 - 8
model/http_model/predatalist.go

@@ -1,13 +1,14 @@
 package http_model
 
-import "time"
-
 type PreDataListRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	ProjectId    string `json:"project_id"`  // 项目ID
-	DataStatus   string `json:"data_status"` // 数据状态,13待传数据
-	EnterpriseId string `json:"enterprise_id"`
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page"`
+	ProjectId    string   `json:"project_id"`  // 项目ID
+	DataStatus   string   `json:"data_status"` // 数据状态,13待传数据
+	EnterpriseId string   `json:"enterprise_id"`
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetPreDataListData struct {
@@ -17,7 +18,7 @@ type GetPreDataListData struct {
 
 type Taskdatainfo struct {
 	Task *TaskInfo `json:"task_info"`
-	DDl  time.Time `json:"ddl"` // 截止时间
+	DDl  string    `json:"ddl"` // 截止时间
 }
 
 func NewPreDataListRequest() *PreDataListRequest {

+ 9 - 8
model/http_model/presketchlist.go

@@ -1,13 +1,14 @@
 package http_model
 
-import "time"
-
 type PreSketchListRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	ProjectId    string `json:"project_id"`    // 项目ID
-	ScriptStatus int    `json:"script_status"` // 稿件状态,10初稿待审
-	EnterpriseId string `json:"enterprise_id"`
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page"`
+	ProjectId    string   `json:"project_id"`    // 项目ID
+	ScriptStatus int      `json:"script_status"` // 稿件状态,10初稿待审
+	EnterpriseId string   `json:"enterprise_id"`
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetSketchTaskListData struct {
@@ -17,7 +18,7 @@ type GetSketchTaskListData struct {
 
 type TasksketchInfo struct {
 	Task *TaskInfo `json:"task_info"`
-	DDl  time.Time `json:"ddl"`
+	DDl  string    `json:"ddl"`
 }
 
 func NewPreSketchListRequest() *PreSketchListRequest {

+ 2 - 3
model/http_model/refuselocaltaskcooprequest.go

@@ -1,9 +1,8 @@
 package http_model
 
 type RefuselocalTaskCoopRequest struct {
-	TaskIds     []string `json:"task_ids"`
-	OperatorId  string   `json:"operator_id"`
-	OperateType int      `json:"operate_type"`
+	TaskIds    []string `json:"task_ids"`
+	OperatorId string   `json:"operator_id"`
 }
 
 type RefuselocalTaskCoopData struct {

+ 3 - 4
model/http_model/reject_data.go

@@ -1,10 +1,9 @@
 package http_model
 
 type RejectDataRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
+	TaskIds    string `json:"task_id_list"` //任务id列表
+	ProjectId  string `json:"project_id"`
+	OperatorId string `json:"operator_id"`
 }
 
 type RejectDataData struct {

+ 3 - 4
model/http_model/reject_link.go

@@ -1,10 +1,9 @@
 package http_model
 
 type RejectLinkRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
+	TaskIds    string `json:"task_id_list"` //任务id列表
+	ProjectId  string `json:"project_id"`
+	OperatorId string `json:"operator_id"`
 }
 
 type RejectLinkData struct {

+ 4 - 5
model/http_model/sketch_accept.go

@@ -1,11 +1,10 @@
 package http_model
 
 type AcceptSketchRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
-	IsSpecial   int    `json:"is_special"`
+	TaskIds    string `json:"task_id_list"` //任务id列表
+	ProjectId  string `json:"project_id"`
+	OperatorId string `json:"operator_id"`
+	IsSpecial  int    `json:"is_special"`
 }
 
 type AcceptSketchData struct {

+ 4 - 5
model/http_model/sketch_loaclaccept.go

@@ -1,11 +1,10 @@
 package http_model
 
 type LocalAcceptSketchRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
-	IsSpecial   int    `json:"is_special"`
+	TaskIds    string `json:"task_id_list"` //任务id列表
+	ProjectId  string `json:"project_id"`
+	OperatorId string `json:"operator_id"`
+	IsSpecial  int    `json:"is_special"`
 }
 
 type LocalAcceptSketchData struct {

+ 3 - 4
model/http_model/sketch_localreject.go

@@ -1,10 +1,9 @@
 package http_model
 
 type LocalRejectSketchRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
+	TaskIds    string `json:"task_id_list"` //任务id列表
+	ProjectId  string `json:"project_id"`
+	OperatorId string `json:"operator_id"`
 }
 
 type LocalRejectSketchData struct {

+ 0 - 1
model/http_model/sketch_opinion.go

@@ -5,7 +5,6 @@ type SketchOpinionRequest struct {
 	ProjectId     string `json:"project_id"`
 	SketchOpinion string `json:"sketch_opinion"` //初稿意见
 	OperatorId    string `json:"operator_id"`
-	OperateType   int    `json:"operate_type"`
 }
 
 type SketchOpinionData struct {

+ 3 - 4
model/http_model/sketch_reject.go

@@ -1,10 +1,9 @@
 package http_model
 
 type RejectSketchRequest struct {
-	TaskIds     string `json:"task_id_list"` //任务id列表
-	ProjectId   string `json:"project_id"`
-	OperatorId  string `json:"operator_id"`
-	OperateType int    `json:"operate_type"`
+	TaskIds    string `json:"task_id_list"` //任务id列表
+	ProjectId  string `json:"project_id"`
+	OperatorId string `json:"operator_id"`
 }
 
 type RejectSketchData struct {

+ 2 - 4
model/http_model/sktech_info.go

@@ -1,7 +1,5 @@
 package http_model
 
-import "time"
-
 type GetSketchInfoRequest struct {
 	TaskID string `json:"task_id"`
 }
@@ -16,8 +14,8 @@ type GetSketchInfoData struct {
 	SketchPhotos   []SketchPhotoInfo `json:"sketch_photos"` //初稿图片以及视频
 	Title          string            `json:"title"`
 	Content        string            `json:"content"`
-	Agreeat        time.Time         `json:"agree_at"`
-	Submitat       time.Time         `json:"submit_at"`
+	Agreeat        string            `json:"agree_at"`
+	Submitat       string            `json:"submit_at"`
 	ReverseOpinion string            `json:"reverse_opinion"`
 }
 

+ 20 - 0
model/http_model/subaccshowrequest.go

@@ -0,0 +1,20 @@
+package http_model
+
+type SubAccShowRequest struct {
+	SubaccountId string `json:"sub_account_id"`
+}
+
+type GetSubAccountData struct {
+	Phonenumber    string `json:"phonenumber"`
+	SubAccountName string `json:"sub_account_name"`
+	JobId          int    `json:"job_id"`
+}
+
+func NewSubAccShowRequest() *SubAccShowRequest {
+	return new(SubAccShowRequest)
+}
+func NewSubAccShowResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetSubAccountData)
+	return resp
+}

+ 10 - 9
model/http_model/taskdatalist.go

@@ -1,13 +1,14 @@
 package http_model
 
-import "time"
-
 type TaskDatalistRequest struct {
-	PageSize     int    `json:"page_size"`
-	PageNum      int    `json:"page_num"`
-	ProjectId    string `json:"project_id"`  // 项目ID
-	DataStatus   string `json:"data_status"` // 链接状态,14
-	EnterpriseId string `json:"enterprise_id"`
+	PageSize     int      `json:"page_size"`
+	PageNum      int      `json:"page"`
+	ProjectId    string   `json:"project_id"`  // 项目ID
+	DataStatus   string   `json:"data_status"` // 链接状态,14
+	EnterpriseId string   `json:"enterprise_id"`
+	SortField    []string `json:"sort_field,omitempty"`
+	SortOrder    []string `json:"sort_order,omitempty"`
+	Others       string   `json:"others,omitempty"`
 }
 
 type GetTaskDatalistData struct {
@@ -17,8 +18,8 @@ type GetTaskDatalistData struct {
 
 type TaskDatainfo struct {
 	Task          *TaskInfo `json:"task_info"`
-	SubmitAt      time.Time `json:"submit_at"` // 提交时间
-	AgreeAt       time.Time `json:"agree_at"`
+	SubmitAt      string    `json:"submit_at"` // 提交时间
+	AgreeAt       string    `json:"agree_at"`
 	DataId        int       `json:"data_id"` //初稿ID
 	PhotoUrl      string    `json:"photo_url"`
 	PlayNumber    int       `json:"play_number"`

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff