Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jk_interface_test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huangqiang
jk_interface_test
Commits
fdc2b4e5
Commit
fdc2b4e5
authored
Apr 27, 2021
by
lanjiali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
学生费用预警查询-学生信息对比
parent
d92abd02
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
12 deletions
+51
-12
workspace.xml
.idea/workspace.xml
+25
-3
report_config.py
..._yun_ying_pc/lanjiali_report/data_config/report_config.py
+0
-4
test_demo.py
script/ji_yun_ying_pc/lanjiali_report/test_demo.py
+26
-5
No files found.
.idea/workspace.xml
View file @
fdc2b4e5
...
@@ -19,7 +19,9 @@
...
@@ -19,7 +19,9 @@
<select
/>
<select
/>
</component>
</component>
<component
name=
"ChangeListManager"
>
<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"
/>
<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>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
...
@@ -224,7 +226,14 @@
...
@@ -224,7 +226,14 @@
<option
name=
"project"
value=
"LOCAL"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1619436346922
</updated>
<updated>
1619436346922
</updated>
</task>
</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
/>
<servers
/>
</component>
</component>
<component
name=
"Vcs.Log.Tabs.Properties"
>
<component
name=
"Vcs.Log.Tabs.Properties"
>
...
@@ -244,6 +253,18 @@
...
@@ -244,6 +253,18 @@
<MESSAGE
value=
"增加allure安装包"
/>
<MESSAGE
value=
"增加allure安装包"
/>
<MESSAGE
value=
"修复return_json的bug"
/>
<MESSAGE
value=
"修复return_json的bug"
/>
<MESSAGE
value=
"关键字查询"
/>
<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>
</component>
</project>
</project>
\ No newline at end of file
script/ji_yun_ying_pc/lanjiali_report/data_config/report_config.py
View file @
fdc2b4e5
...
@@ -34,19 +34,15 @@ school_areas = [2389,2398,3363,3015,3154,3352,2369,3095,3348,3333,3351,3359,3345
...
@@ -34,19 +34,15 @@ school_areas = [2389,2398,3363,3015,3154,3352,2369,3095,3348,3333,3351,3359,3345
#查询学生id列表对应的手机号
#查询学生id列表对应的手机号
def
select_student_phone
(
student_ids
):
def
select_student_phone
(
student_ids
):
print
(
student_ids
)
studentid
=
"','"
.
join
([
str
(
x
)
for
x
in
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}')"
sql
=
f
"select student_prim_phone_no from service_profile.student where student_id in ('{studentid}')"
student_prim_phone_no
=
OperationDb
()
.
query_sql
(
sql
)
student_prim_phone_no
=
OperationDb
()
.
query_sql
(
sql
)
print
(
student_prim_phone_no
)
return
[
x
[
0
]
for
x
in
student_prim_phone_no
]
\
return
[
x
[
0
]
for
x
in
student_prim_phone_no
]
\
#获取当前年份
#获取当前年份
def
select_year
():
def
select_year
():
today
=
datetime
.
datetime
.
today
()
today
=
datetime
.
datetime
.
today
()
year
=
today
.
year
year
=
today
.
year
print
(
year
)
return
year
return
year
#select_year()
#select_year()
...
...
script/ji_yun_ying_pc/lanjiali_report/test_demo.py
View file @
fdc2b4e5
...
@@ -5,6 +5,7 @@ from pytest_assume.plugin import assume
...
@@ -5,6 +5,7 @@ from pytest_assume.plugin import assume
from
common.connect_db
import
OperationDb
from
common.connect_db
import
OperationDb
from
script
import
public_asserts
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.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_report
import
report_finance_student_expense_warning_post
from
script.base_api.service_user.employees
import
*
from
script.base_api.service_user.employees
import
*
...
@@ -306,7 +307,6 @@ class Test_select_student_expense:
...
@@ -306,7 +307,6 @@ class Test_select_student_expense:
#溢价总计
#溢价总计
total_premium
=
jsonpath
.
jsonpath
(
res
,
"$.data.extend.premium"
)
total_premium
=
jsonpath
.
jsonpath
(
res
,
"$.data.extend.premium"
)
print
(
total_premium
)
premium_list
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..premium"
)
premium_list
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..premium"
)
sum_premium
=
round
(
sum
(
premium_list
),
2
)
sum_premium
=
round
(
sum
(
premium_list
),
2
)
if
total_premium
[
0
]
!=
sum_premium
:
if
total_premium
[
0
]
!=
sum_premium
:
...
@@ -316,19 +316,15 @@ class Test_select_student_expense:
...
@@ -316,19 +316,15 @@ class Test_select_student_expense:
#其他抵扣总计
#其他抵扣总计
total_otherDeduction
=
jsonpath
.
jsonpath
(
res
,
"$.data.extend.otherDeduction"
)
total_otherDeduction
=
jsonpath
.
jsonpath
(
res
,
"$.data.extend.otherDeduction"
)
print
(
total_otherDeduction
)
otherDeduction_list
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..otherDeduction"
)
otherDeduction_list
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..otherDeduction"
)
print
(
otherDeduction_list
)
sum_otherDeduction
=
round
(
sum
(
otherDeduction_list
),
2
)
sum_otherDeduction
=
round
(
sum
(
otherDeduction_list
),
2
)
assert
sum_otherDeduction
==
round
(
total_otherDeduction
[
0
],
2
)
assert
sum_otherDeduction
==
round
(
total_otherDeduction
[
0
],
2
)
#差异调整总计
#差异调整总计
total_imbalanceAmount
=
jsonpath
.
jsonpath
(
res
,
"$.data.extend.imbalanceAmount"
)
total_imbalanceAmount
=
jsonpath
.
jsonpath
(
res
,
"$.data.extend.imbalanceAmount"
)
print
(
total_imbalanceAmount
)
imbalanceAmount_list
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..imbalanceAmount"
)
imbalanceAmount_list
=
jsonpath
.
jsonpath
(
res
,
"$.data.list..imbalanceAmount"
)
sum_imbalanceAmount
=
round
(
sum
(
imbalanceAmount_list
),
2
)
sum_imbalanceAmount
=
round
(
sum
(
imbalanceAmount_list
),
2
)
print
(
sum_imbalanceAmount
)
if
total_imbalanceAmount
[
0
]
!=
sum_imbalanceAmount
:
if
total_imbalanceAmount
[
0
]
!=
sum_imbalanceAmount
:
print
(
"计算的差异调整与接口返回的差异调整不相等"
)
print
(
"计算的差异调整与接口返回的差异调整不相等"
)
else
:
else
:
...
@@ -364,3 +360,28 @@ class Test_select_student_expense:
...
@@ -364,3 +360,28 @@ class Test_select_student_expense:
assert
round
(
total_remainAmount
[
0
],
2
)
==
sum_remainAmount
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment