Ethan il y a 8 mois
Parent
commit
671e79b748

+ 25 - 0
app/controller/common.go

@@ -0,0 +1,25 @@
+package controller
+
+import "github.com/gin-gonic/gin"
+
+type JsonStruct struct {
+	Code int         `json:"code"`
+	Msg  interface{} `json:"msg"`
+	Data interface{} `json:"data"`
+	//Count int64       `json:"count"`
+}
+
+type JsonErrStruct struct {
+	Code int         `json:"code"`
+	Msg  interface{} `json:"msg"`
+}
+
+func returnSuccess(c *gin.Context, code int, data interface{}) {
+	json := &JsonStruct{Code: code, Msg: "ok", Data: data}
+	c.JSON(200, json)
+}
+
+func returnError(c *gin.Context, code int) {
+	json := &JsonErrStruct{Code: code, Msg: "error"}
+	c.JSON(400, json)
+}

+ 25 - 0
app/controller/workspace_controller.go

@@ -0,0 +1,25 @@
+package controller
+
+import (
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/app/service"
+)
+
+type WorkspaceController struct{}
+
+type Search struct {
+	EnterpriseId string `json:"enterprise_id"`
+	DateRange    string `json:"days"`
+}
+
+func (w WorkspaceController) GetTakegoodsInfo(c *gin.Context) {
+	search := &Search{}
+	err := c.BindJSON(&search)
+	if err != nil {
+		returnError(c, 40000)
+		return
+	}
+	result := service.EnterpriseService{}.GetEnterpriseTakegoodsInfo(search.EnterpriseId, search.DateRange)
+
+	returnSuccess(c, 20000, result)
+}

+ 30 - 0
app/dao/dao.go

@@ -0,0 +1,30 @@
+package dao
+
+import (
+	"fmt"
+	"gorm.io/driver/mysql"
+
+	"gorm.io/gorm"
+	"youngee_b_api/model/system_model"
+)
+
+var (
+	Db  *gorm.DB
+	err error
+)
+
+func Init(config *system_model.Mysql) {
+	dsn := "%v:%v@tcp(%v:%v)/%v?charset=utf8mb4&parseTime=True&loc=Local"
+	dsn = fmt.Sprintf(dsn, config.User, config.Password, config.Host, config.Port, config.Database)
+	Db, err = gorm.Open(mysql.Open(dsn), &gorm.Config{})
+	if err != nil {
+		panic(err)
+	}
+	if Db.Error != nil {
+		panic(err)
+	}
+
+	//Db.DB().SetMaxIdleConns(10)
+	//Db.DB().SetMaxOpenConns(100)
+	//Db.DB().SetConnMaxLifetime(time.Hour)
+}

+ 3 - 0
app/dao/enterprise_dao.go

@@ -0,0 +1,3 @@
+package dao
+
+type EnterpriseDao struct{}

+ 11 - 0
app/dao/sec_task_info_dao.go

@@ -0,0 +1,11 @@
+package dao
+
+import "youngee_b_api/app/entity"
+
+type SecTaskInfoDao struct{}
+
+func (s SecTaskInfoDao) CountBySelectionId(selectionId string) (int64, error) {
+	var count int64
+	err := Db.Model(&entity.SecTaskInfo{}).Where("selection_id = ?", selectionId).Count(&count).Error
+	return count, err
+}

+ 37 - 0
app/dao/selection_info_dao.go

@@ -0,0 +1,37 @@
+package dao
+
+import (
+	"time"
+	"youngee_b_api/app/entity"
+)
+
+type SelectionInfoDAO struct{}
+
+func (SelectionInfoDAO) GetSelectionInfoById(id string) (entity.SelectionInfo, error) {
+	var selectionInfo entity.SelectionInfo
+	err := Db.Where("selection_id = ?", id).First(&selectionInfo).Error
+	return selectionInfo, err
+}
+
+func (SelectionInfoDAO) UpdateSelectionInfoById(id int, enterpriseId string) {
+	Db.Model(&entity.SelectionInfo{}).Where("id = ?", id).Update("enterprise_id", enterpriseId)
+}
+
+func (SelectionInfoDAO) DeleteSelectionInfoById(id int) error {
+	err := Db.Delete(&entity.SelectionInfo{}, id).Error
+	return err
+}
+
+// 根据enterpriseId查询指定某天的所有带货数据
+func (SelectionInfoDAO) GetSelectionInfoListOfDay(enterpriseId string, date time.Time) ([]entity.SelectionInfo, error) {
+	var selectionInfos []entity.SelectionInfo
+	// 构建查询
+	query := Db.Model(&entity.SelectionInfo{})
+	if enterpriseId != "" {
+		query = query.Where("enterprise_id = ?", enterpriseId)
+	}
+	// 将日期部分提取出来进行匹配
+	query = query.Where("DATE(created_at) = ?", date.Format("2006-01-02"))
+	err := query.Find(&selectionInfos).Error
+	return selectionInfos, err
+}

+ 25 - 0
app/entity/enterprise.go

@@ -0,0 +1,25 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type Enterprise struct {
+	EnterpriseID     string    `gorm:"column:enterprise_id"`     // 企业id,用户ID的生成规则为:1(企业用户代码)+分秒数字+四位随机数字
+	Industry         int64     `gorm:"column:industry"`          // 行业,1-14分别代表能源、化工、材料、机械设备/军工、企业服务/造纸印刷、运输设备、旅游酒店、媒体/信息通信服务、批发/零售、消费品、卫生保健/医疗、金融、建材/建筑/房地产、公共事业
+	BusinessName     string    `gorm:"column:business_name"`     // 公司或组织名称
+	UserID           int64     `gorm:"column:user_id"`           // 对应用户id
+	Balance          float64   `gorm:"column:balance"`           // 账户余额
+	FrozenBalance    float64   `gorm:"column:frozen_balance"`    // 冻结余额
+	AvailableBalance float64   `gorm:"column:available_balance"` // 可用余额
+	BillableAmount   float64   `gorm:"column:billable_amount"`   // 可开票金额
+	Invoicing        float64   `gorm:"column:invoicing"`         // 开票中金额
+	Recharging       float64   `gorm:"column:recharging"`        // 充值中金额
+	CreatedAt        time.Time `gorm:"column:created_at"`        // 创建时间
+	UpdatedAt        time.Time `gorm:"column:updated_at"`        // 更新时间
+}
+
+func (m *Enterprise) TableName() string {
+	return "enterprise"
+}

+ 44 - 0
app/entity/sec_task_info.go

@@ -0,0 +1,44 @@
+package entity
+
+// Code generated by sql2gorm. DO NOT EDIT.
+
+import (
+	"time"
+)
+
+type SecTaskInfo struct {
+	ID                     int       `gorm:"column:id;primary_key"`              // 递增id
+	TaskID                 string    `gorm:"column:task_id"`                     // 选品任务id
+	SelectionID            string    `gorm:"column:selection_id"`                // 选品id
+	TalentID               string    `gorm:"column:talent_id"`                   // 达人id
+	AccountID              int       `gorm:"column:account_id"`                  // 账号id
+	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap"`   // 达人平台信息快照
+	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap"`   // 达人个人信息快照
+	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap"`       // 收货地址快照
+	TaskReward             string    `gorm:"column:task_reward"`                 //  达人赏金
+	TalentPayment          string    `gorm:"column:talent_payment"`              // 达人垫付金额
+	IsPayPayment           int       `gorm:"column:is_pay_payment"`              // 企业是否返样品钱
+	IsPayReward            int       `gorm:"column:is_pay_reward"`               // 企业是否结算悬赏
+	TaskMode               int       `gorm:"column:task_mode"`                   // 任务形式,1、2分别表示纯佣带货、悬赏任务
+	SampleMode             int       `gorm:"column:sample_mode"`                 // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
+	TaskStatus             int       `gorm:"column:task_status;default:1"`       // 任务状态 1待选 2已选 3落选
+	TaskStage              int       `gorm:"column:task_stage"`                  // 任务阶段,详情见info_sec_task_stage表
+	CreateDate             time.Time `gorm:"column:create_date"`                 // 创建时间
+	SelectDate             time.Time `gorm:"column:select_date"`                 // 反选时间
+	DeliveryDate           time.Time `gorm:"column:delivery_date"`               // 发货时间
+	CompleteDate           time.Time `gorm:"column:complete_date"`               // 结束时间
+	WithdrawDate           time.Time `gorm:"column:withdraw_date"`               // 提现时间
+	CompleteStatus         int       `gorm:"column:complete_status;default:1"`   // 结束方式 1未结束 2正常结束 3反选失败
+	LogisticsStatus        int       `gorm:"column:logistics_status;default:1"`  // 发货状态 1 待发货 2已发货 3 已签收
+	AssignmentStatus       uint      `gorm:"column:assignment_status;default:1"` // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	UpdateAt               time.Time `gorm:"column:update_at"`                   // 更新时间
+	WithdrawStatus         int       `gorm:"column:withdraw_status;default:1"`   // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	LeadTeamID             string    `gorm:"column:lead_team_id"`                // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
+	TeamID                 string    `gorm:"column:team_id"`                     // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
+	TeamIncome             int       `gorm:"column:team_income"`                 // young之团团长现金收益
+	TeamPoint              int       `gorm:"column:team_point"`                  // young之团团长积分收益
+}
+
+func (m *SecTaskInfo) TableName() string {
+	return "younggee_sec_task_info"
+}

+ 46 - 0
app/entity/selection_info.go

@@ -0,0 +1,46 @@
+package entity
+
+// Code generated by sql2gorm. DO NOT EDIT.
+
+import (
+	"time"
+)
+
+type SelectionInfo struct {
+	SelectionID      string     `gorm:"column:selection_id;primary_key"` // 选品项目id
+	SelectionName    string     `gorm:"column:selection_name"`           // 选品项目名称
+	EnterpriseID     string     `gorm:"column:enterprise_id"`            // 所属企业id
+	ProductID        int64      `gorm:"column:product_id"`               // 关联商品id
+	ContentType      int64      `gorm:"column:content_type"`             // 内容形式,1代表图文,2代表视频,3代表直播
+	SelectionStatus  int64      `gorm:"column:selection_status"`         // 选品项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
+	TaskMode         int64      `gorm:"column:task_mode"`                // 任务形式,1、2分别表示悬赏任务、纯佣带货
+	Platform         int64      `gorm:"column:platform"`                 // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	SampleMode       int64      `gorm:"column:sample_mode"`              // 领样形式,1、2分别表示免费领样、垫付领样
+	ProductUrl       string     `gorm:"column:product_url"`              // 带货链接
+	SampleNum        int64      `gorm:"column:sample_num"`               // 样品数量
+	RemainNum        int64      `gorm:"column:remain_num"`               // 剩余数量
+	CommissionRate   float64    `gorm:"column:commission_rate"`          // 佣金比例
+	EstimatedCost    float64    `gorm:"column:estimated_cost"`           // 预估成本
+	TaskReward       float64    `gorm:"column:task_reward"`              // 任务悬赏
+	SampleCondition  string     `gorm:"column:sample_condition"`         // 领样条件
+	RewardCondition  string     `gorm:"column:reward_condition"`         // 返现悬赏条件
+	SettlementAmount float64    `gorm:"column:settlement_amount"`        // 结算金额
+	TaskDdl          time.Time  `gorm:"column:task_ddl"`                 // 招募截止时间
+	Detail           string     `gorm:"column:detail"`                   // 卖点总结
+	ProductSnap      string     `gorm:"column:product_snap"`             // 商品信息快照
+	ProductPhotoSnap string     `gorm:"column:product_photo_snap"`       // 商品图片快照
+	CreatedAt        time.Time  `gorm:"column:created_at"`               // 创建时间
+	UpdatedAt        time.Time  `gorm:"column:updated_at"`               // 修改时间
+	SubmitAt         time.Time  `gorm:"column:submit_at"`                // 提交审核时间
+	PassAt           time.Time  `gorm:"column:pass_at"`                  // 审核通过时间
+	FailReason       int64      `gorm:"column:fail_reason"`              // 失效原因,1、2分别表示逾期未支付、项目存在风险
+	PayAt            time.Time  `gorm:"column:pay_at"`                   // 支付时间
+	FinishAt         time.Time  `gorm:"column:finish_at"`                // 结案时间
+	IsRead           int64      `gorm:"column:is_read"`                  // 是否已读
+	AutoTaskID       int64      `gorm:"column:auto_task_id"`             // 定时任务id
+	AutoFailAt       *time.Time `gorm:"column:auto_fail_at"`             // 失效自动处理时间
+}
+
+func (m *SelectionInfo) TableName() string {
+	return "younggee_selection_info"
+}

+ 119 - 0
app/service/enterprise_service.go

@@ -0,0 +1,119 @@
+package service
+
+import (
+	"time"
+	"youngee_b_api/app/dao"
+	"youngee_b_api/app/vo"
+)
+
+type EnterpriseService struct{}
+
+func (e EnterpriseService) GetEnterpriseTakegoodsInfo(enterpriseId string, dateRange string) vo.ReWorkspaceTakegoods {
+	var result vo.ReWorkspaceTakegoods
+	//result.Pay = 1234.5
+	//result.PayList = []float64{4, 6, 9}
+	// 处理时间范围
+	switch dateRange {
+	case "7days":
+		dates := getLastNDays(7)
+		result = calcTakegoodsInfo(dates, enterpriseId)
+		break
+	case "30days":
+		dates := getLastNDays(30)
+		result = calcTakegoodsInfo(dates, enterpriseId)
+		break
+	case "90days":
+		dates := getLastNDays(90)
+		result = calcTakegoodsInfo(dates, enterpriseId)
+		break
+	case "monthly":
+		dates := getCurrentMonthDates()
+		result = calcTakegoodsInfo(dates, enterpriseId)
+		break
+	}
+
+	return result
+}
+
+func getLastNDays(n int) []time.Time {
+	var dates []time.Time
+	today := time.Now()
+	for i := 0; i < n; i++ {
+		date := today.AddDate(0, 0, -i)
+		dates = append(dates, date)
+	}
+	return dates
+}
+
+func getCurrentMonthDates() []time.Time {
+	var dates []time.Time
+	today := time.Now()
+	year, month, _ := today.Date()
+	location := today.Location()
+
+	firstOfMonth := time.Date(year, month, 1, 0, 0, 0, 0, location)
+	nextMonth := firstOfMonth.AddDate(0, 1, 0)
+
+	for current := firstOfMonth; current.Before(nextMonth); current = current.AddDate(0, 0, 1) {
+		dates = append(dates, current)
+	}
+	return dates
+}
+
+func calcTakegoodsInfo(dates []time.Time, enterpriseId string) vo.ReWorkspaceTakegoods {
+	var pay, finish, commission, commissionRate float64
+	var order, person int64
+	var payList, finishList, commissionList, commissionRateList []float64
+	var orderList, personList []int64
+
+	for _, date := range dates {
+		enterprises, _ := (&dao.SelectionInfoDAO{}).GetSelectionInfoListOfDay(enterpriseId, date)
+		if enterprises != nil {
+			var currentPay float64
+			var currentFinish float64
+			var currentCommission float64
+			var currentCommissionRate float64
+			var currentOrder int64
+			var currentPerson int64
+			for _, enterprise := range enterprises {
+				// 带货数据
+				currentPay += enterprise.EstimatedCost
+				currentFinish += enterprise.SettlementAmount
+				currentCommission += enterprise.EstimatedCost * enterprise.CommissionRate
+				currentOrder += enterprise.SampleNum - enterprise.RemainNum
+				// 出单数量
+				currentPerson, _ = (&dao.SecTaskInfoDao{}).CountBySelectionId(enterprise.SelectionID)
+				currentCommissionRate = enterprise.SettlementAmount / float64(currentPerson)
+			}
+			// 带货数据
+			pay += currentPay
+			payList = append(payList, currentPay)
+			finish += currentFinish
+			finishList = append(finishList, currentFinish)
+			commission += currentCommission
+			commissionList = append(commissionList, currentCommission)
+			order += currentOrder
+			orderList = append(orderList, currentOrder)
+			// 出单数量
+			person += currentPerson
+			personList = append(personList, person)
+			commissionRate += currentCommissionRate
+			commissionRateList = append(commissionRateList, currentCommissionRate)
+		}
+	}
+	res := vo.ReWorkspaceTakegoods{
+		Pay:                pay,
+		PayList:            payList,
+		Finish:             finish,
+		FinishList:         finishList,
+		Commission:         commission,
+		CommissionList:     commissionList,
+		Order:              order,
+		OrderList:          orderList,
+		Person:             person,
+		PersonList:         personList,
+		CommissionRate:     commissionRate,
+		CommissionRateList: commissionRateList,
+	}
+	return res
+}

+ 46 - 0
app/service/selection_info_service.go

@@ -0,0 +1,46 @@
+package service
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/db"
+	"youngee_b_api/model/http_model"
+)
+
+type SelectionInfoService struct{}
+
+func (s *SelectionInfoService) GetSelectionInfo(ctx *gin.Context, selectionId string) (*http_model.SelectionDetail, error) {
+	selectionDetail := http_model.SelectionDetail{}
+	selectionInfo, err := db.GetSelectionById(ctx, selectionId)
+
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[selectionDB service] call GetSelectionInfo error,err:%+v", err)
+		return nil, err
+	}
+	selectionBriefInfo, err := db.GetSelectionBriefInfo(ctx, selectionId)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[selectionDB service] call GetSelectionBriefInfo error,err:%+v", err)
+		return nil, err
+	}
+	selectionExampleInfo, err := db.GetSelectionExampleInfo(ctx, selectionId)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[selectionDB service] call GetSelectionExampleInfo error,err:%+v", err)
+		return nil, err
+	}
+	productInfo, err := db.GetProductInfoBySelectionId(ctx, selectionId)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[selectionDB service] call GetProductInfo error,err:%+v", err)
+		return nil, err
+	}
+	productPhotoInfo, err := db.GetProductPhotoInfoBySelectionId(ctx, selectionId)
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[selectionDB service] call GetProductPhotoInfo error,err:%+v", err)
+		return nil, err
+	}
+	selectionDetail.SelectionBrief = selectionBriefInfo
+	selectionDetail.SelectionInfo = selectionInfo
+	selectionDetail.SelectionExample = selectionExampleInfo
+	selectionDetail.ProductInfo = productInfo
+	selectionDetail.ProductPhotoInfo = productPhotoInfo
+	return &selectionDetail, nil
+}

+ 18 - 0
app/vo/re_enterprise.go

@@ -0,0 +1,18 @@
+package vo
+
+import "time"
+
+type ReEnterprise struct {
+	EnterpriseID     string    `gorm:"column:enterprise_id"`     // 企业id,用户ID的生成规则为:1(企业用户代码)+分秒数字+四位随机数字
+	Industry         int64     `gorm:"column:industry"`          // 行业,1-14分别代表能源、化工、材料、机械设备/军工、企业服务/造纸印刷、运输设备、旅游酒店、媒体/信息通信服务、批发/零售、消费品、卫生保健/医疗、金融、建材/建筑/房地产、公共事业
+	BusinessName     string    `gorm:"column:business_name"`     // 公司或组织名称
+	UserID           int64     `gorm:"column:user_id"`           // 对应用户id
+	Balance          float64   `gorm:"column:balance"`           // 账户余额
+	FrozenBalance    float64   `gorm:"column:frozen_balance"`    // 冻结余额
+	AvailableBalance float64   `gorm:"column:available_balance"` // 可用余额
+	BillableAmount   float64   `gorm:"column:billable_amount"`   // 可开票金额
+	Invoicing        float64   `gorm:"column:invoicing"`         // 开票中金额
+	Recharging       float64   `gorm:"column:recharging"`        // 充值中金额
+	CreatedAt        time.Time `gorm:"column:created_at"`        // 创建时间
+	UpdatedAt        time.Time `gorm:"column:updated_at"`        // 更新时间
+}

+ 16 - 0
app/vo/re_workspace_takegoods.go

@@ -0,0 +1,16 @@
+package vo
+
+type ReWorkspaceTakegoods struct {
+	Pay                float64   `json:"pay"`
+	PayList            []float64 `json:"pay_list"`
+	Finish             float64   `json:"finish"`
+	FinishList         []float64 `json:"finish_list"`
+	Commission         float64   `json:"commission"`
+	CommissionList     []float64 `json:"commission_list"`
+	Order              int64     `json:"order"`
+	OrderList          []int64   `json:"order_list"`
+	Person             int64     `json:"person"`
+	PersonList         []int64   `json:"person_list"`
+	CommissionRate     float64   `json:"commissionRate"`
+	CommissionRateList []float64 `json:"commissionRate_list"`
+}

+ 4 - 4
config/init.go

@@ -2,14 +2,13 @@ package config
 
 import (
 	"fmt"
+	"gopkg.in/yaml.v2"
 	"io/ioutil"
 	"os"
-	"youngee_b_api/db"
+	"youngee_b_api/app/dao"
 	"youngee_b_api/model/system_model"
 	"youngee_b_api/redis"
 	"youngee_b_api/service"
-
-	"gopkg.in/yaml.v2"
 )
 
 func Init() *system_model.Server {
@@ -31,7 +30,8 @@ func Init() *system_model.Server {
 }
 
 func loadExternelConfig(config *system_model.Config) {
-	db.Init(config.Mysql)
+	//db.Init(config.Mysql)
+	dao.Init(config.Mysql)
 	redis.Init(config.Redis)
 	service.LoginAuthInit(config.Server.Session)
 	service.SendCodeInit(config.Server.Session)

+ 1 - 0
go.mod

@@ -14,6 +14,7 @@ require (
 	github.com/go-playground/validator/v10 v10.10.1 // indirect
 	github.com/go-redis/redis/v8 v8.11.5
 	github.com/issue9/conv v1.2.2
+	github.com/jinzhu/gorm v1.9.16 // indirect
 	github.com/jinzhu/now v1.1.5 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/mailru/easyjson v0.7.7 // indirect

+ 21 - 0
go.sum

@@ -3,6 +3,7 @@ github.com/GUAIK-ORG/go-snowflake v0.0.0-20200116064823-220c4260e85f h1:RDkg3pyE
 github.com/GUAIK-ORG/go-snowflake v0.0.0-20200116064823-220c4260e85f/go.mod h1:zA7AF9RTfpluCfz0omI4t5KCMaWHUMicsZoMccnaT44=
 github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
 github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
+github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
 github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
 github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
@@ -11,6 +12,7 @@ github.com/agiledragon/gomonkey v2.0.2+incompatible h1:eXKi9/piiC3cjJD1658mEE2o3
 github.com/agiledragon/gomonkey v2.0.2+incompatible/go.mod h1:2NGfXu1a80LLr2cmWXGBDaHEjb1idR6+FVlX5T3D9hw=
 github.com/agiledragon/gomonkey/v2 v2.3.1 h1:k+UnUY0EMNYUFUAQVETGY9uUTxjMdnUkP0ARyJS1zzs=
 github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
+github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
 github.com/caixw/lib.go v0.0.0-20141220110639-1781da9139e0 h1:MnIURgMAFAMyxAHu8h2TbnjxMMd7SKVCPyTZz5EfwNA=
 github.com/caixw/lib.go v0.0.0-20141220110639-1781da9139e0/go.mod h1:hQL8hyiiVE/BSo7gh13njx+DpvoPh/yE8/BkKKc62RA=
 github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
@@ -23,8 +25,12 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM=
+github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
+github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
+github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
@@ -61,9 +67,12 @@ github.com/go-playground/validator/v10 v10.10.1 h1:uA0+amWMiglNZKZ9FJRKUAe9U3RX9
 github.com/go-playground/validator/v10 v10.10.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU=
 github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
 github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
+github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
 github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
+github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
+github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -93,8 +102,11 @@ github.com/issue9/assert/v2 v2.0.0 h1:vN7fr70g5ND6zM39tPZk/E4WCyjGMqApmFbujSTmEo
 github.com/issue9/assert/v2 v2.0.0/go.mod h1:rKr1eVGzXUhAo2af1thiKAhIA8uiSK9Wyn7mcZ4BzAg=
 github.com/issue9/conv v1.2.2 h1:DlvooVwcCgHxGxgVNSt4LFGxIVzWbMV8E2dmQlrGHNA=
 github.com/issue9/conv v1.2.2/go.mod h1:uDqE/xgXbZ5UjC2J5+HLIoguE0qOKGzv7EzLzkvoRPE=
+github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o=
+github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
 github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
 github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
+github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
 github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
@@ -115,6 +127,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
 github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
 github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
 github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
+github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
+github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
 github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
 github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
@@ -123,6 +137,8 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
 github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
 github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
 github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
+github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
+github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -203,7 +219,9 @@ 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=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
@@ -213,10 +231,13 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o=
 golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
+golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=

+ 1 - 1
handler/SpecialTaskFinishData.go

@@ -4,7 +4,7 @@ package handler
 // 	"errors"
 // 	"fmt"
 // 	"youngee_b_api/consts"
-// 	"youngee_b_api/model/http_model"
+// 	"youngee_b_api/entity/http_model"
 // 	"youngee_b_api/pack"
 // 	"youngee_b_api/service"
 // 	"youngee_b_api/util"

+ 57 - 0
handler/WorkspaceGoodsInfo.go

@@ -0,0 +1,57 @@
+package handler
+
+//import (
+//	"youngee_b_api/consts"
+//	"youngee_b_api/entity/http_model"
+//	"youngee_b_api/service"
+//	"youngee_b_api/util"
+//
+//	"github.com/gin-gonic/gin"
+//	"github.com/sirupsen/logrus"
+//	log "github.com/sirupsen/logrus"
+//)
+//
+//func WrapWorkspaceGoodsInfoHandler(ctx *gin.Context) {
+//	handler := newWorkspaceGoodsInfoHandler(ctx)
+//	baseRun(handler)
+//}
+//
+//func newWorkspaceGoodsInfoHandler(ctx *gin.Context) *FindProductHandler {
+//	return &FindProductHandler{
+//		req:  http_model.NewWorkspaceGoodsInfoRequest(),
+//		resp: http_model.NewWorkspaceGoodsInfoResponse(),
+//		ctx:  ctx,
+//	}
+//}
+//
+//type WorkspaceGoodsInfoHandler struct {
+//	req  *http_model.WorkspaceGoodsInfoRequest
+//	resp *http_model.CommonResponse
+//	ctx  *gin.Context
+//}
+//
+//func (h *WorkspaceGoodsInfoHandler) getRequest() interface{} {
+//	return h.req
+//}
+//func (h *WorkspaceGoodsInfoHandler) getContext() *gin.Context {
+//	return h.ctx
+//}
+//func (h *WorkspaceGoodsInfoHandler) getResponse() interface{} {
+//	return h.resp
+//}
+//func (h *WorkspaceGoodsInfoHandler) run() {
+//	data := *&http_model.WorkspaceGoodsInfoRequest{}
+//	data = *h.req
+//	res, err := service.Product.FindByID(h.ctx, data)
+//	if err != nil {
+//		// 数据库查询失败,返回5001
+//		logrus.Errorf("[FindProductHandler] call FindByID err:%+v\n", err)
+//		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
+//		log.Info("FindProduct fail,req:%+v", h.req)
+//		return
+//	}
+//	h.resp.Data = res
+//}
+//func (h *WorkspaceGoodsInfoHandler) checkParam() error {
+//	return nil
+//}

+ 30 - 30
model/gorm_model/selection_info.go

@@ -7,36 +7,36 @@ import (
 )
 
 type YounggeeSelectionInfo struct {
-	SelectionID      string    `gorm:"column:selection_id;primary_key"` // 选品项目id
-	SelectionName    string    `gorm:"column:selection_name"`           // 选品项目名称
-	EnterpriseID     string    `gorm:"column:enterprise_id"`            // 所属企业id
-	ProductID        int       `gorm:"column:product_id"`               // 关联商品id
-	ContentType      int       `gorm:"column:content_type"`             // 内容形式,1代表图文,2代表视频,3代表直播
-	SelectionStatus  int       `gorm:"column:selection_status"`         // 选品项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
-	TaskMode         int       `gorm:"column:task_mode"`                // 任务形式,1、2分别表示悬赏任务、纯佣带货
-	Platform         int       `gorm:"column:platform"`                 // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
-	SampleMode       int       `gorm:"column:sample_mode"`              // 领样形式,1、2分别表示免费领样、垫付领样
-	ProductUrl       string    `gorm:"column:product_url"`              // 带货链接
-	SampleNum        int       `gorm:"column:sample_num"`               // 样品数量
-	RemainNum        int       `gorm:"column:remain_num"`               // 剩余数量
-	CommissionRate   float64       `gorm:"column:commission_rate"`          // 佣金比例
-	EstimatedCost    string    `gorm:"column:estimated_cost"`           // 预估成本
-	TaskReward       string    `gorm:"column:task_reward"`              // 任务悬赏
-	SampleCondition  string    `gorm:"column:sample_condition"`         // 领样条件
-	RewardCondition  string    `gorm:"column:reward_condition"`         // 返现悬赏条件
-	SettlementAmount string    `gorm:"column:settlement_amount"`        // 结算金额
-	TaskDdl          time.Time `gorm:"column:task_ddl"`                 // 招募截止时间
-	Detail           string    `gorm:"column:detail"`                   // 卖点总结
-	ProductSnap      string    `gorm:"column:product_snap"`             // 商品信息快照
-	ProductPhotoSnap string    `gorm:"column:product_photo_snap"`       // 商品图片快照
-	CreatedAt        time.Time `gorm:"column:created_at"`               // 创建时间
-	UpdatedAt        time.Time `gorm:"column:updated_at"`               // 修改时间
-	SubmitAt         time.Time `gorm:"column:submit_at"`                // 提交审核时间
-	PassAt           time.Time `gorm:"column:pass_at"`                  // 审核通过时间
-	FailReason       int       `gorm:"column:fail_reason"`              // 失效原因,1、2分别表示逾期未支付、项目存在风险
-	PayAt            time.Time `gorm:"column:pay_at"`                   // 支付时间
-	FinishAt         time.Time `gorm:"column:finish_at"`                // 结案时间
-	IsRead           int       `gorm:"column:is_read"`                  // 是否已读
+	SelectionID      string     `gorm:"column:selection_id;primary_key"` // 选品项目id
+	SelectionName    string     `gorm:"column:selection_name"`           // 选品项目名称
+	EnterpriseID     string     `gorm:"column:enterprise_id"`            // 所属企业id
+	ProductID        int        `gorm:"column:product_id"`               // 关联商品id
+	ContentType      int        `gorm:"column:content_type"`             // 内容形式,1代表图文,2代表视频,3代表直播
+	SelectionStatus  int        `gorm:"column:selection_status"`         // 选品项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
+	TaskMode         int        `gorm:"column:task_mode"`                // 任务形式,1、2分别表示悬赏任务、纯佣带货
+	Platform         int        `gorm:"column:platform"`                 // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	SampleMode       int        `gorm:"column:sample_mode"`              // 领样形式,1、2分别表示免费领样、垫付领样
+	ProductUrl       string     `gorm:"column:product_url"`              // 带货链接
+	SampleNum        int        `gorm:"column:sample_num"`               // 样品数量
+	RemainNum        int        `gorm:"column:remain_num"`               // 剩余数量
+	CommissionRate   float64    `gorm:"column:commission_rate"`          // 佣金比例
+	EstimatedCost    string     `gorm:"column:estimated_cost"`           // 预估成本
+	TaskReward       string     `gorm:"column:task_reward"`              // 任务悬赏
+	SampleCondition  string     `gorm:"column:sample_condition"`         // 领样条件
+	RewardCondition  string     `gorm:"column:reward_condition"`         // 返现悬赏条件
+	SettlementAmount string     `gorm:"column:settlement_amount"`        // 结算金额
+	TaskDdl          time.Time  `gorm:"column:task_ddl"`                 // 招募截止时间
+	Detail           string     `gorm:"column:detail"`                   // 卖点总结
+	ProductSnap      string     `gorm:"column:product_snap"`             // 商品信息快照
+	ProductPhotoSnap string     `gorm:"column:product_photo_snap"`       // 商品图片快照
+	CreatedAt        time.Time  `gorm:"column:created_at"`               // 创建时间
+	UpdatedAt        time.Time  `gorm:"column:updated_at"`               // 修改时间
+	SubmitAt         time.Time  `gorm:"column:submit_at"`                // 提交审核时间
+	PassAt           time.Time  `gorm:"column:pass_at"`                  // 审核通过时间
+	FailReason       int        `gorm:"column:fail_reason"`              // 失效原因,1、2分别表示逾期未支付、项目存在风险
+	PayAt            time.Time  `gorm:"column:pay_at"`                   // 支付时间
+	FinishAt         time.Time  `gorm:"column:finish_at"`                // 结案时间
+	IsRead           int        `gorm:"column:is_read"`                  // 是否已读
 	AutoTaskID       int        `gorm:"column:auto_task_id"`             // 定时任务id
 	AutoFailAt       *time.Time `gorm:"column:auto_fail_at"`             // 失效自动处理时间
 }

+ 30 - 0
model/http_model/GoodsInfoWorkspace.go

@@ -0,0 +1,30 @@
+package http_model
+
+type WorkspaceGoodsInfoRequest struct {
+	EnterpriseId string `json:"enterprise_id"`
+	Days         int    `json:"days"`
+}
+
+type WorkspaceGoodsInfo struct {
+	Pay                float64   `json:"pay"`
+	PayList            []float64 `json:"pay_list"`
+	Finish             float64   `json:"finish"`
+	FinishList         []float64 `json:"finish_list"`
+	Commission         float64   `json:"commission"`
+	CommissionList     []float64 `json:"commission_list"`
+	Order              int       `json:"order"`
+	OrderList          []int     `json:"order_list"`
+	Person             int       `json:"person"`
+	PersonList         []int     `json:"person_list"`
+	CommissionRate     float64   `json:"commissionRate"`
+	CommissionRateList []float64 `json:"commissionRate_list"`
+}
+
+func NewWorkspaceGoodsInfoRequest() *WorkspaceGoodsInfoRequest {
+	return new(WorkspaceGoodsInfoRequest)
+}
+func NewWorkspaceGoodsInfoResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(WorkspaceGoodsInfo)
+	return resp
+}

+ 9 - 0
route/init.go

@@ -1,6 +1,7 @@
 package route
 
 import (
+	"youngee_b_api/app/controller"
 	"youngee_b_api/handler"
 	"youngee_b_api/middleware"
 	"youngee_b_api/model/http_model"
@@ -158,4 +159,12 @@ func InitRoute(r *gin.Engine) {
 		s.POST("/selection/task/settle", handler.WrapSettleSecTaskHandler)                    // 结算
 		s.POST("/selection/getAllSelection", handler.WrapGetAllSelectionHandler)              // 查询选品广场选品列表
 	}
+
+	// 工作台相关接口
+	workspace := r.Group("/youngee/business/workspace")
+	{
+		workspace.Use(middleware.LoginAuthMiddleware)
+		workspace.POST("/takegoods", controller.WorkspaceController{}.GetTakegoodsInfo)
+	}
+
 }