add workflow 天润Smart-ccc工单数据,dev

This commit is contained in:
root 2024-08-02 14:42:45 +08:00
parent 109fcb2049
commit 786d32311f
1 changed files with 1 additions and 9 deletions

View File

@ -43,14 +43,6 @@ def previous_hour_timestamp(h):
start_of_previous_hour = start_of_current_hour - datetime.timedelta(hours=h)
return int(start_of_previous_hour.timestamp())
def formatted2_previous_month(m):
if m==0:
return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
start_of_current_hour = datetime.datetime.now().replace(minute=0, second=0, microsecond=0)
# 减去一个小时,得到前一个小时的开始时间
start_of_previous_hour = start_of_current_hour - datetime.timedelta(months=m)
return start_of_previous_hour.strftime("%Y-%m-%d %H:%M:%S")
#计算签名
def generate_signature(str, private_key):
signature = hmac.new(private_key.encode(), (str).encode(), hashlib.sha1)
@ -88,7 +80,7 @@ def request_data_signature_post():
print(f'url: {url}')
# body={'endTime':formatted2_previous_hour(0),'startTime':'2024-01-01 00:00:00'}
body={'endTime':formatted2_previous_hour(0),'startTime':formatted2_previous_month(3),'updateTimeStart':formatted2_previous_hour(1),'updateTimeEnd':formatted2_previous_hour(0)}
body={'endTime':formatted2_previous_hour(0),'startTime':'1900-01-01 00:00:00','updateTimeStart':formatted2_previous_hour(1),'updateTimeEnd':formatted2_previous_hour(0)}
jsonData = json.dumps(body)
print(f'body: {jsonData}')
dataReqL=requests.post(url,headers=header,data=jsonData)