转账消息更加明确
This commit is contained in:
parent
a73f8f2d6a
commit
24487f6a4b
@ -181,6 +181,7 @@ class ParsingMSG(DatabaseBase):
|
||||
f"位置:{location.pop('label')} {location.pop('poiname')}\n"
|
||||
f"其他信息:{json.dumps(location, ensure_ascii=False, indent=4)}"
|
||||
)
|
||||
content["src"] = ""
|
||||
elif type_id == (49, 0):
|
||||
DictExtra = self.get_BytesExtra(BytesExtra)
|
||||
url = match_BytesExtra(DictExtra)
|
||||
@ -215,8 +216,15 @@ class ParsingMSG(DatabaseBase):
|
||||
elif type_id == (49, 2000): # 转账消息
|
||||
CompressContent = self.decompress_CompressContent(CompressContent)
|
||||
content_tmp = xml2dict(CompressContent)
|
||||
feedesc = content_tmp.get("appmsg", {}).get("wcpayinfo", {}).get("feedesc", "")
|
||||
content["msg"] = f"转账:{feedesc}"
|
||||
wcpayinfo = content_tmp.get("appmsg", {}).get("wcpayinfo", {})
|
||||
paysubtype = wcpayinfo.get("paysubtype", "") # 转账类型
|
||||
feedesc = wcpayinfo.get("feedesc", "") # 转账金额
|
||||
pay_memo = wcpayinfo.get("pay_memo", "") # 转账备注
|
||||
begintransfertime = wcpayinfo.get("begintransfertime", "") # 转账开始时间
|
||||
content["msg"] = (f"{'已收款' if paysubtype == '3' else '转账'}:{feedesc}\n"
|
||||
f"转账说明:{pay_memo if pay_memo else ''}\n"
|
||||
f"转账时间:{timestamp2str(begintransfertime)}\n"
|
||||
)
|
||||
content["src"] = ""
|
||||
|
||||
elif type_id[0] == 49 and type_id[1] != 0:
|
||||
|
@ -121,6 +121,20 @@ def timestamp2str(timestamp):
|
||||
:param timestamp: 时间戳
|
||||
:return: 时间字符串
|
||||
"""
|
||||
if isinstance(timestamp, str) and timestamp.isdigit():
|
||||
timestamp = int(timestamp)
|
||||
elif isinstance(timestamp, int):
|
||||
pass
|
||||
else:
|
||||
return timestamp
|
||||
|
||||
if len(str(timestamp)) == 13:
|
||||
timestamp = timestamp / 1000
|
||||
elif len(str(timestamp)) == 10:
|
||||
pass
|
||||
else:
|
||||
return timestamp
|
||||
|
||||
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(timestamp))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user