Explorar o código

账单支付&探店

Ethan hai 5 meses
pai
achega
972196f43d

+ 106 - 0
app/controller/bill_controller.go

@@ -0,0 +1,106 @@
+package controller
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/app/service"
+	"youngee_b_api/app/vo"
+)
+
+type BillController struct{}
+
+// 电商带货账单列表
+func (f BillController) SelectionBillList(c *gin.Context) {
+	param := &vo.BalanceParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	result, err := service.RechargeService{}.FrozenInfoList(param)
+	if err != nil {
+		logrus.Errorf("[FrozenInfoList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+	returnSuccess(c, 20000, result)
+}
+
+// 电商带货账单支付
+func (f BillController) SelectionPay(c *gin.Context) {
+	param := &vo.PayParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	err1 := service.BillService{}.PaySelection(param)
+	if err1 != nil {
+		if err1.Error() == "状态异常" {
+			returnError(c, 31000, err1.Error())
+			return
+		}
+		if err1.Error() == "可用余额不足" {
+			returnError(c, 32000, err1.Error())
+			return
+		}
+		logrus.Errorf("[SelectionPay] call Show err:%+v\n", err)
+		returnError(c, 40000, err1.Error())
+		return
+	}
+	returnSuccess(c, 20000, nil)
+}
+
+// 品牌种草账单支付
+func (f BillController) ProjectPay(c *gin.Context) {
+	param := &vo.PayParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	err1 := service.BillService{}.PayProject(param)
+	if err1 != nil {
+		if err1.Error() == "状态异常" {
+			returnError(c, 31000, err1.Error())
+			return
+		}
+		if err1.Error() == "可用余额不足" {
+			returnError(c, 32000, err1.Error())
+			return
+		}
+		logrus.Errorf("[ProjectPay] call Show err:%+v\n", err)
+		returnError(c, 40000, err1.Error())
+		return
+	}
+	returnSuccess(c, 20000, nil)
+}
+
+// 本地生活账单支付
+func (f BillController) LocalLifePay(c *gin.Context) {
+	param := &vo.PayParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	err1 := service.BillService{}.PayLocalLife(param)
+	if err1 != nil {
+		if err1.Error() == "状态异常" {
+			returnError(c, 31000, err1.Error())
+			return
+		}
+		if err1.Error() == "可用余额不足" {
+			returnError(c, 32000, err1.Error())
+			return
+		}
+		logrus.Errorf("[LocalLifePay] call Show err:%+v\n", err)
+		returnError(c, 40000, err1.Error())
+		return
+	}
+	returnSuccess(c, 20000, nil)
+}

+ 39 - 1
app/controller/task_controller.go

@@ -721,7 +721,7 @@ func (t TaskController) LogisticsTalentList(c *gin.Context) {
 	returnSuccess(c, 20000, res)
 }
 
-// 种草任务列表
+// 本地生活列表
 func (t TaskController) LocalLifeTaskList(c *gin.Context) {
 	param := &vo.LocalSearchParam{}
 	err := c.BindJSON(param)
@@ -760,6 +760,44 @@ func (t TaskController) LocalLifeDel(c *gin.Context) {
 	returnSuccess(c, 20000, resultMap)
 }
 
+// 探店本地生活列表
+func (t TaskController) StoreExploreList(c *gin.Context) {
+	param := &vo.LocalSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	res, err := service.LocalLifeService{}.GetStoreExploreList(param)
+	if err != nil {
+		logrus.Errorf("[StoreExploreList] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
+// 探店达人详情
+func (t TaskController) StoreExploreInfo(c *gin.Context) {
+	param := &vo.StoreExploreParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "参数错误")
+		return
+	}
+	res, err := service.LocalLifeService{}.GetStoreExploreInfo(param)
+	if err != nil {
+		logrus.Errorf("[StoreExploreInfo] call Show err:%+v\n", err)
+		returnError(c, 40000, err.Error())
+		return
+	}
+
+	returnSuccess(c, 20000, res)
+}
+
 // 电商带货看数据-达人数据
 func (t TaskController) TalentDataDetail(c *gin.Context) {
 	param := &vo.SelectionShowDataParam{}

+ 45 - 11
app/dao/enterprise_dao.go

@@ -1,21 +1,29 @@
 package dao
 
-import "youngee_b_api/app/entity"
+import (
+	"errors"
+	"gorm.io/gorm"
+	"youngee_b_api/app/entity"
+)
 
 type EnterpriseDao struct{}
 
 func (d EnterpriseDao) GetEnterpriseInfo(enterpriseId string) (*entity.Enterprise, error) {
 	var enterprise entity.Enterprise
-	err := Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).First(&enterprise).Error
+	err := Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Find(&enterprise).Error
 	if err != nil {
-		return nil, err
+		if errors.Is(err, gorm.ErrRecordNotFound) {
+			return nil, nil
+		} else {
+			return nil, err
+		}
 	}
 	return &enterprise, nil
 }
 
 func (d EnterpriseDao) GetEnterprise(enterpriseId string) (*entity.Enterprise, error) {
 	var enterprise entity.Enterprise
-	err := Db.Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Select("business_name, user_id").First(&enterprise).Error
+	err := Db.Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Select("business_name, user_id").Find(&enterprise).Error
 	if err != nil {
 		return nil, err
 	}
@@ -24,24 +32,50 @@ func (d EnterpriseDao) GetEnterprise(enterpriseId string) (*entity.Enterprise, e
 
 func (d EnterpriseDao) GetEnterprisePhone(enterpriseId string) (string, error) {
 	var phone string
-	err := Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Select("phone").First(&phone).Error
+	err := Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Select("phone").Find(&phone).Error
 	if err != nil {
 		return "", err
 	}
 	return phone, nil
 }
 
-// 更新账户余额
-func (d EnterpriseDao) UpdateEnterpriseBalance(enterpriseId string, balance float64) (*string, error) {
+// 充值-更新账户余额
+func (d EnterpriseDao) UpdateEnterpriseBalance(enterpriseId string, amount float64) (*string, error) {
 	var enterprise entity.Enterprise
 	var err error
-	err = Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).First(&enterprise).Error
+	err = Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Find(&enterprise).Error
+	if err != nil {
+		return nil, err
+	}
+	newBalance := enterprise.Balance + amount
+	newAvailableBalance := enterprise.AvailableBalance + amount
+	err = Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Updates(entity.Enterprise{
+		Balance:          newBalance,
+		AvailableBalance: newAvailableBalance}).Error
 	if err != nil {
 		return nil, err
 	}
-	enterprise.Balance += balance
-	enterprise.AvailableBalance += balance
-	err = Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Updates(enterprise).Error
+	return &enterpriseId, nil
+}
+
+// 支付-更新账户余额、冻结金额
+func (d EnterpriseDao) UpdateEnterpriseBalanceAndFrozen(enterpriseId string, amount float64) (*string, error) {
+	var enterprise entity.Enterprise
+	var err error
+	err = Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Find(&enterprise).Error
+	if err != nil {
+		return nil, err
+	}
+	if enterprise.AvailableBalance < amount {
+		return nil, errors.New("可用余额不足")
+	}
+	newBalance := enterprise.Balance - amount
+	newAvailableBalance := enterprise.AvailableBalance - amount
+	newFrozenBalance := enterprise.FrozenBalance + amount
+	err = Db.Debug().Model(&entity.Enterprise{}).Where("enterprise_id = ?", enterpriseId).Updates(entity.Enterprise{
+		Balance:          newBalance,
+		AvailableBalance: newAvailableBalance,
+		FrozenBalance:    newFrozenBalance}).Error
 	if err != nil {
 		return nil, err
 	}

+ 54 - 0
app/dao/local_life_dao.go

@@ -162,3 +162,57 @@ func (d LocalLifeDao) GetLocalLifeList(value int64, fieldName string) ([]*entity
 	}
 	return localLifeInfos, nil
 }
+
+// 探店本地生活列表
+func (d LocalLifeDao) GetLocalStoreExplorePreviews(param *vo.LocalSearchParam) ([]vo.ReLocalStoreExplorePreview, int64, error) {
+	var reLocalStoreExplorePreviews []vo.ReLocalStoreExplorePreview
+	var localLifes []entity.LocalLifeInfo
+	var total int64
+	query := Db.Model(&entity.LocalLifeInfo{})
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reLocalStoreExplorePreviews, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.LocalType != 0 {
+		query = query.Where("local_type = ?", param.LocalType)
+	}
+	if param.LocalPlatform != 0 {
+		query = query.Where("local_platform = ?", param.LocalPlatform)
+	}
+	if param.LocalId != "" {
+		query = query.Where("local_id = ?", param.LocalId)
+	}
+	if param.LocalName != "" {
+		query = query.Where("local_name LIKE ?", "%"+param.LocalName+"%")
+	}
+	query = query.Where("task_status = ? AND task_form = ?", 8, 1)
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, local_id, local_type, local_platform, need_reserve, need_confirm, need_explore, explored_num, store_id, team_buying_id")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("pay_at asc").Offset(offset).Limit(param.PageSize).Find(&localLifes).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, localLife := range localLifes {
+		reLocalStoreExplorePreview := vo.ReLocalStoreExplorePreview{
+			EnterpriseId:  localLife.EnterpriseID,
+			SubAccountId:  localLife.SubAccountID,
+			LocalId:       localLife.LocalID,
+			LocalPlatform: localLife.LocalPlatform,
+			LocalType:     localLife.LocalType,
+			NeedReserve:   localLife.NeedReserve,
+			NeedConfirm:   localLife.NeedConfirm,
+			NeedExplore:   localLife.NeedExplore,
+			ExploredNum:   localLife.ExploredNum,
+			StoreId:       localLife.StoreID,
+			TeamBuyingId:  localLife.TeamBuyingId,
+		}
+		reLocalStoreExplorePreviews = append(reLocalStoreExplorePreviews, reLocalStoreExplorePreview)
+	}
+
+	return reLocalStoreExplorePreviews, total, nil
+}

+ 146 - 0
app/dao/local_life_task_info_dao.go

@@ -0,0 +1,146 @@
+package dao
+
+import (
+	"youngee_b_api/app/entity"
+	"youngee_b_api/app/vo"
+)
+
+type LocalLifeTaskInfoDao struct{}
+
+// 获取指定违约类型的本地生活子任务数量
+func (d LocalLifeTaskInfoDao) CountByDefaultType(localId string, defaultType int64) int64 {
+	var total int64
+	Db.Model(&entity.LocalLifeInfo{}).Where("local_id = ? AND cur_default_type = ?", localId, defaultType).Count(&total)
+	return total
+}
+
+// 获取指定任务阶段的本地生活子任务数量
+func (d LocalLifeTaskInfoDao) CountByTaskStage(localId string, taskStage int64) int64 {
+	var total int64
+	Db.Model(&entity.LocalLifeInfo{}).Where("local_id = ? AND task_stage = ?", localId, taskStage).Count(&total)
+	return total
+}
+
+// 获取指定任务阶段的本地生活子任务
+func (d LocalLifeTaskInfoDao) GetListByTaskStage(localId string, bookStatus int64, time string, page int, pageSize int) ([]*entity.LocalLifeTaskInfo, int64, error) {
+	var taskInfos []*entity.LocalLifeTaskInfo
+	var total int64
+	query := Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", localId, bookStatus)
+	// 计算偏移量
+	offset := (page - 1) * pageSize
+	var err error
+	if bookStatus == 1 {
+		query.Count(&total)
+		err = query.Order("select_date asc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	} else if bookStatus == 2 {
+		if time != "" {
+			query = query.Where("DATE(reserve_time) = ?", time)
+		}
+		query.Count(&total)
+		err = query.Order("reserve_time desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	} else if bookStatus == 3 {
+		if time != "" {
+			query = query.Where("DATE(explore_time) = ?", time)
+		}
+		query.Count(&total)
+		err = query.Order("explore_time desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	} else if bookStatus == 4 {
+		if time != "" {
+			query = query.Where("DATE(finish_explore_time) = ?", time)
+		}
+		query.Count(&total)
+		err = query.Order("finish_explore_time desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+	}
+	if err != nil {
+		return nil, 0, err
+	}
+	return taskInfos, total, nil
+}
+
+// 获取未传初稿的本地生活子任务数据
+func (d LocalLifeTaskInfoDao) GetListBySketchDefault(param *vo.DefaultSearchParam) ([]entity.LocalLifeInfo, int64, error) {
+	projectTaskInfos := []entity.LocalLifeInfo{}
+	var total int64
+	query := Db.Model(&entity.LocalLifeInfo{}).Where("local_id = ? AND cur_default_type = ?", param.TaskId, 4)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, sketch_missing_time")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("sketch_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取未发作品的本地生活子任务数据
+func (d LocalLifeTaskInfoDao) GetListByLinkDefault(param *vo.DefaultSearchParam) ([]entity.LocalLifeInfo, int64, error) {
+	projectTaskInfos := []entity.LocalLifeInfo{}
+	var total int64
+	query := Db.Model(&entity.LocalLifeInfo{}).Where("local_id = ? AND cur_default_type = ?", param.TaskId, 6)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, link_missing_time")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("link_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取未传数据的本地生活子任务数据
+func (d LocalLifeTaskInfoDao) GetListByDataDefault(param *vo.DefaultSearchParam) ([]entity.LocalLifeInfo, int64, error) {
+	projectTaskInfos := []entity.LocalLifeInfo{}
+	var total int64
+	query := Db.Model(&entity.LocalLifeInfo{}).Where("local_id = ? AND cur_default_type = ?", param.TaskId, 8)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, data_missing_time")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("data_missing_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取终止合作的本地生活子任务数据
+func (d LocalLifeTaskInfoDao) GetListByTerminateDefault(param *vo.DefaultSearchParam) ([]entity.LocalLifeInfo, int64, error) {
+	projectTaskInfos := []entity.LocalLifeInfo{}
+	var total int64
+	query := Db.Debug().Model(&entity.LocalLifeInfo{}).Where("local_id = ? AND task_stage = ?", param.TaskId, 17)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, terminate_time, terminate_reason, terminate_operator_type, terminate_operator")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("terminate_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 获取已解约的本地生活子任务数据
+func (d LocalLifeTaskInfoDao) GetListByCancelDefault(param *vo.DefaultSearchParam) ([]entity.LocalLifeInfo, int64, error) {
+	projectTaskInfos := []entity.LocalLifeInfo{}
+	var total int64
+	query := Db.Debug().Model(&entity.LocalLifeInfo{}).Where("local_id = ? AND task_stage = ?", param.TaskId, 16)
+	query.Count(&total)
+	query = query.Select("task_id, talent_id, settle_amount, draft_fee, cancel_time, cancel_reason, cancel_operator_type, cancel_operator")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("cancel_time desc").Offset(offset).Limit(param.PageSize).Find(&projectTaskInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	return projectTaskInfos, total, nil
+}
+
+// 更新字段
+func (d LocalLifeTaskInfoDao) UpdateField(taskId string, updateData map[string]interface{}) error {
+	err := Db.Model(&entity.LocalLifeInfo{}).Where("task_id = ?", taskId).Updates(updateData).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// 批量更新字段
+func (d LocalLifeTaskInfoDao) UpdateFieldBatch(taskIds []string, updateData map[string]interface{}) error {
+	err := Db.Model(&entity.LocalLifeInfo{}).Where("task_id IN ?", taskIds).Updates(updateData).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 8 - 3
app/dao/project_task_info_dao.go

@@ -22,19 +22,24 @@ func (d ProjectTaskInfoDao) CountByTaskStage(projectId string, taskStage int64)
 }
 
 // 获取指定任务阶段的种草子任务
-func (d ProjectTaskInfoDao) GetListByTaskStage(projectId string, taskStage int64, time *string, page int, pageSize int) ([]*entity.ProjectTaskInfo, int64, error) {
+func (d ProjectTaskInfoDao) GetListByTaskStage(projectId string, taskStage int64, time string, page int, pageSize int) ([]*entity.ProjectTaskInfo, int64, error) {
 	var taskInfos []*entity.ProjectTaskInfo
 	var total int64
 	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", projectId, taskStage)
-	query.Count(&total)
 	// 计算偏移量
 	offset := (page - 1) * pageSize
 	var err error
 	if taskStage == 4 {
+		query.Count(&total)
 		err = query.Order("create_date desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
 	} else if taskStage == 5 {
-		err = query.Where("delivery_date >= ?", *time).Order("delivery_date desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
+		if time != "" {
+			query = query.Where("DATE(delivery_date) = ?", time)
+		}
+		query.Count(&total)
+		err = query.Order("delivery_date desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
 	} else if taskStage == 6 {
+		query.Count(&total)
 		err = query.Order("signed_time desc").Offset(offset).Limit(pageSize).Find(&taskInfos).Error
 	}
 	if err != nil {

+ 7 - 6
app/entity/free_strategy.go

@@ -4,14 +4,15 @@ type FreeStrategy struct {
 	FreeStrategyId    int64  `gorm:"column:free_strategy_id;primary_key;AUTO_INCREMENT"` // 免费领样策略id
 	StrategyId        int64  `gorm:"column:strategy_id"`                                 // 策略编号
 	SelectionId       string `gorm:"column:selection_id"`                                // 带货任务id
-	FansNum           int64  `gorm:"column:fans_num"`                                    // 粉丝数量
+	FollowersLow      int64  `gorm:"column:followers_low"`                               // 达人粉丝数下限
+	FollowersUp       int64  `gorm:"column:followers_up"`                                // 达人粉丝数上限
 	SaleNum           int64  `gorm:"column:sale_num"`                                    // 近30天橱窗销量
 	StrategyStatus    int64  `gorm:"column:strategy_status"`                             // 招募策略状态
-	EnrollNum         int    `gorm:"column:enroll_num"`                                  // 报名数量
-	ChooseNum         int    `gorm:"column:choose_num"`                                  // 已选数量
-	BeforeDeliveryNum int    `gorm:"column:before_delivery_num"`                         // 待发货数量
-	DeliveryNum       int    `gorm:"column:delivery_num"`                                // 已发货数量
-	AfterDeliveryNum  int    `gorm:"column:after_delivery_num"`                          // 已收货数量
+	EnrollNum         int64  `gorm:"column:enroll_num"`                                  // 报名数量
+	ChooseNum         int64  `gorm:"column:choose_num"`                                  // 已选数量
+	BeforeDeliveryNum int64  `gorm:"column:before_delivery_num"`                         // 待发货数量
+	DeliveryNum       int64  `gorm:"column:delivery_num"`                                // 已发货数量
+	AfterDeliveryNum  int64  `gorm:"column:after_delivery_num"`                          // 已收货数量
 }
 
 func (m *FreeStrategy) TableName() string {

+ 7 - 3
app/entity/local_life_info.go

@@ -44,9 +44,13 @@ type LocalLifeInfo struct {
 	SettlementAmount    float64   `gorm:"column:settlement_amount"`                         // 结算金额
 	TotalRecruitNum     int64     `gorm:"column:total_recruit_num"`                         // 此任务各策略招募人数总和
 	Tools               string    `gorm:"column:tools"`                                     // 工具选择,1邀约招募 2结算账单 3样品物流 4审稿工具 5作品审查 6数据巡检(,分隔)
-	NeedReview          int64     `gorm:"column:need_review"`                               // 待审稿
-	NeedQuality         int64     `gorm:"column:need_quality"`                              // 待质检
-	NeedCalculate       int64     `gorm:"column:need_calculate"`                            // 待结算
+	NeedReview          int64     `gorm:"column:need_review;default:0;NOT NULL"`            // 待审稿
+	NeedQuality         int64     `gorm:"column:need_quality;default:0;NOT NULL"`           // 待质检
+	NeedCalculate       int64     `gorm:"column:need_calculate;default:0;NOT NULL"`         // 待结算
+	NeedReserve         int64     `gorm:"column:need_reserve;default:0;NOT NULL"`           // 待预约
+	NeedConfirm         int64     `gorm:"column:need_confirm;default:0;NOT NULL"`           // 待确认
+	NeedExplore         int64     `gorm:"column:need_explore;NOT NULL"`                     // 待探店
+	ExploredNum         int64     `gorm:"column:explored_num;default:0;NOT NULL"`           // 已探店
 	InvoiceStatus       int64     `gorm:"column:invoice_status;default:0;NOT NULL"`         // 开票状态(1开票中 2已开票)
 }
 

+ 76 - 72
app/entity/local_life_task_info.go

@@ -4,78 +4,82 @@ package entity
 import "time"
 
 type LocalLifeTaskInfo struct {
-	TaskID                 string    `gorm:"column:task_id;primary_key"`                            // 任务id
-	LocalID                string    `gorm:"column:local_id;NOT NULL"`                              // 项目id
-	TalentID               string    `gorm:"column:talent_id;NOT NULL"`                             // 达人id
-	AccountID              int64     `gorm:"column:account_id;NOT NULL"`                            // 账号id
-	StrategyID             int64     `gorm:"column:strategy_id"`                                    // 报名选择的招募策略id
-	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap;NOT NULL"`             // 达人平台信息快照
-	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap;NOT NULL"`             // 达人个人信息快照
-	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap;NOT NULL"`                 // 收货地址快照
-	TaskReward             string    `gorm:"column:task_reward;NOT NULL"`                           // 达人报酬(3.0未用)
-	SettleAmount           string    `gorm:"column:settle_amount;NOT NULL"`                         // 达人实际所得(自动填充)(扣除违约扣款)
-	AllPayment             string    `gorm:"column:all_payment;NOT NULL"`                           // 企业支付(3.0未用)
-	RealPayment            string    `gorm:"column:real_payment;NOT NULL"`                          // 企业实际支付(加上服务商的服务费)(扣除违约扣款)
-	ServiceRate            int64     `gorm:"column:service_rate"`                                   // 服务费率,千分之
-	ServiceCharge          string    `gorm:"column:service_charge"`                                 // 服务费
-	RealServiceCharge      string    `gorm:"column:real_service_charge"`                            // 服务商实际所得服务费(扣除违约)
-	FeeForm                int64     `gorm:"column:fee_form"`                                       // 稿费形式,1,2,3分别代表产品置换、一口价、自报价
-	ErrBreakRate           int64     `gorm:"column:err_break_rate;default:0;NOT NULL"`              // 未上传类型违约扣款比例,百分之
-	ScriptBreakRate        int64     `gorm:"column:script_break_rate;default:0;NOT NULL"`           // 脚本上传超时违约扣款比例,百分之
-	SketchBreakRate        int64     `gorm:"column:sketch_break_rate;default:0;NOT NULL"`           // 初稿上传超时违约扣款比例,百分之
-	LinkBreakRate          int64     `gorm:"column:link_break_rate;default:0;NOT NULL"`             // 链接上传超时违约扣款比例,百分之
-	DataBreakRate          int64     `gorm:"column:data_break_rate;default:0;NOT NULL"`             // 数据上传超时违约扣款比例,百分之
-	TaskStage              int64     `gorm:"column:task_stage;NOT NULL"`                            // 任务阶段,1:已报名, 2:申请成功, 3:申请失败, 4:待预约探店, 5:预约确认中 6:  , 7:待传脚本, 8:脚本待审, 9:待传初稿, 10:初稿待审, 11:待传链接, 12:链接待审, 13:待传数据, 14:数据待审, 15:已结案, 16:解约, 17:终止合作(过渡态)
-	TaskStatus             int64     `gorm:"column:task_status;default:1;NOT NULL"`                 // 商家任务状态 1待选 2已选 3落选
-	LogisticsStatus        int64     `gorm:"column:logistics_status;default:1"`                     // 发货状态 1 待发货 2已发货 3 已签收
-	BookStatus             uint      `gorm:"column:book_status;default:1"`                          // 预约探店状态 1-5分别代表待预约、已预约、待修改、已修改、已通过
-	SketchStatus           uint      `gorm:"column:sketch_status;default:1"`                        // 初稿上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	LinkStatus             uint      `gorm:"column:link_status;default:1"`                          // 链接上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	DataStatus             uint      `gorm:"column:data_status;default:1"`                          // 数据上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	CompleteStatus         int64     `gorm:"column:complete_status;default:1"`                      // 结束方式 1未结束 2正常结束 3反选失败 4被解约
-	UpdateAt               time.Time `gorm:"column:update_at"`                                      // 更新时间
-	CreateDate             time.Time `gorm:"column:create_date;default:CURRENT_TIMESTAMP;NOT NULL"` // 创建时间,即报名时间
-	SelectDate             time.Time `gorm:"column:select_date"`                                    // 反选时间,即任务开始执行时间
-	DeliveryDate           time.Time `gorm:"column:delivery_date"`                                  // 发货时间
-	CompleteDate           time.Time `gorm:"column:complete_date"`                                  // 结束时间
-	WithdrawDate           time.Time `gorm:"column:withdraw_date"`                                  // 提现时间
-	CurDefaultType         int64     `gorm:"column:cur_default_type"`                               // 当前违约类型 0未违约 1脚本超时违约 2脚本未上传违约 3初稿超时违约 4初稿未上传违约 5链接超时违约 6链接未上传违约 7数据超时违约 8数据未上传违约 9解约待处理 10解约
-	WithdrawStatus         int64     `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字段
-	SettleStatus           int64     `gorm:"column:settle_status;default:1"`                        // 结算状态,1、2分别表示待结算、已结算
-	TeamIncome             string    `gorm:"column:team_income"`                                    // young之团团长现金收益
-	TeamPoint              int64     `gorm:"column:team_point"`                                     // young之团团长积分收益
-	CurBreakAt             time.Time `gorm:"column:cur_break_at"`                                   // 当前阶段截止时间
-	SupplierID             int64     `gorm:"column:supplier_id;default:0"`                          // 服务商ID
-	SupplierStatus         int64     `gorm:"column:supplier_status;default:0"`                      // 服务商任务状态 0表示达人来源非服务商 1待选 2已选 3落选
-	DraftFee               string    `gorm:"column:draft_fee;default:0.00"`                         // 达人稿费,达人所见的稿费金额
-	SignedTime             time.Time `gorm:"column:signed_time"`                                    // 签收时间
-	FansNum                int64     `gorm:"column:fans_num"`                                       // 粉丝数
-	VoteAvg                int64     `gorm:"column:vote_avg"`                                       // 平均点赞数
-	CommitAvg              int64     `gorm:"column:commit_avg"`                                     // 平均评论数
-	BOperator              string    `gorm:"column:b_operator"`                                     // 商家确定达人操作人ID
-	BOperatorType          int64     `gorm:"column:b_operator_type;default:0"`                      // 商家操作人类型,1商家用户,2商家子账号,3管理后台
-	SOperator              int64     `gorm:"column:s_operator;default:0"`                           // 服务商提报达人操作人ID
-	SOperatorType          int64     `gorm:"column:s_operator_type;default:0"`                      // 服务商操作人类型,1服务商主账号,2服务商子账号,3管理后台
-	OpenID                 string    `gorm:"column:open_id"`                                        // 达人报名的快手唯一标识
-	SProjectID             int64     `gorm:"column:s_project_id"`                                   // 服务商种草任务ID
-	SupportFee             string    `gorm:"column:support_fee"`                                    // 提报价格(达人自报价经过计算后,)
-	SketchMissingTime      time.Time `gorm:"column:sketch_missing_time"`                            // 未传初稿违约时间
-	SketchMissingStatus    int64     `gorm:"column:sketch_missing_status;default:0"`                // 未传初稿违约状态,0无违约,1有违约
-	LinkMissingTime        time.Time `gorm:"column:link_missing_time"`                              // 未发作品违约时间
-	LinkMissingStatus      int64     `gorm:"column:link_missing_status;default:0"`                  // 未发作品违约状态,0无违约,1有违约
-	DataMissingTime        time.Time `gorm:"column:data_missing_time"`                              // 未传数据违约时间
-	DataMissingStatus      int64     `gorm:"column:data_missing_status;default:0"`                  // 未传数据违约状态,0无违约,1有违约
-	TerminateOperatorType  int64     `gorm:"column:terminate_operator_type"`                        // 终止合作操作人类型,1商家用户,2商家子账号,3管理后台
-	TerminateOperator      string    `gorm:"column:terminate_operator"`                             // 终止合作操作人ID
-	TerminateReason        string    `gorm:"column:terminate_reason"`                               // 终止理由
-	TerminateTime          time.Time `gorm:"column:terminate_time"`                                 // 终止合作时间
-	CancelOperatorType     int64     `gorm:"column:cancel_operator_type"`                           // 解约操作人类型,1商家用户,2商家子账号,3管理后台
-	CancelOperator         string    `gorm:"column:cancel_operator"`                                // 解约操作人ID
-	CancelReason           string    `gorm:"column:cancel_reason"`                                  // 解约原因
-	CancelTime             time.Time `gorm:"column:cancel_time"`                                    // 解约时间
-	PlatformID             int64     `gorm:"column:platform_id;NOT NULL"`                           // 平台id
+	TaskID                 string    `gorm:"column:task_id;primary_key"`                  // 任务id
+	LocalID                string    `gorm:"column:local_id;NOT NULL"`                    // 项目id
+	TalentID               string    `gorm:"column:talent_id;NOT NULL"`                   // 达人id
+	AccountID              int64     `gorm:"column:account_id;NOT NULL"`                  // 账号id
+	StrategyID             int64     `gorm:"column:strategy_id"`                          // 报名选择的招募策略id
+	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap;NOT NULL"`   // 达人平台信息快照
+	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap;NOT NULL"`   // 达人个人信息快照
+	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap;NOT NULL"`       // 收货地址快照
+	TaskReward             string    `gorm:"column:task_reward;NOT NULL"`                 // 达人报酬(3.0未用)
+	SettleAmount           string    `gorm:"column:settle_amount;NOT NULL"`               // 达人实际所得(自动填充)(扣除违约扣款)
+	AllPayment             string    `gorm:"column:all_payment;NOT NULL"`                 // 企业支付(3.0未用)
+	RealPayment            string    `gorm:"column:real_payment;NOT NULL"`                // 企业实际支付(加上服务商的服务费)(扣除违约扣款)
+	ServiceRate            int64     `gorm:"column:service_rate"`                         // 服务费率,千分之
+	ServiceCharge          string    `gorm:"column:service_charge"`                       // 服务费
+	RealServiceCharge      string    `gorm:"column:real_service_charge"`                  // 服务商实际所得服务费(扣除违约)
+	FeeForm                int64     `gorm:"column:fee_form"`                             // 稿费形式,1,2,3分别代表产品置换、一口价、自报价
+	ErrBreakRate           int64     `gorm:"column:err_break_rate;default:0;NOT NULL"`    // 未上传类型违约扣款比例,百分之
+	ScriptBreakRate        int64     `gorm:"column:script_break_rate;default:0;NOT NULL"` // 脚本上传超时违约扣款比例,百分之
+	SketchBreakRate        int64     `gorm:"column:sketch_break_rate;default:0;NOT NULL"` // 初稿上传超时违约扣款比例,百分之
+	LinkBreakRate          int64     `gorm:"column:link_break_rate;default:0;NOT NULL"`   // 链接上传超时违约扣款比例,百分之
+	DataBreakRate          int64     `gorm:"column:data_break_rate;default:0;NOT NULL"`   // 数据上传超时违约扣款比例,百分之
+	TaskStage              int64     `gorm:"column:task_stage;NOT NULL"`                  // 任务阶段,1:已报名, 2:申请成功, 3:申请失败, 4:待预约探店, 5:预约确认中 6:  , 7:待传脚本, 8:脚本待审, 9:待传初稿, 10:初稿待审, 11:待传链接, 12:链接待审, 13:待传数据, 14:数据待审, 15:已结案, 16:解约, 17:终止合作(过渡态)
+	TaskStatus             int64     `gorm:"column:task_status;default:1;NOT NULL"`       // 商家任务状态 1待选 2已选 3落选
+	LogisticsStatus        int64     `gorm:"column:logistics_status;default:1"`           // 发货状态 1 待发货 2已发货 3 已签收
+	BookStatus             uint      `gorm:"column:book_status;default:1"`                // 预约探店状态 1-5分别代表待预约、已预约、待修改、已修改、已通过
+	SketchStatus           uint      `gorm:"column:sketch_status;default:1"`              // 初稿上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	LinkStatus             uint      `gorm:"column:link_status;default:1"`                // 链接上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	DataStatus             uint      `gorm:"column:data_status;default:1"`                // 数据上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	CompleteStatus         int64     `gorm:"column:complete_status;default:1"`            // 结束方式 1未结束 2正常结束 3反选失败 4被解约
+	UpdateAt               time.Time `gorm:"column:update_at"`                            // 更新时间
+	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"`                        // 提现时间
+	CurDefaultType         int64     `gorm:"column:cur_default_type"`                     // 当前违约类型 0未违约 1脚本超时违约 2脚本未上传违约 3初稿超时违约 4初稿未上传违约 5链接超时违约 6链接未上传违约 7数据超时违约 8数据未上传违约 9解约待处理 10解约
+	WithdrawStatus         int64     `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字段
+	SettleStatus           int64     `gorm:"column:settle_status;default:1"`              // 结算状态,1、2分别表示待结算、已结算
+	TeamIncome             string    `gorm:"column:team_income"`                          // young之团团长现金收益
+	TeamPoint              int64     `gorm:"column:team_point"`                           // young之团团长积分收益
+	CurBreakAt             time.Time `gorm:"column:cur_break_at"`                         // 当前阶段截止时间
+	SupplierID             int64     `gorm:"column:supplier_id;default:0"`                // 服务商ID
+	SupplierStatus         int64     `gorm:"column:supplier_status;default:0"`            // 服务商任务状态 0表示达人来源非服务商 1待选 2已选 3落选
+	DraftFee               string    `gorm:"column:draft_fee;default:0.00"`               // 达人稿费,达人所见的稿费金额
+	SignedTime             time.Time `gorm:"column:signed_time"`                          // 签收时间
+	FansNum                int64     `gorm:"column:fans_num"`                             // 粉丝数
+	VoteAvg                int64     `gorm:"column:vote_avg"`                             // 平均点赞数
+	CommitAvg              int64     `gorm:"column:commit_avg"`                           // 平均评论数
+	BOperator              string    `gorm:"column:b_operator"`                           // 商家确定达人操作人ID
+	BOperatorType          int64     `gorm:"column:b_operator_type;default:0"`            // 商家操作人类型,1商家用户,2商家子账号,3管理后台
+	SOperator              int64     `gorm:"column:s_operator;default:0"`                 // 服务商提报达人操作人ID
+	SOperatorType          int64     `gorm:"column:s_operator_type;default:0"`            // 服务商操作人类型,1服务商主账号,2服务商子账号,3管理后台
+	OpenID                 string    `gorm:"column:open_id"`                              // 达人报名的快手唯一标识
+	SProjectID             int64     `gorm:"column:s_project_id"`                         // 服务商种草任务ID
+	SupportFee             string    `gorm:"column:support_fee"`                          // 提报价格(达人自报价经过计算后,)
+	SketchMissingTime      time.Time `gorm:"column:sketch_missing_time"`                  // 未传初稿违约时间
+	SketchMissingStatus    int64     `gorm:"column:sketch_missing_status;default:0"`      // 未传初稿违约状态,0无违约,1有违约
+	LinkMissingTime        time.Time `gorm:"column:link_missing_time"`                    // 未发作品违约时间
+	LinkMissingStatus      int64     `gorm:"column:link_missing_status;default:0"`        // 未发作品违约状态,0无违约,1有违约
+	DataMissingTime        time.Time `gorm:"column:data_missing_time"`                    // 未传数据违约时间
+	DataMissingStatus      int64     `gorm:"column:data_missing_status;default:0"`        // 未传数据违约状态,0无违约,1有违约
+	TerminateOperatorType  int64     `gorm:"column:terminate_operator_type"`              // 终止合作操作人类型,1商家用户,2商家子账号,3管理后台
+	TerminateOperator      string    `gorm:"column:terminate_operator"`                   // 终止合作操作人ID
+	TerminateReason        string    `gorm:"column:terminate_reason"`                     // 终止理由
+	TerminateTime          time.Time `gorm:"column:terminate_time"`                       // 终止合作时间
+	CancelOperatorType     int64     `gorm:"column:cancel_operator_type"`                 // 解约操作人类型,1商家用户,2商家子账号,3管理后台
+	CancelOperator         string    `gorm:"column:cancel_operator"`                      // 解约操作人ID
+	CancelReason           string    `gorm:"column:cancel_reason"`                        // 解约原因
+	CancelTime             time.Time `gorm:"column:cancel_time"`                          // 解约时间
+	PlatformID             int64     `gorm:"column:platform_id;NOT NULL"`                 // 平台id
+	City                   string    `gorm:"column:city"`                                 // 所在城市
+	ReserveTime            time.Time `gorm:"column:reserve_time"`                         // 预约探店时间
+	ExploreTime            time.Time `gorm:"column:explore_time"`                         // 探店时间
+	FinishExploreTime      time.Time `gorm:"column:finish_explore_time"`                  // 完成探店时间
 }
 
 func (m *LocalLifeTaskInfo) TableName() string {

+ 79 - 0
app/service/bill_service.go

@@ -0,0 +1,79 @@
+package service
+
+import (
+	"errors"
+	"youngee_b_api/app/dao"
+	"youngee_b_api/app/entity"
+	"youngee_b_api/app/vo"
+)
+
+type BillService struct{}
+
+// 电商带货账单支付
+func (p BillService) PaySelection(param *vo.PayParam) error {
+	selectionId := param.ObjectId
+	selectionInfo, err1 := dao.SelectionInfoDAO{}.GetSelectionInfoById(selectionId)
+	if err1 != nil {
+		return err1
+	}
+	selectionStatus := selectionInfo.SelectionStatus
+	if selectionStatus != 4 {
+		return errors.New("状态异常")
+	}
+	_, err2 := dao.EnterpriseDao{}.UpdateEnterpriseBalanceAndFrozen(selectionInfo.EnterpriseID, selectionInfo.EstimatedCost)
+	if err2 != nil {
+		return err2
+	}
+	err3 := dao.SelectionInfoDAO{}.UpdateSelectionInfo(entity.SelectionInfo{SelectionID: selectionId, SelectionStatus: 6})
+	if err3 != nil {
+		return err3
+	}
+
+	return nil
+}
+
+// 品牌种草账单支付
+func (p BillService) PayProject(param *vo.PayParam) error {
+	projectId := param.ObjectId
+	projectInfo, err1 := dao.ProjectDAO{}.GetProjectById(projectId)
+	if err1 != nil {
+		return err1
+	}
+	projectStatus := projectInfo.ProjectStatus
+	if projectStatus != 6 {
+		return errors.New("状态异常")
+	}
+	_, err2 := dao.EnterpriseDao{}.UpdateEnterpriseBalanceAndFrozen(projectInfo.EnterpriseID, projectInfo.PaymentAmount)
+	if err2 != nil {
+		return err2
+	}
+	err3 := dao.ProjectDAO{}.UpdateProject(entity.Project{ProjectId: projectId, ProjectStatus: 8})
+	if err3 != nil {
+		return err3
+	}
+
+	return nil
+}
+
+// 本地生活账单支付
+func (p BillService) PayLocalLife(param *vo.PayParam) error {
+	localId := param.ObjectId
+	localInfo, err1 := dao.LocalLifeDao{}.GetLocalById(localId)
+	if err1 != nil {
+		return err1
+	}
+	localStatus := localInfo.TaskStatus
+	if localStatus != 6 {
+		return errors.New("状态异常")
+	}
+	_, err2 := dao.EnterpriseDao{}.UpdateEnterpriseBalanceAndFrozen(localInfo.EnterpriseID, localInfo.PaymentAmount)
+	if err2 != nil {
+		return err2
+	}
+	err3 := dao.LocalLifeDao{}.UpdateLocal(entity.LocalLifeInfo{LocalID: localId, TaskStatus: 8})
+	if err3 != nil {
+		return err3
+	}
+
+	return nil
+}

+ 124 - 1
app/service/local_life_service.go

@@ -677,7 +677,7 @@ func (s LocalLifeService) LocalLifeToReview(localUpdateParam *vo.LocalUpdatePara
 	return &localId, nil
 }
 
-// 种草任务列表
+// 本地生活任务列表
 func (s LocalLifeService) GetLocalLifeTaskList(param *vo.LocalSearchParam) (vo.ResultVO, error) {
 	if param.Page == 0 {
 		param.Page = 1
@@ -735,3 +735,126 @@ func (s LocalLifeService) DeleteLocalLife(localId string) (*string, error) {
 	}
 	return res, nil
 }
+
+// 探店本地生活列表
+func (s LocalLifeService) GetStoreExploreList(param *vo.LocalSearchParam) (vo.ResultVO, error) {
+	if param.Page == 0 {
+		param.Page = 1
+	}
+	if param.PageSize == 0 {
+		param.PageSize = 10
+	}
+	var result vo.ResultVO
+	reLocalStoreExplorePreviews, total, err := (&dao.LocalLifeDao{}).GetLocalStoreExplorePreviews(param)
+	if err != nil {
+		return result, err
+	}
+	for i := range reLocalStoreExplorePreviews {
+		var creatorName string
+		var storeName string
+		var storeLocation string
+		var mainImage string
+		if reLocalStoreExplorePreviews[i].SubAccountId == 0 {
+			enterprise, err := dao.EnterpriseDao{}.GetEnterprise(reLocalStoreExplorePreviews[i].EnterpriseId)
+			if err == nil && enterprise != nil {
+				creatorName = enterprise.BusinessName
+			}
+		} else {
+			subAccount, err := dao.SubAccountDao{}.GetSubAccount(reLocalStoreExplorePreviews[i].SubAccountId)
+			if err == nil && subAccount != nil {
+				creatorName = subAccount.SubAccountName
+			}
+		}
+		store, err := dao.StoreDao{}.GetStoreByID(reLocalStoreExplorePreviews[i].StoreId)
+		if err == nil && store != nil {
+			storeName = store.StoreName
+			storeLocation = store.StoreLocation
+		}
+		mainImage, err = dao.ProductPhotoDAO{}.GetMainPhotoByStoreID(reLocalStoreExplorePreviews[i].StoreId)
+		reLocalStoreExplorePreviews[i].CreatorName = creatorName
+		reLocalStoreExplorePreviews[i].StoreName = storeName
+		reLocalStoreExplorePreviews[i].StoreLocation = storeLocation
+		reLocalStoreExplorePreviews[i].MainImage = mainImage
+	}
+	result = vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    total,
+		Data:     reLocalStoreExplorePreviews,
+	}
+	return result, nil
+}
+
+// 探店达人详情
+func (s LocalLifeService) GetStoreExploreInfo(param *vo.StoreExploreParam) (*vo.ResultVO, error) {
+	if param.Page <= 0 {
+		param.Page = 1
+	}
+	if param.PageSize <= 0 {
+		param.PageSize = 10
+	}
+	var reStoreExploreTalents []*vo.ReStoreExploreTalent
+	var total int64
+	result := vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    total,
+		Data:     reStoreExploreTalents,
+	}
+	var localLifeTaskInfos []*entity.LocalLifeTaskInfo
+	var err error
+	localLifeId := param.LocalLifeId
+	if param.Status == 1 { // 待预约
+		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByTaskStage(localLifeId, 1, "", param.Page, param.PageSize)
+	} else if param.Status == 2 { // 待确认
+		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByTaskStage(localLifeId, 2, param.SearchTime, param.Page, param.PageSize)
+	} else if param.Status == 3 { // 待探店
+		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByTaskStage(localLifeId, 5, param.SearchTime, param.Page, param.PageSize)
+	} else if param.Status == 4 { // 已探店
+		localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByTaskStage(localLifeId, 6, param.SearchTime, param.Page, param.PageSize)
+	}
+	if err != nil {
+		return nil, err
+	}
+	for _, localLifeTaskInfo := range localLifeTaskInfos {
+		// 获取达人信息
+		talentInfo, err := dao.TalentInfoDao{}.SelectTalentInfo(localLifeTaskInfo.TalentID)
+		if err != nil {
+			return nil, err
+		}
+		//regionName, err := dao.RegionInfoDao{}.SelectRegion(talentInfo.VisitStoreRegion)
+		//if err != nil {
+		//	regionName = ""
+		//}
+		regionName := localLifeTaskInfo.City
+		talentPreview := &vo.TalentPreview{
+			TalentId:    localLifeTaskInfo.TalentID,
+			TalentPhoto: talentInfo.Avatar,
+			TalentName:  talentInfo.TalentWxNickname,
+			Account:     "",
+			Location:    regionName,
+		}
+		reStoreExploreTalent := &vo.ReStoreExploreTalent{
+			ReTalentPreview: talentPreview,
+		}
+		if param.Status == 1 {
+			reStoreExploreTalent.CooperateTime = localLifeTaskInfo.SelectDate.Format("2006-01-02 15:04:05")
+		} else if param.Status == 2 {
+			reStoreExploreTalent.ReserveTime = localLifeTaskInfo.ReserveTime.Format("2006-01-02 15:04:05")
+		} else if param.Status == 3 {
+			reStoreExploreTalent.ExploreTime = localLifeTaskInfo.ExploreTime.Format("2006-01-02 15:04:05")
+			reStoreExploreTalent.Operator = ""
+		} else if param.Status == 4 {
+			reStoreExploreTalent.FinishExploreTime = localLifeTaskInfo.FinishExploreTime.Format("2006-01-02 15:04:05")
+			reStoreExploreTalent.Operator = ""
+		}
+		reStoreExploreTalents = append(reStoreExploreTalents, reStoreExploreTalent)
+	}
+	result = vo.ResultVO{
+		Page:     param.Page,
+		PageSize: param.PageSize,
+		Total:    total,
+		Data:     reStoreExploreTalents,
+	}
+	return &result, nil
+}

+ 4 - 2
app/service/selection_info_service.go

@@ -251,7 +251,8 @@ func (s SelectionInfoService) UpdateSelectionInfo(selectionUpdateParam *vo.Selec
 				free := entity.FreeStrategy{
 					SelectionId:    selectionInfo.SelectionID,
 					StrategyId:     v.StrategyId,
-					FansNum:        v.FansNum,
+					FollowersLow:   v.FollowersLow,
+					FollowersUp:    v.FollowersUp,
 					SaleNum:        v.SaleNum,
 					StrategyStatus: 1,
 					EnrollNum:      0,
@@ -360,7 +361,8 @@ func (s SelectionInfoService) GetSelectionDetail(selectionId string) (*vo.ReSele
 	for _, freeStrategy := range freeStrategys {
 		freeStrategyPreview := &vo.FreeStrategyPreview{
 			StrategyId:     freeStrategy.StrategyId,
-			FansNum:        freeStrategy.FansNum,
+			FollowersLow:   freeStrategy.FollowersLow,
+			FollowersUp:    freeStrategy.FollowersUp,
 			SaleNum:        freeStrategy.SaleNum,
 			StrategyStatus: freeStrategy.StrategyStatus,
 		}

+ 3 - 3
app/service/task_info_service.go

@@ -27,11 +27,11 @@ func (t TaskInfoService) LogisticsTalentList(param *vo.LogisticsTalentParam) (*v
 	var err error
 	projectId := param.ProjectId
 	if param.Status == 1 { // 待发货
-		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTaskStage(projectId, 4, nil, param.Page, param.PageSize)
+		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTaskStage(projectId, 4, "", param.Page, param.PageSize)
 	} else if param.Status == 2 { // 待签收
-		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTaskStage(projectId, 5, &param.DeliveryTime, param.Page, param.PageSize)
+		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTaskStage(projectId, 5, param.DeliveryTime, param.Page, param.PageSize)
 	} else if param.Status == 3 { // 已签收
-		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTaskStage(projectId, 6, nil, param.Page, param.PageSize)
+		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTaskStage(projectId, 6, "", param.Page, param.PageSize)
 	}
 	if err != nil {
 		return nil, err

+ 10 - 0
app/vo/bill_search_param.go

@@ -0,0 +1,10 @@
+package vo
+
+type BillSelectionSearchParam struct {
+	EnterpriseId string `json:"enterprise_id"` // 企业id
+	SubAccountId int64  `json:"sub_account_id"`
+	Platform     int64  `json:"platform"`    // 0全部 1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	BillStatus   string `json:"bill_status"` // 项目状态,0全部 1待支付-4 2执行中-6 3已结案-8
+	Page         int    `json:"page"`
+	PageSize     int    `json:"page_size"`
+}

+ 5 - 0
app/vo/pay_param.go

@@ -0,0 +1,5 @@
+package vo
+
+type PayParam struct {
+	ObjectId string `json:"object_id"` // 公开电商带货/种草/本地生活id
+}

+ 17 - 0
app/vo/re_bill_selection_info.go

@@ -0,0 +1,17 @@
+package vo
+
+type ReBillSelectionInfo struct {
+	ProductId    int64   `json:"productId"`
+	MainImage    string  `json:"mainImage"`
+	ProductName  string  `json:"productName"`
+	ProductPrice float64 `json:"productPrice"`
+
+	SelectionId       string  `json:"selectionId"`
+	SelectionPlatform int64   `json:"selectionPlatform"`
+	BillStatus        int64   `json:"billStatus"`
+	CreatedAt         string  `json:"createdAt"`
+	TaskDdl           string  `json:"taskDdl"`
+	Reward            float64 `json:"reward"`       // 悬赏池总金额
+	ActualAmount      float64 `json:"actualAmount"` // 实际兑现金额
+	CreatorName       string  `json:"creatorName"`
+}

+ 20 - 0
app/vo/re_local_store_explore_preview.go

@@ -0,0 +1,20 @@
+package vo
+
+type ReLocalStoreExplorePreview struct {
+	MainImage     string `json:"mainImage"`
+	StoreName     string `json:"storeName"`
+	StoreLocation string `json:"storeLocation"`
+	StoreId       int64  `json:"storeId"`
+	TeamBuyingId  int64  `json:"teamBuyingId"`
+
+	EnterpriseId  string `json:"enterpriseId"`
+	SubAccountId  int64  `json:"subAccountId"`
+	LocalId       string `json:"localId"`
+	LocalPlatform int64  `json:"localPlatform"`
+	LocalType     int64  `json:"localType"`
+	NeedReserve   int64  `json:"needReserve"` // 待预约
+	NeedConfirm   int64  `json:"needConfirm"` // 待确认
+	NeedExplore   int64  `json:"needExplore"` // 待探店
+	ExploredNum   int64  `json:"exploredNum"` // 已探店
+	CreatorName   string `json:"creatorName"`
+}

+ 2 - 1
app/vo/re_selection_detail.go

@@ -30,7 +30,8 @@ type ReSelectionDetail struct {
 
 type FreeStrategyPreview struct {
 	StrategyId     int64 `json:"strategyId"`
-	FansNum        int64 `json:"fansNum"`
+	FollowersLow   int64 `json:"followers_low"` // 达人粉丝数下限
+	FollowersUp    int64 `json:"followers_up"`  // 达人粉丝数上限
 	SaleNum        int64 `json:"saleNum"`
 	StrategyStatus int64 `json:"strategyStatus"` // 策略状态,1-2分别代表未删除、已删除
 }

+ 12 - 0
app/vo/re_store_explore_talent.go

@@ -0,0 +1,12 @@
+package vo
+
+type ReStoreExploreTalent struct {
+	ReTalentPreview *TalentPreview `json:"reTalentPreview"` // 达人信息
+
+	CooperateTime     string `json:"cooperate_time"`      // 确认合作时间 select_date
+	ReserveTime       string `json:"reserve_time"`        // 探店时间预约
+	ExploreTime       string `json:"explore_time"`        // 探店时间
+	FinishExploreTime string `json:"finish_explore_time"` // 完成探店时间
+
+	Operator string `json:"operator"` // 操作人
+}

+ 6 - 5
app/vo/selection_info_update_param.go

@@ -41,11 +41,12 @@ type SecMaterialInfo struct {
 
 // 领样策略
 type UpdateFreeStrategys struct {
-	StrategyId int64 `json:"strategy_id"` // 策略编号
-	FansNum    int64 `json:"fans_num"`    // 粉丝数目
-	SaleNum    int64 `json:"sale_num"`    // 近30天橱窗销量
-	EnrollNum  int64 `json:"enroll_num"`  // 报名人数
-	ChooseNum  int64 `json:"choose_num"`  // 已选人数
+	StrategyId   int64 `json:"strategy_id"`   // 策略编号
+	FollowersLow int64 `json:"followers_low"` // 达人粉丝数下限
+	FollowersUp  int64 `json:"followers_up"`  // 达人粉丝数上限
+	SaleNum      int64 `json:"sale_num"`      // 近30天橱窗销量
+	EnrollNum    int64 `json:"enroll_num"`    // 报名人数
+	ChooseNum    int64 `json:"choose_num"`    // 已选人数
 }
 
 // 悬赏策略

+ 10 - 0
app/vo/store_explore_param.go

@@ -0,0 +1,10 @@
+package vo
+
+type StoreExploreParam struct {
+	LocalLifeId string `json:"local_life_id"`
+	Status      int64  `json:"status"`      // 1待预约 2待确认 3待探店 4已探店
+	TalentName  string `json:"talent_name"` // 达人昵称
+	SearchTime  string `json:"search_time"` // 预约探店时间/探店时间/完成探店时间
+	Page        int    `json:"page"`
+	PageSize    int    `json:"page_size"`
+}

+ 13 - 0
route/init.go

@@ -244,6 +244,12 @@ func InitRoute(r *gin.Engine) {
 		// 寄样管理
 		task.POST("/logistics/talent/list", controller.TaskController{}.LogisticsTalentList) // 达人物流列表
 
+		// 探店管理
+		task.POST("/store/explore/list", controller.TaskController{}.StoreExploreList) // 探店本地生活列表
+		task.POST("/store/explore/info", controller.TaskController{}.StoreExploreInfo) // 探店达人详情
+		// 终止合作
+		// 预约时间驳回
+
 		// 服务商合作
 		task.POST("/supplier/list", controller.TaskController{}.GetSupplierInTargetTaskList) // 服务商合作-服务商列表
 		task.POST("/supplier/invite", controller.TaskController{}.InviteSupplier)            // 服务商合作-邀约合作
@@ -260,11 +266,18 @@ func InitRoute(r *gin.Engine) {
 		finance.POST("/recharge/show", controller.FinanceController{}.ShowRecharge)                  // 充值管理——累计充值金额、确认中金额
 		finance.POST("/recharge/info", controller.FinanceController{}.RechargeInfoList)              // 充值管理——充值记录
 		// YG官方汇款账号
+
 		finance.POST("/invoice/default/update", controller.FinanceController{}.UpdateInvoiceDefault) // 设置默认开票抬头
 		finance.POST("/invoice/default/get", controller.FinanceController{}.GetInvoiceDefault)       // 获取默认开票抬头
 		finance.POST("/invoice/bill", controller.FinanceController{}.BillInvoice)                    // 确认开票
 		finance.POST("/invoice/list/bill", controller.FinanceController{}.GetBillList)               // 开票记录
 		finance.POST("/invoice/list/billable", controller.FinanceController{}.GetBillableList)       // 可开票账单
+
+		//finance.POST("/bill/selection/list", controller.BillController{}.SelectionBillList) // 账单查询-电商带货
+		finance.POST("/bill/selection/pay", controller.BillController{}.SelectionPay) // 电商带货账单支付
+		finance.POST("/bill/project/pay", controller.BillController{}.ProjectPay)     // 品牌种草账单支付
+		finance.POST("/bill/local/pay", controller.BillController{}.LocalLifePay)     // 本地生活账单支付
+
 	}
 	// 推广合作-服务商相关接口
 	cooperation := r.Group("/youngee/b/cooperation/supplier")