|
@@ -359,6 +359,181 @@ func (s BillService) GetBillLocalSupplierList(param *vo.SearchSupplierBillParam)
|
|
|
return result, nil
|
|
|
}
|
|
|
|
|
|
+// 品牌种草账单达人列表
|
|
|
+func (s BillService) GetBillProjectTalentList(param *vo.SearchTalentBillParam) (vo.ResultVO, error) {
|
|
|
+ if param.Page == 0 {
|
|
|
+ param.Page = 1
|
|
|
+ }
|
|
|
+ if param.PageSize == 0 {
|
|
|
+ param.PageSize = 10
|
|
|
+ }
|
|
|
+ var result vo.ResultVO
|
|
|
+ var reBillTalents []vo.ReBillTalent
|
|
|
+ var stage int64
|
|
|
+ if param.Status == 1 {
|
|
|
+ stage = 15
|
|
|
+ } else if param.Status == 2 {
|
|
|
+ stage = 15
|
|
|
+ }
|
|
|
+ taskInfos, total, err := dao.ProjectTaskInfoDao{}.GetListByTaskStage2(param.TaskId, stage, param.Page, param.PageSize, param.Others)
|
|
|
+ if err != nil {
|
|
|
+ return result, err
|
|
|
+ }
|
|
|
+ for _, taskInfo := range taskInfos {
|
|
|
+ talentId := taskInfo.TalentID
|
|
|
+ talentInfo, _ := dao.TalentInfoDao{}.GetTalentInfo(talentId)
|
|
|
+ platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.GetUserInfo(taskInfo.OpenID)
|
|
|
+ reBillTalent := vo.ReBillTalent{
|
|
|
+ TalentId: talentId,
|
|
|
+ OpenId: platformKuaishouUserInfo.OpenID,
|
|
|
+ PlatformId: platformKuaishouUserInfo.PlatformID,
|
|
|
+ NickName: talentInfo.TalentNickname,
|
|
|
+ HeadUri: platformKuaishouUserInfo.HeadUri,
|
|
|
+ City: platformKuaishouUserInfo.City,
|
|
|
+ Gender: platformKuaishouUserInfo.Gender,
|
|
|
+ ViewNum: taskInfo.ViewNum,
|
|
|
+ VoteAvg: taskInfo.VoteAvg,
|
|
|
+ CollectNum: taskInfo.CollectNum,
|
|
|
+ CommitAvg: taskInfo.CommitAvg,
|
|
|
+ ChargeActual: taskInfo.RealPayment,
|
|
|
+ ChargeSettle: taskInfo.SettleAmount,
|
|
|
+ SettleTime: taskInfo.CompleteDate.Format("2006-01-02 15:04:05"),
|
|
|
+ }
|
|
|
+ if taskInfo.SupplierId == 0 {
|
|
|
+ reBillTalent.TalentSource = "公海"
|
|
|
+ } else {
|
|
|
+ reBillTalent.TalentSource = taskInfo.SOperateName
|
|
|
+ }
|
|
|
+ reBillTalents = append(reBillTalents, reBillTalent)
|
|
|
+ }
|
|
|
+ result = vo.ResultVO{
|
|
|
+ Page: param.Page,
|
|
|
+ PageSize: param.PageSize,
|
|
|
+ Total: total,
|
|
|
+ Data: reBillTalents,
|
|
|
+ }
|
|
|
+ return result, nil
|
|
|
+}
|
|
|
+
|
|
|
+// 本地生活账单达人列表
|
|
|
+func (s BillService) GetBillLocalTalentList(param *vo.SearchTalentBillParam) (vo.ResultVO, error) {
|
|
|
+ if param.Page == 0 {
|
|
|
+ param.Page = 1
|
|
|
+ }
|
|
|
+ if param.PageSize == 0 {
|
|
|
+ param.PageSize = 10
|
|
|
+ }
|
|
|
+ var result vo.ResultVO
|
|
|
+ var reBillTalents []vo.ReBillTalent
|
|
|
+ var stage int64
|
|
|
+ if param.Status == 1 {
|
|
|
+ stage = 15
|
|
|
+ } else if param.Status == 2 {
|
|
|
+ stage = 15
|
|
|
+ }
|
|
|
+ taskInfos, total, err := dao.LocalLifeTaskInfoDao{}.GetListByTaskStage2(param.TaskId, stage, param.Page, param.PageSize, param.Others)
|
|
|
+ if err != nil {
|
|
|
+ return result, err
|
|
|
+ }
|
|
|
+ for _, taskInfo := range taskInfos {
|
|
|
+ talentId := taskInfo.TalentID
|
|
|
+ talentInfo, _ := dao.TalentInfoDao{}.GetTalentInfo(talentId)
|
|
|
+ platformKuaishouUserInfo, _ := dao.PlatformKuaishouUserInfoDao{}.GetUserInfo(taskInfo.OpenID)
|
|
|
+ reBillTalent := vo.ReBillTalent{
|
|
|
+ TalentId: talentId,
|
|
|
+ OpenId: platformKuaishouUserInfo.OpenID,
|
|
|
+ PlatformId: platformKuaishouUserInfo.PlatformID,
|
|
|
+ NickName: talentInfo.TalentNickname,
|
|
|
+ HeadUri: platformKuaishouUserInfo.HeadUri,
|
|
|
+ City: platformKuaishouUserInfo.City,
|
|
|
+ Gender: platformKuaishouUserInfo.Gender,
|
|
|
+ ViewNum: taskInfo.ViewNum,
|
|
|
+ VoteAvg: taskInfo.VoteAvg,
|
|
|
+ CollectNum: taskInfo.CollectNum,
|
|
|
+ CommitAvg: taskInfo.CommitAvg,
|
|
|
+ ChargeActual: taskInfo.RealPayment,
|
|
|
+ ChargeSettle: taskInfo.SettleAmount,
|
|
|
+ SettleTime: taskInfo.CompleteDate.Format("2006-01-02 15:04:05"),
|
|
|
+ }
|
|
|
+ if taskInfo.SupplierID == 0 {
|
|
|
+ reBillTalent.TalentSource = "公海"
|
|
|
+ } else {
|
|
|
+ reBillTalent.TalentSource = taskInfo.SOperateName
|
|
|
+ }
|
|
|
+ reBillTalents = append(reBillTalents, reBillTalent)
|
|
|
+ }
|
|
|
+ result = vo.ResultVO{
|
|
|
+ Page: param.Page,
|
|
|
+ PageSize: param.PageSize,
|
|
|
+ Total: total,
|
|
|
+ Data: reBillTalents,
|
|
|
+ }
|
|
|
+ return result, nil
|
|
|
+}
|
|
|
+
|
|
|
+// 账单查询-顶部数据预览
|
|
|
+func (s BillService) GetBillPreview(param *vo.SearchTalentBillParam) (vo.ReBillDataPreview, error) {
|
|
|
+ var reBillDataPreview vo.ReBillDataPreview
|
|
|
+ if param.Task == 2 {
|
|
|
+ project, err := dao.ProjectDAO{}.GetProjectById(param.TaskId)
|
|
|
+ if err != nil {
|
|
|
+ return reBillDataPreview, err
|
|
|
+ }
|
|
|
+ if project == nil {
|
|
|
+ return reBillDataPreview, nil
|
|
|
+ }
|
|
|
+ var talentTotalAmount, supplierTotalAmount float64
|
|
|
+ taskInfos, _, err2 := dao.ProjectTaskInfoDao{}.GetListByTaskStage2(param.TaskId, 15, param.Page, param.PageSize, "")
|
|
|
+ if err2 != nil || len(taskInfos) == 0 {
|
|
|
+ talentTotalAmount = 0.0
|
|
|
+ supplierTotalAmount = 0.0
|
|
|
+ }
|
|
|
+ for _, taskInfo := range taskInfos {
|
|
|
+ if taskInfo.SupplierId == 0 {
|
|
|
+ talentTotalAmount += taskInfo.SettleAmount
|
|
|
+ } else {
|
|
|
+ supplierTotalAmount += taskInfo.RealServiceCharge
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reBillDataPreview = vo.ReBillDataPreview{
|
|
|
+ FrozenTotalAmount: project.NeedPay,
|
|
|
+ SettleTotalAmount: project.SettlementAmount,
|
|
|
+ TalentNum: project.SettleNum,
|
|
|
+ TalentTotalAmount: talentTotalAmount,
|
|
|
+ SupplierTotalAmount: supplierTotalAmount,
|
|
|
+ }
|
|
|
+ } else if param.Task == 3 {
|
|
|
+ local, err := dao.LocalLifeDao{}.GetLocalById(param.TaskId)
|
|
|
+ if err != nil {
|
|
|
+ return reBillDataPreview, err
|
|
|
+ }
|
|
|
+ if local == nil {
|
|
|
+ return reBillDataPreview, nil
|
|
|
+ }
|
|
|
+ var talentTotalAmount, supplierTotalAmount float64
|
|
|
+ taskInfos, _, err2 := dao.LocalLifeTaskInfoDao{}.GetListByTaskStage2(param.TaskId, 15, param.Page, param.PageSize, "")
|
|
|
+ if err2 != nil || len(taskInfos) == 0 {
|
|
|
+ talentTotalAmount = 0.0
|
|
|
+ supplierTotalAmount = 0.0
|
|
|
+ }
|
|
|
+ for _, taskInfo := range taskInfos {
|
|
|
+ if taskInfo.SupplierID == 0 {
|
|
|
+ talentTotalAmount += taskInfo.SettleAmount
|
|
|
+ } else {
|
|
|
+ supplierTotalAmount += taskInfo.RealServiceCharge
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reBillDataPreview = vo.ReBillDataPreview{
|
|
|
+ FrozenTotalAmount: local.NeedPay,
|
|
|
+ SettleTotalAmount: local.SettlementAmount,
|
|
|
+ TalentNum: local.SettleNum,
|
|
|
+ TalentTotalAmount: talentTotalAmount,
|
|
|
+ SupplierTotalAmount: supplierTotalAmount,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return reBillDataPreview, nil
|
|
|
+}
|
|
|
+
|
|
|
// 本地生活账单列表
|
|
|
func (s BillService) GetBillLocalLifeTaskList(param *vo.LocalSearchParam) (vo.ResultVO, error) {
|
|
|
if param.Page == 0 {
|