Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/develop' into develop

lin-jim-leon 3 settimane fa
parent
commit
adbb6ffc90

+ 28 - 0
app/controller/cooperation_controller.go

@@ -95,6 +95,20 @@ func (o CooperationController) GetSupplierConfirmingList(c *gin.Context) {
 	returnSuccess(c, 20000, result)
 }
 
+// 服务商管理-角标
+func (o CooperationController) GetSupplierCount(c *gin.Context) {
+	param := &vo.SupplierConfirmingParam{}
+	err := c.BindJSON(param)
+	if err != nil || "" == param.EnterpriseId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result := service.CooperationService{}.GetSupplierCount(param)
+
+	returnSuccess(c, 20000, result)
+}
+
 // 门店详情
 func (o CooperationController) GetStoreDetail(c *gin.Context) {
 	param := &vo.StoreSearchParam{}
@@ -268,3 +282,17 @@ func (o CooperationController) DeleteProduct(c *gin.Context) {
 	resultMap["productId"] = productId
 	returnSuccess(c, 20000, resultMap)
 }
+
+// 商品列表角标
+func (o CooperationController) CountProduct(c *gin.Context) {
+	param := &vo.GetAllProductParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	resMap := service.ProductService{}.CountProduct(param)
+
+	returnSuccess(c, 20000, resMap)
+}

+ 28 - 0
app/controller/finance_controller.go

@@ -110,6 +110,20 @@ func (f FinanceController) FrozenInfoList(c *gin.Context) {
 	returnSuccess(c, 20000, result)
 }
 
+// 余额管理——冻结记录-角标
+func (f FinanceController) FrozenInfoCount(c *gin.Context) {
+	param := &vo.BalanceParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result := service.RechargeService{}.FrozenInfoCount(param)
+
+	returnSuccess(c, 20000, result)
+}
+
 // 充值管理——累计充值金额、确认中金额
 func (f FinanceController) ShowRecharge(c *gin.Context) {
 	param := &vo.RechargeParam{}
@@ -146,6 +160,20 @@ func (f FinanceController) RechargeInfoList(c *gin.Context) {
 	returnSuccess(c, 20000, result)
 }
 
+// 充值管理——充值记录-角标
+func (f FinanceController) RechargeInfoCount(c *gin.Context) {
+	param := &vo.RechargeParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	result := service.RechargeService{}.RechargeInfoCount(param)
+
+	returnSuccess(c, 20000, result)
+}
+
 // 设置默认开票抬头
 func (f FinanceController) UpdateInvoiceDefault(c *gin.Context) {
 	param := &vo.InvoiceDefaultParam{}

+ 85 - 1
app/controller/task_controller.go

@@ -227,6 +227,20 @@ func (t TaskController) SelectionClose(c *gin.Context) {
 	returnSuccess(c, 20000, resultMap)
 }
 
+// 电商带货选达人角标 未处理、同意合作、拒绝合作
+func (t TaskController) SelectionTalentCount(c *gin.Context) {
+	param := &vo.SelectionSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res := service.SelectionInfoService{}.SelectionTalentCount(param.SelectionId)
+
+	returnSuccess(c, 20000, res)
+}
+
 // 创建种草任务
 func (t TaskController) CreateProject(c *gin.Context) {
 	data := &vo.ProjectCreateParam{}
@@ -523,6 +537,20 @@ func (t TaskController) GetPublicDefaultTalentList(c *gin.Context) {
 	returnSuccess(c, 20000, res)
 }
 
+// 违约管理——公开任务-违约达人列表角标
+func (t TaskController) GetPublicDefaultTalentCount(c *gin.Context) {
+	param := &vo.DefaultSearchParam{}
+	err := c.BindJSON(param)
+	if err != nil {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res, _ := service.DefaultService{}.GetPublicDefaultTalentCount(param)
+
+	returnSuccess(c, 20000, res)
+}
+
 // 违约管理——定向任务-违约达人列表
 func (t TaskController) GetTargetDefaultTalentList(c *gin.Context) {
 	param := &vo.DefaultSearchParam{}
@@ -600,6 +628,20 @@ func (o TaskController) GetSupplierInTargetTaskList(c *gin.Context) {
 	returnSuccess(c, 20000, result)
 }
 
+// 服务商合作-服务商列表角标
+func (t TaskController) GetSupplierInTargetCount(c *gin.Context) {
+	param := &vo.SupplierSearchInTargetTaskParam{}
+	err := c.BindJSON(param)
+	if err != nil || "" == param.EnterpriseId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res := service.CooperationService{}.GetSupplierInTargetCount(param)
+
+	returnSuccess(c, 20000, res)
+}
+
 // 服务商合作-邀约合作
 func (o TaskController) InviteSupplier(c *gin.Context) {
 	param := &vo.SupplierInviteInTargetTaskParam{}
@@ -841,7 +883,21 @@ func (t TaskController) LocalLifeToReview(c *gin.Context) {
 	returnSuccess(c, 20000, resultMap)
 }
 
-// 达人物流列表
+// 带货待发货、待签收、已签收统计
+func (t TaskController) LogisticsSelectionTalentCount(c *gin.Context) {
+	param := &vo.LogisticsSelectionTalentParam{}
+	err := c.BindJSON(param)
+	if err != nil || "" == param.SelectionId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res := service.TaskInfoService{}.LogisticsSelectionTalentCount(param)
+
+	returnSuccess(c, 20000, res)
+}
+
+// 种草达人物流列表
 func (t TaskController) LogisticsTalentList(c *gin.Context) {
 	param := &vo.LogisticsTalentParam{}
 	err := c.BindJSON(param)
@@ -860,6 +916,20 @@ func (t TaskController) LogisticsTalentList(c *gin.Context) {
 	returnSuccess(c, 20000, res)
 }
 
+// 种草待发货、待签收、已签收统计
+func (t TaskController) LogisticsTalentCount(c *gin.Context) {
+	param := &vo.LogisticsTalentParam{}
+	err := c.BindJSON(param)
+	if err != nil || "" == param.ProjectId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res := service.TaskInfoService{}.LogisticsTalentCount(param)
+
+	returnSuccess(c, 20000, res)
+}
+
 // 本地生活列表
 func (t TaskController) LocalLifeTaskList(c *gin.Context) {
 	param := &vo.LocalSearchParam{}
@@ -955,6 +1025,20 @@ func (t TaskController) StoreExploreInfo(c *gin.Context) {
 	returnSuccess(c, 20000, res)
 }
 
+// 探店达人列表角标
+func (t TaskController) StoreExploreInfoCount(c *gin.Context) {
+	param := &vo.StoreExploreParam{}
+	err := c.BindJSON(param)
+	if err != nil || "" == param.LocalLifeId {
+		logrus.Errorf("Request bind err:%+v\n", err)
+		returnError(c, 40000, "Parameter Error: "+err.Error())
+		return
+	}
+	res := service.LocalLifeService{}.StoreExploreInfoCount(param)
+
+	returnSuccess(c, 20000, res)
+}
+
 // 探店终止合作
 func (t TaskController) StoreExploreOver(c *gin.Context) {
 	param := &vo.LocalTalentOperateParam{}

+ 2 - 2
app/dao/enterprise_supplier_cooperate_dao.go

@@ -28,7 +28,7 @@ func (d EnterpriseSupplierCooperateDao) GetSupplierByEnterprise(enterpriseId str
 	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
 	var total int64
 	offset := (page - 1) * pageSize
-	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 2", enterpriseId)
+	query := Db.Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 2", enterpriseId)
 	query.Count(&total)
 	query = query.Select("supplier_id, cooperate_num, upload_talent_num, cooperate_talent_num, b_operator, b_operator_type, agree_time")
 	err := query.Order("agree_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
@@ -56,7 +56,7 @@ func (d EnterpriseSupplierCooperateDao) GetSupplierConfirmingList(enterpriseId s
 	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
 	var total int64
 	offset := (page - 1) * pageSize
-	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 1", enterpriseId)
+	query := Db.Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 1", enterpriseId)
 	query.Count(&total)
 	query = query.Select("supplier_id,  b_operator, b_operator_type, cooperate_status, create_time")
 	err := query.Order("create_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error

+ 5 - 5
app/dao/info_auto_default_dao.go

@@ -16,11 +16,11 @@ func (d InfoAutoDefaultDao) GetAutoDefaultLast(enterpriseId string) entity.InfoA
 	return autoDefaultInfo
 }
 
-// 获取指定 auto_default_id 的指定字段值
-func (d InfoAutoDefaultDao) GetValueByIdFieldName(autoDefaultId int64, fieldName string) int64 {
-	var value int64
-	Db.Model(&entity.InfoAutoDefault{}).Select(fieldName).Where("auto_default_id = ?", autoDefaultId).Find(&value)
-	return value
+// 获取指定 auto_default_id 的字段值
+func (d InfoAutoDefaultDao) GetValueById(autoDefaultId int64) (entity.InfoAutoDefault, error) {
+	var infoAutoDefault entity.InfoAutoDefault
+	err := Db.Model(&entity.InfoAutoDefault{}).Where("auto_default_id = ?", autoDefaultId).Find(&infoAutoDefault).Error
+	return infoAutoDefault, err
 }
 
 // 为当前 enterpriseId 插入新的策略配置

+ 49 - 2
app/dao/local_life_dao.go

@@ -151,7 +151,7 @@ func (d LocalLifeDao) DeleteLocalLife(localId string) (*string, error) {
 	if localId == "" {
 		return &localId, nil
 	}
-	err := Db.Where("local_id = ?", localId).Delete(&entity.LocalLifeInfo{}).Error
+	err := Db.Model(&entity.LocalLifeInfo{}).Where("local_id = ?", localId).Delete(&entity.LocalLifeInfo{}).Error
 	if err != nil {
 		return nil, err
 	}
@@ -179,6 +179,9 @@ func (d LocalLifeDao) GetLocalDraftList(param *vo.LocalDraftParam) ([]vo.ReLocal
 	if param.LocalPlatform != 0 {
 		query = query.Where("local_platform = ?", param.LocalPlatform)
 	}
+	if param.Others != "" {
+		query = query.Where("enterprise_id = ? or local_id = ? or local_name LIKE ?", param.Others, param.Others, "%"+param.Others+"%")
+	}
 	query.Count(&total)
 	query = query.Select("enterprise_id, sub_account_id, local_id, local_platform, local_type, created_at, store_id")
 	offset := (param.Page - 1) * param.PageSize
@@ -201,7 +204,7 @@ func (d LocalLifeDao) GetLocalDraftList(param *vo.LocalDraftParam) ([]vo.ReLocal
 	return reLocalTaskPreviews, total, nil
 }
 
-// 获取公开种草中全部指定状态值的项目
+// 获取公开本地生活中全部指定状态值的项目
 func (d LocalLifeDao) GetLocalLifeList(value int64, fieldName string) ([]*entity.LocalLifeInfo, error) {
 	var localLifeInfos []*entity.LocalLifeInfo
 	err := Db.Model(entity.LocalLifeInfo{}).Where(fmt.Sprintf("local_type = ? AND %s = ? ", fieldName), 1, value).Find(&localLifeInfos).Error
@@ -211,6 +214,50 @@ func (d LocalLifeDao) GetLocalLifeList(value int64, fieldName string) ([]*entity
 	return localLifeInfos, nil
 }
 
+// 违约管理——违约公开本地生活任务列表
+func (d LocalLifeDao) GetLocalPublicList(param *vo.DefaultSearchParam) ([]vo.ReTaskDefaultPublic, int64, error) {
+	var reTaskDefaultPublics []vo.ReTaskDefaultPublic
+	var localLifeInfos []entity.LocalLifeInfo
+	var total int64
+	query := Db.Model(&entity.LocalLifeInfo{}).Where("local_type = ?", 1)
+	// 动态添加查询条件
+	if param.SubAccountId == 0 {
+		if param.EnterpriseId == "" {
+			return reTaskDefaultPublics, 0, errors.New("enterpriseId is empty")
+		}
+		query = query.Where("enterprise_id = ?", param.EnterpriseId)
+	} else {
+		query = query.Where("sub_account_id = ?", param.SubAccountId)
+	}
+	if param.Platform != 0 {
+		query = query.Where("local_platform = ?", param.Platform)
+	}
+	if param.Others != "" {
+		query = query.Where("enterprise_id = ? or local_id = ? or local_name LIKE ?", param.Others, param.Others, "%"+param.Others+"%")
+	}
+	query.Count(&total)
+	query = query.Select("enterprise_id, sub_account_id, local_id, local_platform, task_form, content_type, store_id")
+	offset := (param.Page - 1) * param.PageSize
+	if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&localLifeInfos).Error; err != nil {
+		return nil, 0, err
+	}
+	for _, localLife := range localLifeInfos {
+		reTaskDefaultPublic := vo.ReTaskDefaultPublic{
+			EnterpriseId: localLife.EnterpriseID,
+			SubAccountId: localLife.SubAccountID,
+			TaskId:       localLife.LocalID,
+			Platform:     localLife.LocalPlatform,
+			TaskForm:     localLife.TaskForm,
+			ContentType:  localLife.ContentType,
+			TaskType:     1,
+			StoreId:      localLife.StoreID,
+		}
+		reTaskDefaultPublics = append(reTaskDefaultPublics, reTaskDefaultPublic)
+	}
+
+	return reTaskDefaultPublics, total, nil
+}
+
 // 探店本地生活列表
 func (d LocalLifeDao) GetLocalStoreExplorePreviews(param *vo.LocalSearchParam) ([]vo.ReLocalStoreExplorePreview, int64, error) {
 	var reLocalStoreExplorePreviews []vo.ReLocalStoreExplorePreview

+ 5 - 2
app/dao/project_dao.go

@@ -157,14 +157,14 @@ func (d ProjectDAO) DeleteProject(projectId string) (*string, error) {
 	if projectId == "" {
 		return &projectId, nil
 	}
-	err := Db.Debug().Where("project_id = ?", projectId).Delete(&entity.Project{}).Error
+	err := Db.Model(&entity.Project{}).Where("project_id = ?", projectId).Delete(&entity.Project{}).Error
 	if err != nil {
 		return nil, err
 	}
 	return &projectId, nil
 }
 
-// 获取草稿箱——电商带货任务列表
+// 获取草稿箱——种草任务列表
 func (d ProjectDAO) GetProjectDraftList(param *vo.ProjectDraftParam) ([]vo.ReProjectTaskPreview, int64, error) {
 	var reProjectTaskPreviews []vo.ReProjectTaskPreview
 	var projects []entity.Project
@@ -185,6 +185,9 @@ func (d ProjectDAO) GetProjectDraftList(param *vo.ProjectDraftParam) ([]vo.RePro
 	if param.ProjectPlatform != 0 {
 		query = query.Where("project_platform = ?", param.ProjectPlatform)
 	}
+	if param.Others != "" {
+		query = query.Where("enterprise_id = ? or project_id = ? or project_name LIKE ?", param.Others, param.Others, "%"+param.Others+"%")
+	}
 	query.Count(&total)
 	query = query.Select("enterprise_id, sub_account_id, project_id, project_platform, project_type, created_at, product_id")
 	offset := (param.Page - 1) * param.PageSize

+ 13 - 1
app/dao/project_task_info_dao.go

@@ -22,10 +22,22 @@ 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, talentNickname string) ([]*entity.ProjectTaskInfo, int64, error) {
 	var taskInfos []*entity.ProjectTaskInfo
 	var total int64
 	query := Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", projectId, taskStage)
+	if talentNickname != "" {
+		var talentInfos []entity.YoungeeTalentInfo
+		err1 := Db.Model(&entity.YoungeeTalentInfo{}).Where("talent_wx_nickname = ?", talentNickname).Find(&talentInfos).Error
+		if err1 != nil {
+			return nil, 0, err1
+		}
+		var talentIds []string
+		for _, talentInfo := range talentInfos {
+			talentIds = append(talentIds, talentInfo.ID)
+		}
+		query = query.Where("talent_id in ?", talentIds)
+	}
 	// 计算偏移量
 	offset := (page - 1) * pageSize
 	var err error

+ 71 - 0
app/dao/s_local_dao.go

@@ -0,0 +1,71 @@
+package dao
+
+import (
+	"youngee_b_api/app/entity"
+)
+
+type SLocalLifeDao struct{}
+
+// 插入数据
+func (d SLocalLifeDao) Insert(record *entity.SLocalLifeInfo) error {
+	result := Db.Debug().Model(&entity.SLocalLifeInfo{}).Create(&record)
+	return result.Error
+}
+
+// 根据本地生活id、邀约状态返回数据列表
+func (d SLocalLifeDao) GetSLocalLifeByStatus(localId string, status int64, page int, pageSize int) ([]*entity.SLocalLifeInfo, int64, error) {
+	var sLocalLifeInfos []*entity.SLocalLifeInfo
+	var total int64
+	offset := (page - 1) * pageSize
+	query := Db.Debug().Model(&entity.SLocalLifeInfo{}).Where("local_id = ? AND s_local_status = ?", localId, status)
+	query.Count(&total)
+	query = query.Select("supplier_id,  b_operator, b_operator_type")
+	err := query.Order("create_time desc").Offset(offset).Limit(pageSize).Find(&sLocalLifeInfos).Error
+	if err != nil {
+		return nil, 0, err
+	}
+
+	return sLocalLifeInfos, total, nil
+}
+
+//// 检查给定的服务商是否在该商家库中
+//func (d SupplierDao) EnterpriseDatabaseCheck(enterpriseId string, supplierId int64) (bool, error) {
+//	var count int64
+//	err := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND supplier_id = ? AND cooperate_status != 2", enterpriseId, supplierId).Count(&count).Error
+//	if err != nil {
+//		return false, err
+//	}
+//	return count > 0, nil
+//}
+//
+//// 获取指定商家的服务商库
+//func (d SupplierDao) GetSupplierByEnterprise(enterpriseId string, page int, pageSize int) ([]*entity.EnterpriseSupplierCooperate, int64, error) {
+//	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
+//	var total int64
+//	offset := (page - 1) * pageSize
+//	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 2", enterpriseId)
+//	query.Count(&total)
+//	query = query.Select("supplier_id, cooperate_num, upload_talent_num, cooperate_talent_num, b_operator, b_operator_type, agree_time")
+//	err := query.Order("agree_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
+//	if err != nil {
+//		return nil, 0, err
+//	}
+//
+//	return enterpriseSupplierCooperates, total, nil
+//}
+//
+//// 获取邀请待确认的服务商
+//func (d SupplierDao) GetSupplierConfirmingList(enterpriseId string, page int, pageSize int) ([]*entity.EnterpriseSupplierCooperate, int64, error) {
+//	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
+//	var total int64
+//	offset := (page - 1) * pageSize
+//	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 1", enterpriseId)
+//	query.Count(&total)
+//	query = query.Select("supplier_id,  b_operator, b_operator_type, cooperate_status, create_time")
+//	err := query.Order("create_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
+//	if err != nil {
+//		return nil, 0, err
+//	}
+//
+//	return enterpriseSupplierCooperates, total, nil
+//}

+ 41 - 41
app/dao/s_project_dao.go

@@ -28,44 +28,44 @@ func (d SProjectDao) GetSProjectByStatus(projectId string, status int64, page in
 	return sProjectInfos, total, nil
 }
 
-// 检查给定的服务商是否在该商家库中
-func (d SupplierDao) EnterpriseDatabaseCheck(enterpriseId string, supplierId int64) (bool, error) {
-	var count int64
-	err := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND supplier_id = ? AND cooperate_status != 2", enterpriseId, supplierId).Count(&count).Error
-	if err != nil {
-		return false, err
-	}
-	return count > 0, nil
-}
-
-// 获取指定商家的服务商库
-func (d SupplierDao) GetSupplierByEnterprise(enterpriseId string, page int, pageSize int) ([]*entity.EnterpriseSupplierCooperate, int64, error) {
-	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
-	var total int64
-	offset := (page - 1) * pageSize
-	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 2", enterpriseId)
-	query.Count(&total)
-	query = query.Select("supplier_id, cooperate_num, upload_talent_num, cooperate_talent_num, b_operator, b_operator_type, agree_time")
-	err := query.Order("agree_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
-	if err != nil {
-		return nil, 0, err
-	}
-
-	return enterpriseSupplierCooperates, total, nil
-}
-
-// 获取邀请待确认的服务商
-func (d SupplierDao) GetSupplierConfirmingList(enterpriseId string, page int, pageSize int) ([]*entity.EnterpriseSupplierCooperate, int64, error) {
-	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
-	var total int64
-	offset := (page - 1) * pageSize
-	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 1", enterpriseId)
-	query.Count(&total)
-	query = query.Select("supplier_id,  b_operator, b_operator_type, cooperate_status, create_time")
-	err := query.Order("create_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
-	if err != nil {
-		return nil, 0, err
-	}
-
-	return enterpriseSupplierCooperates, total, nil
-}
+//// 检查给定的服务商是否在该商家库中
+//func (d SupplierDao) EnterpriseDatabaseCheck(enterpriseId string, supplierId int64) (bool, error) {
+//	var count int64
+//	err := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND supplier_id = ? AND cooperate_status != 2", enterpriseId, supplierId).Count(&count).Error
+//	if err != nil {
+//		return false, err
+//	}
+//	return count > 0, nil
+//}
+//
+//// 获取指定商家的服务商库
+//func (d SupplierDao) GetSupplierByEnterprise(enterpriseId string, page int, pageSize int) ([]*entity.EnterpriseSupplierCooperate, int64, error) {
+//	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
+//	var total int64
+//	offset := (page - 1) * pageSize
+//	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 2", enterpriseId)
+//	query.Count(&total)
+//	query = query.Select("supplier_id, cooperate_num, upload_talent_num, cooperate_talent_num, b_operator, b_operator_type, agree_time")
+//	err := query.Order("agree_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
+//	if err != nil {
+//		return nil, 0, err
+//	}
+//
+//	return enterpriseSupplierCooperates, total, nil
+//}
+//
+//// 获取邀请待确认的服务商
+//func (d SupplierDao) GetSupplierConfirmingList(enterpriseId string, page int, pageSize int) ([]*entity.EnterpriseSupplierCooperate, int64, error) {
+//	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
+//	var total int64
+//	offset := (page - 1) * pageSize
+//	query := Db.Debug().Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 1", enterpriseId)
+//	query.Count(&total)
+//	query = query.Select("supplier_id,  b_operator, b_operator_type, cooperate_status, create_time")
+//	err := query.Order("create_time desc").Offset(offset).Limit(pageSize).Find(&enterpriseSupplierCooperates).Error
+//	if err != nil {
+//		return nil, 0, err
+//	}
+//
+//	return enterpriseSupplierCooperates, total, nil
+//}

+ 4 - 1
app/dao/selection_info_dao.go

@@ -139,7 +139,7 @@ func (d SelectionInfoDAO) DeleteSelection(selectionId string) (*string, error) {
 	if selectionId == "" {
 		return &selectionId, nil
 	}
-	err := Db.Where("selection_id = ?", selectionId).Delete(&entity.SelectionInfo{}).Error
+	err := Db.Model(&entity.SelectionInfo{}).Where("selection_id = ?", selectionId).Delete(&entity.SelectionInfo{}).Error
 	if err != nil {
 		return nil, err
 	}
@@ -164,6 +164,9 @@ func (d SelectionInfoDAO) GetSelectionDraftList(param *vo.SelectionDraftParam) (
 	if param.SelectionPlatform != 0 {
 		query = query.Where("platform = ?", param.SelectionPlatform)
 	}
+	if param.Others != "" {
+		query = query.Where("enterprise_id = ? or selection_id = ? or selection_name LIKE ?", param.Others, param.Others, "%"+param.Others+"%")
+	}
 	query.Count(&total)
 	query = query.Select("enterprise_id, sub_account_id, selection_id, platform, created_at, product_id")
 	offset := (param.Page - 1) * param.PageSize

+ 9 - 9
app/entity/local_life_task_info.go

@@ -12,13 +12,13 @@ type LocalLifeTaskInfo struct {
 	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"`                // 企业实际支付(加上服务商的服务费)(扣除违约扣款)
+	TaskReward             float64   `gorm:"column:task_reward;NOT NULL"`                 // 达人报酬(3.0未用)
+	SettleAmount           float64   `gorm:"column:settle_amount;NOT NULL"`               // 达人实际所得(自动填充)(扣除违约扣款)
+	AllPayment             float64   `gorm:"column:all_payment;NOT NULL"`                 // 企业支付(3.0未用)
+	RealPayment            float64   `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"`                  // 服务商实际所得服务费(扣除违约)
+	ServiceCharge          float64   `gorm:"column:service_charge"`                       // 服务费
+	RealServiceCharge      float64   `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"` // 脚本上传超时违约扣款比例,百分之
@@ -44,12 +44,12 @@ type LocalLifeTaskInfo struct {
 	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之团团长现金收益
+	TeamIncome             float64   `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"`               // 达人稿费,达人所见的稿费金额
+	DraftFee               float64   `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"`                             // 平均点赞数
@@ -60,7 +60,7 @@ type LocalLifeTaskInfo struct {
 	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"`                          // 提报价格(达人自报价经过计算后,)
+	SupportFee             float64   `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"`                    // 未发作品违约时间

+ 1 - 0
app/entity/platform_kuaishou_user_info.go

@@ -24,6 +24,7 @@ type PlatformKuaishouUserInfo struct {
 	IsDelete     int64     `gorm:"column:is_delete;NOT NULL"`
 	LikeNum      int64     `gorm:"column:like_num;NOT NULL"`
 	VideoNum     int64     `gorm:"column:video_num;NOT NULL"`
+	City         string    `gorm:"column:city"`
 }
 
 func (m *PlatformKuaishouUserInfo) TableName() string {

+ 22 - 22
app/entity/project_task_info.go

@@ -8,39 +8,39 @@ type ProjectTaskInfo struct {
 	TaskID                 string    `gorm:"column:task_id;primary_key;AUTO_INCREMENT"`   // 任务id
 	ProjectID              string    `gorm:"column:project_id;NOT NULL"`                  // 项目id
 	TalentID               string    `gorm:"column:talent_id;NOT NULL"`                   // 达人id
-	AccountID              int       `gorm:"column:account_id;NOT NULL"`                  // 账号id
+	AccountID              int64     `gorm:"column:account_id;NOT NULL"`                  // 账号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"`       // 收货地址快照
-	StrategyID             int       `gorm:"column:strategy_id"`                          // 报名选择的招募策略id
+	StrategyID             int64     `gorm:"column:strategy_id"`                          // 报名选择的招募策略id
 	TaskReward             float64   `gorm:"column:task_reward;NOT NULL"`                 // 达人报酬
 	SettleAmount           float64   `gorm:"column:settle_amount;NOT NULL"`               // 达人实际所得(扣除违约扣款)
 	AllPayment             float64   `gorm:"column:all_payment;NOT NULL"`                 // 企业支付
 	RealPayment            float64   `gorm:"column:real_payment;NOT NULL"`                // 企业实际支付(扣除违约扣款)
-	ErrBreakRate           int       `gorm:"column:err_break_rate;default:0;NOT NULL"`    // 未上传类型违约扣款比例,百分之
-	ScriptBreakRate        int       `gorm:"column:script_break_rate;default:0;NOT NULL"` // 脚本上传超时违约扣款比例,百分之
-	SketchBreakRate        int       `gorm:"column:sketch_break_rate;default:0;NOT NULL"` // 初稿上传超时违约扣款比例,百分之
-	LinkBreakRate          int       `gorm:"column:link_break_rate;default:0;NOT NULL"`   // 链接上传超时违约扣款比例,百分之
-	DataBreakRate          int       `gorm:"column:data_break_rate;default:0;NOT NULL"`   // 数据上传超时违约扣款比例,百分之
-	FeeForm                int       `gorm:"column:fee_form;NOT NULL"`                    // 稿费形式,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"`   // 数据上传超时违约扣款比例,百分之
+	FeeForm                int64     `gorm:"column:fee_form;NOT NULL"`                    // 稿费形式,1,2,3分别代表产品置换、固定稿费、自报价
 	ServiceCharge          float64   `gorm:"column:service_charge"`                       // 服务费
-	ServiceRate            int       `gorm:"column:service_rate"`                         // 服务费率,千分之
-	TaskStatus             int       `gorm:"column:task_status;default:1;NOT NULL"`       // 任务状态 1待选 2已选 3落选
-	TaskStage              int       `gorm:"column:task_stage;NOT NULL"`                  // 任务阶段,详情见info_task_stage表
+	ServiceRate            int64     `gorm:"column:service_rate"`                         // 服务费率,千分之
+	TaskStatus             int64     `gorm:"column:task_status;default:1;NOT NULL"`       // 任务状态 1待选 2已选 3落选
+	TaskStage              int64     `gorm:"column:task_stage;NOT NULL"`                  // 任务阶段,详情见info_task_stage表
 	CreateDate             time.Time `gorm:"column:create_date;NOT NULL"`                 // 创建时间
 	SelectDate             time.Time `gorm:"column:select_date"`                          // 反选时间
 	DeliveryDate           time.Time `gorm:"column:delivery_date"`                        // 发货时间
-	CompleteStatus         int       `gorm:"column:complete_status;default:1;NOT NULL"`   // 结束方式 1未结束 2正常结束 3反选失败 4被解约
+	CompleteStatus         int64     `gorm:"column:complete_status;default:1;NOT NULL"`   // 结束方式 1未结束 2正常结束 3反选失败 4被解约
 	CompleteDate           time.Time `gorm:"column:complete_date"`                        // 结束时间
-	LogisticsStatus        int       `gorm:"column:logistics_status;default:1"`           // 发货状态 1 待发货 2已发货 3 已签收
-	ScriptStatus           uint      `gorm:"column:script_status;default:1"`              // 脚本上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	SketchStatus           uint      `gorm:"column:sketch_status;default:1"`              // 初稿上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	LogisticsStatus        int64     `gorm:"column:logistics_status;default:1"`           // 发货状态 1 待发货 2已发货 3 已签收
+	ScriptStatus           uint64    `gorm:"column:script_status;default:1"`              // 脚本上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	SketchStatus           uint64    `gorm:"column:sketch_status;default:1"`              // 初稿上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
 	UpdateAt               time.Time `gorm:"column:update_at"`                            // 更新时间
-	LinkStatus             uint      `gorm:"column:link_status;default:1"`                // 链接上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	DataStatus             uint      `gorm:"column:data_status;default:1"`                // 数据上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	CurDefaultType         int       `gorm:"column:cur_default_type"`                     // 任务当前处于的违约类型 0-8分别表示未违约、脚本超时违约、脚本未上传违约、初稿超时违约、初稿未上传违约、链接超时违约、链接未上传违约、数据超时违约、数据未上传违约
-	WithdrawStatus         int       `gorm:"column:withdraw_status;default:1"`            // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
-	SettleStatus           int       `gorm:"column:settle_status;default:1"`              // 结算状态,1、2分别表示待结算、已结算
+	LinkStatus             uint64    `gorm:"column:link_status;default:1"`                // 链接上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	DataStatus             uint64    `gorm:"column:data_status;default:1"`                // 数据上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	CurDefaultType         int64     `gorm:"column:cur_default_type"`                     // 任务当前处于的违约类型 0-8分别表示未违约、脚本超时违约、脚本未上传违约、初稿超时违约、初稿未上传违约、链接超时违约、链接未上传违约、数据超时违约、数据未上传违约
+	WithdrawStatus         int64     `gorm:"column:withdraw_status;default:1"`            // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	SettleStatus           int64     `gorm:"column:settle_status;default:1"`              // 结算状态,1、2分别表示待结算、已结算
 	DraftFee               float64   `gorm:"column:draft_fee;NOT NULL"`                   // 达人稿费,达人所见的稿费金额
 	SignedTime             time.Time `gorm:"column:signed_time"`                          // 签收时间
 	TerminateTime          time.Time `gorm:"column:terminate_time"`
@@ -50,9 +50,9 @@ type ProjectTaskInfo struct {
 	SketchMissingTime      time.Time `gorm:"column:sketch_missing_time"`
 	LinkMissingTime        time.Time `gorm:"column:link_missing_time"`
 	DataMissingTime        time.Time `gorm:"column:data_missing_time"`
-	TerminateOperatorType  int       `gorm:"column:terminate_operator_type;default:0;NOT NULL"`
+	TerminateOperatorType  int64     `gorm:"column:terminate_operator_type;default:0;NOT NULL"`
 	TerminateOperator      string    `gorm:"column:terminate_operator"`
-	CancelOperatorType     int       `gorm:"column:cancel_operator_type;default:0;NOT NULL"`
+	CancelOperatorType     int64     `gorm:"column:cancel_operator_type;default:0;NOT NULL"`
 	CancelOperator         string    `gorm:"column:cancel_operator"`
 }
 

+ 41 - 0
app/entity/s_local.go

@@ -0,0 +1,41 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package entity
+
+import (
+	"time"
+)
+
+type SLocalLifeInfo struct {
+	SLocalID            int64     `gorm:"column:s_local_id;primary_key;AUTO_INCREMENT"` // 主键ID
+	LocalID             string    `gorm:"column:local_id"`                              // 被加入商单的原本地生活ID
+	LocalType           int64     `gorm:"column:local_type"`                            // 类型,1代表公开,2代表定向
+	LocalName           string    `gorm:"column:local_name"`                            // 名称
+	LocalPlatform       int64     `gorm:"column:local_platform"`                        // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	StoreID             int64     `gorm:"column:store_id"`                              // 门店ID
+	TeamBuyingID        int64     `gorm:"column:team_buying_id"`                        // 关联团购id
+	TaskForm            int64     `gorm:"column:task_form"`                             // 任务形式,1-2分别代表线下探店,素材分发
+	ContentType         int64     `gorm:"column:content_type"`                          // 内容形式,1代表图文,2代表视频
+	TaskStatus          int64     `gorm:"column:task_status"`                           // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、执行中、失效、已结案
+	EnterpriseID        string    `gorm:"column:enterprise_id"`                         // 商家ID
+	SupplierID          int64     `gorm:"column:supplier_id"`                           // 服务商ID
+	ApplyNum            int64     `gorm:"column:apply_num"`                             // 报名人数
+	RecruitNum          int64     `gorm:"column:recruit_num"`                           // 已招募人数
+	SettleNum           int64     `gorm:"column:settle_num;default:0"`                  // 已结算人数
+	SubAccountID        int64     `gorm:"column:sub_account_id"`                        // 服务商子账号ID
+	ServiceCharge       string    `gorm:"column:service_charge"`                        // 服务商预估可赚服务费
+	ServiceChargeActual string    `gorm:"column:service_charge_actual"`                 // 服务商实际可赚服务费
+	OperatorType        int64     `gorm:"column:operator_type;default:0"`               // 添加商单操作人类型,1为服务商主账号,2为服务商子账号
+	SLocalStatus        int64     `gorm:"column:s_local_status;default:0"`              // 服务商本地生活任务状态,1待确认,2已确认,3已拒绝
+	StrategyStatus      int64     `gorm:"column:strategy_status;default:2"`             // 定向本地生活任务是否替换招募策略,1是,2否
+	BOperator           string    `gorm:"column:b_operator"`                            // 商家发起入库邀约人
+	BOperatorType       int64     `gorm:"column:b_operator_type"`                       // 商家发起入库邀约人类型:1主账号 2子账号
+	CreateTime          time.Time `gorm:"column:create_time"`                           // 创建时间
+	CreateStrategyID    int64     `gorm:"column:create_strategy_id"`                    // 服务商替换招募策略操作人ID
+	CreateStrategyType  int64     `gorm:"column:create_strategy_type"`                  // 服务商替换招募策略操作人类型:1服务商主账号,2子账号
+	ShareCode           string    `gorm:"column:share_code"`                            // 分享码url
+	FinishTime          time.Time `gorm:"column:finish_time"`                           // 结案时间
+}
+
+func (m *SLocalLifeInfo) TableName() string {
+	return "younggee_s_local_life_info"
+}

+ 1 - 0
app/entity/s_project.go

@@ -35,6 +35,7 @@ type SProjectInfo struct {
 	CreateTime          time.Time `gorm:"column:create_time"`                        // 创建时间
 	CreateStrategyID    int64     `gorm:"column:create_strategy_id"`                 // 服务商修改服务费操作人ID
 	CreateStrategyType  int64     `gorm:"column:create_strategy_type"`               // 服务商修改服务费操作人类型:1服务商主账号,2子账号
+	FinishTime          time.Time `gorm:"column:finish_time"`                        // 结案时间
 }
 
 func (m *SProjectInfo) TableName() string {

+ 48 - 3
app/service/cooperation_service.go

@@ -192,6 +192,19 @@ func (s CooperationService) GetSupplierConfirmingList(param *vo.SupplierConfirmi
 	return result, nil
 }
 
+// 服务商管理-角标
+func (t CooperationService) GetSupplierCount(param *vo.SupplierConfirmingParam) map[string]int64 {
+	res := make(map[string]int64)
+	var inPoolNum int64     // 在库服务商
+	var confirmingNum int64 // 邀请待确认
+	dao.Db.Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 2", param.EnterpriseId).Count(&inPoolNum)
+	dao.Db.Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = 1", param.EnterpriseId).Count(&confirmingNum)
+	res["inPoolNum"] = inPoolNum
+	res["confirmingNum"] = confirmingNum
+
+	return res
+}
+
 // 服务商合作-服务商列表
 func (s CooperationService) GetSupplierInTargetTaskList(param *vo.SupplierSearchInTargetTaskParam) (vo.ResultVO, error) {
 	if param.Page <= 0 {
@@ -210,6 +223,7 @@ func (s CooperationService) GetSupplierInTargetTaskList(param *vo.SupplierSearch
 	}
 	var enterpriseSupplierCooperates []*entity.EnterpriseSupplierCooperate
 	var sProjectInfos []*entity.SProjectInfo
+	var sLocalLifeInfos []*entity.SLocalLifeInfo
 	var enterpriseOperator string
 	if param.Status == 1 { // 可邀约
 		enterpriseSupplierCooperates, total, _ = dao.EnterpriseSupplierCooperateDao{}.GetSupplierByEnterprise(param.EnterpriseId, param.Page, param.PageSize)
@@ -219,7 +233,7 @@ func (s CooperationService) GetSupplierInTargetTaskList(param *vo.SupplierSearch
 			sProjectInfos, total, _ = dao.SProjectDao{}.GetSProjectByStatus(param.TaskId, 1, param.Page, param.PageSize)
 		} else if param.TaskType == 3 {
 			// 本地生活
-
+			sLocalLifeInfos, total, _ = dao.SLocalLifeDao{}.GetSLocalLifeByStatus(param.TaskId, 1, param.Page, param.PageSize)
 		}
 	} else if param.Status == 3 { // 合作中
 		if param.TaskType == 2 {
@@ -227,7 +241,7 @@ func (s CooperationService) GetSupplierInTargetTaskList(param *vo.SupplierSearch
 			sProjectInfos, total, _ = dao.SProjectDao{}.GetSProjectByStatus(param.TaskId, 2, param.Page, param.PageSize)
 		} else if param.TaskType == 3 {
 			// 本地生活
-
+			sLocalLifeInfos, total, _ = dao.SLocalLifeDao{}.GetSLocalLifeByStatus(param.TaskId, 2, param.Page, param.PageSize)
 		}
 	}
 	if enterpriseSupplierCooperates == nil {
@@ -242,7 +256,14 @@ func (s CooperationService) GetSupplierInTargetTaskList(param *vo.SupplierSearch
 			}
 		} else if param.TaskType == 3 {
 			// 本地生活
-
+			for _, sLocalLifeInfo := range sLocalLifeInfos {
+				supplierId := sLocalLifeInfo.SupplierID
+				enterpriseSupplierCooperate, err1 := dao.EnterpriseSupplierCooperateDao{}.GetDataByEnterpriseAndSupplier(param.EnterpriseId, supplierId)
+				if err1 != nil {
+					return result, err1
+				}
+				enterpriseSupplierCooperates = append(enterpriseSupplierCooperates, enterpriseSupplierCooperate)
+			}
 		}
 	}
 	for _, enterpriseSupplierCooperate := range enterpriseSupplierCooperates {
@@ -301,6 +322,30 @@ func (s CooperationService) GetSupplierInTargetTaskList(param *vo.SupplierSearch
 	return result, nil
 }
 
+// 服务商合作-服务商列表角标
+func (t CooperationService) GetSupplierInTargetCount(param *vo.SupplierSearchInTargetTaskParam) map[string]int64 {
+	res := make(map[string]int64)
+	var invitableNum int64   // 可邀约
+	var invitingNum int64    // 邀约中
+	var cooperatingNum int64 // 合作中
+	dao.Db.Model(&entity.EnterpriseSupplierCooperate{}).Where("enterprise_id = ? AND cooperate_status = ?", param.EnterpriseId, 2).Count(&invitableNum)
+	if param.TaskType == 2 {
+		// 品牌种草
+		dao.Db.Model(&entity.SProjectInfo{}).Where("project_id = ? AND s_project_status = ?", param.TaskId, 1).Count(&invitingNum)
+		dao.Db.Model(&entity.SProjectInfo{}).Where("project_id = ? AND s_project_status = ?", param.TaskId, 2).Count(&cooperatingNum)
+	} else if param.TaskType == 3 {
+		// 本地生活
+		dao.Db.Model(&entity.SLocalLifeInfo{}).Where("local_id = ? AND s_local_status = ?", param.TaskId, 1).Count(&invitingNum)
+		dao.Db.Model(&entity.SProjectInfo{}).Where("local_id = ? AND s_local_status = ?", param.TaskId, 2).Count(&cooperatingNum)
+
+	}
+	res["invitableNum"] = invitableNum
+	res["invitingNum"] = invitingNum
+	res["cooperatingNum"] = cooperatingNum
+
+	return res
+}
+
 // 服务商合作-邀约合作
 func (s CooperationService) InviteSupplierInTargetTask(param *vo.SupplierInviteInTargetTaskParam) error {
 	var sProjectInfo entity.SProjectInfo

+ 331 - 135
app/service/default_service.go

@@ -20,57 +20,116 @@ func (s DefaultService) GetPublicDefaultList(param *vo.DefaultSearchParam) (vo.R
 		param.PageSize = 10
 	}
 	var result vo.ResultVO
-	// 以下代码只考虑了种草
-	reTaskDefaultPublics, total, err := (&dao.ProjectDAO{}).GetProjectPublicList(param)
-	if err != nil {
-		return result, err
-	}
-	for i := range reTaskDefaultPublics {
-		// 获取商品详情字段
-		var creatorName string
-		var productName string
-		var productPrice float64
-		var mainImage string
-		if reTaskDefaultPublics[i].SubAccountId == 0 {
-			enterprise, err := dao.EnterpriseDao{}.GetEnterprise(reTaskDefaultPublics[i].EnterpriseId)
-			if err == nil && enterprise != nil {
-				creatorName = enterprise.BusinessName
+	// 种草
+	if param.TaskType == 1 {
+		reTaskDefaultPublics, total, err := (&dao.ProjectDAO{}).GetProjectPublicList(param)
+		if err != nil {
+			return result, err
+		}
+		for i := range reTaskDefaultPublics {
+			// 获取商品详情字段
+			var creatorName string
+			var productName string
+			var productPrice float64
+			var mainImage string
+			if reTaskDefaultPublics[i].SubAccountId == 0 {
+				enterprise, err := dao.EnterpriseDao{}.GetEnterprise(reTaskDefaultPublics[i].EnterpriseId)
+				if err == nil && enterprise != nil {
+					creatorName = enterprise.BusinessName
+				}
+			} else {
+				subAccount, err := dao.SubAccountDao{}.GetSubAccount(reTaskDefaultPublics[i].SubAccountId)
+				if err == nil && subAccount != nil {
+					creatorName = subAccount.SubAccountName
+				}
 			}
-		} else {
-			subAccount, err := dao.SubAccountDao{}.GetSubAccount(reTaskDefaultPublics[i].SubAccountId)
-			if err == nil && subAccount != nil {
-				creatorName = subAccount.SubAccountName
+			product, err := dao.ProductDAO{}.GetProductByID(reTaskDefaultPublics[i].ProductId)
+			if err == nil && product != nil {
+				productName = product.ProductName
+				productPrice = product.ProductPrice
 			}
+			mainImage, err = dao.ProductPhotoDAO{}.GetMainPhotoByProductID(reTaskDefaultPublics[i].ProductId)
+			reTaskDefaultPublics[i].CreatorName = creatorName
+			reTaskDefaultPublics[i].ProductName = productName
+			reTaskDefaultPublics[i].ProductPrice = productPrice
+			reTaskDefaultPublics[i].MainImage = mainImage
+			// 获取未传数量字段	0-10分别表示未违约、脚本超时违约、脚本未上传违约、初稿超时违约、初稿未上传违约、链接超时违约、链接未上传违约、数据超时违约、数据未上传违约、解约待处理、解约
+			projectId := reTaskDefaultPublics[i].TaskId
+			noSketchNum := dao.ProjectTaskInfoDao{}.CountByDefaultType(projectId, 4)
+			noLinkNum := dao.ProjectTaskInfoDao{}.CountByDefaultType(projectId, 6)
+			noDataNum := dao.ProjectTaskInfoDao{}.CountByDefaultType(projectId, 8)
+			// 终止合作还是解约字段待确认
+			endCooperationNum := dao.ProjectTaskInfoDao{}.CountByTaskStage(projectId, 16)
+			reTaskDefaultPublics[i].NoSketchNum = noSketchNum
+			reTaskDefaultPublics[i].NoLinkNum = noLinkNum
+			reTaskDefaultPublics[i].NoDataNum = noDataNum
+			reTaskDefaultPublics[i].EndCooperationNum = endCooperationNum
 		}
-		product, err := dao.ProductDAO{}.GetProductByID(reTaskDefaultPublics[i].ProductId)
-		if err == nil && product != nil {
-			productName = product.ProductName
-			productPrice = product.ProductPrice
+		result = vo.ResultVO{
+			Page:     param.Page,
+			PageSize: param.PageSize,
+			Total:    total,
+			Data:     reTaskDefaultPublics,
 		}
-		mainImage, err = dao.ProductPhotoDAO{}.GetMainPhotoByProductID(reTaskDefaultPublics[i].ProductId)
-		reTaskDefaultPublics[i].CreatorName = creatorName
-		reTaskDefaultPublics[i].ProductName = productName
-		reTaskDefaultPublics[i].ProductPrice = productPrice
-		reTaskDefaultPublics[i].MainImage = mainImage
-		// 获取未传数量字段	0-10分别表示未违约、脚本超时违约、脚本未上传违约、初稿超时违约、初稿未上传违约、链接超时违约、链接未上传违约、数据超时违约、数据未上传违约、解约待处理、解约
-		projectId := reTaskDefaultPublics[i].TaskId
-		noSketchNum := dao.ProjectTaskInfoDao{}.CountByDefaultType(projectId, 4)
-		noLinkNum := dao.ProjectTaskInfoDao{}.CountByDefaultType(projectId, 6)
-		noDataNum := dao.ProjectTaskInfoDao{}.CountByDefaultType(projectId, 8)
-		// 终止合作还是解约字段待确认
-		endCooperationNum := dao.ProjectTaskInfoDao{}.CountByTaskStage(projectId, 16)
-		reTaskDefaultPublics[i].NoSketchNum = noSketchNum
-		reTaskDefaultPublics[i].NoLinkNum = noLinkNum
-		reTaskDefaultPublics[i].NoDataNum = noDataNum
-		reTaskDefaultPublics[i].EndCooperationNum = endCooperationNum
-	}
-	result = vo.ResultVO{
-		Page:     param.Page,
-		PageSize: param.PageSize,
-		Total:    total,
-		Data:     reTaskDefaultPublics,
+		return result, nil
+		// 本地生活
+	} else if param.TaskType == 2 {
+		reTaskDefaultPublics, total, err := (&dao.ProjectDAO{}).GetProjectPublicList(param)
+		if err != nil {
+			return result, err
+		}
+		for i := range reTaskDefaultPublics {
+			// 获取商品详情字段
+			var creatorName string
+			var storeName string
+			var storeLocation string
+			//var productPrice float64
+			var mainImage string
+			if reTaskDefaultPublics[i].SubAccountId == 0 {
+				enterprise, err := dao.EnterpriseDao{}.GetEnterprise(reTaskDefaultPublics[i].EnterpriseId)
+				if err == nil && enterprise != nil {
+					creatorName = enterprise.BusinessName
+				}
+			} else {
+				subAccount, err := dao.SubAccountDao{}.GetSubAccount(reTaskDefaultPublics[i].SubAccountId)
+				if err == nil && subAccount != nil {
+					creatorName = subAccount.SubAccountName
+				}
+			}
+			store, err := dao.StoreDao{}.GetStoreByID(reTaskDefaultPublics[i].StoreId)
+			if err == nil && store != nil {
+				storeName = store.StoreName
+				storeLocation = store.StoreLocation
+			}
+			mainImage, err = dao.ProductPhotoDAO{}.GetMainPhotoByStoreID(reTaskDefaultPublics[i].StoreId)
+			reTaskDefaultPublics[i].CreatorName = creatorName
+			reTaskDefaultPublics[i].StoreName = storeName
+			reTaskDefaultPublics[i].StoreLocation = storeLocation
+			reTaskDefaultPublics[i].MainImage = mainImage
+			// 获取未传数量字段	0-10分别表示未违约、脚本超时违约、脚本未上传违约、初稿超时违约、初稿未上传违约、链接超时违约、链接未上传违约、数据超时违约、数据未上传违约、解约待处理、解约
+			localId := reTaskDefaultPublics[i].TaskId
+			noSketchNum := dao.LocalLifeTaskInfoDao{}.CountByDefaultType(localId, 4)
+			noLinkNum := dao.LocalLifeTaskInfoDao{}.CountByDefaultType(localId, 6)
+			noDataNum := dao.LocalLifeTaskInfoDao{}.CountByDefaultType(localId, 8)
+			// 终止合作还是解约字段待确认
+			endCooperationNum := dao.LocalLifeTaskInfoDao{}.CountByTaskStage(localId, 16)
+			reTaskDefaultPublics[i].NoSketchNum = noSketchNum
+			reTaskDefaultPublics[i].NoLinkNum = noLinkNum
+			reTaskDefaultPublics[i].NoDataNum = noDataNum
+			reTaskDefaultPublics[i].EndCooperationNum = endCooperationNum
+		}
+		result = vo.ResultVO{
+			Page:     param.Page,
+			PageSize: param.PageSize,
+			Total:    total,
+			Data:     reTaskDefaultPublics,
+		}
+		return result, nil
+
+	} else {
+		return result, nil
 	}
-	return result, nil
+
 }
 
 // 违约管理——违约定向任务列表
@@ -137,101 +196,238 @@ func (s DefaultService) GetPublicDefaultTalentList(param *vo.DefaultSearchParam)
 	}
 	var result vo.ResultVO
 	var reTalentDefaults []*vo.ReTalentDefault
-	// 以下代码只考虑了种草
-	var projectTaskInfos []entity.ProjectTaskInfo
-	var total int64
-	var err error
-	var cutRate int64
-	defaultType := param.DefaultType
-	if defaultType == 1 { // 未传初稿
-		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListBySketchDefault(param)
-		autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
-		cutRate = dao.InfoAutoDefaultDao{}.GetValueByIdFieldName(*autoDefaultId, "sketch_replace_not_upload")
-	} else if defaultType == 2 { // 未发作品
-		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByLinkDefault(param)
-		autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
-		cutRate = dao.InfoAutoDefaultDao{}.GetValueByIdFieldName(*autoDefaultId, "link_replace_not_upload")
-	} else if defaultType == 3 { // 未传数据
-		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByDataDefault(param)
-		autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
-		cutRate = dao.InfoAutoDefaultDao{}.GetValueByIdFieldName(*autoDefaultId, "data_replace_not_upload")
-	} else if defaultType == 4 { // 终止合作
-		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTerminateDefault(param)
-	} else if defaultType == 5 { // 已解约
-		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByCancelDefault(param)
-	}
-	if err != nil {
-		return result, err
-	}
-	for _, projectTaskInfo := range projectTaskInfos {
-		talentId := projectTaskInfo.TalentID
-		talentPhone, _ := dao.TalentInfoDao{}.SelectTalentPhone(talentId)
-		platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.SelectUserInfo(talentId)
-		reTalentDefault := &vo.ReTalentDefault{
-			TalentId:    talentId,
-			TalentPhone: *talentPhone,
-			TaskId:      projectTaskInfo.TaskID,
-			DraftFee:    projectTaskInfo.DraftFee,
-			OpenId:      platformKuaishouUserInfo.OpenId,
-			NickName:    platformKuaishouUserInfo.NickName,
-			HeadUri:     platformKuaishouUserInfo.HeadUri,
-			City:        "-",
+	// 种草
+	if param.TaskType == 1 {
+		var projectTaskInfos []entity.ProjectTaskInfo
+		var total int64
+		var err error
+		var cutRate int64 // 违约扣款比例
+		defaultType := param.DefaultType
+		if defaultType == 1 { // 未传初稿
+			projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListBySketchDefault(param)
+			autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
+			infoAutoDefault, _ := dao.InfoAutoDefaultDao{}.GetValueById(*autoDefaultId)
+			cutRate = infoAutoDefault.SketchOtherNotUpload
+		} else if defaultType == 2 { // 未发作品
+			projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByLinkDefault(param)
+			autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
+			infoAutoDefault, _ := dao.InfoAutoDefaultDao{}.GetValueById(*autoDefaultId)
+			cutRate = infoAutoDefault.LinkReplaceNotUpload
+		} else if defaultType == 3 { // 未传数据
+			projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByDataDefault(param)
+			autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
+			infoAutoDefault, _ := dao.InfoAutoDefaultDao{}.GetValueById(*autoDefaultId)
+			cutRate = infoAutoDefault.DataReplaceNotUpload
+		} else if defaultType == 4 { // 终止合作
+			projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTerminateDefault(param)
+		} else if defaultType == 5 { // 已解约
+			projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByCancelDefault(param)
 		}
-		if defaultType == 1 {
-			reTalentDefault.DefaultTime = projectTaskInfo.SketchMissingTime.Format("2006-01-02 15:04:05")
-			reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
-		} else if defaultType == 2 {
-			reTalentDefault.DefaultTime = projectTaskInfo.LinkMissingTime.Format("2006-01-02 15:04:05")
-			reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
-		} else if defaultType == 3 {
-			reTalentDefault.DefaultTime = projectTaskInfo.DataMissingTime.Format("2006-01-02 15:04:05")
-			reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
-		} else if defaultType == 4 {
-			reTalentDefault.DefaultTime = projectTaskInfo.TerminateTime.Format("2006-01-02 15:04:05")
-			reTalentDefault.Reason = projectTaskInfo.TerminateReason
-			terminateOperatorType := projectTaskInfo.TerminateOperatorType
-			if terminateOperatorType == 1 {
-				enterprise, _ := dao.EnterpriseDao{}.GetEnterprise(projectTaskInfo.TerminateOperator)
-				reTalentDefault.OperatorName = enterprise.BusinessName
-			} else if terminateOperatorType == 2 {
-				operatorId, _ := strconv.ParseInt(projectTaskInfo.TerminateOperator, 10, 64)
-				subAccount, _ := dao.SubAccountDao{}.GetSubAccount(operatorId)
-				reTalentDefault.OperatorName = subAccount.SubAccountName
-			} else if terminateOperatorType == 3 {
-				operatorId, _ := strconv.ParseInt(projectTaskInfo.TerminateOperator, 10, 64)
-				userName, _ := dao.UserDao{}.GetNameByUserId(operatorId)
-				reTalentDefault.OperatorName = userName
+		if err != nil {
+			return result, err
+		}
+		for _, projectTaskInfo := range projectTaskInfos {
+			talentId := projectTaskInfo.TalentID
+			talentInfo, _ := dao.TalentInfoDao{}.SelectTalentInfo(talentId)
+			platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.SelectUserInfo(talentId)
+			reTalentDefault := &vo.ReTalentDefault{
+				TalentId:    talentId,
+				TalentPhone: talentInfo.TalentPhoneNumber,
+				TaskId:      projectTaskInfo.TaskID,
+				DraftFee:    projectTaskInfo.DraftFee,
+				OpenId:      platformKuaishouUserInfo.OpenId,
+				NickName:    platformKuaishouUserInfo.NickName,
+				HeadUri:     platformKuaishouUserInfo.HeadUri,
+				City:        platformKuaishouUserInfo.City,
+				Gender:      talentInfo.Sex,
 			}
-		} else if defaultType == 5 {
-			reTalentDefault.DefaultTime = projectTaskInfo.CancelTime.Format("2006-01-02 15:04:05")
-			reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
-			reTalentDefault.Reason = projectTaskInfo.CancelReason
-			cancelOperatorType := projectTaskInfo.CancelOperatorType
-			if cancelOperatorType == 1 {
-				enterprise, _ := dao.EnterpriseDao{}.GetEnterprise(projectTaskInfo.CancelOperator)
-				reTalentDefault.OperatorName = enterprise.BusinessName
-			} else if cancelOperatorType == 2 {
-				operatorId, _ := strconv.ParseInt(projectTaskInfo.CancelOperator, 10, 64)
-				subAccount, _ := dao.SubAccountDao{}.GetSubAccount(operatorId)
-				reTalentDefault.OperatorName = subAccount.SubAccountName
-			} else if cancelOperatorType == 3 {
-				operatorId, _ := strconv.ParseInt(projectTaskInfo.CancelOperator, 10, 64)
-				userName, _ := dao.UserDao{}.GetNameByUserId(operatorId)
-				reTalentDefault.OperatorName = userName
+			if defaultType == 1 {
+				reTalentDefault.DefaultTime = projectTaskInfo.SketchMissingTime.Format("2006-01-02 15:04:05")
+				reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
+			} else if defaultType == 2 {
+				reTalentDefault.DefaultTime = projectTaskInfo.LinkMissingTime.Format("2006-01-02 15:04:05")
+				reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
+			} else if defaultType == 3 {
+				reTalentDefault.DefaultTime = projectTaskInfo.DataMissingTime.Format("2006-01-02 15:04:05")
+				reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
+			} else if defaultType == 4 {
+				reTalentDefault.DefaultTime = projectTaskInfo.TerminateTime.Format("2006-01-02 15:04:05")
+				reTalentDefault.Reason = projectTaskInfo.TerminateReason
+				terminateOperatorType := projectTaskInfo.TerminateOperatorType
+				if terminateOperatorType == 1 {
+					enterprise, _ := dao.EnterpriseDao{}.GetEnterprise(projectTaskInfo.TerminateOperator)
+					reTalentDefault.OperatorName = enterprise.BusinessName
+				} else if terminateOperatorType == 2 {
+					operatorId, _ := strconv.ParseInt(projectTaskInfo.TerminateOperator, 10, 64)
+					subAccount, _ := dao.SubAccountDao{}.GetSubAccount(operatorId)
+					reTalentDefault.OperatorName = subAccount.SubAccountName
+				} else if terminateOperatorType == 3 {
+					operatorId, _ := strconv.ParseInt(projectTaskInfo.TerminateOperator, 10, 64)
+					userName, _ := dao.UserDao{}.GetNameByUserId(operatorId)
+					reTalentDefault.OperatorName = userName
+				}
+			} else if defaultType == 5 {
+				reTalentDefault.DefaultTime = projectTaskInfo.CancelTime.Format("2006-01-02 15:04:05")
+				reTalentDefault.SettleAmount = projectTaskInfo.SettleAmount
+				reTalentDefault.Reason = projectTaskInfo.CancelReason
+				cancelOperatorType := projectTaskInfo.CancelOperatorType
+				if cancelOperatorType == 1 {
+					enterprise, _ := dao.EnterpriseDao{}.GetEnterprise(projectTaskInfo.CancelOperator)
+					reTalentDefault.OperatorName = enterprise.BusinessName
+				} else if cancelOperatorType == 2 {
+					operatorId, _ := strconv.ParseInt(projectTaskInfo.CancelOperator, 10, 64)
+					subAccount, _ := dao.SubAccountDao{}.GetSubAccount(operatorId)
+					reTalentDefault.OperatorName = subAccount.SubAccountName
+				} else if cancelOperatorType == 3 {
+					operatorId, _ := strconv.ParseInt(projectTaskInfo.CancelOperator, 10, 64)
+					userName, _ := dao.UserDao{}.GetNameByUserId(operatorId)
+					reTalentDefault.OperatorName = userName
+				}
 			}
+			reTalentDefaults = append(reTalentDefaults, reTalentDefault)
 		}
-		reTalentDefaults = append(reTalentDefaults, reTalentDefault)
+		resultMap := make(map[string]interface{})
+		resultMap["cutRate"] = cutRate
+		resultMap["reTalentDefaults"] = reTalentDefaults
+		result = vo.ResultVO{
+			Page:     param.Page,
+			PageSize: param.PageSize,
+			Total:    total,
+			Data:     resultMap,
+		}
+		return result, nil
+		// 本地生活
+	} else if param.TaskType == 2 {
+		var localLifeTaskInfos []entity.LocalLifeTaskInfo
+		var total int64
+		var err error
+		var cutRate int64 // 违约扣款比例
+		defaultType := param.DefaultType
+		if defaultType == 1 { // 未传初稿
+			localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListBySketchDefault(param)
+			autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
+			infoAutoDefault, _ := dao.InfoAutoDefaultDao{}.GetValueById(*autoDefaultId)
+			cutRate = infoAutoDefault.SketchOtherNotUpload
+		} else if defaultType == 2 { // 未发作品
+			localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByLinkDefault(param)
+			autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
+			infoAutoDefault, _ := dao.InfoAutoDefaultDao{}.GetValueById(*autoDefaultId)
+			cutRate = infoAutoDefault.LinkReplaceNotUpload
+		} else if defaultType == 3 { // 未传数据
+			localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByDataDefault(param)
+			autoDefaultId, _ := dao.ProjectDAO{}.GetAutoDefaultId(param.TaskId)
+			infoAutoDefault, _ := dao.InfoAutoDefaultDao{}.GetValueById(*autoDefaultId)
+			cutRate = infoAutoDefault.DataReplaceNotUpload
+		} else if defaultType == 4 { // 终止合作
+			localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByTerminateDefault(param)
+		} else if defaultType == 5 { // 已解约
+			localLifeTaskInfos, total, err = dao.LocalLifeTaskInfoDao{}.GetListByCancelDefault(param)
+		}
+		if err != nil {
+			return result, err
+		}
+		for _, localLifeTaskInfo := range localLifeTaskInfos {
+			talentId := localLifeTaskInfo.TalentID
+			talentInfo, _ := dao.TalentInfoDao{}.SelectTalentInfo(talentId)
+			platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.SelectUserInfo(talentId)
+			reTalentDefault := &vo.ReTalentDefault{
+				TalentId:    talentId,
+				TalentPhone: talentInfo.TalentPhoneNumber,
+				TaskId:      localLifeTaskInfo.TaskID,
+				DraftFee:    localLifeTaskInfo.DraftFee,
+				OpenId:      platformKuaishouUserInfo.OpenId,
+				NickName:    platformKuaishouUserInfo.NickName,
+				HeadUri:     platformKuaishouUserInfo.HeadUri,
+				City:        platformKuaishouUserInfo.City,
+				Gender:      talentInfo.Sex,
+			}
+			if defaultType == 1 {
+				reTalentDefault.DefaultTime = localLifeTaskInfo.SketchMissingTime.Format("2006-01-02 15:04:05")
+				reTalentDefault.SettleAmount = localLifeTaskInfo.SettleAmount
+			} else if defaultType == 2 {
+				reTalentDefault.DefaultTime = localLifeTaskInfo.LinkMissingTime.Format("2006-01-02 15:04:05")
+				reTalentDefault.SettleAmount = localLifeTaskInfo.SettleAmount
+			} else if defaultType == 3 {
+				reTalentDefault.DefaultTime = localLifeTaskInfo.DataMissingTime.Format("2006-01-02 15:04:05")
+				reTalentDefault.SettleAmount = localLifeTaskInfo.SettleAmount
+			} else if defaultType == 4 {
+				reTalentDefault.DefaultTime = localLifeTaskInfo.TerminateTime.Format("2006-01-02 15:04:05")
+				reTalentDefault.Reason = localLifeTaskInfo.TerminateReason
+				terminateOperatorType := localLifeTaskInfo.TerminateOperatorType
+				if terminateOperatorType == 1 {
+					enterprise, _ := dao.EnterpriseDao{}.GetEnterprise(localLifeTaskInfo.TerminateOperator)
+					reTalentDefault.OperatorName = enterprise.BusinessName
+				} else if terminateOperatorType == 2 {
+					operatorId, _ := strconv.ParseInt(localLifeTaskInfo.TerminateOperator, 10, 64)
+					subAccount, _ := dao.SubAccountDao{}.GetSubAccount(operatorId)
+					reTalentDefault.OperatorName = subAccount.SubAccountName
+				} else if terminateOperatorType == 3 {
+					operatorId, _ := strconv.ParseInt(localLifeTaskInfo.TerminateOperator, 10, 64)
+					userName, _ := dao.UserDao{}.GetNameByUserId(operatorId)
+					reTalentDefault.OperatorName = userName
+				}
+			} else if defaultType == 5 {
+				reTalentDefault.DefaultTime = localLifeTaskInfo.CancelTime.Format("2006-01-02 15:04:05")
+				reTalentDefault.SettleAmount = localLifeTaskInfo.SettleAmount
+				reTalentDefault.Reason = localLifeTaskInfo.CancelReason
+				cancelOperatorType := localLifeTaskInfo.CancelOperatorType
+				if cancelOperatorType == 1 {
+					enterprise, _ := dao.EnterpriseDao{}.GetEnterprise(localLifeTaskInfo.CancelOperator)
+					reTalentDefault.OperatorName = enterprise.BusinessName
+				} else if cancelOperatorType == 2 {
+					operatorId, _ := strconv.ParseInt(localLifeTaskInfo.CancelOperator, 10, 64)
+					subAccount, _ := dao.SubAccountDao{}.GetSubAccount(operatorId)
+					reTalentDefault.OperatorName = subAccount.SubAccountName
+				} else if cancelOperatorType == 3 {
+					operatorId, _ := strconv.ParseInt(localLifeTaskInfo.CancelOperator, 10, 64)
+					userName, _ := dao.UserDao{}.GetNameByUserId(operatorId)
+					reTalentDefault.OperatorName = userName
+				}
+			}
+			reTalentDefaults = append(reTalentDefaults, reTalentDefault)
+		}
+		resultMap := make(map[string]interface{})
+		resultMap["cutRate"] = cutRate
+		resultMap["reTalentDefaults"] = reTalentDefaults
+		result = vo.ResultVO{
+			Page:     param.Page,
+			PageSize: param.PageSize,
+			Total:    total,
+			Data:     resultMap,
+		}
+		return result, nil
+
+	} else {
+		return result, nil
 	}
-	resultMap := make(map[string]interface{})
-	resultMap["cutRate"] = cutRate
-	resultMap["reTalentDefaults"] = reTalentDefaults
-	result = vo.ResultVO{
-		Page:     param.Page,
-		PageSize: param.PageSize,
-		Total:    total,
-		Data:     resultMap,
+}
+
+// 违约管理——公开任务-违约达人列表角标
+func (s DefaultService) GetPublicDefaultTalentCount(param *vo.DefaultSearchParam) (map[string]int64, error) {
+	res := make(map[string]int64)
+	var noSketchNum int64
+	var noLinkNum int64
+	var noDataNum int64
+	var endCooperationNum int64
+	if param.TaskType == 1 {
+		noSketchNum = dao.ProjectTaskInfoDao{}.CountByDefaultType(param.TaskId, 4)
+		noLinkNum = dao.ProjectTaskInfoDao{}.CountByDefaultType(param.TaskId, 6)
+		noDataNum = dao.ProjectTaskInfoDao{}.CountByDefaultType(param.TaskId, 8)
+		// 终止合作还是解约字段待确认
+		endCooperationNum = dao.ProjectTaskInfoDao{}.CountByTaskStage(param.TaskId, 16)
+	} else {
+		noSketchNum = dao.LocalLifeTaskInfoDao{}.CountByDefaultType(param.TaskId, 4)
+		noLinkNum = dao.LocalLifeTaskInfoDao{}.CountByDefaultType(param.TaskId, 6)
+		noDataNum = dao.LocalLifeTaskInfoDao{}.CountByDefaultType(param.TaskId, 8)
+		// 终止合作还是解约字段待确认
+		endCooperationNum = dao.LocalLifeTaskInfoDao{}.CountByTaskStage(param.TaskId, 16)
 	}
-	return result, nil
+	res["noSketchNum"] = noSketchNum
+	res["noLinkNum"] = noLinkNum
+	res["noDataNum"] = noDataNum
+	res["endCooperationNum"] = endCooperationNum
+
+	return res, nil
 }
 
 // 违约管理——定向任务-违约达人列表

+ 24 - 4
app/service/local_life_service.go

@@ -142,8 +142,8 @@ func (s LocalLifeService) CreateLocalLife(localCreateParam *vo.LocalCreateParam)
 				totalRecruitNum += strategy.RecruitNumber
 				if strategy.FeeForm == 2 {
 					recruitStrategy.Offer = strategy.Offer
-					recruitStrategy.ServiceCharge = strategy.Offer * localCreateParam.ServiceChargeRate
-					recruitStrategy.TOffer = strategy.Offer * (1 - localCreateParam.ServiceChargeRate)
+					recruitStrategy.ServiceCharge = strategy.Offer * localCreateParam.ServiceChargeRate * 0.01
+					recruitStrategy.TOffer = strategy.Offer * (1 - localCreateParam.ServiceChargeRate*0.01)
 				}
 				recruits = append(recruits, recruitStrategy)
 			}
@@ -203,8 +203,8 @@ func (s LocalLifeService) UpdateLocal(localUpdateParam *vo.LocalUpdateParam) (*s
 				totalRecruitNum += strategy.RecruitNumber
 				if strategy.FeeForm == 2 {
 					recruitStrategy.Offer = strategy.Offer
-					recruitStrategy.ServiceCharge = strategy.Offer * localUpdateParam.ServiceChargeRate
-					recruitStrategy.TOffer = strategy.Offer * (1 - localUpdateParam.ServiceChargeRate)
+					recruitStrategy.ServiceCharge = strategy.Offer * localUpdateParam.ServiceChargeRate * 0.01
+					recruitStrategy.TOffer = strategy.Offer * (1 - localUpdateParam.ServiceChargeRate*0.01)
 				}
 				recruits = append(recruits, recruitStrategy)
 			}
@@ -1127,6 +1127,7 @@ func (s LocalLifeService) GetStoreExploreInfo(param *vo.StoreExploreParam) (*vo.
 			TalentName:  talentInfo.TalentWxNickname,
 			Account:     "",
 			Location:    regionName,
+			Gender:      talentInfo.Sex,
 		}
 		reStoreExploreTalent := &vo.ReStoreExploreTalent{
 			ReTalentPreview: talentPreview,
@@ -1154,6 +1155,25 @@ func (s LocalLifeService) GetStoreExploreInfo(param *vo.StoreExploreParam) (*vo.
 	return &result, nil
 }
 
+// 探店达人列表角标
+func (t LocalLifeService) StoreExploreInfoCount(param *vo.StoreExploreParam) map[string]int64 {
+	res := make(map[string]int64)
+	var needBook int64
+	var needConfirm int64
+	var needExplore int64
+	var explored int64
+	dao.Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", param.LocalLifeId, 1).Count(&needBook)
+	dao.Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", param.LocalLifeId, 2).Count(&needConfirm)
+	dao.Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", param.LocalLifeId, 5).Count(&needExplore)
+	dao.Db.Model(&entity.LocalLifeTaskInfo{}).Where("local_id = ? AND book_status = ?", param.LocalLifeId, 6).Count(&explored)
+	res["needBook"] = needBook
+	res["needConfirm"] = needConfirm
+	res["needExplore"] = needExplore
+	res["explored"] = explored
+
+	return res
+}
+
 // 终止合作
 func (s LocalLifeService) StoreExploreOver(param *vo.LocalTalentOperateParam) (*string, error) {
 	taskId := param.TaskId

+ 20 - 0
app/service/product_service.go

@@ -209,6 +209,26 @@ func (p ProductService) DeleteProduct(param *vo.ProductUpdateParam) (int64, erro
 	return param.ProductId, nil
 }
 
+// 商品列表-角标
+func (t ProductService) CountProduct(param *vo.GetAllProductParam) map[string]int64 {
+	res := make(map[string]int64)
+	var commonProduct int64
+	var kuaishouProduct int64
+	if param.ProductTitle != "" {
+		dao.Db.Model(&entity.Product{}).Where("enterprise_id = ? sub_account_id = ? and product_type = ? AND is_deleted = 0 and product_name LIKE ?", param.EnterpriseId, param.SubAccountId, 0, "%"+param.ProductTitle+"%").Count(&commonProduct)
+		dao.Db.Model(&entity.Product{}).Where("enterprise_id = ? sub_account_id = ? and product_type = ? AND is_deleted = 0 and product_name LIKE ?", param.EnterpriseId, param.SubAccountId, 1, "%"+param.ProductTitle+"%").Count(&kuaishouProduct)
+
+	} else {
+		dao.Db.Model(&entity.Product{}).Where("enterprise_id = ? sub_account_id = ? and product_type = ? AND is_deleted = 0", param.EnterpriseId, param.SubAccountId, 0).Count(&commonProduct)
+		dao.Db.Model(&entity.Product{}).Where("enterprise_id = ? sub_account_id = ? and product_type = ? AND is_deleted = 0", param.EnterpriseId, param.SubAccountId, 1).Count(&kuaishouProduct)
+
+	}
+	res["commonProduct"] = commonProduct
+	res["kuaishouProduct"] = kuaishouProduct
+
+	return res
+}
+
 // 获取商品类目
 func (p ProductService) GetProductCategorys() ([]string, error) {
 	var categorys []string

+ 4 - 4
app/service/project_service.go

@@ -143,8 +143,8 @@ func (s ProjectService) CreateProject(projectCreateParam *vo.ProjectCreateParam)
 				totalRecruitNum += strategy.RecruitNumber
 				if strategy.FeeForm == 2 {
 					recruitStrategy.Offer = strategy.Offer
-					recruitStrategy.ServiceCharge = strategy.Offer * projectCreateParam.ServiceChargeRate
-					recruitStrategy.TOffer = strategy.Offer * (1 - projectCreateParam.ServiceChargeRate)
+					recruitStrategy.ServiceCharge = strategy.Offer * projectCreateParam.ServiceChargeRate * 0.01
+					recruitStrategy.TOffer = strategy.Offer * (1 - projectCreateParam.ServiceChargeRate*0.01)
 				}
 				recruits = append(recruits, recruitStrategy)
 			}
@@ -207,8 +207,8 @@ func (s ProjectService) UpdateProject(projectUpdateParam *vo.ProjectUpdateParam)
 				totalRecruitNum += strategy.RecruitNumber
 				if strategy.FeeForm == 2 {
 					recruitStrategy.Offer = strategy.Offer
-					recruitStrategy.ServiceCharge = strategy.Offer * projectUpdateParam.ServiceChargeRate
-					recruitStrategy.TOffer = strategy.Offer * (1 - projectUpdateParam.ServiceChargeRate)
+					recruitStrategy.ServiceCharge = strategy.Offer * projectUpdateParam.ServiceChargeRate * 0.01
+					recruitStrategy.TOffer = strategy.Offer * (1 - projectUpdateParam.ServiceChargeRate*0.01)
 				}
 				recruits = append(recruits, recruitStrategy)
 			}

+ 42 - 6
app/service/recharge_service.go

@@ -339,6 +339,26 @@ func (s RechargeService) FrozenInfoList(param *vo.BalanceParam) (vo.ResultVO, er
 	return result, nil
 }
 
+// 余额管理——冻结记录-角标
+func (t RechargeService) FrozenInfoCount(param *vo.BalanceParam) map[string]int64 {
+	res := make(map[string]int64)
+	var blockNum1 int64
+	var blockNum2 int64
+	var blockReleaseNum1 int64
+	var blockReleaseNum2 int64
+	// 冻结中
+	dao.Db.Model(entity.SelectionInfo{}).Where(fmt.Sprintf("enterprise_id = ? AND (selection_status between 5 and 6) "), param.EnterpriseId).Count(&blockNum1)
+	dao.Db.Model(entity.Project{}).Where(fmt.Sprintf("enterprise_id = ? AND (project_status between 7 and 8) "), param.EnterpriseId).Count(&blockNum2)
+	// 冻结解除
+	dao.Db.Model(entity.SelectionInfo{}).Where(fmt.Sprintf("enterprise_id = ? AND (selection_status between 7 and 8) "), param.EnterpriseId).Count(&blockReleaseNum1)
+	dao.Db.Model(entity.Project{}).Where(fmt.Sprintf("enterprise_id = ? AND (project_status between 9 and 10) "), param.EnterpriseId).Count(&blockReleaseNum2)
+
+	res["blockNum"] = blockNum1 + blockNum2
+	res["blockReleaseNum"] = blockReleaseNum1 + blockReleaseNum2
+
+	return res
+}
+
 // 充值管理——累计充值金额、确认中金额
 func (s RechargeService) ShowRecharge(param *vo.RechargeParam) (*vo.ReRechargeShow, error) {
 	reRechargeShow := new(vo.ReRechargeShow)
@@ -393,13 +413,13 @@ func (s RechargeService) RechargeInfoList(param *vo.RechargeParam) (vo.ResultVO,
 		}
 		reRechargeInfos = append(reRechargeInfos, reRechargeInfo)
 	}
-	rechargingNum, _ := dao.RechargeRecordDao{}.RechargeStatusCount(param.EnterpriseId, 1)
-	rechargedNum, _ := dao.RechargeRecordDao{}.RechargeStatusCount(param.EnterpriseId, 2)
-	failNum, _ := dao.RechargeRecordDao{}.RechargeStatusCount(param.EnterpriseId, 3)
+	//rechargingNum, _ := dao.RechargeRecordDao{}.RechargeStatusCount(param.EnterpriseId, 1)
+	//rechargedNum, _ := dao.RechargeRecordDao{}.RechargeStatusCount(param.EnterpriseId, 2)
+	//failNum, _ := dao.RechargeRecordDao{}.RechargeStatusCount(param.EnterpriseId, 3)
 	resMap := make(map[string]interface{})
-	resMap["rechargingNum"] = rechargingNum
-	resMap["rechargedNum"] = rechargedNum
-	resMap["failNum"] = failNum
+	//resMap["rechargingNum"] = rechargingNum
+	//resMap["rechargedNum"] = rechargedNum
+	//resMap["failNum"] = failNum
 	resMap["reRechargeInfos"] = reRechargeInfos
 	result = vo.ResultVO{
 		Page:     param.Page,
@@ -410,6 +430,22 @@ func (s RechargeService) RechargeInfoList(param *vo.RechargeParam) (vo.ResultVO,
 	return result, nil
 }
 
+// 余额管理——冻结记录-角标
+func (t RechargeService) RechargeInfoCount(param *vo.RechargeParam) map[string]int64 {
+	res := make(map[string]int64)
+	var rechargeConfirming int64
+	var recharged int64
+	var rechargeFail int64
+	dao.Db.Model(&entity.RechargeRecord{}).Where("enterprise_id = ? AND status = ?", param.EnterpriseId, 1).Count(&rechargeConfirming)
+	dao.Db.Model(&entity.RechargeRecord{}).Where("enterprise_id = ? AND status = ?", param.EnterpriseId, 2).Count(&recharged)
+	dao.Db.Model(&entity.RechargeRecord{}).Where("enterprise_id = ? AND status = ?", param.EnterpriseId, 3).Count(&rechargeFail)
+	res["rechargeConfirming"] = rechargeConfirming
+	res["recharged"] = recharged
+	res["rechargeFail"] = rechargeFail
+
+	return res
+}
+
 // 财务待办——充值确认中金额
 func (s RechargeService) GetFinance(param *vo.CommonParam) (float64, error) {
 	confirmingRecharge, err := dao.RechargeRecordDao{}.GetRechargeAmount(param.EnterpriseId, 1)

+ 17 - 1
app/service/selection_info_service.go

@@ -881,7 +881,7 @@ func (s SelectionInfoService) GetSelectionTaskList(param *vo.SelectionSearchPara
 func (s SelectionInfoService) DeleteSelection(selectionId string) (*string, error) {
 	res, err := dao.SelectionInfoDAO{}.DeleteSelection(selectionId)
 	if err != nil {
-		logrus.Errorf("[projectDB service] call DeleteSelection error,err:%+v", err)
+		logrus.Errorf("[selectionDB service] call DeleteSelection error,err:%+v", err)
 		return res, err
 	}
 	return res, nil
@@ -897,6 +897,22 @@ func (s SelectionInfoService) CloseSelection(selectionId string) (*string, error
 	return &selectionId, err
 }
 
+// 电商带货选达人角标 未处理、同意合作、拒绝合作
+func (s SelectionInfoService) SelectionTalentCount(selectionId string) map[string]int64 {
+	res := make(map[string]int64)
+	var unhandledNum int64
+	var agreeNum int64
+	var refuseNum int64
+	dao.Db.Model(&entity.SelectionTaskInfo{}).Where("selection_id = ? AND free_stage in ?", selectionId, []int{1}).Count(&unhandledNum)
+	dao.Db.Model(&entity.ProjectTaskInfo{}).Where("selection_id = ? AND free_stage in ?", selectionId, []int{3, 4, 5}).Count(&agreeNum)
+	dao.Db.Model(&entity.ProjectTaskInfo{}).Where("selection_id = ? AND free_stage in ?", selectionId, []int{2}).Count(&refuseNum)
+	res["unhandledNum"] = unhandledNum
+	res["agreeNum"] = agreeNum
+	res["refuseNum"] = refuseNum
+
+	return res
+}
+
 // 草稿箱——电商带货
 func (s SelectionInfoService) GetSelectionDraftList(param *vo.SelectionDraftParam) (vo.ResultVO, error) {
 	if param.Page == 0 {

+ 36 - 3
app/service/task_info_service.go

@@ -8,6 +8,22 @@ import (
 
 type TaskInfoService struct{}
 
+// 带货待发货、待签收、已签收统计
+func (t TaskInfoService) LogisticsSelectionTalentCount(param *vo.LogisticsSelectionTalentParam) map[string]int64 {
+	res := make(map[string]int64)
+	var needDelivery int64
+	var needReceive int64
+	var received int64
+	dao.Db.Model(&entity.SelectionTaskInfo{}).Where("selection_id = ? AND free_stage = ?", param.SelectionId, 3).Count(&needDelivery)
+	dao.Db.Model(&entity.SelectionTaskInfo{}).Where("selection_id = ? AND free_stage = ?", param.SelectionId, 4).Count(&needReceive)
+	dao.Db.Model(&entity.SelectionTaskInfo{}).Where("selection_id = ? AND free_stage = ?", param.SelectionId, 5).Count(&received)
+	res["needDelivery"] = needDelivery
+	res["needReceive"] = needReceive
+	res["received"] = received
+
+	return res
+}
+
 // 达人物流管理
 func (t TaskInfoService) LogisticsTalentList(param *vo.LogisticsTalentParam) (*vo.ResultVO, error) {
 	if param.Page <= 0 {
@@ -28,11 +44,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, "", param.Page, param.PageSize)
+		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTaskStage(projectId, 4, "", param.Page, param.PageSize, param.Nickname)
 	} 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, param.Nickname)
 	} else if param.Status == 3 { // 已签收
-		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTaskStage(projectId, 6, "", param.Page, param.PageSize)
+		projectTaskInfos, total, err = dao.ProjectTaskInfoDao{}.GetListByTaskStage(projectId, 6, "", param.Page, param.PageSize, param.Nickname)
 	}
 	if err != nil {
 		return nil, err
@@ -57,6 +73,7 @@ func (t TaskInfoService) LogisticsTalentList(param *vo.LogisticsTalentParam) (*v
 			TalentName:  talentInfo.TalentWxNickname,
 			Account:     "",
 			Location:    regionName,
+			Gender:      talentInfo.Sex,
 		}
 		reLogisticsTalent := &vo.ReLogisticsTalent{
 			TalentPostAddrSnap: projectTaskInfo.TalentPostAddrSnap,
@@ -85,6 +102,22 @@ func (t TaskInfoService) LogisticsTalentList(param *vo.LogisticsTalentParam) (*v
 	return &result, nil
 }
 
+// 种草待发货、待签收、已签收统计
+func (t TaskInfoService) LogisticsTalentCount(param *vo.LogisticsTalentParam) map[string]int64 {
+	res := make(map[string]int64)
+	var needDelivery int64
+	var needReceive int64
+	var received int64
+	dao.Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.ProjectId, 4).Count(&needDelivery)
+	dao.Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.ProjectId, 5).Count(&needReceive)
+	dao.Db.Model(&entity.ProjectTaskInfo{}).Where("project_id = ? AND task_stage = ?", param.ProjectId, 6).Count(&received)
+	res["needDelivery"] = needDelivery
+	res["needReceive"] = needReceive
+	res["received"] = received
+
+	return res
+}
+
 func (t TaskInfoService) SelectionRewardCashDetail(param *vo.SelectionRewardCashParam) (*vo.ReSelectionRewardCash, error) {
 	if param.Page == 0 {
 		param.Page = 1

+ 2 - 2
app/vo/default_search_param.go

@@ -6,10 +6,10 @@ type DefaultSearchParam struct {
 	Page         int    `json:"page"`
 	PageSize     int    `json:"page_size"`
 	Platform     int64  `json:"platform"`
-	ProjectType  int64  `json:"project_type"` // 任务类型,0全部 1品牌种草,2本地生活
+	TaskType     int64  `json:"task_type"`    // 任务类型,0全部 1品牌种草,2本地生活
 	DefaultType  int64  `json:"default_type"` // 违约类型 1未传初稿 2未发作品 3未传数据 4终止合作 5已解约
+	Others       string `json:"others"`       // 任务标题/任务ID/创建者
 
 	TaskId     string `json:"task_id"`     // 任务ID
-	Others     string `json:"others"`      // 任务标题/任务ID/创建者
 	TalentName string `json:"talent_name"` // 达人昵称
 }

+ 1 - 1
app/vo/local_draft_param.go

@@ -8,5 +8,5 @@ type LocalDraftParam struct {
 	LocalPlatform int64  `json:"local_platform"` // 平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
 	LocalType     int64  `json:"local_type"`     // 项目类型 1全流程 2专项
 
-	//ProjectId string `json:"project_id"` // 任务ID
+	Others string `json:"others"` // 任务标题/任务ID/创建者
 }

+ 10 - 0
app/vo/logistics_selection_talent_param.go

@@ -0,0 +1,10 @@
+package vo
+
+type LogisticsSelectionTalentParam struct {
+	SelectionId  string `json:"selection_id"`
+	Status       int64  `json:"status"`        // 1待发货 2待签收 3已签收
+	DeliveryTime string `json:"delivery_time"` // 发货时间
+	Nickname     string `json:"nickname"`      // 达人昵称
+	Page         int    `json:"page"`
+	PageSize     int    `json:"page_size"`
+}

+ 3 - 3
app/vo/logistics_talent_param.go

@@ -4,7 +4,7 @@ type LogisticsTalentParam struct {
 	ProjectId    string `json:"project_id"`
 	Status       int64  `json:"status"`        // 1待发货 2待签收 3已签收
 	DeliveryTime string `json:"delivery_time"` // 发货时间
-	//Nickname  string `json:"nickname"` // 达人昵称
-	Page     int `json:"page"`
-	PageSize int `json:"page_size"`
+	Nickname     string `json:"nickname"`      // 达人昵称
+	Page         int    `json:"page"`
+	PageSize     int    `json:"page_size"`
 }

+ 1 - 1
app/vo/project_draft_param.go

@@ -8,5 +8,5 @@ type ProjectDraftParam struct {
 	ProjectPlatform int64  `json:"project_platform"` // 平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
 	ProjectType     int64  `json:"project_type"`     // 项目类型 1全流程 2专项
 
-	//ProjectId string `json:"project_id"` // 任务ID
+	Others string `json:"others"` // 任务标题/任务ID/创建者
 }

+ 1 - 0
app/vo/re_logistics_talent.go

@@ -17,4 +17,5 @@ type TalentPreview struct {
 	TalentName  string `json:"talentName"`
 	Account     string `json:"account"`
 	Location    string `json:"location"`
+	Gender      int64  `json:"gender"`
 }

+ 4 - 2
app/vo/re_talent_default.go

@@ -6,11 +6,13 @@ type ReTalentDefault struct {
 	NickName     string  `json:"nickName"`
 	HeadUri      string  `json:"headUri"`
 	City         string  `json:"city"`
+	Gender       int64   `json:"gender"`       // 0未知 1男 2女
 	TalentPhone  string  `json:"talentPhone"`  // 表youngee_talent_info
 	TaskId       string  `json:"taskId"`       // 任务id
 	DraftFee     float64 `json:"draftFee"`     // 稿费价格
 	SettleAmount float64 `json:"settleAmount"` // 结算金额
 	DefaultTime  string  `json:"defaultTime"`  // 违约时间
-	Reason       string  `json:"reason"`       // 终止理由或解约原因
-	OperatorName string  `json:"operatorName"` // 操作人
+
+	Reason       string `json:"reason"`       // 终止理由或解约原因
+	OperatorName string `json:"operatorName"` // 操作人
 }

+ 5 - 0
app/vo/re_task_default_public.go

@@ -6,6 +6,11 @@ type ReTaskDefaultPublic struct {
 	ProductName  string  `json:"productName"`
 	ProductPrice float64 `json:"productPrice"`
 
+	StoreName     string `json:"storeName"`
+	StoreLocation string `json:"storeLocation"`
+	StoreId       int64  `json:"storeId"`
+	TeamBuyingId  int64  `json:"teamBuyingId"`
+
 	EnterpriseId      string `json:"enterpriseId"`
 	SubAccountId      int64  `json:"subAccountId"`
 	TaskId            string `json:"taskId"`

+ 1 - 1
app/vo/selection_draft_param.go

@@ -7,5 +7,5 @@ type SelectionDraftParam struct {
 	PageSize          int    `json:"page_size"`
 	SelectionPlatform int64  `json:"selection_platform"` // 平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
 
-	//SelectionId string `json:"selection_id"` // 任务ID
+	Others string `json:"others"` // 任务标题/任务ID/创建者
 }

+ 8 - 6
model/http_model/GetSecTaskList.go

@@ -8,12 +8,14 @@ type GetSecTaskListRequest struct {
 	SelectionId   string `json:"selection_id"`
 	SecTaskStatus int    `json:"sec_task_status"`
 	SearchValue   string `json:"search_value"`
-	Type          int    `json:"type"` // 查询类型,1、2、3分别表示确定达人查询、发货管理查询、结算管理查询
-	TaskStage     int    `json:"sec_task_stage"`
-	FreeStage     int    `json:"free_stage"`   // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货
-	RewardStage   int    `json:"reward_stage"` // 悬赏阶段,1-2分别代表待结算(管理后台设置)、已结算(小程序端设置)
-	SaleNumMin    int    `json:"sale_num_min"` // 30天橱窗销量区间最小值
-	SaleNumMax    int    `json:"sale_num_max"` // 30天橱窗销量区间最大值
+	Type          int    `json:"type"`           // 查询类型,1、2、3分别表示确定达人查询、发货管理查询、结算管理查询
+	TaskStage     int    `json:"sec_task_stage"` // 查询条件
+	FreeStage     int    `json:"free_stage"`     // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货
+	RewardStage   int    `json:"reward_stage"`   // 悬赏阶段,1-2分别代表待结算(管理后台设置)、已结算(小程序端设置)
+	SaleNumMin    int    `json:"sale_num_min"`   // 30天橱窗销量区间最小值
+	SaleNumMax    int    `json:"sale_num_max"`   // 30天橱窗销量区间最大值
+	OrderBy       string `json:"order_by"`       // 排序条件
+	OrderDesc     int    `json:"order_desc"`     // 是否降序
 }
 
 type GetSecTaskListData struct {

+ 32 - 21
route/init.go

@@ -189,14 +189,16 @@ func InitRoute(r *gin.Engine) {
 		task.POST("/product/findAll", controller.TaskController{}.GetAllProduct) // 关联商品-已有商品展示
 		task.POST("/product/create", controller.TaskController{}.CreateProduct)  // 关联商品-新建商品
 
-		task.POST("/selection/create", controller.TaskController{}.CreateSelection)             // 创建带货任务
-		task.POST("/selection/update", controller.TaskController{}.UpdateSelection)             // 更新带货任务(样品奖励、补充信息)
-		task.POST("/selection/detail", controller.TaskController{}.GetSelectionDetail)          // 电商带货任务预览
-		task.POST("/selection/copy", controller.TaskController{}.CopySelection)                 // 电商带货复制任务(获取原任务-创建任务)
-		task.POST("/selection/toReview", controller.TaskController{}.SelectionToReview)         // 电商带货提交审核
-		task.POST("/selection/task/list", controller.TaskController{}.SelectionTaskList)        // 电商带货任务列表
-		task.POST("/selection/del", controller.TaskController{}.SelectionDel)                   // 删除带货任务
-		task.POST("/selection/close", controller.TaskController{}.SelectionClose)               // 结束带货任务
+		task.POST("/selection/create", controller.TaskController{}.CreateSelection)      // 创建带货任务
+		task.POST("/selection/update", controller.TaskController{}.UpdateSelection)      // 更新带货任务(样品奖励、补充信息)
+		task.POST("/selection/detail", controller.TaskController{}.GetSelectionDetail)   // 电商带货任务预览
+		task.POST("/selection/copy", controller.TaskController{}.CopySelection)          // 电商带货复制任务(获取原任务-创建任务)
+		task.POST("/selection/toReview", controller.TaskController{}.SelectionToReview)  // 电商带货提交审核
+		task.POST("/selection/task/list", controller.TaskController{}.SelectionTaskList) // 电商带货任务列表
+		task.POST("/selection/del", controller.TaskController{}.SelectionDel)            // 删除带货任务
+		task.POST("/selection/close", controller.TaskController{}.SelectionClose)        // 结束带货任务
+		// 电商带货选达人列表 见/youngee/b/selection/task/list
+		task.POST("/selection/talent/count", controller.TaskController{}.SelectionTalentCount)  // 电商带货选达人角标
 		task.POST("/selection/data/talent", controller.TaskController{}.TalentDataDetail)       // 电商带货看数据-达人数据
 		task.POST("/selection/data/sample", controller.TaskController{}.SampleDataDetail)       // 电商带货看数据-领样数据
 		task.POST("/selection/data/selection", controller.TaskController{}.SelectionDataDetail) // 电商带货看数据-带货数据
@@ -296,25 +298,30 @@ func InitRoute(r *gin.Engine) {
 		task.POST("/draft/localLife/list", controller.TaskController{}.GetLocalLifeDraftList) // 草稿箱——本地生活列表
 
 		// 违约管理
-		task.POST("/default/public/list", controller.TaskController{}.GetPublicDefaultList)              // 违约管理——公开任务列表
-		task.POST("/default/public/talent/list", controller.TaskController{}.GetPublicDefaultTalentList) // 违约管理——公开任务-违约达人列表
-		task.POST("/default/target/list", controller.TaskController{}.GetTargetDefaultList)              // 违约管理——定向任务列表
-		task.POST("/default/target/talent/list", controller.TaskController{}.GetTargetDefaultTalentList) // 违约管理——定向任务-违约达人列表
-		task.POST("/default/talent/cancel", controller.TaskController{}.CancelTalent)                    // 违约管理——达人解约
-		task.POST("/default/talent/cancel/list", controller.TaskController{}.CancelTalentList)           // 违约管理——达人批量解约
+		task.POST("/default/public/list", controller.TaskController{}.GetPublicDefaultList)                // 违约管理——公开任务列表
+		task.POST("/default/public/talent/list", controller.TaskController{}.GetPublicDefaultTalentList)   // 违约管理——公开任务-违约达人列表
+		task.POST("/default/public/talent/count", controller.TaskController{}.GetPublicDefaultTalentCount) // 违约管理——公开任务-违约达人列表角标
+		task.POST("/default/target/list", controller.TaskController{}.GetTargetDefaultList)                // 违约管理——定向任务列表
+		task.POST("/default/target/talent/list", controller.TaskController{}.GetTargetDefaultTalentList)   // 违约管理——定向任务-违约达人列表
+		task.POST("/default/talent/cancel", controller.TaskController{}.CancelTalent)                      // 违约管理——达人解约
+		task.POST("/default/talent/cancel/list", controller.TaskController{}.CancelTalentList)             // 违约管理——达人批量解约
 
 		// 寄样管理
-		task.POST("/logistics/talent/list", controller.TaskController{}.LogisticsTalentList) // 达人物流列表
+		task.POST("/logistics/selection/talent/count", controller.TaskController{}.LogisticsSelectionTalentCount) // 带货待发货、待签收、已签收角标
+		task.POST("/logistics/talent/list", controller.TaskController{}.LogisticsTalentList)                      // 种草达人物流列表
+		task.POST("/logistics/talent/count", controller.TaskController{}.LogisticsTalentCount)                    // 种草待发货、待签收、已签收角标
 
 		// 探店管理
-		task.POST("/store/explore/list", controller.TaskController{}.StoreExploreList)       // 探店本地生活列表
-		task.POST("/store/explore/info", controller.TaskController{}.StoreExploreInfo)       // 探店达人详情
-		task.POST("/store/explore/over", controller.TaskController{}.StoreExploreOver)       // 终止合作
-		task.POST("/store/explore/operate", controller.TaskController{}.StoreExploreOperate) // 预约时间批量同意/驳回
+		task.POST("/store/explore/list", controller.TaskController{}.StoreExploreList)            // 探店本地生活列表
+		task.POST("/store/explore/info", controller.TaskController{}.StoreExploreInfo)            // 探店达人列表
+		task.POST("/store/explore/info/count", controller.TaskController{}.StoreExploreInfoCount) // 探店达人列表角标
+		task.POST("/store/explore/over", controller.TaskController{}.StoreExploreOver)            // 终止合作
+		task.POST("/store/explore/operate", controller.TaskController{}.StoreExploreOperate)      // 预约时间批量同意/驳回
 
 		// 服务商合作(其中品牌种草、本地生活列表限制类型为定向即可)
-		task.POST("/supplier/list", controller.TaskController{}.GetSupplierInTargetTaskList) // 服务商合作-服务商列表
-		task.POST("/supplier/invite", controller.TaskController{}.InviteSupplier)            // 服务商合作-邀约合作
+		task.POST("/supplier/list", controller.TaskController{}.GetSupplierInTargetTaskList)    // 服务商合作-服务商列表
+		task.POST("/supplier/list/count", controller.TaskController{}.GetSupplierInTargetCount) // 服务商合作-服务商列表角标
+		task.POST("/supplier/invite", controller.TaskController{}.InviteSupplier)               // 服务商合作-邀约合作
 	}
 	// 财务结算相关接口
 	finance := r.Group("/youngee/b/finance")
@@ -325,8 +332,10 @@ func InitRoute(r *gin.Engine) {
 		finance.POST("/pay/queryOrderByTradeId", controller.FinanceController{}.QueryOrderByTradeId) // 根据交易id查询微信是否扫码付款
 		finance.POST("/balance/show", controller.FinanceController{}.ShowBalance)                    // 余额管理——总金额、可用余额、冻结金额
 		finance.POST("/balance/frozen/info", controller.FinanceController{}.FrozenInfoList)          // 余额管理——冻结记录
+		finance.POST("/balance/frozen/count", controller.FinanceController{}.FrozenInfoCount)        // 余额管理——冻结记录-角标
 		finance.POST("/recharge/show", controller.FinanceController{}.ShowRecharge)                  // 充值管理——累计充值金额、确认中金额
 		finance.POST("/recharge/info", controller.FinanceController{}.RechargeInfoList)              // 充值管理——充值记录
+		finance.POST("/recharge/count", controller.FinanceController{}.RechargeInfoCount)            // 充值管理——充值记录-角标
 		// YG官方汇款账号
 
 		finance.POST("/invoice/default/update", controller.FinanceController{}.UpdateInvoiceDefault) // 设置默认开票抬头
@@ -352,6 +361,7 @@ func InitRoute(r *gin.Engine) {
 		cooperation.POST("/invite", controller.CooperationController{}.InviteSupplier)                // 服务商入库批量邀请
 		cooperation.POST("/inPool", controller.CooperationController{}.GetEnterprisePoolList)         // 在库服务商列表
 		cooperation.POST("/confirming", controller.CooperationController{}.GetSupplierConfirmingList) // 邀请待确认服务商列表
+		cooperation.POST("/count", controller.CooperationController{}.GetSupplierCount)               // 服务商管理-角标
 	}
 	// 推广合作-商品管理相关接口
 	product := r.Group("/youngee/b/cooperation/product")
@@ -360,6 +370,7 @@ func InitRoute(r *gin.Engine) {
 		product.POST("/detail", controller.CooperationController{}.GetProductDetail) // 商品详情
 		product.POST("/update", controller.CooperationController{}.UpdateProduct)    // 更新商品
 		product.POST("/del", controller.CooperationController{}.DeleteProduct)       // 删除商品
+		product.POST("/count", controller.CooperationController{}.CountProduct)      // 商品列表-角标
 	}
 	// 推广合作-门店管理相关接口
 	store := r.Group("/youngee/b/cooperation/store")