|
@@ -77,7 +77,11 @@ func GetProjecttaskList(ctx context.Context, request http_model.GetTaskListReque
|
|
|
db := GetReadDB(ctx)
|
|
|
var projecrtaskinfo []gorm_model.YoungeeTaskInfo
|
|
|
query := db.Model(&gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_status = ?", request.ProjectId, request.CoopType)
|
|
|
-
|
|
|
+ var projectinfo gorm_model.ProjectInfo
|
|
|
+ err := db.Model(&gorm_model.ProjectInfo{}).Where("project_id = ?", request.ProjectId).First(&projectinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return &http_model.GetTaskListData{}, err
|
|
|
+ }
|
|
|
// 构建查询条件
|
|
|
if request.FeeFrom != nil {
|
|
|
query = query.Where("fee_form = ?", request.FeeFrom)
|
|
@@ -90,7 +94,9 @@ func GetProjecttaskList(ctx context.Context, request http_model.GetTaskListReque
|
|
|
query = query.Where("supplier_id !=0 AND supplier_status = 2")
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if request.Others != "" {
|
|
|
+ query = query.Where("talent_name LIKE ? OR s_operate_name LIKE ?", "%"+request.Others+"%", "%"+request.Others+"%")
|
|
|
+ }
|
|
|
// 计算总数
|
|
|
var total int64
|
|
|
if err := query.Count(&total).Error; err != nil {
|
|
@@ -160,10 +166,82 @@ func GetProjecttaskList(ctx context.Context, request http_model.GetTaskListReque
|
|
|
case 3:
|
|
|
Time = task.CompleteDate
|
|
|
}
|
|
|
+ var listtime, stageintro string
|
|
|
+ switch task.TaskStage {
|
|
|
+ case 4:
|
|
|
+ {
|
|
|
+ listtime = task.SelectDate.Format("2006-01-02 15:04:05")
|
|
|
+ stageintro = "执行开始时间"
|
|
|
+ }
|
|
|
+ case 5:
|
|
|
+ {
|
|
|
+ listtime = task.DeliveryDate.Format("2006-01-02 15:04:05")
|
|
|
+ stageintro = "商家寄样时间"
|
|
|
+ }
|
|
|
+ case 9:
|
|
|
+ {
|
|
|
+ listtime = task.CurBreakAt.Format("2006-01-02 15:04:05")
|
|
|
+ stageintro = "初稿上传截止时间"
|
|
|
+ }
|
|
|
+ case 10:
|
|
|
+ {
|
|
|
+ var sketchinfo gorm_model.YounggeeSketchInfo
|
|
|
+ err := db.Model(&gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_review = 0", task.TaskID).First(&sketchinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ listtime = sketchinfo.SubmitAt.Format("2006-01-02 15:04:05")
|
|
|
+ stageintro = "达人上传初稿时间" //
|
|
|
+ }
|
|
|
+ case 11:
|
|
|
+ {
|
|
|
+ listtime = task.CurBreakAt.Format("2006-01-02 15:04:05")
|
|
|
+ stageintro = " 链接上传截止时间"
|
|
|
+ }
|
|
|
+ case 12:
|
|
|
+ {
|
|
|
+ var linkinfo gorm_model.YounggeeLinkInfo
|
|
|
+ err := db.Model(&gorm_model.YounggeeLinkInfo{}).Where("task_id = ? and is_review = 0", task.TaskID).First(&linkinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ listtime = linkinfo.SubmitAt.Format("2006-01-02 15:04:05")
|
|
|
+ stageintro = "达人上传链接时间"
|
|
|
+ }
|
|
|
+ case 13:
|
|
|
+ {
|
|
|
+ listtime = task.CurBreakAt.Format("2006-01-02 15:04:05")
|
|
|
+ stageintro = "数据待传截止时间"
|
|
|
+ }
|
|
|
+ case 14:
|
|
|
+ {
|
|
|
+ var datainfo gorm_model.YounggeeDataInfo
|
|
|
+ err := db.Model(&gorm_model.YounggeeDataInfo{}).Where("task_id = ? and is_review = 0", task.TaskID).First(&datainfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ var auto_task_finish gorm_model.InfoAutoTask
|
|
|
+ db.Model(&gorm_model.InfoAutoTask{}).Where("enterprise_id = ?", request.EnterPriseId).First(&auto_task_finish)
|
|
|
+ // 将小时数转换为 Duration 后相加
|
|
|
+ resultTime := datainfo.SubmitAt.Add(time.Duration(auto_task_finish.TaskFinishAuto) * time.Hour)
|
|
|
+ listtime = resultTime.Format("2006-01-02 15:04:05")
|
|
|
+ stageintro = "品牌最晚结算时间"
|
|
|
+ }
|
|
|
+ case 15:
|
|
|
+ {
|
|
|
+ listtime = task.CompleteDate.Format("2006-01-02 15:04:05")
|
|
|
+ stageintro = "品牌结算时间"
|
|
|
+ }
|
|
|
+ case 16:
|
|
|
+ {
|
|
|
+ listtime = task.CancelTime.Format("2006-01-02 15:04:05")
|
|
|
+ stageintro = "解约时间"
|
|
|
+ }
|
|
|
+ }
|
|
|
boperator := getBOperator(db, task.BOperator, task.BOperatorType)
|
|
|
nickname, headurl, gender, fansnum, voteavg := getTalentinfo(db, task.OpenId)
|
|
|
Iscoop := getIscoop(db, task.TalentID, request.EnterPriseId)
|
|
|
- s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus)
|
|
|
+ s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, projectinfo.ProjectType)
|
|
|
response := &http_model.TaskInfo{
|
|
|
TaskId: task.TaskID,
|
|
|
ProjectId: task.ProjectID,
|
|
@@ -187,6 +265,8 @@ func GetProjecttaskList(ctx context.Context, request http_model.GetTaskListReque
|
|
|
ISCoop: Iscoop,
|
|
|
Sprojectid: task.SprojectId,
|
|
|
City: task.City,
|
|
|
+ ListTime: listtime,
|
|
|
+ StageIntro: stageintro,
|
|
|
}
|
|
|
taskInfoPointers = append(taskInfoPointers, response)
|
|
|
}
|
|
@@ -245,18 +325,30 @@ func determineFrom(supplierID, supplierStatus int) int {
|
|
|
return 1
|
|
|
}
|
|
|
|
|
|
-func stype(db *gorm.DB, supplierID, supplierStatus int) (int, string) {
|
|
|
- if supplierID != 0 && supplierStatus == 2 {
|
|
|
- var supplierinfo gorm_model.Supplier
|
|
|
- err := db.Model(gorm_model.Supplier{}).Where("supplier_id = ?", supplierID).First(&supplierinfo).Error
|
|
|
- if err != nil {
|
|
|
- return 0, "公海"
|
|
|
+func stype(db *gorm.DB, supplierID, supplierStatus int, projecttype int64) (int, string) {
|
|
|
+ if projecttype == 1 {
|
|
|
+ if supplierID != 0 && supplierStatus == 2 {
|
|
|
+ var supplierinfo gorm_model.Supplier
|
|
|
+ err := db.Model(gorm_model.Supplier{}).Where("supplier_id = ?", supplierID).First(&supplierinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return 0, "公海"
|
|
|
+ }
|
|
|
+ return supplierinfo.SupplierType, supplierinfo.SupplierName
|
|
|
}
|
|
|
- return supplierinfo.SupplierType, supplierinfo.SupplierName
|
|
|
+ return 0, "公海"
|
|
|
+ } else {
|
|
|
+ if supplierID != 0 && supplierStatus == 2 {
|
|
|
+ var supplierinfo gorm_model.Supplier
|
|
|
+ err := db.Model(gorm_model.Supplier{}).Where("supplier_id = ?", supplierID).First(&supplierinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return 0, "私域"
|
|
|
+ }
|
|
|
+ return supplierinfo.SupplierType, supplierinfo.SupplierName
|
|
|
+ }
|
|
|
+ return 0, "私域"
|
|
|
}
|
|
|
- return 0, "公海"
|
|
|
}
|
|
|
-func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, operatorid string, operatetype int, Isspecial int, req http_model.PassproTaskCoopRequest) (bool, error) {
|
|
|
+func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, operatorid string, operatetype int, Isspecial int, Enterpriseid string, req http_model.PassproTaskCoopRequest) (bool, error) {
|
|
|
db := GetReadDB(ctx)
|
|
|
var count int64
|
|
|
err := db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id IN ? AND task_stage = 1", taskIds).Count(&count).Error
|
|
@@ -317,6 +409,21 @@ func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, op
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ var opid string
|
|
|
+ var optype int
|
|
|
+ switch operatetype {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ opid = Enterpriseid
|
|
|
+ optype = 1
|
|
|
+ }
|
|
|
+ case 4:
|
|
|
+ {
|
|
|
+ opid = operatorid
|
|
|
+ optype = 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//4.根据达人来源改变状态、阶段、数目
|
|
|
var tasks []gorm_model.YoungeeTaskInfo
|
|
|
err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id IN ? AND task_stage = 1", taskIds).Find(&tasks).Error
|
|
@@ -331,8 +438,8 @@ func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, op
|
|
|
TaskStage: taskstages,
|
|
|
TaskStatus: 2,
|
|
|
UpdateAt: time.Now(),
|
|
|
- BOperator: operatorid,
|
|
|
- BOperatorType: operatetype,
|
|
|
+ BOperator: opid,
|
|
|
+ BOperatorType: optype,
|
|
|
SelectDate: time.Now(),
|
|
|
}
|
|
|
err = tx.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ? AND task_stage = 1", taskInfo.TaskID).Updates(updateData).Error
|
|
@@ -354,13 +461,13 @@ func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, op
|
|
|
}
|
|
|
//服务商s_project已招募人数+1
|
|
|
var sprojectinfo gorm_model.YounggeeSProjectInfo
|
|
|
- err = db.Model(gorm_model.YounggeeSProjectInfo{}).Where(" s_project_id =?", req.SProjectId).Find(&sprojectinfo).Error
|
|
|
+ err = db.Model(gorm_model.YounggeeSProjectInfo{}).Where(" s_project_id =?", taskInfo.SprojectId).Find(&sprojectinfo).Error
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
sprojectinfo.RecruitNum += 1
|
|
|
fmt.Println("......", projectinfo.RecruitNum)
|
|
|
- err = tx.Model(gorm_model.YounggeeSProjectInfo{}).Where(" s_project_id =?", req.SProjectId).Updates(sprojectinfo).Error
|
|
|
+ err = tx.Model(gorm_model.YounggeeSProjectInfo{}).Where(" s_project_id =?", taskInfo.SprojectId).Updates(sprojectinfo).Error
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -388,8 +495,8 @@ func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, op
|
|
|
TaskStage: taskstages,
|
|
|
TaskStatus: 2,
|
|
|
UpdateAt: time.Now(),
|
|
|
- BOperator: operatorid,
|
|
|
- BOperatorType: operatetype,
|
|
|
+ BOperator: opid,
|
|
|
+ BOperatorType: optype,
|
|
|
SelectDate: time.Now(),
|
|
|
}
|
|
|
err = tx.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ? AND task_stage = 1", taskInfo.TaskID).Updates(updateData).Error
|
|
@@ -427,7 +534,7 @@ func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, op
|
|
|
return true, nil
|
|
|
}
|
|
|
|
|
|
-func RefuseproTaskCoop(ctx context.Context, taskIds []string, operatorid string, operatetype int) (bool, error) {
|
|
|
+func RefuseproTaskCoop(ctx context.Context, taskIds []string, operatorid string, operatetype int, Enterpriseid string) (bool, error) {
|
|
|
db := GetWriteDB(ctx)
|
|
|
// 1. 校验
|
|
|
var count int64
|
|
@@ -439,6 +546,21 @@ func RefuseproTaskCoop(ctx context.Context, taskIds []string, operatorid string,
|
|
|
return false, errors.New("任务id有误")
|
|
|
}
|
|
|
|
|
|
+ var opid string
|
|
|
+ var optype int
|
|
|
+ switch operatetype {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ opid = Enterpriseid
|
|
|
+ optype = 1
|
|
|
+ }
|
|
|
+ case 4:
|
|
|
+ {
|
|
|
+ opid = operatorid
|
|
|
+ optype = 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 2. 查询任务对应达人id(用于生成达人消息)
|
|
|
var talentIds []string
|
|
|
err = db.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", taskIds).Select("talent_id").Find(&talentIds).Error
|
|
@@ -456,8 +578,8 @@ func RefuseproTaskCoop(ctx context.Context, taskIds []string, operatorid string,
|
|
|
TaskStage: 3,
|
|
|
TaskStatus: 3,
|
|
|
UpdateAt: time.Now(),
|
|
|
- BOperator: operatorid,
|
|
|
- BOperatorType: operatetype,
|
|
|
+ BOperator: opid,
|
|
|
+ BOperatorType: optype,
|
|
|
CompleteDate: time.Now(),
|
|
|
}
|
|
|
err = tx.Model(gorm_model.YoungeeTaskInfo{}).Where("task_id = ? AND task_stage = 1", taskInfo.TaskID).Updates(updateData).Error
|
|
@@ -479,7 +601,11 @@ func GetPreSketchList(ctx context.Context, request http_model.PreSketchListReque
|
|
|
db := GetReadDB(ctx)
|
|
|
var projecrtaskinfo []gorm_model.YoungeeTaskInfo
|
|
|
query := db.Model(&gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_stage = ?", request.ProjectId, request.ScriptStatus)
|
|
|
-
|
|
|
+ var projectinfo gorm_model.ProjectInfo
|
|
|
+ err := db.Model(&gorm_model.ProjectInfo{}).Where("project_id = ?", request.ProjectId).First(&projectinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return &http_model.GetSketchTaskListData{}, err
|
|
|
+ }
|
|
|
if request.Others != "" {
|
|
|
query = query.Where("talent_name LIKE ? OR s_operate_name LIKE ?", "%"+request.Others+"%", "%"+request.Others+"%")
|
|
|
}
|
|
@@ -545,7 +671,7 @@ func GetPreSketchList(ctx context.Context, request http_model.PreSketchListReque
|
|
|
for _, task := range projecrtaskinfo {
|
|
|
nickname, headurl, gender, fansnum, voteavg := getTalentinfo(db, task.OpenId)
|
|
|
Iscoop := getIscoop(db, task.TalentID, request.EnterpriseId)
|
|
|
- s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus)
|
|
|
+ s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, projectinfo.ProjectType)
|
|
|
taskinfo := &http_model.TaskInfo{
|
|
|
TaskId: task.TaskID,
|
|
|
ProjectId: task.ProjectID,
|
|
@@ -584,7 +710,11 @@ func GetSketchList(ctx context.Context, request http_model.TasksketchlistRequest
|
|
|
db := GetReadDB(ctx)
|
|
|
var projecrtaskinfo []gorm_model.YoungeeTaskInfo
|
|
|
query := db.Model(&gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_stage = ?", request.ProjectId, request.ScriptStatus)
|
|
|
-
|
|
|
+ var projectinfo gorm_model.ProjectInfo
|
|
|
+ err := db.Model(&gorm_model.ProjectInfo{}).Where("project_id = ?", request.ProjectId).First(&projectinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return &http_model.GetsketchtaskListData{}, err
|
|
|
+ }
|
|
|
if request.Others != "" {
|
|
|
query = query.Where("talent_name LIKE ? OR s_operate_name LIKE ?", "%"+request.Others+"%", "%"+request.Others+"%")
|
|
|
}
|
|
@@ -648,7 +778,7 @@ func GetSketchList(ctx context.Context, request http_model.TasksketchlistRequest
|
|
|
taskInfoPointers := make([]*http_model.Tasksketchinfo, 0, len(projecrtaskinfo))
|
|
|
for _, task := range projecrtaskinfo {
|
|
|
nickname, headurl, gender, fansnum, voteavg := getTalentinfo(db, task.OpenId)
|
|
|
- s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus)
|
|
|
+ s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, projectinfo.ProjectType)
|
|
|
taskinfo := &http_model.TaskInfo{
|
|
|
TaskId: task.TaskID,
|
|
|
ProjectId: task.ProjectID,
|
|
@@ -669,11 +799,21 @@ func GetSketchList(ctx context.Context, request http_model.TasksketchlistRequest
|
|
|
HeadUrl: headurl,
|
|
|
City: task.City,
|
|
|
}
|
|
|
+
|
|
|
var sketchinfo gorm_model.YounggeeSketchInfo
|
|
|
- err := db.Model(&gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_review = 0", task.TaskID).First(&sketchinfo).Error
|
|
|
- if err != nil {
|
|
|
- return nil, err
|
|
|
+ switch request.ScriptStatus {
|
|
|
+ case 10:
|
|
|
+ err := db.Model(&gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_review = 0 ", task.TaskID).First(&sketchinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ case 11:
|
|
|
+ err := db.Model(&gorm_model.YounggeeSketchInfo{}).Where("task_id = ? and is_ok = 1", task.TaskID).First(&sketchinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
boperator := getBOperator(db, task.BOperator, task.BOperatorType)
|
|
|
response := &http_model.Tasksketchinfo{
|
|
|
Task: taskinfo,
|
|
@@ -695,7 +835,11 @@ func GetPreLinkList(ctx context.Context, request http_model.PreLinkListRequest)
|
|
|
db := GetReadDB(ctx)
|
|
|
var projecrtaskinfo []gorm_model.YoungeeTaskInfo
|
|
|
query := db.Model(&gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_stage = ?", request.ProjectId, request.LinkStatus)
|
|
|
-
|
|
|
+ var projectinfo gorm_model.ProjectInfo
|
|
|
+ err := db.Model(&gorm_model.ProjectInfo{}).Where("project_id = ?", request.ProjectId).First(&projectinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return &http_model.GetprelinkListData{}, err
|
|
|
+ }
|
|
|
if request.Others != "" {
|
|
|
query = query.Where("talent_name LIKE ? OR s_operate_name LIKE ?", "%"+request.Others+"%", "%"+request.Others+"%")
|
|
|
}
|
|
@@ -760,7 +904,7 @@ func GetPreLinkList(ctx context.Context, request http_model.PreLinkListRequest)
|
|
|
for _, task := range projecrtaskinfo {
|
|
|
nickname, headurl, gender, fansnum, voteavg := getTalentinfo(db, task.OpenId)
|
|
|
Iscoop := getIscoop(db, task.TalentID, request.EnterpriseId)
|
|
|
- s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus)
|
|
|
+ s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, projectinfo.ProjectType)
|
|
|
taskinfo := &http_model.TaskInfo{
|
|
|
TaskId: task.TaskID,
|
|
|
ProjectId: task.ProjectID,
|
|
@@ -799,7 +943,11 @@ func GetLinkList(ctx context.Context, request http_model.TaskLinklistRequest) (*
|
|
|
db := GetReadDB(ctx)
|
|
|
var projecrtaskinfo []gorm_model.YoungeeTaskInfo
|
|
|
query := db.Model(&gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_stage = ?", request.ProjectId, request.LinkStatus)
|
|
|
-
|
|
|
+ var projectinfo gorm_model.ProjectInfo
|
|
|
+ err := db.Model(&gorm_model.ProjectInfo{}).Where("project_id = ?", request.ProjectId).First(&projectinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return &http_model.GettasklinkListData{}, err
|
|
|
+ }
|
|
|
if request.Others != "" {
|
|
|
query = query.Where("talent_name LIKE ? OR s_operate_name LIKE ?", "%"+request.Others+"%", "%"+request.Others+"%")
|
|
|
}
|
|
@@ -864,7 +1012,7 @@ func GetLinkList(ctx context.Context, request http_model.TaskLinklistRequest) (*
|
|
|
for _, task := range projecrtaskinfo {
|
|
|
nickname, headurl, gender, fansnum, voteavg := getTalentinfo(db, task.OpenId)
|
|
|
Iscoop := getIscoop(db, task.TalentID, request.EnterpriseId)
|
|
|
- s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus)
|
|
|
+ s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, projectinfo.ProjectType)
|
|
|
taskinfo := &http_model.TaskInfo{
|
|
|
TaskId: task.TaskID,
|
|
|
ProjectId: task.ProjectID,
|
|
@@ -887,9 +1035,17 @@ func GetLinkList(ctx context.Context, request http_model.TaskLinklistRequest) (*
|
|
|
City: task.City,
|
|
|
}
|
|
|
var linkinfo gorm_model.YounggeeLinkInfo
|
|
|
- err := db.Model(&gorm_model.YounggeeLinkInfo{}).Where("task_id = ? and is_review = 0", task.TaskID).First(&linkinfo).Error
|
|
|
- if err != nil {
|
|
|
- return nil, err
|
|
|
+ switch request.LinkStatus {
|
|
|
+ case "12":
|
|
|
+ err := db.Model(&gorm_model.YounggeeLinkInfo{}).Where("task_id = ? and is_review = 0 ", task.TaskID).First(&linkinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ case "13":
|
|
|
+ err := db.Model(&gorm_model.YounggeeLinkInfo{}).Where("task_id = ? and is_ok = 1", task.TaskID).First(&linkinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
}
|
|
|
boperator := getBOperator(db, task.BOperator, task.BOperatorType)
|
|
|
response := &http_model.TaskLinkinfo{
|
|
@@ -914,6 +1070,11 @@ func GetPreDataList(ctx context.Context, request http_model.PreDataListRequest)
|
|
|
db := GetReadDB(ctx)
|
|
|
var projecrtaskinfo []gorm_model.YoungeeTaskInfo
|
|
|
query := db.Model(&gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_stage = ?", request.ProjectId, request.DataStatus)
|
|
|
+ var projectinfo gorm_model.ProjectInfo
|
|
|
+ err := db.Model(&gorm_model.ProjectInfo{}).Where("project_id = ?", request.ProjectId).First(&projectinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return &http_model.GetPreDataListData{}, err
|
|
|
+ }
|
|
|
if request.Others != "" {
|
|
|
query = query.Where("talent_name LIKE ? OR s_operate_name LIKE ?", "%"+request.Others+"%", "%"+request.Others+"%")
|
|
|
}
|
|
@@ -977,7 +1138,7 @@ func GetPreDataList(ctx context.Context, request http_model.PreDataListRequest)
|
|
|
for _, task := range projecrtaskinfo {
|
|
|
nickname, headurl, gender, fansnum, voteavg := getTalentinfo(db, task.OpenId)
|
|
|
Iscoop := getIscoop(db, task.TalentID, request.EnterpriseId)
|
|
|
- s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus)
|
|
|
+ s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, projectinfo.ProjectType)
|
|
|
taskinfo := &http_model.TaskInfo{
|
|
|
TaskId: task.TaskID,
|
|
|
ProjectId: task.ProjectID,
|
|
@@ -1014,6 +1175,11 @@ func GetPreDataList(ctx context.Context, request http_model.PreDataListRequest)
|
|
|
|
|
|
func GetDataList(ctx context.Context, request http_model.TaskDatalistRequest) (*http_model.GetTaskDatalistData, error) {
|
|
|
db := GetReadDB(ctx)
|
|
|
+ var projectinfo gorm_model.ProjectInfo
|
|
|
+ err := db.Model(&gorm_model.ProjectInfo{}).Where("project_id = ?", request.ProjectId).First(&projectinfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return &http_model.GetTaskDatalistData{}, err
|
|
|
+ }
|
|
|
var projecrtaskinfo []gorm_model.YoungeeTaskInfo
|
|
|
query := db.Model(&gorm_model.YoungeeTaskInfo{}).Where("project_id = ? AND task_stage = ?", request.ProjectId, request.DataStatus)
|
|
|
if request.Others != "" {
|
|
@@ -1079,7 +1245,7 @@ func GetDataList(ctx context.Context, request http_model.TaskDatalistRequest) (*
|
|
|
for _, task := range projecrtaskinfo {
|
|
|
nickname, headurl, gender, fansnum, voteavg := getTalentinfo(db, task.OpenId)
|
|
|
Iscoop := getIscoop(db, task.TalentID, request.EnterpriseId)
|
|
|
- s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus)
|
|
|
+ s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, projectinfo.ProjectType)
|
|
|
taskinfo := &http_model.TaskInfo{
|
|
|
TaskId: task.TaskID,
|
|
|
ProjectId: task.ProjectID,
|
|
@@ -1102,9 +1268,17 @@ func GetDataList(ctx context.Context, request http_model.TaskDatalistRequest) (*
|
|
|
City: task.City,
|
|
|
}
|
|
|
var datainfo gorm_model.YounggeeDataInfo
|
|
|
- err := db.Model(&gorm_model.YounggeeDataInfo{}).Where("task_id = ? and is_review = 0", task.TaskID).First(&datainfo).Error
|
|
|
- if err != nil {
|
|
|
- return nil, err
|
|
|
+ switch request.DataStatus {
|
|
|
+ case "12":
|
|
|
+ err := db.Model(&gorm_model.YounggeeDataInfo{}).Where("task_id = ? and is_review = 0 ", task.TaskID).First(&datainfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ case "13":
|
|
|
+ err := db.Model(&gorm_model.YounggeeDataInfo{}).Where("task_id = ? and is_ok = 1", task.TaskID).First(&datainfo).Error
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
}
|
|
|
boperator := getBOperator(db, task.BOperator, task.BOperatorType)
|
|
|
response := &http_model.TaskDatainfo{
|