Commit fdc2b4e5 authored by lanjiali's avatar lanjiali

学生费用预警查询-学生信息对比

parent d92abd02
......@@ -19,7 +19,9 @@
<select />
</component>
<component name="ChangeListManager">
<list default="true" id="54f4d37d-1724-4813-a1e2-24e200088c5f" name="Default Changelist" comment="关键字查询">
<list default="true" id="54f4d37d-1724-4813-a1e2-24e200088c5f" name="Default Changelist" comment="学生费用预警查询">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/data_config/report_config.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/data_config/report_config.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/test_demo.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/test_demo.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
......@@ -224,7 +226,14 @@
<option name="project" value="LOCAL" />
<updated>1619436346922</updated>
</task>
<option name="localTasksCounter" value="6" />
<task id="LOCAL-00006" summary="学生费用预警查询">
<created>1619436496702</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1619436496702</updated>
</task>
<option name="localTasksCounter" value="7" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
......@@ -244,6 +253,18 @@
<MESSAGE value="增加allure安装包" />
<MESSAGE value="修复return_json的bug" />
<MESSAGE value="关键字查询" />
<option name="LAST_COMMIT_MESSAGE" value="关键字查询" />
<MESSAGE value="学生费用预警查询" />
<option name="LAST_COMMIT_MESSAGE" value="学生费用预警查询" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/script/ji_yun_ying_pc/lanjiali_report/data_config/report_config.py</url>
<line>64</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>
\ No newline at end of file
......@@ -34,19 +34,15 @@ school_areas = [2389,2398,3363,3015,3154,3352,2369,3095,3348,3333,3351,3359,3345
#查询学生id列表对应的手机号
def select_student_phone(student_ids):
print(student_ids)
studentid = "','".join([str(x) for x in student_ids])
print(studentid)
sql = f"select student_prim_phone_no from service_profile.student where student_id in ('{studentid}')"
student_prim_phone_no = OperationDb().query_sql(sql)
print(student_prim_phone_no)
return [x[0] for x in student_prim_phone_no]\
#获取当前年份
def select_year():
today = datetime.datetime.today()
year = today.year
print(year)
return year
#select_year()
......
......@@ -5,6 +5,7 @@ from pytest_assume.plugin import assume
from common.connect_db import OperationDb
from script import public_asserts
from script.base_api.service_profile import students_queryById_get
from script.ji_yun_ying_pc.lanjiali_report.data_config.report_config import *
from script.base_api.service_report import report_finance_student_expense_warning_post
from script.base_api.service_user.employees import *
......@@ -306,7 +307,6 @@ class Test_select_student_expense:
#溢价总计
total_premium = jsonpath.jsonpath(res,"$.data.extend.premium")
print(total_premium)
premium_list = jsonpath.jsonpath(res,"$.data.list..premium")
sum_premium = round(sum(premium_list),2)
if total_premium[0] != sum_premium:
......@@ -316,19 +316,15 @@ class Test_select_student_expense:
#其他抵扣总计
total_otherDeduction = jsonpath.jsonpath(res,"$.data.extend.otherDeduction")
print(total_otherDeduction)
otherDeduction_list = jsonpath.jsonpath(res,"$.data.list..otherDeduction")
print(otherDeduction_list)
sum_otherDeduction = round(sum(otherDeduction_list),2)
assert sum_otherDeduction == round(total_otherDeduction[0],2)
#差异调整总计
total_imbalanceAmount = jsonpath.jsonpath(res,"$.data.extend.imbalanceAmount")
print(total_imbalanceAmount)
imbalanceAmount_list = jsonpath.jsonpath(res,"$.data.list..imbalanceAmount")
sum_imbalanceAmount = round(sum(imbalanceAmount_list),2)
print(sum_imbalanceAmount)
if total_imbalanceAmount[0] != sum_imbalanceAmount:
print("计算的差异调整与接口返回的差异调整不相等")
else:
......@@ -364,3 +360,28 @@ class Test_select_student_expense:
assert round(total_remainAmount[0], 2) == sum_remainAmount
@allure.step("学生费用预警-查看学生信息")
def test_select_stuinfo(self):
data = {
"pageNum": 1,
"pageSize": 10000,
"studentStatuses": [1110],
"year": select_year(),
"keyword": '蓝',
"term": select_term(),
"schoolAreaIds": school_areas
}
res = report_finance_student_expense_warning_post(header=jyy_header,body=data)
studentId_list = jsonpath.jsonpath(res,"$.data.list..studentId")
studentname_list = jsonpath.jsonpath(res,"$.data.list..studentName")
if len(studentId_list) == 0 & len(studentname_list) == 0:
print("接口查询没有返回数据")
else:
params = "studentId="+str(studentId_list[0])
student_res = students_queryById_get(header=jyy_header,params=params)
student_name = student_res['data']['studentName']
assert studentname_list[0] == student_name
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment