智盟项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

task_pay_life_order_settle.go 739 B

4 months ago
1234567891011121314151617181920212223242526272829303132333435
  1. package task
  2. import (
  3. "applet/app/task/svc"
  4. "applet/app/utils"
  5. "fmt"
  6. "math/rand"
  7. "time"
  8. )
  9. func taskPayLifeOrderSettle() {
  10. for {
  11. if len(ch) > workerNum {
  12. time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000)))
  13. } else {
  14. goto START
  15. }
  16. }
  17. START:
  18. ch <- 1
  19. month := utils.GetTimeRange("current_month")
  20. fmt.Println(month)
  21. arg := map[string]string{
  22. "status": "订单付款",
  23. "sort": "id desc",
  24. "is_to_settle": "2",
  25. "is_commission": "1",
  26. "to_settle_time": utils.Int64ToStr(month["start"]),
  27. "p": "1",
  28. "size": "100",
  29. "pvd": "own_didi_online_car,own_didi_freight,own_didi_chauffeur,own_oilstation,own_king_flower",
  30. }
  31. svc.LifeOrderSettle(arg)
  32. <-ch
  33. }