|
@@ -392,3 +392,114 @@ func (*sLocalLife) CreateSpecialStrategy(ctx context.Context, request *http_mode
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
+
|
|
|
+// GetFullSLocalBillList 服务商本地生活任务账单列表
|
|
|
+func (*sLocalLife) GetFullSLocalBillList(ctx context.Context, req *http_model.FullSLocalBillListRequest) (*http_model.FullSLocalBillData, error) {
|
|
|
+
|
|
|
+ // 1. 查询本地生活任务基本信息
|
|
|
+ fullLocals, total, err := db.GetFullSLocalBillList(ctx, req.PageSize, req.PageNum, req.SupplierId)
|
|
|
+ if err != nil {
|
|
|
+ logrus.WithContext(ctx).Errorf("[fullLocals service] call GetFullSLocalLifeList error,err:%+v", err)
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ var fullLocalData *http_model.FullSLocalBillData
|
|
|
+ fullLocalData = &http_model.FullSLocalBillData{}
|
|
|
+ fullLocalData.Total = total
|
|
|
+ for _, fullLocal := range fullLocals {
|
|
|
+ var fullLocalPreview *http_model.FullSLocalBillListData
|
|
|
+ fullLocalPreview = &http_model.FullSLocalBillListData{}
|
|
|
+ fullLocalPreview.SLocalId = fullLocal.SLocalId
|
|
|
+ fullLocalPreview.LocalId = fullLocal.LocalId
|
|
|
+ fullLocalPreview.LocalPlatform = fullLocal.LocalPlatform
|
|
|
+ fullLocalPreview.TaskForm = fullLocal.TaskForm
|
|
|
+ fullLocalPreview.ContentType = fullLocal.ContentType
|
|
|
+ fullLocalPreview.TaskStatus = fullLocal.TaskStatus
|
|
|
+ fullLocalPreview.EnterpriseId = fullLocal.EnterpriseId
|
|
|
+ fullLocalPreview.SupplierId = fullLocal.SupplierId
|
|
|
+ fullLocalPreview.SubAccountId = fullLocal.SubAccountId
|
|
|
+ fullLocalPreview.ServiceChargeActual = fullLocal.ServiceChargeActual
|
|
|
+ fullLocalPreview.ServiceChargeSettle = fullLocal.ServiceChargeSettle
|
|
|
+ fullLocalPreview.StoreId = fullLocal.StoreId
|
|
|
+ fullLocalData.SLocalList = append(fullLocalData.SLocalList, fullLocalPreview)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2. 查询本地生活补充信息:门店信息,招募策略
|
|
|
+ for _, local := range fullLocalData.SLocalList {
|
|
|
+
|
|
|
+ // 2.1. 门店信息
|
|
|
+ storeInfo, productErr := db.FindStoreById(ctx, local.StoreId)
|
|
|
+ if productErr != nil {
|
|
|
+ return nil, productErr
|
|
|
+ }
|
|
|
+ if storeInfo != nil {
|
|
|
+ local.StoreId = storeInfo.StoreId
|
|
|
+ local.StoreName = storeInfo.StoreName
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2.2. 门店图片信息
|
|
|
+ productPhotoInfo, productPhotoErr := db.GetStorePhotoByStoreID(ctx, local.StoreId)
|
|
|
+ if productPhotoErr != nil {
|
|
|
+ return nil, productPhotoErr
|
|
|
+ }
|
|
|
+ if productPhotoInfo != nil {
|
|
|
+ for _, photo := range productPhotoInfo {
|
|
|
+ fmt.Println(photo)
|
|
|
+ if photo.Symbol == 1 {
|
|
|
+ local.StorePhotoSymbol = 1
|
|
|
+ local.StorePhotoUrl = photo.PhotoUrl
|
|
|
+ local.StorePhotoUid = photo.PhotoUid
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return fullLocalData, nil
|
|
|
+}
|
|
|
+
|
|
|
+// FullSLocalTaskBillList 服务商本地生活子任务账单列表
|
|
|
+func (*sLocalLife) FullSLocalTaskBillList(ctx context.Context, request *http_model.FullSLocalTaskBillListRequest) (*http_model.FullSLocalTaskBillData, error) {
|
|
|
+ var currSLocalTaskBillData *http_model.FullSLocalTaskBillData
|
|
|
+ currSLocalTaskBillData = &http_model.FullSLocalTaskBillData{}
|
|
|
+ currSLocalTaskBillData.DraftFee = 0
|
|
|
+ currSLocalTaskBillData.DraftFeeSettle = 0
|
|
|
+
|
|
|
+ // 1. 查找子任务
|
|
|
+ taskList, total, taskListErr := db.GetSLocalTaskList(ctx, request.SProjectId, request.TalentId, request.PageSize, request.PageNum)
|
|
|
+ if taskListErr != nil {
|
|
|
+ return nil, taskListErr
|
|
|
+ }
|
|
|
+ if taskList != nil {
|
|
|
+ currSLocalTaskBillData.Total = total
|
|
|
+ for _, task := range taskList {
|
|
|
+ var curr *http_model.FullSLocalTaskBillListData
|
|
|
+ curr = &http_model.FullSLocalTaskBillListData{}
|
|
|
+ curr.TaskId = task.TaskID
|
|
|
+ curr.ServiceCharge = task.ServiceCharge
|
|
|
+ curr.ViewNum = 0
|
|
|
+ curr.VoteNum = 0
|
|
|
+ curr.CommitNum = 0
|
|
|
+ curr.CollectNum = 0
|
|
|
+ curr.ServiceCharge = task.ServiceCharge
|
|
|
+ curr.DraftFee = task.DraftFee
|
|
|
+ curr.DelayRate = task.ScriptBreakRate + task.SketchBreakRate + task.LinkBreakRate + task.DataBreakRate
|
|
|
+ curr.RealServiceCharge = task.RealPayment - task.SettleAmount
|
|
|
+ curr.SettleAmount = task.SettleAmount
|
|
|
+ curr.SettleTime = conv.MustString(task.CompleteDate)
|
|
|
+ currSLocalTaskBillData.DraftFee += curr.DraftFee
|
|
|
+ currSLocalTaskBillData.DraftFeeSettle += curr.SettleAmount
|
|
|
+ currSLocalTaskBillData.SLocalTaskList = append(currSLocalTaskBillData.SLocalTaskList, curr)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2. 补充任务信息
|
|
|
+ sProjectInfo, sProjectErr := db.GetSProjectDetail(ctx, request.SProjectId)
|
|
|
+ if sProjectErr != nil {
|
|
|
+ return nil, sProjectErr
|
|
|
+ }
|
|
|
+ if sProjectInfo != nil {
|
|
|
+ currSLocalTaskBillData.SettleNum = sProjectInfo.SettleNum
|
|
|
+ currSLocalTaskBillData.ChooseNum = sProjectInfo.ApplyNum
|
|
|
+ currSLocalTaskBillData.ServiceCharge = sProjectInfo.ServiceCharge
|
|
|
+ currSLocalTaskBillData.ServiceChargeSettle = sProjectInfo.ServiceChargeSettle
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return currSLocalTaskBillData, nil
|
|
|
+}
|