bill.go 882 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package accounting
  4. import (
  5. "context"
  6. "gd_crontab/rpc_apis"
  7. "gd_crontab/rpc_apis/gd_management"
  8. "fmt"
  9. "time"
  10. )
  11. func GenerateBill(){
  12. fmt.Println("start generate bill :",time.Now().Format("2006-01-02 15:04:05"))
  13. //month := time.Now().AddDate(0,-1,0).Format("2006-01")
  14. mreq := gd_management.GenerateBillReq{
  15. //Month: month,
  16. }
  17. _,err := rpc_apis.Management.GenerateBill(context.Background(), &mreq)
  18. if err != nil{
  19. fmt.Println(err )
  20. }
  21. }
  22. func BillNotify(){
  23. fmt.Println("start bill notify :",time.Now().Format("2006-01-02 15:04:05"))
  24. //month := time.Now().AddDate(0,-1,0).Format("2006-01")
  25. mreq := gd_management.BillNotifyReq{
  26. //Month: month,
  27. }
  28. _,err := rpc_apis.Management.BillNotify(context.Background(), &mreq)
  29. if err != nil{
  30. fmt.Println(err )
  31. }
  32. }