소스 검색

ProjectDetail

Xingyu Xian 1 개월 전
부모
커밋
8aa2b8e7db

+ 7 - 10
handler/project_show.go

@@ -1,7 +1,6 @@
 package handler
 
 import (
-	"fmt"
 	"youngee_b_api/consts"
 	"youngee_b_api/model/http_model"
 	"youngee_b_api/service"
@@ -19,14 +18,14 @@ func WrapShowProjectHandler(ctx *gin.Context) {
 
 func newShowProjectHandler(ctx *gin.Context) *ShowProjectHandler {
 	return &ShowProjectHandler{
-		req:  http_model.NewShowProjectRequest(),
-		resp: http_model.NewShowProjectResponse(),
+		req:  http_model.NewShowNewProjectRequest(),
+		resp: http_model.NewShowNewProjectResponse(),
 		ctx:  ctx,
 	}
 }
 
 type ShowProjectHandler struct {
-	req  *http_model.ShowProjectRequest
+	req  *http_model.ShowNewProjectRequest
 	resp *http_model.CommonResponse
 	ctx  *gin.Context
 }
@@ -41,12 +40,10 @@ func (h *ShowProjectHandler) getResponse() interface{} {
 	return h.resp
 }
 func (h *ShowProjectHandler) run() {
-	data := http_model.ShowProjectRequest{}
-	data = *h.req
-	//auth := middleware.GetSessionAuth(h.ctx)
-	//enterpriseID := auth.EnterpriseID
-	fmt.Printf("projectID %+v", data.ProjectID)
-	res, err := service.Project.GetPorjectDetail(h.ctx, data.ProjectID)
+	// auth := middleware.GetSessionAuth(h.ctx)
+	// enterpriseID := auth.EnterpriseID
+	// fmt.Printf("projectID %+v", data.ProjectID)
+	res, err := service.Project.GetProjectDetail(h.ctx, h.req.ProjectId)
 	if err != nil {
 		logrus.Errorf("[ShowProjectHandler] call Show err:%+v\n", err)
 		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")

+ 1 - 1
handler/show_s_project.go

@@ -43,7 +43,7 @@ func (h *ShowSProjectHandler) run() {
 	data := http_model.ShowSProjectRequest{}
 	data = *h.req
 	// fmt.Printf("sProjectId %+v", data.SProjectId)
-	res, err := service.SProject.GetSPorjectDetail(h.ctx, data.SProjectId)
+	res, err := service.SProject.GetSProjectDetail(h.ctx, data.SProjectId)
 	if err != nil {
 		logrus.Errorf("[ShowProjectHandler] call Show err:%+v\n", err)
 		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")

+ 55 - 0
handler/store_find.go

@@ -0,0 +1,55 @@
+package handler
+
+import (
+	"youngee_b_api/consts"
+	"youngee_b_api/model/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 WrapFindStoreHandler(ctx *gin.Context) {
+	handler := newFindStoreHandler(ctx)
+	baseRun(handler)
+}
+
+func newFindStoreHandler(ctx *gin.Context) *FindStoreHandler {
+	return &FindStoreHandler{
+		req:  http_model.NewFindStoreRequest(),
+		resp: http_model.NewFindStoreResponse(),
+		ctx:  ctx,
+	}
+}
+
+type FindStoreHandler struct {
+	req  *http_model.FindStoreRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *FindStoreHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *FindStoreHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *FindStoreHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *FindStoreHandler) run() {
+	res, err := service.LocalLife.GetStoreInfo(h.ctx, h.req)
+	if err != nil {
+		// 数据库查询失败,返回5001
+		logrus.Errorf("[FindStoreHandler] call FindByID err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
+		log.Info("FindStore fail,req:%+v", h.req)
+		return
+	}
+	h.resp.Data = res
+}
+func (h *FindStoreHandler) checkParam() error {
+	return nil
+}

+ 48 - 0
handler/supplier_amount_bill_list.go

@@ -0,0 +1,48 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapSupplierAmountBillListHandler(ctx *gin.Context) {
+	handler := newSupplierAmountBillListHandler(ctx)
+	baseRun(handler)
+}
+
+func newSupplierAmountBillListHandler(ctx *gin.Context) *SupplierAmountBillListHandler {
+	return &SupplierAmountBillListHandler{
+		req:  http_model.SupplierAmountBillRequest(),
+		resp: http_model.SupplierAmountBillResponse(),
+		ctx:  ctx,
+	}
+}
+
+type SupplierAmountBillListHandler struct {
+	req  *http_model.SupplierAmountBillListRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *SupplierAmountBillListHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *SupplierAmountBillListHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *SupplierAmountBillListHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *SupplierAmountBillListHandler) run() {
+	data, err := service.Supplier.GetSupplierAmountBillList(h.ctx, h.req)
+	if err != nil {
+		h.resp.Message = err.Error()
+	}
+	h.resp.Data = data
+	h.resp.Message = "成功查询"
+}
+
+func (h *SupplierAmountBillListHandler) checkParam() error {
+	return nil
+}

+ 55 - 0
handler/team_buying_find.go

@@ -0,0 +1,55 @@
+package handler
+
+import (
+	"youngee_b_api/consts"
+	"youngee_b_api/model/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 WrapFindTeamBuyingHandler(ctx *gin.Context) {
+	handler := newFindTeamBuyingHandler(ctx)
+	baseRun(handler)
+}
+
+func newFindTeamBuyingHandler(ctx *gin.Context) *FindTeamBuyingHandler {
+	return &FindTeamBuyingHandler{
+		req:  http_model.NewFindTeamBuyingRequest(),
+		resp: http_model.NewFindTeamBuyingResponse(),
+		ctx:  ctx,
+	}
+}
+
+type FindTeamBuyingHandler struct {
+	req  *http_model.FindTeamBuyingRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *FindTeamBuyingHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *FindTeamBuyingHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *FindTeamBuyingHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *FindTeamBuyingHandler) run() {
+	res, err := service.LocalLife.GetTeamBuyingInfo(h.ctx, h.req)
+	if err != nil {
+		// 数据库查询失败,返回5001
+		logrus.Errorf("[FindTeamBuyingHandler] call FindByID err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
+		log.Info("FindTeamBuying fail,req:%+v", h.req)
+		return
+	}
+	h.resp.Data = res
+}
+func (h *FindTeamBuyingHandler) checkParam() error {
+	return nil
+}

+ 39 - 0
model/http_model/find_store.go

@@ -0,0 +1,39 @@
+package http_model
+
+type FindStoreRequest struct {
+	StoreID int `json:"store_id"`
+}
+
+type StorePhoto struct {
+	PhotoUrl string `json:"photo_url"` // 图片或视频url
+	PhotoUid string `json:"photo_uid"`
+	Symbol   int64  `json:"symbol"` // 标志位,1为主图,2为轮播图,3为轮播图视频,4详情图,5详情图视频
+}
+
+type FindStoreData struct {
+	StoreId            int           `json:"store_id"`             // 门店id
+	StoreName          string        `json:"store_name"`           // 门店名称
+	StoreCategory      string        `json:"store_category"`       // 门店类目(/分隔)
+	StoreType          int           `json:"store_type"`           // 门店类型,1单门店,2连锁门店
+	StoreLocation      string        `json:"store_location"`       // 门店地址
+	StoreDetail        string        `json:"store_detail"`         // 门店特点
+	StoreLink          string        `json:"store_link"`           // 分销链接
+	TeamNum            int           `json:"team_num"`             // 包含团购套餐数
+	BelongEnterpriseId string        `json:"belong_enterprise_id"` // 门店所属商家ID
+	IsDeleted          int           `json:"is_deleted"`           // 已删除(0否 1是)
+	OperateType        int           `json:"operate_type"`         // 操作人类型(1商家 2后台)
+	EnterpriseId       string        `json:"enterprise_id"`        // 商家id
+	SubAccountId       int           `json:"sub_account_id"`       // 商家子账号id
+	CreatedAt          string        `json:"created_at"`           // 创建时间
+	UpdatedAt          string        `json:"updated_at"`           // 更新时间
+	StorePhotos        []*StorePhoto `json:"store_photos"`         // 商品图片列表
+}
+
+func NewFindStoreRequest() *FindStoreRequest {
+	return new(FindStoreRequest)
+}
+func NewFindStoreResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(FindStoreData)
+	return resp
+}

+ 38 - 0
model/http_model/find_team_buying.go

@@ -0,0 +1,38 @@
+package http_model
+
+type FindTeamBuyingRequest struct {
+	TeamBuyingId int `json:"team_buying_id"`
+}
+
+type TeamBuyingPhoto struct {
+	PhotoUrl string `json:"photo_url"` // 图片或视频url
+	PhotoUid string `json:"photo_uid"`
+	Symbol   int64  `json:"symbol"` // 标志位,1为主图,2为轮播图,3为轮播图视频,4详情图,5详情图视频
+}
+
+type FindTeamBuyingData struct {
+	TeamBuyingId       int                `json:"team_buying_id"`       // 团购id
+	StoreId            int                `json:"store_id"`             // 所属门店ID
+	TeamBuyingCategory string             `json:"team_buying_category"` // 团购类目(/分隔)
+	TeamBuyingName     string             `json:"team_buying_name"`     // 团购标题
+	TeamBuyingPrice    float64            `json:"team_buying_price"`    // 团购售价
+	PublicCommission   int                `json:"public_commission"`    // 公开佣金%
+	TeamBuyingDetail   string             `json:"team_buying_detail"`   // 团购详情
+	TeamBuyingLink     string             `json:"team_buying_link"`     // 分销链接
+	IsDeleted          int                `json:"is_deleted"`           // 删除(0否 1是)
+	OperateType        int                `json:"operate_type"`         // 操作人类型(1商家 2后台)
+	EnterpriseId       string             `json:"enterprise_id"`        // 商家id
+	SubAccountId       int                `json:"sub_account_id"`       // 商家子账号id
+	CreatedAt          string             `json:"created_at"`           // 创建时间
+	UpdatedAt          string             `json:"updated_at"`           // 更新时间
+	TeamBuyingPhotos   []*TeamBuyingPhoto `json:"team_buying_photos"`   // 商品图片列表
+}
+
+func NewFindTeamBuyingRequest() *FindTeamBuyingRequest {
+	return new(FindTeamBuyingRequest)
+}
+func NewFindTeamBuyingResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(FindTeamBuyingData)
+	return resp
+}

+ 4 - 1
model/http_model/full_project_list.go

@@ -12,6 +12,7 @@ type FullProjectListRequest struct {
 	ProjectForm        string `json:"project_form"`         // 种草任务形式
 	ProjectContentType string `json:"project_content_type"` // 种草任务内容形式
 	ProjectUpdated     string `json:"project_updated"`      // 种草任务最后操作时间
+	AddToListStatus    int    `json:"add_to_list_status"`   // 加入商单状态,1已加入,2未加入
 }
 
 type FullProjectPreview struct {
@@ -23,6 +24,7 @@ type FullProjectPreview struct {
 	ProjectType        string                 `json:"project_type"`         // 种草任务类型
 	ProjectContentType string                 `json:"project_content_type"` // 种草任务内容形式
 	RecruitStrategy    []*EasyRecruitStrategy `json:"recruit_strategy"`     // 招募策略
+	EnterpriseId       string                 `json:"enterprise_id"`        // 商家ID
 	ProjectUpdated     string                 `json:"project_updated"`      // 最后操作时间
 	EstimatedCost      float64                `json:"estimated_cost"`       // 任务总预算
 	ServiceChargeRate  float64                `json:"service_charge_rate"`  // 服务费率
@@ -45,12 +47,13 @@ type EasyRecruitStrategy struct {
 
 type FullProjectListData struct {
 	FullProjectPreview []*FullProjectPreview `json:"full_project_pre_view"`
-	Total              string                `json:"total"`
+	Total              int64                 `json:"total"`
 }
 
 func NewFullProjectListRequest() *FullProjectListRequest {
 	return new(FullProjectListRequest)
 }
+
 func NewFullProjectListResponse() *CommonResponse {
 	resp := new(CommonResponse)
 	resp.Data = new(FullProjectListData)

+ 2 - 2
model/http_model/local_life_detail.go

@@ -10,8 +10,7 @@ type ShowLocalPhoto struct {
 
 type ShowLocalData struct {
 	// 系统信息
-	SLocalId          int     `json:"s_local_id"`          // 主键ID
-	LocalId           string  `json:"local_id"`            // 被加入商单的原本地生活ID
+	LocalId           string  `json:"local_id"`            // 本地生活ID
 	LocalPlatform     int     `json:"local_platform"`      // 任务平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
 	TaskStatus        int     `json:"task_status"`         // 任务状态
 	CreateAt          string  `json:"create_at"`           // 创建时间
@@ -21,6 +20,7 @@ type ShowLocalData struct {
 	ServiceChargeRate float64 `json:"service_charge_rate"` // 公开服务费率
 
 	// 关联主体
+	PromoteBody          int     `json:"promote_body"`            // 推广主体(1门店 2团购)
 	StoreId              int     `json:"store_id"`                // 关联门店id
 	StoreName            string  `json:"store_name"`              // 门店名称
 	StoreCategory        string  `json:"store_category"`          // 门店类目(/分隔)

+ 65 - 0
model/http_model/show_project.go

@@ -0,0 +1,65 @@
+package http_model
+
+import "youngee_b_api/model/gorm_model"
+
+type ShowNewProjectData struct {
+	ProjectName         string                             `json:"project_name"`           // 项目名称
+	ProjectStatus       int64                              `json:"project_status"`         // 项目状态,1-7分别代表创建中、待审核、招募中、待支付、失效、执行中、已结案
+	ProjectType         int64                              `json:"project_type"`           // 项目类型,1代表全流程项目,2代表专项项目
+	ProjectPlatform     int64                              `json:"project_platform"`       // 项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
+	ProjectForm         int64                              `json:"project_form"`           // 项目形式,1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创
+	TalentType          string                             `json:"talent_type"`            // 达人类型
+	RecruitDdl          string                             `json:"recruit_ddl"`            // 招募截止时间
+	ContentType         int64                              `json:"content_type"`           // 内容形式,1代表图文,2代表视频
+	ProjectDetail       string                             `json:"project_detail"`         // 项目详情
+	SRecruitStrategys   []ShowNewRecruitStrategy           `json:"recruit_strategys"`      // 招募策略
+	ProductID           int64                              `json:"product_id"`             // 关联商品id
+	ProductInfo         string                             `json:"product_info"`           // 商品信息
+	ProductPhotoInfo    string                             `json:"product_photo_info"`     // 商品图片
+	EstimatedCost       float64                            `json:"estimated_cost"`         // 预估成本
+	EnterpriseID        string                             `json:"enterprise_id"`          // 企业id
+	ProjectID           string                             `json:"project_id"`             // 项目id
+	FailReason          string                             `json:"fail_reason"`            // 失效原因
+	Phone               string                             `json:"phone"`                  // 联系方式
+	PassAt              string                             `json:"pass_at"`                // 审核通过时间
+	CreatorCompany      string                             `json:"creator_company"`        // 创建人公司
+	SubAccountId        int                                `json:"sub_account_id"`         // 商家子账号
+	CreatorType         int                                `json:"creator_type"`           // 种草任务创建人类型,1商家主账号,2商家子账号
+	CreatorName         string                             `json:"creator_name"`           // 创建人名称
+	ServiceChargeRate   float64                            `json:"service_charge_rate"`    // 公开服务费率
+	ProductName         string                             `json:"product_name"`           // 商品名称
+	ProductMainPhotoUrl string                             `json:"product_main_photo_url"` // 商品主图Url
+	Symbol              int                                `json:"symbol"`                 // 图片标志位
+	ProductMainPhotoUid string                             `json:"product_main_photo_uid"` // 商品主图Uid
+	ProductType         int64                              `json:"product_type"`           // 商品类型,0一般,1快手
+	ProductCategory     string                             `json:"product_category"`       // 商品类目
+	ProductCreateAt     string                             `json:"product_create_at"`      // 商品入库时间
+	ProductPrice        float64                            `json:"product_price"`          // 商品售价
+	ProjectBriefInfo    []*gorm_model.YounggeeProjectBrief `json:"project_brief_info"`     // Brief
+	ProjectMaterial     []*gorm_model.ProjectMaterial      `json:"project_material"`       // 素材
+	Tools               string                             `json:"tools"`                  // 工具选择
+}
+
+type ShowNewRecruitStrategy struct {
+	RecruitStrategyID int64   `json:"recruit_strategy_id"` // ID
+	FeeForm           int64   `json:"fee_form"`            // 稿费形式,1-3分别代表自报价、固定稿费、产品置换
+	StrategyID        int64   `json:"strategy_id"`         // 策略id
+	FollowersLow      int64   `json:"followers_low"`       // 达人粉丝数下限
+	FollowersUp       int64   `json:"followers_up"`        // 达人粉丝数上限
+	RecruitNumber     int64   `json:"recruit_number"`      // 招募数量
+	Offer             float64 `json:"offer"`               // 报价
+	ServiceCharge     float64 `json:"service_charge"`      // 服务费
+}
+
+type ShowNewProjectRequest struct {
+	ProjectId string `json:"project_id"` // 服务商种草任务id
+}
+
+func NewShowNewProjectRequest() *ShowNewProjectRequest {
+	return new(ShowNewProjectRequest)
+}
+func NewShowNewProjectResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(ShowNewProjectData)
+	return resp
+}

+ 0 - 1
model/http_model/special_project_list.go

@@ -35,7 +35,6 @@ type SpecialProjectResponse struct {
 	ProductId          int64                 `json:"product_id"`           // 商品ID
 	ProductPrice       float64               `json:"product_price"`        // 商品售价
 	Tools              string                `json:"tools"`                // 工具选择,1邀约招募 2样品物流 3审稿工具 4作品审查 5数据巡检 6结算账单(,分隔)
-
 }
 
 func NewSpecialProjectListRequest() *SpecialProjectListRequest {

+ 62 - 0
model/http_model/supplier_amount_bill_list.go

@@ -0,0 +1,62 @@
+package http_model
+
+type SupplierAmountBillListRequest struct {
+	SupplierId int    `json:"supplier_id"` // 服务商ID
+	Status     int    `json:"status"`      // 账单状态
+	Condition  string `json:"condition"`   // 筛选条件
+	PageNum    int32  `json:"page_num"`
+	PageSize   int32  `json:"page_size"`
+}
+
+type SupplierAmountBillData struct {
+	SupplierAmountBillList []*SupplierAmountBillListData `json:"supplier_amount_bill_list"` // 任务账单信息
+	FullAmount             float64                       `json:"full_amount"`               // 总余额
+	Settle                 float64                       `json:"settle"`                    // 可提现
+	Total                  int64                         `json:"total"`                     // 数量
+}
+
+type SupplierAmountBillListData struct {
+	Type int `json:"type"` // 任务类型
+
+	// 种草
+	SProjectId         int     `json:"s_project_id"`         // 服务商加入商单后的种草任务ID
+	ProjectId          string  `json:"project_id"`           // 被服务商加入商单的原种草任务ID
+	ProjectPlatform    int64   `json:"project_platform"`     // 种草任务平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	ProductPhotoUrl    string  `json:"product_photo_url"`    // 商品主图URL
+	ProductPhotoSymbol int64   `json:"product_photo_symbol"` // 标志位
+	ProductPhotoUid    string  `json:"product_photo_uid"`    // uid
+	ProductName        string  `json:"product_name"`         // 商品名称
+	ProductId          int64   `json:"product_id"`           // 商品ID
+	ProductPrice       float64 `json:"product_price"`        // 商品售价
+
+	// 本地生活
+	SLocalId         int    `json:"s_local_id"`         // 服务商任务ID
+	LocalId          string `json:"local_id"`           // 任务ID
+	LocalPlatform    int    `json:"local_platform"`     // 任务平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	StorePhotoUrl    string `json:"store_photo_url"`    // 门店主图URL
+	StorePhotoSymbol int64  `json:"store_photo_symbol"` // 门店标志位
+	StorePhotoUid    string `json:"store_photo_uid"`    // 门店uid
+	StoreName        string `json:"store_name"`         // 门店名称
+	StoreId          int    `json:"store_id"`           // 门店ID
+
+	// 共有
+	EnterpriseId        string  `json:"enterprise_id"`         // 所属企业ID
+	SupplierId          int     `json:"supplier_id"`           // 所属服务商ID
+	SubAccountId        int     `json:"sub_account_id"`        // 所属子账号ID
+	OperatorType        int     `json:"column:operator_type"`  // 添加商单操作人类型,1为服务商主账号,2为服务商子账号
+	ServiceChargeActual float64 `json:"service_charge_actual"` // 服务商实际可赚服务费
+	ServiceChargeSettle float64 `json:"service_charge_settle"` // 已结算服务费
+	RecruitNum          int     `json:"column:recruit_num"`    // 合作人数
+	SettleNum           int     `json:"column:settle_num"`     // 已结算人数
+	CreateTime          string  `json:"create_time"`           // 加入商单时间
+}
+
+func SupplierAmountBillRequest() *SupplierAmountBillListRequest {
+	return new(SupplierAmountBillListRequest)
+}
+
+func SupplierAmountBillResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(SupplierAmountBillData)
+	return resp
+}

+ 6 - 6
pack/full_project.go

@@ -1,7 +1,6 @@
 package pack
 
 import (
-	"youngee_b_api/consts"
 	"youngee_b_api/model/gorm_model"
 	"youngee_b_api/model/http_model"
 
@@ -20,13 +19,14 @@ func GormFullProjectToHttpFullProjectPreview(gormProjectInfo *gorm_model.Project
 	updatedTime := conv.MustString(gormProjectInfo.UpdatedAt)
 	updatedTime = updatedTime[0:19]
 	return &http_model.FullProjectPreview{
+		EnterpriseId:       gormProjectInfo.EnterpriseID,
 		ProjectId:          gormProjectInfo.ProjectID,
 		ProjectName:        gormProjectInfo.ProjectName,
-		ProjectStatus:      consts.GetProjectStatus(gormProjectInfo.ProjectStatus),
-		ProjectPlatform:    consts.GetProjectPlatform(gormProjectInfo.ProjectPlatform),
-		ProjectForm:        consts.GetProjectForm(gormProjectInfo.ProjectForm),
-		ProjectContentType: consts.GetProjectContentType(gormProjectInfo.ContentType),
-		ProjectType:        consts.GetProjectType(gormProjectInfo.ProjectType),
+		ProjectStatus:      conv.MustString(gormProjectInfo.ProjectStatus),
+		ProjectPlatform:    conv.MustString(gormProjectInfo.ProjectPlatform),
+		ProjectForm:        conv.MustString(gormProjectInfo.ProjectForm),
+		ProjectContentType: conv.MustString(gormProjectInfo.ContentType),
+		ProjectType:        conv.MustString(gormProjectInfo.ProjectType),
 		ProjectUpdated:     updatedTime,
 		ProductId:          gormProjectInfo.ProductID,
 		EstimatedCost:      gormProjectInfo.EstimatedCost,

+ 5 - 0
route/init.go

@@ -197,6 +197,8 @@ func InitRoute(r *gin.Engine) {
 		l.POST("/sLocalLife/showSLocal", handler.WrapShowSLocalHandler)                  // 服务商本地生活任务详情
 		l.POST("/sLocalLife/taskList", handler.WrapLocalTaskListHandler)                 // 子任务列表
 		l.POST("/sLocalLife/changeTaskStatus", handler.WrapLocalChangeTaskStatusHandler) // 改变子任务的状态 报名通过,拒绝报名
+		l.POST("/sLocalLife/teamBuying/find", handler.WrapFindTeamBuyingHandler)         // 查找团购
+		l.POST("/sLocalLife/store/find", handler.WrapFindStoreHandler)                   // 查找门店
 
 		l.POST("/localLife/specialLocalList", handler.WrapSpecialLocalListHandler)           // 商单广场-定向本地生活任务列表
 		l.POST("/sLocalLife/specialAddToList", handler.WrapSpecialLocalAddToListHandler)     // 定向本地生活任务同意/拒绝加入商单
@@ -209,6 +211,9 @@ func InitRoute(r *gin.Engine) {
 	{
 		f.Use(middleware.LoginAuthMiddleware)
 
+		// 余额管理
+		f.POST("/supplierAmount/billList", handler.WrapSupplierAmountBillListHandler) // 账单列表
+
 		// 账单查询
 		f.POST("/fullSProject/billList", handler.WrapFullSProjectBillListHandler)         // 种草任务账单列表
 		f.POST("/fullSProject/taskBillList", handler.WrapFullSProjectTaskBillListHandler) // 种草子任务账单列表

+ 10 - 3
service/cooperate.go

@@ -39,9 +39,16 @@ func (*cooperate) GetEnterpriseInfoBySupplierId(ctx context.Context, request *ht
 			cooperateData.SOperatorType = c.SOperatorType
 			cooperateData.BOperator = c.BOperator
 			cooperateData.BOperatorType = c.BOperatorType
-			cooperateData.CreateTime = conv.MustString(c.CreateTime)
-			cooperateData.AgreeTime = conv.MustString(c.AgreeTime)
-			cooperateData.RejectTime = conv.MustString(c.RejectTime)
+			if cooperateData.CreateTime != "" {
+				cooperateData.CreateTime = conv.MustString(c.CreateTime, "")
+			}
+			if cooperateData.AgreeTime != "" {
+				cooperateData.AgreeTime = conv.MustString(c.AgreeTime, "")
+			}
+			if cooperateData.RejectTime != "" {
+				cooperateData.RejectTime = conv.MustString(c.RejectTime, "")
+			}
+
 			// 1.2. 商家信息
 			enterpriseInfo, enterpriseErr := db.GetEnterpriseByEnterpriseID(ctx, c.EnterpriseId)
 			if enterpriseErr != nil {

+ 87 - 0
service/local_life.go

@@ -299,3 +299,90 @@ func (*localLife) ShowLocalLife(ctx context.Context, req *http_model.ShowLocalRe
 
 	return localInfo, nil
 }
+
+// GetStoreInfo 门店信息查找
+func (*localLife) GetStoreInfo(ctx context.Context, req *http_model.FindStoreRequest) (*http_model.FindStoreData, error) {
+	var storeData *http_model.FindStoreData
+	storeData = &http_model.FindStoreData{}
+
+	// 1.1. 门店信息
+	storeInfo, storeErr := db.FindStoreById(ctx, req.StoreID)
+	if storeErr != nil {
+		return nil, storeErr
+	}
+	if storeInfo != nil {
+		storeData.StoreId = storeInfo.StoreId
+		storeData.StoreName = storeInfo.StoreName
+		storeData.StoreCategory = storeInfo.StoreCategory
+		storeData.StoreType = storeInfo.StoreType
+		storeData.StoreLocation = storeInfo.StoreLocation
+		storeData.StoreDetail = storeInfo.StoreDetail
+		storeData.StoreLink = storeInfo.StoreLink
+		storeData.TeamNum = storeInfo.TeamNum
+		storeData.BelongEnterpriseId = storeInfo.BelongEnterpriseId
+		storeData.IsDeleted = storeInfo.IsDeleted
+		storeData.OperateType = storeInfo.OperateType
+		storeData.EnterpriseId = storeInfo.EnterpriseId
+		storeData.SubAccountId = storeInfo.SubAccountId
+		var Photos *http_model.StorePhoto
+		Photos = &http_model.StorePhoto{}
+
+		// 1.2. 门店图片信息
+		storePhotoInfo, storePhotoErr := db.GetStorePhotoByStoreID(ctx, req.StoreID)
+		if storePhotoErr != nil {
+			return nil, storePhotoErr
+		}
+		if storePhotoInfo != nil {
+			for _, photo := range storePhotoInfo {
+				Photos.PhotoUrl = photo.PhotoUrl
+				Photos.PhotoUid = photo.PhotoUid
+				Photos.Symbol = photo.Symbol
+				storeData.StorePhotos = append(storeData.StorePhotos, Photos)
+			}
+		}
+	}
+	return storeData, nil
+}
+
+// GetTeamBuyingInfo 团购信息查找
+func (*localLife) GetTeamBuyingInfo(ctx context.Context, req *http_model.FindTeamBuyingRequest) (*http_model.FindTeamBuyingData, error) {
+	var teamBuyingData *http_model.FindTeamBuyingData
+	teamBuyingData = &http_model.FindTeamBuyingData{}
+
+	// 1.1. 门店信息
+	teamInfo, teamErr := db.FindTeamById(ctx, req.TeamBuyingId)
+	if teamErr != nil {
+		return nil, teamErr
+	}
+	if teamInfo != nil {
+		teamBuyingData.TeamBuyingId = teamInfo.TeamBuyingId
+		teamBuyingData.StoreId = teamInfo.StoreId
+		teamBuyingData.TeamBuyingCategory = teamInfo.TeamBuyingCategory
+		teamBuyingData.TeamBuyingName = teamInfo.TeamBuyingName
+		teamBuyingData.TeamBuyingPrice = teamInfo.TeamBuyingPrice
+		teamBuyingData.PublicCommission = teamInfo.PublicCommission
+		teamBuyingData.TeamBuyingDetail = teamInfo.TeamBuyingDetail
+		teamBuyingData.TeamBuyingLink = teamInfo.TeamBuyingLink
+		teamBuyingData.IsDeleted = teamInfo.IsDeleted
+		teamBuyingData.OperateType = teamInfo.OperateType
+		teamBuyingData.EnterpriseId = teamInfo.EnterpriseId
+		teamBuyingData.SubAccountId = teamInfo.SubAccountId
+		var Photos *http_model.TeamBuyingPhoto
+		Photos = &http_model.TeamBuyingPhoto{}
+
+		// 2.4. 团购图片信息
+		teamPhotoInfo, teamPhotoErr := db.GetTeamPhotoByStoreID(ctx, req.TeamBuyingId)
+		if teamPhotoErr != nil {
+			return nil, teamPhotoErr
+		}
+		if teamPhotoInfo != nil {
+			for _, photo := range teamPhotoInfo {
+				Photos.PhotoUrl = photo.PhotoUrl
+				Photos.PhotoUid = photo.PhotoUid
+				Photos.Symbol = photo.Symbol
+				teamBuyingData.TeamBuyingPhotos = append(teamBuyingData.TeamBuyingPhotos, Photos)
+			}
+		}
+	}
+	return teamBuyingData, nil
+}

+ 129 - 1
service/project.go

@@ -373,7 +373,7 @@ func (*project) GetFullProjectList(ctx context.Context, pageSize, pageNum int32,
 	}
 	fullProjectListData := new(http_model.FullProjectListData)
 	fullProjectListData.FullProjectPreview = pack.MGormFullProjectToHttpFullProjectPreview(fullProjects)
-	fullProjectListData.Total = conv.MustString(total)
+	fullProjectListData.Total = total
 
 	// 2. 查询种草任务补充信息:商品信息,招募策略
 	for _, project := range fullProjectListData.FullProjectPreview {
@@ -749,3 +749,131 @@ func (p *project) GetProjectStrategys(ctx *gin.Context, projectId string) ([]gor
 	}
 	return recruitStrategys, nil
 }
+
+// GetProjectDetail 查找种草任务详情
+func (*project) GetProjectDetail(ctx context.Context, ProjectId string) (*http_model.ShowNewProjectData, error) {
+	var sProjectData *http_model.ShowNewProjectData
+	sProjectData = &http_model.ShowNewProjectData{}
+
+	// 1. 取出种草表中的信息
+	projectInfo, projectErr := db.GetProjectDetail(ctx, ProjectId)
+	if projectErr != nil {
+		return nil, projectErr
+	}
+	if projectInfo != nil {
+		sProjectData.ProjectName = projectInfo.ProjectName
+		sProjectData.ProjectID = projectInfo.ProjectID
+		sProjectData.ProjectType = projectInfo.ProjectType
+		sProjectData.ProjectPlatform = projectInfo.ProjectPlatform
+		sProjectData.ProjectForm = projectInfo.ProjectForm
+		sProjectData.ContentType = projectInfo.ContentType
+		sProjectData.EnterpriseID = projectInfo.EnterpriseID
+		sProjectData.TalentType = projectInfo.TalentType
+		sProjectData.RecruitDdl = conv.MustString(projectInfo.RecruitDdl)[0:19]
+		sProjectData.ProjectDetail = projectInfo.ProjectDetail
+		sProjectData.EstimatedCost = projectInfo.EstimatedCost
+		sProjectData.PassAt = conv.MustString(projectInfo.PassAt)[0:19]
+		sProjectData.Tools = projectInfo.Tools
+
+		// 3. 取出招募策略并聚合达人数量信息
+		recruitStrategy, recruitErr := db.GetRecruitStrategyByProjectId(ctx, ProjectId)
+		if recruitErr != nil {
+			return nil, recruitErr
+		}
+		if recruitStrategy != nil {
+			for _, strategy := range recruitStrategy {
+				showStrategy := http_model.ShowNewRecruitStrategy{
+					StrategyID:        strategy.StrategyID,
+					FeeForm:           strategy.FeeForm,
+					RecruitStrategyID: strategy.RecruitStrategyID,
+					FollowersLow:      strategy.FollowersLow,
+					FollowersUp:       strategy.FollowersUp,
+					RecruitNumber:     strategy.RecruitNumber,
+					ServiceCharge:     projectInfo.ServiceChargeRate,
+					Offer:             strategy.Offer,
+				}
+				sProjectData.SRecruitStrategys = append(sProjectData.SRecruitStrategys, showStrategy)
+			}
+		}
+
+		// 4. 取出种草任务创建者用户信息
+		if projectInfo.OperatorType == 1 {
+			// fmt.Println("商家用户")
+			enterpriseInfo, enterpriseErr := db.GetEnterpriseByEnterpriseID(ctx, projectInfo.EnterpriseID)
+			if enterpriseErr != nil {
+				return nil, enterpriseErr
+			}
+			sProjectData.CreatorName = enterpriseInfo.BusinessName
+			sProjectData.CreatorCompany = enterpriseInfo.BusinessName
+			sProjectData.CreatorType = 1
+			sProjectData.Phone = enterpriseInfo.BusinessName
+		} else if projectInfo.OperatorType == 2 {
+			// fmt.Println("商家子账号")
+			enterpriseInfo, enterpriseErr := db.GetEnterpriseByEnterpriseID(ctx, projectInfo.EnterpriseID)
+			if enterpriseErr != nil {
+				return nil, enterpriseErr
+			}
+			sProjectData.CreatorCompany = enterpriseInfo.BusinessName
+			subAccountInfo, SubAccountErr := db.FindSubAccountById(ctx, projectInfo.SubAccountId)
+			if SubAccountErr != nil {
+				return nil, SubAccountErr
+			}
+			sProjectData.Phone = subAccountInfo.PhoneNumber
+			jobInfo, jobErr := db.FindJobByJobId(ctx, subAccountInfo.JobId)
+			if jobErr != nil {
+				return nil, jobErr
+			}
+			sProjectData.CreatorType = 2
+			sProjectData.CreatorName = jobInfo.JobName
+		}
+
+		// 5. 商品信息
+		// 5.1. 取出商品信息并聚合
+		productInfo, productErr := db.GetProductByID(ctx, projectInfo.ProductID)
+		if productErr != nil {
+			return nil, productErr
+		}
+		if productInfo != nil {
+			sProjectData.ProductID = productInfo.ProductID
+			sProjectData.ProductName = productInfo.ProductName
+			sProjectData.ProductType = productInfo.ProductType
+			sProjectData.ProductPrice = productInfo.ProductPrice
+			sProjectData.ProductCategory = productInfo.ProductCategory
+		}
+		// 5.2. 聚合商品图片信息
+		productPhotoInfo, productPhotoErr := db.GetProductPhotoByProductID(ctx, projectInfo.ProductID)
+		if productPhotoErr != nil {
+			return nil, productPhotoErr
+		}
+		if productPhotoInfo != nil {
+			for _, p := range productPhotoInfo {
+				if p.Symbol == 1 {
+					sProjectData.ProductMainPhotoUrl = p.PhotoUrl
+					sProjectData.ProductMainPhotoUid = p.PhotoUid
+					sProjectData.Symbol = 1
+				}
+			}
+		}
+
+		// 6. 执行要求Brief和素材
+		// 6.1. Brief
+		projectBrief, briefErr := db.FindProjectBriefByProjectId(ctx, sProjectData.ProjectID)
+		if briefErr != nil {
+			return nil, briefErr
+		}
+		if projectBrief != nil {
+			sProjectData.ProjectBriefInfo = projectBrief
+		}
+
+		// 6.2. 素材
+		projectMaterial, materialErr := db.FindProjectMaterialByProjectId(ctx, sProjectData.ProjectID)
+		if materialErr != nil {
+			return nil, materialErr
+		}
+		if projectMaterial != nil {
+			sProjectData.ProjectMaterial = projectMaterial
+		}
+	}
+
+	return sProjectData, nil
+}

+ 3 - 4
service/s_project.go

@@ -152,8 +152,8 @@ func (*sProject) GetSProjectList(ctx context.Context, supplierId int, pageSize,
 	return SProjectList, nil
 }
 
-// GetSPorjectDetail 查找服务商种草任务详情
-func (*sProject) GetSPorjectDetail(ctx context.Context, sProjectId int) (*http_model.ShowSProjectData, error) {
+// GetSProjectDetail 查找服务商种草任务详情
+func (*sProject) GetSProjectDetail(ctx context.Context, sProjectId int) (*http_model.ShowSProjectData, error) {
 	var sProjectData *http_model.ShowSProjectData
 	sProjectData = &http_model.ShowSProjectData{}
 
@@ -537,7 +537,7 @@ func (*sProject) FullSProjectBillList(ctx context.Context, request *http_model.F
 			}
 			if productPhotoInfo != nil {
 				for _, photo := range productPhotoInfo {
-					fmt.Println(photo)
+					//fmt.Println(photo)
 					if photo.Symbol == 1 {
 						billData.ProductPhotoSymbol = 1
 						billData.ProductPhotoUrl = photo.PhotoUrl
@@ -548,7 +548,6 @@ func (*sProject) FullSProjectBillList(ctx context.Context, request *http_model.F
 			currSProjectBillData.SProjectList = append(currSProjectBillData.SProjectList, billData)
 		}
 	}
-
 	return currSProjectBillData, nil
 }
 

+ 4 - 0
service/supplier.go

@@ -645,3 +645,7 @@ func (*supplier) GetSupplierWithdrawList(ctx context.Context, req *http_model.Su
 	}
 	return supplierWithdrawListData, nil
 }
+
+func (*supplier) GetSupplierAmountBillList(ctx context.Context, req *http_model.SupplierAmountBillListRequest) (*http_model.SupplierAmountBillData, error) {
+	return nil, nil
+}