|
@@ -66,7 +66,7 @@ def check_params(func, param_rows: dict, is_check_type=False) -> (bool, list):
|
|
|
"""
|
|
|
函数传参数
|
|
|
"""
|
|
|
- _default_params = {"attach_text": {}, "bidamount": 0, "budget": 0} # 必要参数的默认值
|
|
|
+ _default_params = {"attach_text": {}, "bidamount": 0, "budget": 0,"supervisorrate":0} # 必要参数的默认值
|
|
|
func_params = inspect.getfullargspec(func) # 取出函数的参数
|
|
|
args_annotations = func_params.annotations # 参数类型dict,取出参数类型
|
|
|
args_list = func_params.args # 参数list
|
|
@@ -192,7 +192,8 @@ if __name__ == '__main__':
|
|
|
"autoid" : int(249351001),
|
|
|
"bidamount" : 15440.0,
|
|
|
"bidway" : "电子投标",
|
|
|
- "budget" : 15440.0,
|
|
|
+ "budget" : 15440.0,
|
|
|
+ "supervisorrate": 0.03,
|
|
|
"buyer" : "二连浩特市人民医院",
|
|
|
"buyerclass" : "医疗",
|
|
|
"dataprocess" : int(8),
|
|
@@ -221,20 +222,14 @@ if __name__ == '__main__':
|
|
|
"winner" : "二连浩特市智慧真彩文体办公",
|
|
|
"pici" : int(1698740066)
|
|
|
}
|
|
|
- result=check(row,rules={ "purchasinglist" : {
|
|
|
- "0101" : {
|
|
|
- "name" : "标的物评估",
|
|
|
- "parent_name" : "标的物",
|
|
|
- "parent_code" : "01"
|
|
|
+ result=check(row,rules={
|
|
|
+ "bidamount" : {
|
|
|
+ "0104": {
|
|
|
+ "name": "中标金额存在费率,折扣率",
|
|
|
+ "parent_name": "金额错误",
|
|
|
+ "parent_code": "01",
|
|
|
}
|
|
|
},
|
|
|
- "title": {
|
|
|
- "0101": {
|
|
|
- "name": "<=5个字",
|
|
|
- "parent_name": "长度类型",
|
|
|
- "parent_code": "01"
|
|
|
- }
|
|
|
- }
|
|
|
})
|
|
|
|
|
|
print(result)
|