xtn-tools-pro 1.0.0.7.0__py3-none-any.whl → 1.0.0.7.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,8 +12,10 @@ import re
12
12
  import uuid
13
13
  import math
14
14
  import json
15
+ import random
15
16
  from uuid import UUID
16
17
  from pprint import pformat
18
+ from datetime import datetime
17
19
  from urllib.parse import urlencode
18
20
 
19
21
 
@@ -111,6 +113,7 @@ def get_calculate_total_page(total, limit):
111
113
  total_pages = math.ceil(total / limit)
112
114
  return total_pages
113
115
 
116
+
114
117
  def get_build_url_with_params(url, params):
115
118
  """
116
119
  传入url和params拼接完整的url ->效果 https://wwww.xxxx.com/?xxx1=1&xxx2=2
@@ -123,8 +126,24 @@ def get_build_url_with_params(url, params):
123
126
  return full_url
124
127
 
125
128
 
129
+ def get_orderId_random(prefix="", suffix=""):
130
+ """
131
+ 随机生成20位订单号,前部分由年月日时分秒组成
132
+ :param prefix: 自定义前缀
133
+ :param suffix: 自定义后缀
134
+ :return:
135
+ """
136
+ current_time = datetime.now()
137
+ date_time_str = current_time.strftime("%y%m%d%H%M%S")
138
+ # 生成随机部分
139
+ random_number = ''.join(random.choices('0123456789', k=8))
140
+ # 组合成完整的数字
141
+ combined_number = int(date_time_str + random_number)
142
+ return f"{prefix}{combined_number}{suffix}"
143
+
126
144
 
127
145
  if __name__ == '__main__':
128
146
  # print(get_uuid(4))
129
147
  from faker import Faker
130
148
 
149
+ print(get_orderId_random())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xtn-tools-pro
3
- Version: 1.0.0.7.0
3
+ Version: 1.0.0.7.1
4
4
  Summary: xtn 开发工具
5
5
  Author: xtn
6
6
  Author-email: czw011122@gmail.com
@@ -16,13 +16,13 @@ xtn_tools_pro/task_pro/go_fun_v3.py,sha256=wPd7LFQlDhLH-5SIlq_1k8og5oW6KWeY6g3Qv
16
16
  xtn_tools_pro/utils/__init__.py,sha256=I1_n_NP23F2lBqlF4EOlnOdLYxM8M4pbn63UhJN1hRE,418
17
17
  xtn_tools_pro/utils/crypto.py,sha256=RZ5AET4udlraACWMeNF-17JiZ2R6Ahb47_j4tjkV7LE,3190
18
18
  xtn_tools_pro/utils/file_utils.py,sha256=VfdIxog4s1UW5NpKkCvQsUs9qHjLoNCnstZbnftkT4w,2046
19
- xtn_tools_pro/utils/helpers.py,sha256=eHhvhcw_jcUhCA6HwOqpD4XU_V_ZoHDgj3qtLR8yzx8,3812
19
+ xtn_tools_pro/utils/helpers.py,sha256=H-a3gnahIah3kJqyKzzKlPWtVQYcFlJncz2rAfBqIiw,4444
20
20
  xtn_tools_pro/utils/log.py,sha256=m0WtTWkkwtrki1ftP8vCDR8bMfK2gcfUGx5J2x2IlLQ,10138
21
21
  xtn_tools_pro/utils/retry.py,sha256=0wjHsR5DBBKpv4naMfxiky8kprrZes4WURIfFQ4H708,1657
22
22
  xtn_tools_pro/utils/sql.py,sha256=EAKzbkZP7Q09j15Gm6o0_uq0qgQmcCQT6EAawbpp4v0,6263
23
23
  xtn_tools_pro/utils/time_utils.py,sha256=TUtzG61PeVYXhaQd6pBrXAdlz7tBispNIRQRcGhE2No,4859
24
- xtn_tools_pro-1.0.0.7.0.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
- xtn_tools_pro-1.0.0.7.0.dist-info/METADATA,sha256=LCoHQGYJvwiZ3WZ90CNTRFcV55SKwM5uAsidHfLhPRo,455
26
- xtn_tools_pro-1.0.0.7.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
27
- xtn_tools_pro-1.0.0.7.0.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
28
- xtn_tools_pro-1.0.0.7.0.dist-info/RECORD,,
24
+ xtn_tools_pro-1.0.0.7.1.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ xtn_tools_pro-1.0.0.7.1.dist-info/METADATA,sha256=Yl6AU8kAvrr4nKEBgCHpLCJbOXtZ7UksCEF7XU-Gtuo,455
26
+ xtn_tools_pro-1.0.0.7.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
27
+ xtn_tools_pro-1.0.0.7.1.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
28
+ xtn_tools_pro-1.0.0.7.1.dist-info/RECORD,,