// Copyright 2021 getensh.com. All rights reserved. // Use of this source code is governed by getensh.com. package bill import ( "context" "fmt" "git.getensh.com/common/gopkgs/cache" "git.getensh.com/common/gopkgs/logger" "go.uber.org/zap" "property-task/impl/v1/common" "property-task/pb" pb_v1 "property-task/pb/v1" ) // 定时生成账单 func GenerateBill() { cache.RedisLock(common.TaskKey) defer cache.RedisUnlock(common.TaskKey) // 获取小区列表 ids := common.GetGardenList() mreq := pb_v1.GenerateBillRequest{} fmt.Printf("开始生成账单\n") for _, v := range ids { fmt.Printf("xxxxxxxxxxxxxxxxxxxx:%v\n", v.GardenId) mreq.GardenId = v.GardenId _, err := pb.Garden.GenerateBill(context.Background(), &mreq) if err != nil { logger.Error("func", zap.String("call", "pb.Garden.GenerateBill "), zap.String("error", err.Error())) } fmt.Printf("xxxxx:%v\n", err) } }