first commit

This commit is contained in:
jefferyzhao
2025-07-30 18:53:06 +08:00
commit 9a923a67b9
26 changed files with 1949 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

8
.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 数据源本地存储已忽略文件
/dataSources/
/dataSources.local.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

18
.idea/enterprise-wechat-payment-push.iml generated Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="Flask">
<option name="enabled" value="true" />
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Jinja2" />
</component>
</module>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/enterprise-wechat-payment-push.iml" filepath="$PROJECT_DIR$/.idea/enterprise-wechat-payment-push.iml" />
</modules>
</component>
</project>

4
1.py Normal file
View File

@ -0,0 +1,4 @@
from utils import *
a = query_pay_details("231002197204291515")
logger.info(fa)

71
FuiouPay.py Normal file
View File

@ -0,0 +1,71 @@
import json
from datetime import datetime
import requests
from Crypto.PublicKey import RSA
import base64
from Crypto.Cipher import PKCS1_v1_5
import logging
logger = logging.getLogger(__name__)
# 使用公钥加密
def rsa_long_encrypt(public_key,msg, length=100):
"""
单次加密串的长度最大为 (key_size/8)-11
1024bit的证书用100 2048bit的证书用 200
"""
pub_key = RSA.importKey(open(public_key).read())
# pub_key = RSA.importKey(open('E:/YinJian/银建支付对接维护说明/富友/fy-enterprise-wechat-payment-push/pub_key.pem').read())
pubobj = PKCS1_v1_5.new(pub_key)
res = []
for i in range(0, len(msg), length):
res.append(pubobj.encrypt(msg[i:i + length].encode('GBK')))
return base64.b64encode(b"".join(res)).decode('GBK')
class H5Main:
def __init__(self, sub_mchnt_cd):
self.mchnt_cd = "0001000F7152279"
self.sub_mchnt_cd = sub_mchnt_cd
self.url = 'https://aggpcpay.fuioupay.com/aggh5Gate.fuiou'
self.notify_url = "http://web.jiyuankeshang.com/api2/paymentCallBack"
# self.notify_url = "http://172.16.6.15:3006/paymentCallBack"
def unified_order(self, order_no, total, description):
if self.sub_mchnt_cd == '0001000F7152364':
param = {
"mchnt_cd": self.sub_mchnt_cd,
"order_date": datetime.now().strftime("%Y%m%d"),
"order_id": order_no,
"order_amt": total,
"page_notify_url": self.notify_url,
"back_notify_url": self.notify_url,
"ver": "4.0.0",
"goods_name": "履约服务费",
"goods_detail": description,
"fee_type": "CNY",
}
pub_key_location = 'dg_pub_key.pem'
# pub_key_location = 'E:\YinJian\银建支付对接维护说明\DP\DP-enterprise-wechat-payment-push\dg_pub_key.pem'
else:
param = {
"mchnt_cd": self.mchnt_cd,
"sub_mchnt_cd": self.sub_mchnt_cd,
"order_date": datetime.now().strftime("%Y%m%d"),
"order_id": order_no,
"order_amt": total,
"page_notify_url": self.notify_url,
"back_notify_url": self.notify_url,
"ver": "4.0.0",
"goods_name": "承包金",
"goods_detail": description,
"fee_type": "CNY",
}
pub_key_location = 'pub_key.pem'
# pub_key_location = 'E:\YinJian\银建支付对接维护说明\DP\DP-enterprise-wechat-payment-push\pub_key.pem'
logger.info(f"======================发起支付===================={param}")
# 加密
message = json.dumps(param)
encrypted_message = rsa_long_encrypt(pub_key_location,message,100)
return json.dumps({"message": encrypted_message})

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

56
config.py Normal file
View File

@ -0,0 +1,56 @@
'''
coding:utf-8
@Time:2023/3/28 5:02 PM
@Author:dyq
'''
# 调用域名
base_path = 'https://www.jiyuankeshang.com'
# 企微应用id 应用ID
corpid = 'wweb8b852846334c2f'
zy_corpid = 'wwc276f7a0347c310b'
SECRET = 'MPa5NNk5SpE51CWrJEr6CkjWOzcpUxA_oIMC47bmj5c'
ZY_SECRET = 'ozJbEVP-tHzOJyNIfeANlvZ7lIO9Pu0GJYv1pzUmjsE'
zy_agentid = '1000092'
agentid = '1000005'
# 商户号
#mchid = '1640957093'
# APIv3密钥
v3_SECRET = '87568e2507acb94056e7310c9c2ab9d5'
# 服务器IP
ip = '101.43.208.145'
# 商户号证书序列号
#serial_no = '22E0F3EA849ABD1E687C82D43D26190C46DA5834'
# 未收付应用id
pay_app = '675b8d1a24d61bca7bf1cb4c'
lw_pay_app = '65815f117de49256b1e67e75'
# # 已收表单Id
received_id = '67f37759de8bbe9eed71b793'
lw_received_id = '66038178cdefd20d643ae7c5'
# # 未收表单Id
uncollected_id = '67e21d2ebaccd58c66fa7c77'
lw_uncollected_id = '660376f8e0f50cf16cd2971a'
# # 充值明细
pay_details_id = '67ee3fa22e399b68fef8d839'
lw_pay_details_id = '659fa34cd0365889c7750269'
# # 个人账户
accout_id = '67ee40362e399b68fef8e000'
# 增减项app
hz_app = '675b8d1a24d61bca7bf1cb4c'
# 增减项表单
hz_id = '67f38f4abaccd58c66bd7246'
# 驾驶员信息表单
# ht_id = '658e440978f6daedd0db50c3'
ht_id = '658e233e78f6daedd0da54c6'
# 收付款事由基础设置表单
reasons_id = '680ae70dde8bbe9eed7fa8f0'
# apikey
apikey = '82bl1lhsgjzhd9ahBYvaMNVAncYYRkbE'
# 辅助表单(查询驾驶员身份证号)
fu_app = '6437c223ee895d000812a37d'
fu_id = '64685d55e6051a000edad530'
# 财务管理应用ID
cw_app = '675b8d1a24d61bca7bf1cb4c'
#驾驶员支付信息
transactions_id = '66a850d3b3c800c6f541be2f'
rule_sort = {"收预收承包金": 0, "承包金": 1, "调度费": 2, "保养费": 3, "费税收取-其他": 4}

3
dg_priv_key.pem Normal file
View File

@ -0,0 +1,3 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC822wv9HcW+qqn8l8ne5ICkUh1rFGGrBuGvrmO0ULemFsGpp3g+opW8u2dKJxy+ezqywe+2IU6vuGqIp32FW4EjjeuTKq1UcD7mAiPc0jmp60DD5Jy1ILBBiwEX1WY4GLVHn5kzG4E5XX9fxAg69zBpxDaI//cUljdBUGY/ZL79qAo22Oq1f2va+wEA+uJA0qir0/BO1tMxraa6PmFRniOAIof+49nIaKS+QKV01P9qcllZ61woI6QzWtDuuTIXllxOM9tFh0SPePHTnuXJrA6/bsqkbYOUGC7b6DA22KQVF51fWFD5bNbWuCYUYi6Sj9ErU1KUmrHs24D2Hd+ON+jAgMBAAECggEBAIUpqlT96OK5CI+3JETwqnlI+3CNekadICOYY7pB7waJItXDsdqqjdTVIZoIwpeHhffgBKwae4Z6hR+znPGhFpv7s2MhB9Ulug8smgyb2zFX1XQtDLQPB8sWkP7cQbyzqrxe7fwg8QpeyR1e9H5iEJwzMny9mXE+Vw4w4JoBYhxqBzZgVn1rn5w4pt+UonFo5peZSoDDYSm37ReJ9Ay6/XzS3SEGOA1cKxYfpltZ7MBTmspAxBSgDlrmW+wjnN6qZuDOQkq9YodmaZUqcv4j+JupGbPPKxbhAOOxvnLTB2QQpWqKBZ4iwlpjb921498zxIZJ1JdTqJ4e2MCM60+/QaECgYEA91DVOv4QZrxN8f1YAWqfdDrE9UZP/9DC06BKOEGv6g8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BkSO3sOK8XPIR47m3qNhioZuuFIIUS03PgRXByHXozwIDAQAB
-----END PUBLIC KEY-----

333
dpapp.py Normal file
View File

@ -0,0 +1,333 @@
from flask import Flask, request, redirect, abort, session, jsonify
from utils import *
from FuiouPay import H5Main
# from WXPay import WXPay
import os, _thread, urllib
import logging
from logging.handlers import TimedRotatingFileHandler
from flask_cors import CORS
app = Flask(__name__)
app.config['SECRET_KEY'] = os.urandom(24)
CORS(app, supports_credentials=True)
def setup_logging():
"""配置日志系统,按天分割日志文件"""
# 创建日志目录
log_dir = "logs"
os.makedirs(log_dir, exist_ok=True)
# 设置日志格式
log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
formatter = logging.Formatter(log_format)
# 创建按天轮转的文件处理器
file_handler = TimedRotatingFileHandler(
filename=os.path.join(log_dir, 'dpapp.log'),
when='midnight', # 每天午夜轮转
interval=1, # 每天一个文件
backupCount=30, # 保留30天的日志
encoding='utf-8'
)
file_handler.setFormatter(formatter)
file_handler.setLevel(logging.INFO)
# 创建控制台处理器
console_handler = logging.StreamHandler()
console_handler.setFormatter(formatter)
console_handler.setLevel(logging.DEBUG)
# 获取根logger并配置
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
logger.addHandler(file_handler)
logger.addHandler(console_handler)
# 初始化日志配置
setup_logging()
# 获取当前模块的 logger
logger = logging.getLogger(__name__)
logger.info(f"DPPayApp started") # 会输出到文件和控制台
@app.route('/queryUserId', methods=['GET'])
def queryUserId():
# 获取支付明细
try:
code = request.args.get('code')
data = query_wx_userid(code)
if len(data) <= 11:
res = query_wx_fj_info(data)
data = res
return redirect(f'http://web.jiyuankeshang.com/#/DPpay?user={data}&appid={corpid}&agentid={agentid}')
except Exception as e:
return {}
@app.route('/queryUserIdZY', methods=['GET'])
def queryUserIdZY():
# 获取支付明细
try:
code = request.args.get('code')
data = query_zy_wx_userid(code)
if len(data) <= 11:
res = query_zy_wx_fj_info(data)
data = res
return redirect(f'http://web.jiyuankeshang.com/#/DPpay?user={data}&appid={zy_corpid}&agentid={zy_agentid}')
except Exception as e:
return {}
@app.route('/queryUser', methods=['GET'])
def queryUserApi():
# 获取支付明细
try:
id = request.args.get('user')
data = queryUser(id)
for item in data['pay_detail']:
if 'charge_amount' in item:
item['price'] = item.pop('charge_amount')
if 'charge_time' in item:
item['time'] = item.pop('charge_time')
logger.info(f"===================queryUserdata{data}")
return data
except Exception as e:
return {}
@app.route('/getPaymentDetails', methods=['GET'])
def getPaymentDetails():
try:
id = request.args.get('user', '')
id = id.replace(" ", "")
if not id:
logger.info(f"no id")
return {}
data = query_pay_details(id)
for item in data:
if item == "amount":
continue
for detail in data[item]['data']:
if 'fukuanshiyou' in detail:
detail['name'] = detail.pop('fukuanshiyou')
return data
except Exception as e:
logger.info(f"error{e}")
return {}
@app.route('/paymentCallBack', methods=['POST'])
def paymentCallBack():
# 充值成功后回调 {"pay_amount": 20000, "id": "18515367096"}
try:
logger.info(f"====================================paymentCallBack=========================================")
msg = request.data.decode('UTF-8')
logger.info(f"回调参数为===={msg}")
msg = eval(msg)
logger.info(f"eval参数为===={msg}")
if msg['resp_desc'] == '成功':
logger.info(f"=================================充值回调SUCCESS==========================================")
if msg['mchnt_cd'] == '0001000F7152364':
rsa_key = RSA.importKey(open('dg_priv_key.pem').read())
# rsa_key = RSA.importKey(open('E:\YinJian\银建支付对接维护说明\DP\DP-enterprise-wechat-payment-push\dg_priv_key.pem').read())
else:
rsa_key = RSA.importKey(open('priv_key.pem').read())
# rsa_key = RSA.importKey(open('E:\YinJian\银建支付对接维护说明\DP\DP-enterprise-wechat-payment-push\priv_key.pem').read())
logger.info(f"msg==={msg['message']}")
logger.info(f"rsa_key{rsa_key}")
whp = rsa_long_decrypt(rsa_key, msg['message'])
logger.info(f"报文已解密{whp}")
whp_dict = json.loads(whp)
# 打印字典中的所有键
logger.info(f"1111111{whp_dict.keys()}")
# 获取'order_id'键的值并取前18个字符
id = whp_dict['order_id'][:18]
# 查询机构、分司
res = filter_jdy_ht(id)
transaction_id = whp_dict['pay_ssn']
amount = float(whp_dict['order_amt'])
order_pay_type = whp_dict['order_pay_type']
# 判断支付类型
if order_pay_type[:2] == "We":
pay_type = "微信支付"
elif order_pay_type[:3] == "Ali":
pay_type = "支付宝支付"
elif order_pay_type == "0000000000":
pay_type = "云闪付支付"
amount = amount / 100
if whp_dict['mchnt_cd'] == '0001000F7152364':
payment_items = "驾驶员履约服务费"
info1 = {"pay_amount": amount, "id": id,
"fs": res[1], "jg": res[0], "name": res[4], "shfid": res[7],
"fsfz": res[6],
"hphm": res[5], "transaction_id": transaction_id, "payment_items": payment_items,
"pay_type": pay_type}
logger.info(f"充值回调处理{info1}")
_thread.start_new_thread(add_payment_lw, ({"pay_amount": amount, "id": id,
"fs": res[1], "jg": res[0], "name": res[4], "shfid": res[7],
"fsfz": res[6],
"hphm": res[5], "transaction_id": transaction_id, "payment_items": payment_items, "pay_type": pay_type},))
else:
payment_items = "承包金"
info1 = {"pay_amount": amount, "id": id,
"fs": res[1], "jg": res[0], "name": res[4], "shfid": res[7],
"fsfz": res[6],
"hphm": res[5], "transaction_id": transaction_id, "payment_items": payment_items, "pay_type": pay_type}
logger.info(f"充值回调处理{info1}")
_thread.start_new_thread(add_payment, ({"pay_amount": amount, "id": id,
"fs": res[1], "jg": res[0], "name": res[4], "shfid": res[7],
"fsfz": res[6],
"hphm": res[5], "transaction_id": transaction_id, "payment_items": payment_items, "pay_type": pay_type},))
return {"code": 200}
except Exception as e:
return jsonify(error=str(e)), 500
@app.route('/test', methods=['POST'])
def test():
# 新增未收付明细 {"pay_amount": 20000, "id": "18515367096"}
try:
data = request.data.decode("utf-8")
logger.info(f"data{data}")
return {}
except Exception as e:
logger.error(f"error{e}")
return {}
@app.route('/addUnPayment', methods=['POST'])
def addno_moneyment():
# 新增未收付明细 {"pay_amount": 20000, "id": "18515367096"}
try:
data = request.data.decode("utf-8")
data = data.replace("null", "None")
data = eval(data)
data = data['data']
if data['mode_type'] == "DP":
res = filter_jdy_ht(data['id_card'])
_thread.start_new_thread(add_payment, ({"pay_amount": 0, "id": data['id_card'],
"fs": res[1], "jg": res[0], "name": res[4], "shfid": res[7],
"fsfz": res[6],
"hphm": res[5]}, 1))
return {}
else:
return {}
except Exception as e:
logger.error(f"addUnPayment,e{e},res{res}")
return {}
@app.route('/addPayment', methods=['POST'])
def addPayment():
# 新增充值明细 {"pay_amount": 20000, "id": "18515367096"}
try:
data = request.data.decode("utf-8")
logger.info(f"新增充值明细,data{data}")
data = data.replace("null", "None")
data = eval(data)
data = data['data']
if data['mode_type'] == "DP":
res = filter_jdy_ht(data['id_card'])
if not data['charge_amount']:
data['charge_amount'] = 0
if not res:
# 合同表单未有数据
logger.info(f"合同表单未有数据,data{data}")
fsfz = data['fsfz']['dept_no'] if data['fsfz'] else ""
_thread.start_new_thread(add_payment, ({"pay_amount": data['charge_amount'], "id": data['id_card'],
"fs": data['fs'], "jg": data['jg'], "name": data['name'],
"fsfz": fsfz, "hphm": data['hphm']}, 1))
else:
logger.info(f"新增充值明细111,pay_amount: {data['charge_amount']}, id: {data['id_card']},fs: {res[1]}, jg: {res[0]}, name: {res[4]}, shfid: {res[7]},fsfz: {res[6]},hphm: {res[5]}")
_thread.start_new_thread(add_payment, ({"pay_amount": data['charge_amount'], "id": data['id_card'],
"fs": res[1], "jg": res[0], "name": res[4], "shfid": res[7],
"fsfz": res[6],
"hphm": res[5]}, 1))
return {"code": 200}
else:
return {"code": 200}
except Exception as e:
logger.info(f"addPayment,e{e},data{data}")
return {}
@app.route('/addlwPayment', methods=['POST'])
def addlwPayment():
# 新增充值明细 {"pay_amount": 20000, "id": "18515367096"}
try:
data = request.data.decode("utf-8")
logger.info(f"新增充值明细{data}")
data = data.replace("null", "None")
data = eval(data)
data = data['data']
res = filter_jdy_ht(data['id_card'])
if not data['price']:
data['price'] = 0
if not res:
# 合同表单未有数据
fsfz = data['fsfz']['dept_no'] if data['fsfz'] else ""
_thread.start_new_thread(add_payment_lw, ({"pay_amount": data['price'], "id": data['id_card'],
"fs": data['fs'], "jg": data['jg'], "name": data['name'],
"fsfz": fsfz, "hphm": data['hphm']}, 1))
else:
_thread.start_new_thread(add_payment_lw, ({"pay_amount": data['price'], "id": data['id_card'],
"fs": res[1], "jg": res[0], "name": res[4], "shfid": res[7],
"fsfz": res[6],
"hphm": res[5]}, 1))
return {}
except Exception as e:
logger.info(f"addlwPayment,e{e},data{data}")
return {}
@app.route('/transactions', methods=['GET'])
def transactions():
# 调起h5支付
try:
logger.info(f"开始支付")
id = request.args.get('user')
price = request.args.get('price')
shh = request.args.get('option')
logger.info(f"===============费用缴纳类型为{shh}===============")
logger.info(f"金额,{price}")
if not float(price):
res = filter_jdy_ht(id)
_thread.start_new_thread(add_payment, ({"pay_amount": 0, "id": id,
"fs": res[1], "jg": res[0], "name": res[4], "shfid": res[7],
"fsfz": res[6],
"hphm": res[5]}, 1))
return {}
else:
# 查询商户号、商户号证书
res = filter_jdy_ht(id)
logger.info(f"res,{res}")
if not res:
return "error"
logger.info(f"金额,{price}")
price = float(price) * 100
if shh == '1':
if not res[2] or not res[0]:
return "error"
fy = H5Main(res[2])
logger.info(f"发起缴纳承包金,{id}{int(time.time())}{int(price)}")
message = fy.unified_order(f"{id}{int(time.time())}", int(price), "订单支付")
return message
else:
fy = H5Main('0001000F7152364')
logger.info(f"发起缴纳履约服务费{id}{int(time.time())}, {int(price)}")
message = fy.unified_order(f"{id}{int(time.time())}", int(price), "订单支付")
return message
except Exception as e:
logger.error(f"error{e}")
return jsonify(error=str(e)), 500
if __name__ == '__main__':
app.run(host="0.0.0.0", port=3005, processes=True)

46
logs/dpapp.log Normal file

File diff suppressed because one or more lines are too long

35
logs/payapp.log Normal file
View File

@ -0,0 +1,35 @@
2025-05-08 11:23:20,165 - dpapp - INFO - DPPayApp started
2025-05-08 11:23:20,176 - werkzeug - INFO - * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
2025-05-08 11:23:23,957 - dpapp - INFO - 新增充值明细,data{"data":{"_id":"681c22c147f52adcb2aeed04","_widget_1743667106306":null,"_widget_1743667108715":"CZMX202505080000001","_widget_1744091796748":[],"appId":"675b8d1a24d61bca7bf1cb4c","car_dept":"金建","charge_amount":200,"charge_note":"","charge_time":"2025-05-08T03:19:22.000Z","collect_pos":"","contract_num":"","createTime":"2025-05-08T03:19:29.185Z","creator":{"_id":"66b980a0683f21a2d1429548","name":"葛梦伟","status":1,"type":0,"username":"993848"},"deleteTime":null,"deleter":null,"entryId":"67ee3fa22e399b68fef8d839","formName":"充值明细表_财务","form_code":"","form_name":"","fs":"J315车队","fs_p":{"_id":"66d19d41d6eb869c4d32f453","dept_no":1776480,"name":"J315车队","type":0},"hphm":"京BDB5375","hz_month":null,"hz_month1":"","id_card":"450481198712202058","jg":"康建利福汽车服务","mode_type":"DP","name":"曾辉","pay_type":"微信支付","payment_content":"","rq":null,"shfid":"J488912202058","transactionid":"4200002659202504282942276472","type":"转入","updateTime":"2025-05-08T03:19:29.185Z","updater":{"_id":"66b980a0683f21a2d1429548","name":"葛梦伟","status":1,"type":0,"username":"993848"},"ys":null,"zhtype":"预收款","zxform_code":""},"op":"data_create","opTime":1746674369185}
2025-05-08 11:23:24,035 - utils - INFO - req_tool_jdy{'code': 3005, 'msg': 'The request contains invalid parameter(s).'}
2025-05-08 11:23:26,101 - utils - INFO - req_tool_jdy{'code': 3005, 'msg': 'The request contains invalid parameter(s).'}
2025-05-08 11:23:28,184 - utils - INFO - req_tool_jdy{'code': 3005, 'msg': 'The request contains invalid parameter(s).'}
2025-05-08 11:23:30,233 - utils - INFO - req_tool_jdy{'code': 3005, 'msg': 'The request contains invalid parameter(s).'}
2025-05-08 11:24:52,308 - dpapp - INFO - DPPayApp started
2025-05-08 11:24:52,316 - werkzeug - INFO - * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
2025-05-08 11:24:54,897 - dpapp - INFO - 新增充值明细,data{"data":{"_id":"681c22c147f52adcb2aeed04","_widget_1743667106306":null,"_widget_1743667108715":"CZMX202505080000001","_widget_1744091796748":[],"appId":"675b8d1a24d61bca7bf1cb4c","car_dept":"金建","charge_amount":200,"charge_note":"","charge_time":"2025-05-08T03:19:22.000Z","collect_pos":"","contract_num":"","createTime":"2025-05-08T03:19:29.185Z","creator":{"_id":"66b980a0683f21a2d1429548","name":"葛梦伟","status":1,"type":0,"username":"993848"},"deleteTime":null,"deleter":null,"entryId":"67ee3fa22e399b68fef8d839","formName":"充值明细表_财务","form_code":"","form_name":"","fs":"J315车队","fs_p":{"_id":"66d19d41d6eb869c4d32f453","dept_no":1776480,"name":"J315车队","type":0},"hphm":"京BDB5375","hz_month":null,"hz_month1":"","id_card":"450481198712202058","jg":"康建利福汽车服务","mode_type":"DP","name":"曾辉","pay_type":"微信支付","payment_content":"","rq":null,"shfid":"J488912202058","transactionid":"4200002659202504282942276472","type":"转入","updateTime":"2025-05-08T03:19:29.185Z","updater":{"_id":"66b980a0683f21a2d1429548","name":"葛梦伟","status":1,"type":0,"username":"993848"},"ys":null,"zhtype":"预收款","zxform_code":""},"op":"data_create","opTime":1746674369185}
2025-05-08 11:24:55,016 - dpapp - INFO - addPayment,e'price',data{'_id': '681c22c147f52adcb2aeed04', '_widget_1743667106306': None, '_widget_1743667108715': 'CZMX202505080000001', '_widget_1744091796748': [], 'appId': '675b8d1a24d61bca7bf1cb4c', 'car_dept': '金建', 'charge_amount': 200, 'charge_note': '', 'charge_time': '2025-05-08T03:19:22.000Z', 'collect_pos': '', 'contract_num': '', 'createTime': '2025-05-08T03:19:29.185Z', 'creator': {'_id': '66b980a0683f21a2d1429548', 'name': '葛梦伟', 'status': 1, 'type': 0, 'username': '993848'}, 'deleteTime': None, 'deleter': None, 'entryId': '67ee3fa22e399b68fef8d839', 'formName': '充值明细表_财务', 'form_code': '', 'form_name': '', 'fs': 'J315车队', 'fs_p': {'_id': '66d19d41d6eb869c4d32f453', 'dept_no': 1776480, 'name': 'J315车队', 'type': 0}, 'hphm': '京BDB5375', 'hz_month': None, 'hz_month1': '', 'id_card': '450481198712202058', 'jg': '康建利福汽车服务', 'mode_type': 'DP', 'name': '曾辉', 'pay_type': '微信支付', 'payment_content': '', 'rq': None, 'shfid': 'J488912202058', 'transactionid': '4200002659202504282942276472', 'type': '转入', 'updateTime': '2025-05-08T03:19:29.185Z', 'updater': {'_id': '66b980a0683f21a2d1429548', 'name': '葛梦伟', 'status': 1, 'type': 0, 'username': '993848'}, 'ys': None, 'zhtype': '预收款', 'zxform_code': ''}
2025-05-08 11:24:55,017 - werkzeug - INFO - 127.0.0.1 - - [08/May/2025 11:24:55] "POST /addPayment HTTP/1.1" 200 -
2025-05-08 11:28:26,818 - dpapp - INFO - DPPayApp started
2025-05-08 11:28:26,825 - werkzeug - INFO - * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
2025-05-08 11:28:28,513 - dpapp - INFO - 新增充值明细,data{"data":{"_id":"681c22c147f52adcb2aeed04","_widget_1743667106306":null,"_widget_1743667108715":"CZMX202505080000001","_widget_1744091796748":[],"appId":"675b8d1a24d61bca7bf1cb4c","car_dept":"金建","charge_amount":200,"charge_note":"","charge_time":"2025-05-08T03:19:22.000Z","collect_pos":"","contract_num":"","createTime":"2025-05-08T03:19:29.185Z","creator":{"_id":"66b980a0683f21a2d1429548","name":"葛梦伟","status":1,"type":0,"username":"993848"},"deleteTime":null,"deleter":null,"entryId":"67ee3fa22e399b68fef8d839","formName":"充值明细表_财务","form_code":"","form_name":"","fs":"J315车队","fs_p":{"_id":"66d19d41d6eb869c4d32f453","dept_no":1776480,"name":"J315车队","type":0},"hphm":"京BDB5375","hz_month":null,"hz_month1":"","id_card":"450481198712202058","jg":"康建利福汽车服务","mode_type":"DP","name":"曾辉","pay_type":"微信支付","payment_content":"","rq":null,"shfid":"J488912202058","transactionid":"4200002659202504282942276472","type":"转入","updateTime":"2025-05-08T03:19:29.185Z","updater":{"_id":"66b980a0683f21a2d1429548","name":"葛梦伟","status":1,"type":0,"username":"993848"},"ys":null,"zhtype":"预收款","zxform_code":""},"op":"data_create","opTime":1746674369185}
2025-05-08 11:28:28,614 - dpapp - INFO - addPayment,e'price',data{'_id': '681c22c147f52adcb2aeed04', '_widget_1743667106306': None, '_widget_1743667108715': 'CZMX202505080000001', '_widget_1744091796748': [], 'appId': '675b8d1a24d61bca7bf1cb4c', 'car_dept': '金建', 'charge_amount': 200, 'charge_note': '', 'charge_time': '2025-05-08T03:19:22.000Z', 'collect_pos': '', 'contract_num': '', 'createTime': '2025-05-08T03:19:29.185Z', 'creator': {'_id': '66b980a0683f21a2d1429548', 'name': '葛梦伟', 'status': 1, 'type': 0, 'username': '993848'}, 'deleteTime': None, 'deleter': None, 'entryId': '67ee3fa22e399b68fef8d839', 'formName': '充值明细表_财务', 'form_code': '', 'form_name': '', 'fs': 'J315车队', 'fs_p': {'_id': '66d19d41d6eb869c4d32f453', 'dept_no': 1776480, 'name': 'J315车队', 'type': 0}, 'hphm': '京BDB5375', 'hz_month': None, 'hz_month1': '', 'id_card': '450481198712202058', 'jg': '康建利福汽车服务', 'mode_type': 'DP', 'name': '曾辉', 'pay_type': '微信支付', 'payment_content': '', 'rq': None, 'shfid': 'J488912202058', 'transactionid': '4200002659202504282942276472', 'type': '转入', 'updateTime': '2025-05-08T03:19:29.185Z', 'updater': {'_id': '66b980a0683f21a2d1429548', 'name': '葛梦伟', 'status': 1, 'type': 0, 'username': '993848'}, 'ys': None, 'zhtype': '预收款', 'zxform_code': ''}
2025-05-08 11:28:28,614 - werkzeug - INFO - 127.0.0.1 - - [08/May/2025 11:28:28] "POST /addPayment HTTP/1.1" 200 -
2025-05-08 11:29:16,713 - dpapp - INFO - DPPayApp started
2025-05-08 11:29:16,720 - werkzeug - INFO - * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
2025-05-08 11:29:18,796 - dpapp - INFO - 新增充值明细,data{"data":{"_id":"681c22c147f52adcb2aeed04","_widget_1743667106306":null,"_widget_1743667108715":"CZMX202505080000001","_widget_1744091796748":[],"appId":"675b8d1a24d61bca7bf1cb4c","car_dept":"金建","charge_amount":200,"charge_note":"","charge_time":"2025-05-08T03:19:22.000Z","collect_pos":"","contract_num":"","createTime":"2025-05-08T03:19:29.185Z","creator":{"_id":"66b980a0683f21a2d1429548","name":"葛梦伟","status":1,"type":0,"username":"993848"},"deleteTime":null,"deleter":null,"entryId":"67ee3fa22e399b68fef8d839","formName":"充值明细表_财务","form_code":"","form_name":"","fs":"J315车队","fs_p":{"_id":"66d19d41d6eb869c4d32f453","dept_no":1776480,"name":"J315车队","type":0},"hphm":"京BDB5375","hz_month":null,"hz_month1":"","id_card":"450481198712202058","jg":"康建利福汽车服务","mode_type":"DP","name":"曾辉","pay_type":"微信支付","payment_content":"","rq":null,"shfid":"J488912202058","transactionid":"4200002659202504282942276472","type":"转入","updateTime":"2025-05-08T03:19:29.185Z","updater":{"_id":"66b980a0683f21a2d1429548","name":"葛梦伟","status":1,"type":0,"username":"993848"},"ys":null,"zhtype":"预收款","zxform_code":""},"op":"data_create","opTime":1746674369185}
2025-05-08 11:29:18,892 - dpapp - INFO - 新增充值明细111,pay_amount: 200, id: 450481198712202058,fs: J315车队, jg: 康建利福汽车服务, name: 曾辉, shfid: J488912202058,fsfz: 1776480,hphm: 京BDB5375
2025-05-08 11:29:18,892 - werkzeug - INFO - 127.0.0.1 - - [08/May/2025 11:29:18] "POST /addPayment HTTP/1.1" 200 -
2025-05-08 11:29:18,893 - utils - INFO - 开始========data{'pay_amount': 200, 'id': '450481198712202058', 'fs': 'J315车队', 'jg': '康建利福汽车服务', 'name': '曾辉', 'shfid': 'J488912202058', 'fsfz': 1776480, 'hphm': '京BDB5375'}, type1
2025-05-08 11:29:18,893 - utils - INFO - 开始查询未收付明细, id_card: 450481198712202058,filter_data: {'app_id': '675b8d1a24d61bca7bf1cb4c', 'entry_id': '67e21d2ebaccd58c66fa7c77', 'limit': 100, 'filter': {'rel': 'and', 'cond': [{'field': 'id_card', 'method': 'eq', 'value': ['450481198712202058']}, {'field': 'no_money', 'method': 'eq', 'value': ['450481198712202058']}]}}
2025-05-08 11:29:21,521 - utils - INFO - 执行承包金add_payment{'pay_amount': 200, 'id': '450481198712202058', 'fs': 'J315车队', 'jg': '康建利福汽车服务', 'name': '曾辉', 'shfid': 'J488912202058', 'fsfz': 1776480, 'hphm': '京BDB5375'}
2025-05-08 11:29:21,521 - utils - INFO - 更新未收付{'2025-03': {'data': [{'creator': {'name': '葛梦伟', 'username': '993848', 'status': 1, 'type': 0, 'departments': [791], 'integrate_id': '993848'}, 'updater': {'name': '葛梦伟', 'username': '993848', 'status': 1, 'type': 0, 'departments': [791], 'integrate_id': '993848'}, 'deleter': None, 'createTime': '2025-05-08T02:09:51.328Z', 'updateTime': '2025-05-08T02:09:51.328Z', 'deleteTime': None, 'code': 'YZWL25050800001', '_widget_1745810482694': 'WSF25031800330', 'type': '收款', 'fukuanshiyou': '交通违法扣款', 'month1': '2025-03', 'month': '2025-02-28T16:00:00.000Z', 'yewubiaodanmingcheng': '替换车辆归还', 'yewubiaodanbianma': 'CLGH-p20250318005', 'sijixingming': '曾辉', 'id_card': '450481198712202058', 'shfid': 'J488912202058', 'company_jc': '', 'xd': '', 'sijisuozaigongsi': '康建利福汽车服务', 'fs': 'J315车队', 'license_plate': '京BD02424', 'fs_p': {'name': 'J315车队', 'dept_no': 1776480, 'type': 0, 'parent_no': 328, 'integrate_id': '1776480', 'status': 1}, 'money': 1200.0, 'pay': 1200.0, 'no_money': 0, 'ys': '2025-03-17T16:00:00.000Z', 'start_time': None, 'end_time': None, 'hz_month': '2025-02-28T16:00:00.000Z', '_widget_1744679600972': '', 'mode_type': 'DP', 'lydunjiao': '月租', 'bill_type': '个人账单', 'contract_num': '', 'car_dept': '金建', 'sy': '', 'shgid': '', '_id': '681c126f2e399b68feb72083', 'appId': '675b8d1a24d61bca7bf1cb4c', 'entryId': '67e21d2ebaccd58c66fa7c77', 'sort': 9999, 'flag': 1, 'flag_m': 1200.0}], '_th_amount': 1200.0, 'hz': []}, 'amount': 1200.0}
2025-05-08 11:29:21,673 - utils - INFO - 新增已收========={'app_id': '675b8d1a24d61bca7bf1cb4c', 'entry_id': '67f37759de8bbe9eed71b793', 'is_start_trigger': True, 'is_start_workflow': True, 'data': {'code': {'value': 'YZWL25050800001'}, 'type': {'value': '收款'}, 'fukuanshiyou': {'value': '交通违法扣款'}, 'month': {'value': '2025-02-28T16:00:00.000Z'}, 'month1': {'value': '2025-03'}, 'yewubiaodanmingcheng': {'value': '替换车辆归还'}, 'yewubiaodanbianma': {'value': 'CLGH-p20250318005'}, 'sijixingming': {'value': '曾辉'}, 'shfid': {'value': 'J488912202058'}, 'id_card': {'value': '450481198712202058'}, 'pay_time': {'value': '2025-05-08 03:29:21'}, 'company_jc': {'value': ''}, 'xd': {'value': ''}, 'sijisuozaigongsi': {'value': '康建利福汽车服务'}, 'fs': {'value': 'J315车队'}, 'license_plate': {'value': '京BD02424'}, 'money': {'value': 1200.0}, 'pay': {'value': 1200.0}, 'hz_month': {'value': '2025-02-28T16:00:00.000Z'}, 'fs_p': {'value': 1776480}, 'shgid': {'value': ''}, 'mode_type': {'value': 'DP'}, 'sy': {'value': '个人账户抵扣'}, 'ys': {'value': '2025-03-17T16:00:00.000Z'}, 'lydunjiao': {'value': '月租'}, 'bill_type': {'value': '个人账单'}, 'car_dept': {'value': '金建'}, 'contract_num': {'value': ''}}}

3
priv_key.pem Normal file
View File

@ -0,0 +1,3 @@
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC/32miL42GsFcVwII+YDxjbjAdASu6f0SyD6fz5jFl+QWYJ16Z8suIpFOpsrvlVE9t8PD1gX1tJmmJYCi1IjoUrVxdKc6nBZ8w68xhttIdnP341W2bBMjWK1Tr3IWC1BwUFYOaGT4c5RJf886BzmUQpQetxi88nXWJCVbAEedhi4OdCgULS7Z74leTDgIi3+xlU7qLICndcCC4zPQM3IsETt/WQBW0bed+sNYI7RxMaAKQ6PaGcbryjZshDtRby+s8UqgdHVnDXY4++DafJ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DqYuSueoY0EUecZh5WH6MdpZOAOJZ1LVzcKEogwKBgQDkA5O4Fcxgo8fZaCkeV7Tlg1C1RJBXDD+E29ToAJw2EOruPkWV+rkrZZSpz+4pwgKgcM9IIZJKo/fI7tKDIwj3D+JzFO+H0RNiyMvrCZe7fDnvaPcFGPwqKwyCpjkurKtUdXYbHz9wapFJzaLpYD9opPRBRwZK8TkmXSWNyJi0Kw==
-----END PRIVATE KEY-----

3
pub_key.pem Normal file
View File

@ -0,0 +1,3 @@
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCg2Sk+UF++991s65lk5rIekfG82nvlzz5P8JKxm98ZA4e2UE4avHvGnFv16maFl6SzOTtKcVMnJzyxJsyTIUZvOeEuBXv2ChdVpqux19h1UJPrUoaSH1gi8sYYSkQkiX8i4JJy4yXEmShdajDEPU/ywZ2/0MqXahO1GlFwQid+wwIDAQAB
-----END PUBLIC KEY-----

20
test.py Normal file
View File

@ -0,0 +1,20 @@
from flask import Flask, request, redirect, abort, session
from FuiouPay import H5Main
from utils import *
import os, _thread, urllib
from utils import *
# add_payment({'pay_amount': 5000, 'id': '450481198712202058', 'fs': 'J315车队', 'jg': '金建', 'name': '曾辉', 'fsfz': 1776480,
# 'shfid': 'J488912202058', 'hphm': '京BD02424', 'paymentdetails': []},1)
id_list = ['411024199002103214','130425199203156312','211381198704144119','210602198306150513','422326197404090017','41082219930630201X','413026197704257299','410311198701065578','131002198910063051','411403199405137232','210905198607031038','142702197203072115','34080219650302041X','412721197606053511','410927199001035018','131121198209030213','410523200311100274','231002197204291515','132801196904071812','232303197608246853','372930198112167358','412722199902065731','410182198203162134','410927198406156016','130726199606110055','131126198302172111','41232219740905339X','410482198110215934','130427199008233119','412723196806056811','320721197103302615','410522199911138135','13262719771129171X','37132519820630091X','430721198211020017','332621197109082770','412728197605121599','410311198710282558','41232719990822131X','342127197411200830','522421197401054894','410103197304162475','410122198212114429','120104198611146012','13212919770913071X','132628198209210516','411503199801054012','519002197404161293','130533198304185332','413026199503010977','413028197410216419','410523200011179355','410603198903230056','131024198710023985','411381198506044552','130429196810033818','513723198508160067','410482197411022357','410523199006115052','130634198609253510','372924199009153318','412723198011142184','130730199305153419','342222198104206050','371312198608046713','412702197605171832','110102197203151112','41052119921227705X','130427199405064718','130423197705012114','342127198002109272','410901198602281152','410927199306026032','230281199505102137','37252319830720845X','410821199010271019','41302619760122841X','130226197507055955','410221197404201417','140302197301191018','410927199905241017','142701197406033611','132130197009086717','131002197010093111','210727198110075139','230202198010292514','132522198006080535','410311198207063016','410523199004101036','410927198708105011','410521199101158090','41052119850529051X','413025197112266312','41052219770205813X']
for id in id_list:
res = filter_jdy_ht(id)
if not res:
print(f"未查询到数据: {id}")
continue
add_payment({"pay_amount": 0, "id": id,
"fs": res[1], "jg": res[0], "name": res[4], "shfid": res[7],
"fsfz": res[6],
"hphm": res[5]}, 1)
time.sleep(10)

1328
utils.py Normal file

File diff suppressed because it is too large Load Diff