Bläddra i källkod

执行中、招募中

lin-jim-leon 6 månader sedan
förälder
incheckning
3636262136

+ 0 - 19
app/controller/workspace_controller.go

@@ -2,7 +2,6 @@ package controller
 
 import (
 	"github.com/gin-gonic/gin"
-	"youngee_b_api/app/dao"
 	"youngee_b_api/app/service"
 )
 
@@ -24,21 +23,3 @@ func (w WorkspaceController) GetTakegoodsInfo(c *gin.Context) {
 
 	returnSuccess(c, 20000, result)
 }
-
-type Search_name struct {
-	BusinessName string `json:"business_name"`
-	DateRange    string `json:"days"`
-}
-
-func (w WorkspaceController) GetSearchInfobybusinessname(c *gin.Context) {
-	search_ID := &Search_name{}
-	err := c.BindJSON(&search_ID)
-	if err != nil {
-		returnError(c, 40000)
-		return
-	}
-	enterpriseId, _ := (&dao.EnterpriseDao{}).GetenterpriseIdbynickname(search_ID.BusinessName)
-	search := Search{EnterpriseId: enterpriseId, DateRange: search_ID.DateRange}
-	result := service.EnterpriseService{}.GetEnterpriseTakegoodsInfo(search.EnterpriseId, search.DateRange)
-	returnSuccess(c, 20000, result)
-}

+ 103 - 55
db/project.go

@@ -331,13 +331,12 @@ func GetCreatingNumber(ctx context.Context, enterpriseID string) (*int64, error)
 func GetProjectData(ctx context.Context, projectid string) (http_model.ProjectDataResponse, error) {
 	db := GetReadDB(ctx)
 	var projectInfo gorm_model.ProjectInfo
-
 	// 查询项目基本信息
 	if err := db.Where("project_id = ?", projectid).First(&projectInfo).Error; err != nil {
 		logrus.WithContext(ctx).Errorf("[Project db] GetProjectData error, err: %+v", err)
 		return http_model.ProjectDataResponse{}, err
 	}
-
+	fmt.Println("projectInfo---", projectInfo.ProjectID)
 	var projectTasks []gorm_model.YoungeeTaskInfo
 	if err := db.Where("project_id = ? AND task_status = ?", projectid, 2).Find(&projectTasks).Error; err != nil {
 		return http_model.ProjectDataResponse{}, err
@@ -429,7 +428,6 @@ func GetProjectData(ctx context.Context, projectid string) (http_model.ProjectDa
 	} else {
 		manRatio = 0
 	}
-
 	// 构建响应
 	res := http_model.ProjectDataResponse{
 		Recruittime: *projectInfo.PassAt,
@@ -464,6 +462,18 @@ func GetProjectExecuteData(ctx context.Context, projectid string) (http_model.Ex
 	if err = query.Count(&total).Error; err != nil {
 		return http_model.ExecuteDataResponse{}, err
 	}
+
+	// 初始化统计数据
+	skedateStats := make(map[string]int)
+	linkdateStatics := make(map[string]int)
+	startDate := *projectData.CreatedAt
+	endDate := time.Now()
+	// 填充日期统计
+	for d := startDate; d.Before(endDate) || d.Equal(endDate); d = d.Add(24 * time.Hour) {
+		skedateStats[d.Format("2006-01-02")] = 0
+		linkdateStatics[d.Format("2006-01-02")] = 0
+	}
+
 	var presketchnum int64                                         //代传初稿数
 	var sketchnum int64                                            //待审
 	var sketchaccnum int64                                         //通过
@@ -479,7 +489,10 @@ func GetProjectExecuteData(ctx context.Context, projectid string) (http_model.Ex
 	var acclinkcnt, backcnt, submintcnt, firlinkacccnt int
 	var defaultnum int64
 	var defaultratio float64
+	var sktchinfo gorm_model.YounggeeSketchInfo
+	var draftee, settle_amount float64
 	for _, task := range projectTaskInfo {
+		draftee += task.DraftFee
 		switch task.TaskStage {
 		case 9:
 			presketchnum += 1
@@ -501,70 +514,89 @@ func GetProjectExecuteData(ctx context.Context, projectid string) (http_model.Ex
 		if task.CurDefaultType != 0 {
 			defaultnum += 1
 		}
-		var sktchinfo gorm_model.YounggeeSketchInfo
-		err = db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? ", task.TaskID).First(&sktchinfo).Error
-		if err != nil {
-			return http_model.ExecuteDataResponse{}, err
-		} else {
-
-			if projectData.ProjectForm == 1 {
-				if task.SignedTime.IsZero() {
-					createduraion += sktchinfo.CreateAt.Sub(task.SignedTime)
-					crecnt += 1
+		if task.TaskStage == 15 {
+			settle_amount += task.SettleAmount
+		}
+		if task.TaskStage > 9 {
+			//初稿
+			//err = db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ? ", task.TaskID).First(&sktchinfo).Error
+			err = db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ?", task.TaskID).Order("create_at ASC").First(&sktchinfo).Error
 
-				}
+			if err != nil {
+				return http_model.ExecuteDataResponse{}, err
 			} else {
-				if sktchinfo.IsSubmit == 1 {
-					createduraion += sktchinfo.CreateAt.Sub(task.SelectDate)
-					crecnt += 1
-				}
-			}
 
-			if sktchinfo.IsOk == 1 {
-				duration += sktchinfo.AgreeAt.Sub(sktchinfo.CreateAt)
-				accskecnt += 1
-			}
+				if projectData.ProjectForm == 1 {
+					if !task.SignedTime.IsZero() {
+						createduraion += sktchinfo.CreateAt.Sub(task.SignedTime)
+						crecnt += 1
+
+					}
+				} else {
+					if sktchinfo.IsSubmit == 1 {
+						createduraion += sktchinfo.CreateAt.Sub(task.SelectDate)
+						crecnt += 1
+					}
+				} //平均创作耗时
+				var sktchaccinfo gorm_model.YounggeeSketchInfo
+				err = db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id = ?", task.TaskID).Order("create_at ASC").Last(&sktchaccinfo).Error
+				if err != nil {
+					return http_model.ExecuteDataResponse{}, err
+				}
 
-			if sktchinfo.IsSubmit == 1 {
-				submint += 1
-				if sktchinfo.RejectAt.IsZero() && sktchinfo.IsOk == 1 {
-					firacccnt += 1
+				if sktchaccinfo.IsOk == 1 {
+					duration += sktchaccinfo.AgreeAt.Sub(sktchinfo.CreateAt)
+					accskecnt += 1 //审稿耗时
+					submint += 1
+					if sktchaccinfo.SketchID == sktchinfo.SketchID {
+						firacccnt += 1
+					} //首次通过
+					AgreeDate := sktchaccinfo.AgreeAt.Format("2006-01-02")
+					if _, exists := skedateStats[AgreeDate]; exists {
+						skedateStats[AgreeDate]++
+					}
 				}
 			}
 		}
+		if task.TaskStage > 11 {
+			var linkinfo gorm_model.YounggeeLinkInfo //最后一次上传link
+			err = db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? ", task.TaskID).Order("create_at ASC").Last(&linkinfo).Error
+			if err != nil {
+				continue
+			} else {
 
-		var linkinfo gorm_model.YounggeeLinkInfo
-		err = db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? ", task.TaskID).First(&linkinfo).Error
-		if err != nil {
-			return http_model.ExecuteDataResponse{}, err
-		} else {
-
-			if linkinfo.IsOk == 1 {
-				linkaccduartion += linkinfo.AgreeAt.Sub(linkinfo.CreateAt)
-				acclinkcnt += 1
-			}
+				if linkinfo.IsOk == 1 {
+					linkaccduartion += linkinfo.AgreeAt.Sub(linkinfo.CreateAt)
+					acclinkcnt += 1
+				} //平均质检时间
+				var linkfirinfo gorm_model.YounggeeLinkInfo //最后一次上传link
+				err = db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? ", task.TaskID).Order("create_at ASC").First(&linkfirinfo).Error
+				if err != nil {
+					return http_model.ExecuteDataResponse{}, err
+				} else {
+					backduration += linkinfo.CreateAt.Sub(sktchinfo.AgreeAt)
+					backcnt += 1
+					var linklasinfo gorm_model.YounggeeLinkInfo //最后一次上传link
+					err = db.Model(gorm_model.YounggeeLinkInfo{}).Where("task_id = ? ", task.TaskID).Order("create_at ASC").Last(&linklasinfo).Error
+					if err != nil {
+						return http_model.ExecuteDataResponse{}, err
+					}
+					if linklasinfo.IsOk == 1 {
+						submintcnt += 1
+						if linklasinfo.LinkID == linkfirinfo.LinkID {
+							firlinkacccnt += 1
+						} //首次通过
+						AgreeDate := linklasinfo.AgreeAt.Format("2006-01-02")
+						if _, exists := linkdateStatics[AgreeDate]; exists {
+							linkdateStatics[AgreeDate]++
+						}
+
+					}
+				}
 
-			if linkinfo.IsSubmit == 1 {
-				backduration += linkinfo.SubmitAt.Sub(sktchinfo.AgreeAt)
-				backcnt += 1
 			}
 
-			if linkinfo.IsSubmit == 1 {
-				submintcnt += 1
-				if linkinfo.RejectAt.IsZero() && linkinfo.IsOk == 1 {
-					firlinkacccnt += 1
-				}
-			}
 		}
-
-		//var datainfo gorm_model.YounggeeDataInfo
-		//err = db.Model(gorm_model.YounggeeDataInfo{}).Where("task_id = ? ", task.TaskID).First(&datainfo).Error
-		//if err != nil {
-		//	return http_model.ExecuteDataResponse{}, err
-		//} else {
-		//	if datainfo
-		//
-		//}
 	}
 	if submint > 0 && firacccnt > 0 {
 		firaccratio = float64(firacccnt) / float64(submint)
@@ -619,6 +651,22 @@ func GetProjectExecuteData(ctx context.Context, projectid string) (http_model.Ex
 		DataNum:         datanum,
 		DefaultNum:      defaultnum,
 		DefaultRatio:    defaultratio,
+		DraftFee:        draftee,
+		Settle_Amount:   settle_amount,
 	}
 	return res, nil
 }
+
+func GetProjecdata(ctx context.Context, projectid string) (http_model.ProjectdataResponse, error) {
+	db := GetReadDB(ctx)
+	var projectInfo gorm_model.ProjectInfo
+
+	// 查询项目基本信息
+	if err := db.Where("project_id = ?", projectid).First(&projectInfo).Error; err != nil {
+		logrus.WithContext(ctx).Errorf("[Project db] GetProjectData error, err: %+v", err)
+		return http_model.ProjectdataResponse{}, err
+	}
+
+	res := http_model.ProjectdataResponse{}
+	return res, nil
+}

+ 7 - 5
db/project_task.go

@@ -18,7 +18,7 @@ func GetProjecttaskList(ctx context.Context, request http_model.GetTaskListReque
 
 	// 构建查询条件
 	if request.FeeFrom != nil {
-		query = query.Where("feed_from = ?", request.FeeFrom)
+		query = query.Where("fee_form = ?", request.FeeFrom)
 	}
 	if request.Type != nil {
 		switch *request.Type {
@@ -67,6 +67,7 @@ func GetProjecttaskList(ctx context.Context, request http_model.GetTaskListReque
 			CurrentDefaultType: task.CurDefaultType,
 			From:               determineFrom(task.SupplierId, task.SupplierStatus),
 			Boperator:          boperator,
+			CreateAt:           task.CreateDate,
 		}
 		taskInfoPointers = append(taskInfoPointers, response)
 	}
@@ -124,9 +125,9 @@ func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, op
 	}
 	var taskstages int
 	if project.ProjectForm == 1 {
-		taskstages = 5
+		taskstages = 4
 	} else {
-		taskstages = 7
+		taskstages = 9
 	}
 
 	//4.根据达人来源改变状态、阶段、数目
@@ -151,18 +152,19 @@ func PassProTaskCoop(ctx context.Context, projectId string, taskIds []string, op
 					return err
 				}
 
-				//project招募数+1
+				//project招募数+1,预估成本+服务商价格
 				var projectinfo gorm_model.ProjectInfo
 				err = db.Model(gorm_model.ProjectInfo{}).Where("project_id = ?", projectId).Find(&projectinfo).Error
 				if err != nil {
 					return err
 				}
 				projectinfo.RecruitNum += 1
+				projectinfo.EstimatedCost += taskInfo.SupportFee
 				err = tx.Model(gorm_model.ProjectInfo{}).Where("project_id = ? ", projectId).Updates(projectinfo).Error
 				if err != nil {
 					return err
 				}
-
+				//服务商s_project已招募人数+1
 				var sprojectinfo gorm_model.YounggeeSProjectInfo
 				err = db.Model(gorm_model.YounggeeSProjectInfo{}).Where("project_id = ?", projectId).Find(&sprojectinfo).Error
 				if err != nil {

+ 1 - 1
db/task.go

@@ -400,7 +400,7 @@ func EndTask(ctx context.Context, req http_model.EndTaskRequest) error {
 	updates := gorm_model.YoungeeTaskInfo{TaskStage: 17}
 
 	// 更新指定任务的 Stage
-	err := db.Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id = ?", req.TaskId).Updates(updates).Error
+	err := db.Model(&gorm_model.YoungeeTaskInfo{}).Where("task_id IN ?", req.TaskId).Updates(updates).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[EndTask] error updating task stage, task_id: %s, err: %+v", req.TaskId, err)
 		return err

+ 4 - 1
go.mod

@@ -44,7 +44,7 @@ require (
 	github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
 	github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
 	github.com/hpcloud/tail v1.0.0 // indirect
-	github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.115 // indirect
+	github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.116 // indirect
 	github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 // indirect
 	github.com/issue9/assert/v2 v2.0.0 // indirect
 	github.com/jinzhu/inflection v1.0.0 // indirect
@@ -75,9 +75,11 @@ require (
 	github.com/stretchr/testify v1.8.4 // indirect
 	github.com/tidwall/match v1.1.1 // indirect
 	github.com/tidwall/pretty v1.2.0 // indirect
+	github.com/tjfoc/gmsm v1.4.1 // indirect
 	github.com/ugorji/go/codec v1.2.7 // indirect
 	github.com/urfave/cli/v2 v2.3.0 // indirect
 	github.com/yuin/goldmark v1.4.13 // indirect
+	go.mongodb.org/mongo-driver v1.12.0 // indirect
 	golang.org/x/mod v0.8.0 // indirect
 	golang.org/x/sync v0.1.0 // indirect
 	golang.org/x/term v0.20.0 // indirect
@@ -86,6 +88,7 @@ require (
 	gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
 	gopkg.in/errgo.v2 v2.1.0 // indirect
 	gopkg.in/fsnotify.v1 v1.4.7 // indirect
+	gopkg.in/ini.v1 v1.67.0 // indirect
 	gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )

+ 6 - 0
go.sum

@@ -102,6 +102,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.115 h1:0i/6REsHzn1KCW7hF0H1XxXibzmY9CuGUkOX71yRNwY=
 github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.115/go.mod h1:JWz2ujO9X3oU5wb6kXp+DpR2UuDj2SldDbX8T0FSuhI=
+github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.116 h1:2xdw38EHrdkciWjRdwd75p6a+cXe4PxWSgHMNYMbQnI=
+github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.116/go.mod h1:JWz2ujO9X3oU5wb6kXp+DpR2UuDj2SldDbX8T0FSuhI=
 github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/issue9/assert/v2 v2.0.0 h1:vN7fr70g5ND6zM39tPZk/E4WCyjGMqApmFbujSTmEo0=
 github.com/issue9/assert/v2 v2.0.0/go.mod h1:rKr1eVGzXUhAo2af1thiKAhIA8uiSK9Wyn7mcZ4BzAg=
@@ -197,6 +199,7 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
 github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
 github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
 github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
 github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 h1:+iNTcqQJy0OZ5jk6a5NLib47eqXK8uYcPX+O4+cBpEM=
 github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w=
@@ -211,6 +214,7 @@ github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
 github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
 github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
 github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
+github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho=
 github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE=
 github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
 github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
@@ -229,6 +233,7 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
 github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
+go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0PiE=
 go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -382,6 +387,7 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
 gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
 gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
+gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
 gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=

+ 61 - 0
handler/project_data.go

@@ -0,0 +1,61 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapDataHandler(ctx *gin.Context) {
+	handler := newDataHandler(ctx)
+	baseRun(handler)
+}
+
+type Data struct {
+	ctx  *gin.Context
+	req  *http_model.DataRequest
+	resp *http_model.CommonResponse
+}
+
+func (c Data) getContext() *gin.Context {
+	return c.ctx
+}
+
+func (c Data) getResponse() interface{} {
+	return c.resp
+}
+
+func (c Data) getRequest() interface{} {
+	return c.req
+}
+
+func (c Data) run() {
+	data := http_model.DataRequest{}
+	data = *c.req
+	//auth := middleware.GetSessionAuth(c.ctx)
+	//enterpriseID := auth.EnterpriseID
+	res, err := service.Project.ProjectData(c.ctx, data)
+	if err != nil {
+		logrus.Errorf("[Data] call Data err:%+v\n", err)
+		util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
+		logrus.Info("Data fail,req:%+v", c.req)
+		return
+	}
+	c.resp.Message = "成功看数据"
+	c.resp.Data = res
+}
+
+func (c Data) checkParam() error {
+	return nil
+}
+
+func newDataHandler(ctx *gin.Context) *Data {
+	return &Data{
+		ctx:  ctx,
+		req:  http_model.NewDataRequest(),
+		resp: http_model.NewDataResponse(),
+	}
+}

+ 4 - 6
main.go

@@ -3,8 +3,6 @@ package main
 import (
 	"fmt"
 	"github.com/gin-gonic/gin"
-	"log"
-	"youngee_b_api/app/schedule"
 	"youngee_b_api/config"
 	_ "youngee_b_api/docs"
 	"youngee_b_api/route"
@@ -21,9 +19,9 @@ func main() {
 
 	addr := fmt.Sprintf("%v:%v", config.Host, config.Port)
 	//err := service.AutoTask()
-	err := schedule.AutoTask()
-	if err != nil {
-		log.Println("service AutoTask error:", err)
-	}
+	//err := schedule.AutoTask()
+	//if err != nil {
+	//	log.Println("service AutoTask error:", err)
+	//}
 	r.Run(addr) // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
 }

+ 1 - 0
model/gorm_model/project_task.go

@@ -53,6 +53,7 @@ type YoungeeTaskInfo struct {
 	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"`                          //提报价格
 }
 
 func (m *YoungeeTaskInfo) TableName() string {

+ 0 - 13
model/gorm_model/subaccount.go

@@ -1,13 +0,0 @@
-package gorm_model
-
-type YounggeeSubAccount struct {
-	SubAccountId   int    `gorm:"column:sub_account_id;primary_key;AUTO_INCREMENT"` // 子账号ID
-	PhoneNumber    int    `gorm:"column:phone_number"`                              // 手机号
-	SubAccountName string `gorm:"column:sub_account_name"`                          // 子账号名称
-	JobId          int    `gorm:"column:job_id"`                                    // 岗位ID
-	EnterpriseId   string `gorm:"column:enterprise_id"`                             // 所属商家账号ID
-}
-
-func (m *YounggeeSubAccount) TableName() string {
-	return "younggee_sub_account"
-}

+ 1 - 1
model/http_model/EndTaskRequest.go

@@ -1,7 +1,7 @@
 package http_model
 
 type EndTaskRequest struct {
-	TaskId int `json:"task_id"`
+	TaskId []int `json:"task_ids"`
 }
 
 func NewEndTaskRequest() *EndTaskRequest {

+ 4 - 4
model/http_model/data_accept.go

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

+ 2 - 0
model/http_model/executedata.go

@@ -24,6 +24,8 @@ type ExecuteDataResponse struct {
 	DataNum         int64         `json:"data_num"`
 	DefaultNum      int64         `json:"default_num"`
 	DefaultRatio    float64       `json:"default_ratio"`
+	DraftFee        float64       `json:"draft_fee"`
+	Settle_Amount   float64       `json:"settle_amount"`
 }
 
 func NewExecuteDataRequest() *ExecuteDataRequest {

+ 17 - 14
model/http_model/gettasklist.go

@@ -1,5 +1,7 @@
 package http_model
 
+import "time"
+
 type GetTaskListRequest struct {
 	PageSize  int    `json:"page_size"`
 	PageNum   int    `json:"page_num"`
@@ -15,20 +17,21 @@ type GetTaskListData struct {
 }
 
 type TaskInfo struct {
-	TaskId             string  `json:"task_id"`
-	ProjectId          string  `json:"project_id"`
-	TalentId           string  `json:"talent_id"`
-	FansNum            int     `json:"fans_num"`
-	DraftFee           float64 `json:"draft_fee"`
-	FeeFrom            int     `json:"fee_from"`
-	TaskStage          int     `json:"task_stage"`
-	Voteavg            int     `json:"vote_avg"`
-	Commentavg         int     `json:"commit_avg"`
-	CurrentDefaultType int     `json:"current_default_type"`
-	From               int     `json:"from"`   //1公海,2服务商
-	SType              int     `json:"s_type"` //1个人,2机构
-	Boperator          string  `json:"b_operator"`
-	SettleAmount       float64 `json:"settle_amount"`
+	TaskId             string    `json:"task_id"`
+	ProjectId          string    `json:"project_id"`
+	TalentId           string    `json:"talent_id"`
+	FansNum            int       `json:"fans_num"`
+	DraftFee           float64   `json:"draft_fee"`
+	FeeFrom            int       `json:"fee_from"`
+	TaskStage          int       `json:"task_stage"`
+	Voteavg            int       `json:"vote_avg"`
+	Commentavg         int       `json:"commit_avg"`
+	CurrentDefaultType int       `json:"current_default_type"`
+	From               int       `json:"from"`   //1公海,2服务商
+	SType              int       `json:"s_type"` //1个人,2机构
+	Boperator          string    `json:"b_operator"`
+	SettleAmount       float64   `json:"settle_amount"`
+	CreateAt           time.Time `json:"create_time"`
 }
 
 func NewGetTaskListRequest() *GetTaskListRequest {

+ 18 - 0
model/http_model/project_data_request.go

@@ -0,0 +1,18 @@
+package http_model
+
+type DataRequest struct {
+	ProjectId string `json:"project_id"`
+}
+
+type ProjectdataResponse struct {
+}
+
+func NewDataRequest() *DataRequest {
+	return new(DataRequest)
+}
+
+func NewDataResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(ProjectdataResponse)
+	return resp
+}

+ 1 - 1
model/http_model/tasksketchlist.go

@@ -6,7 +6,7 @@ type TasksketchlistRequest struct {
 	PageSize     int    `json:"page_size"`
 	PageNum      int    `json:"page_num"`
 	ProjectId    string `json:"project_id"`    // 项目ID
-	ScriptStatus string `json:"script_status"` // 稿件状态
+	ScriptStatus int    `json:"script_status"` // 稿件状态
 }
 
 type GetsketchtaskListData struct {

+ 3 - 33
route/init.go

@@ -37,7 +37,7 @@ func InitRoute(r *gin.Engine) {
 	//	c.JSON(200, resp)
 	//	// 注意这里只是debug用的 接口要写成handler形式
 	//})
-	m := r.Group("/youngee/m")
+	m := r.Group("/youngee/b")
 	{
 		m.Use(middleware.LoginAuthMiddleware)
 		m.POST("/test", func(c *gin.Context) {
@@ -71,38 +71,7 @@ func InitRoute(r *gin.Engine) {
 
 		//m.POST("/project/tasklinklist", handler.WrapTaskLinkListHandler)                     // 查询链接列表
 		//m.POST("/project/taskdatalist", handler.WrapTaskDataListHandler)                     // 查询数据列表
-		m.POST("/product/findKuaishou", handler.WrapFindKuaishouProductHandler)              // 查询快手产品信息
-		m.POST("/product/findall", handler.WrapFindAllProductHandler)                        // 查询全部产品
-		m.POST("/product/find", handler.WrapFindProductHandler)                              // 查找单个产品
-		m.POST("/project/create", handler.WrapCreateProjectHandler)                          // 创建项目
-		m.POST("/project/show", handler.WrapShowProjectHandler)                              // 展示项目内容
-		m.POST("/project/update", handler.WrapUpdateProjectHandler)                          // 更新项目
-		m.POST("/project/delete", handler.WrapDeleteProjectHandler)                          // 删除项目
-		m.POST("/product/create", handler.WrapCreateProductHandler)                          // 创建项目
-		m.POST("/project/list", handler.WrapFullProjectListHandler)                          // 项目列表
-		m.POST("/project/taskList", handler.WrapProjectTaskListHandler)                      // 任务列表
-		m.POST("/project/draftlist", handler.WrapProjectDraftBoxListHandler)                 // 草稿箱查询
-		m.GET("/project/getCreatingNumber", handler.WrapGetCreatingNumberHandler)            // 查询创建中项目数量
-		m.POST("/project/changeTaskStatus", handler.WrapProjectChangeTaskStatusHandler)      // 改变任务的状态
-		m.POST("/pay/paysum", handler.WrapPaySumHandler)                                     // 支付总额
-		m.POST("/pay/projectpay", handler.WrapProjectPayHandler)                             // 支付
-		m.POST("/enterprise/balance", handler.WrapEnterpriseBalanceHandler)                  // 样叽页面各种余额
-		m.POST("/project/tasklogisticslist", handler.WrapTaskLogisticsListHandler)           // 物流信息查询
-		m.POST("/project/createlogistics", handler.WrapCreateLogisticsHandler)               // 创建物流信息
-		m.POST("/project/signforreceipt", handler.WrapSignForReceiptHandler)                 // 签收
-		m.POST("/project/taskscriptlist", handler.WrapTaskScriptListHandler)                 // 查询脚本列表
-		m.POST("/project/scriptopinion", handler.WrapScriptOpinionHandler)                   // 脚本审核意见提交
-		m.POST("/project/acceptscript", handler.WrapAcceptScriptHandler)                     // 同意脚本
-		m.POST("/project/tasksketchlist", handler.WrapTaskSketchListHandler)                 // 查询初稿列表
-		m.POST("/project/findsketchphoto", handler.WrapFindSketchPhotoHandler)               // 查询脚本配图和视频demo
-		m.POST("/project/sketchopinion", handler.WrapSketchOpinionHandler)                   // 初稿审核意见提交
-		m.POST("/project/acceptsketch", handler.WrapAcceptSketchHandler)                     // 同意脚本
-		m.POST("/project/tasklinklist", handler.WrapTaskLinkListHandler)                     // 查询链接列表
-		m.POST("/project/linkopinion", handler.WrapLinkOpinionHandler)                       // 链接审核意见提交
-		m.POST("/project/acceptlink", handler.WrapAcceptLinkHandler)                         // 同意链接
-		m.POST("/project/taskdatalist", handler.WrapTaskDataListHandler)                     // 查询数据列表
-		m.POST("/project/dataopinion", handler.WrapDataOpinionHandler)                       // 数据审核意见提交
-		m.POST("/project/acceptdata", handler.WrapAcceptDataHandler)                         // 同意数据
+
 		m.POST("/pay/getCodeUrl", handler.WrapGetCodeUrlHandler)                             // 获取微信支付codeURL
 		m.POST("/pay/queryOrderByTradeId", handler.WrapQueryOrderByTradeIdHandler)           // 根据交易id查询微信是否扫码付款
 		m.POST("/pay/rechargeBalance", handler.WrapRechargeBalanceHandler)                   // 支付成功后修改企业余额
@@ -191,6 +160,7 @@ func InitRoute(r *gin.Engine) {
 		m.POST("/project/rejectdata", handler.WrapRejectDataHandler)     // 拒绝数据
 
 		m.POST("/project/executedata", handler.WrapExecuteDataHandler) //看数据
+		m.POST("/project/data", handler.WrapDataHandler)
 	}
 
 	// 选品广场相关接口

+ 9 - 0
service/project.go

@@ -642,3 +642,12 @@ func (*project) ExecuteData(ctx context.Context, Project http_model.ExecuteDataR
 	}
 	return &projectdata, nil
 }
+
+func (*project) ProjectData(ctx context.Context, Project http_model.DataRequest) (*http_model.ProjectdataResponse, error) {
+	projectdata, err := db.GetProjecdata(ctx, Project.ProjectId)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[project service] call Data error,err:%+v", err)
+		return nil, err
+	}
+	return &projectdata, nil
+}