Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
cc802e9e
Commit
cc802e9e
authored
Mar 23, 2020
by
黄静
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hj
parent
80ff4169
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
calc_result/IndexComputerFile.py
+24
-7
calc_result/RiskComputer.py
+1
-1
No files found.
calc_result/IndexComputerFile.py
100755 → 100644
View file @
cc802e9e
...
...
@@ -17,14 +17,15 @@ class IndexComputer:
S
=
[]
for
factorkey
in
indexItem
.
FactorsValue
:
tempval
=
indexItem
.
FactorsValue
[
factorkey
]
tempval
=
str
(
tempval
)
if
indexItem
.
FactorsValue
[
factorkey
]
is
None
:
print
(
"is None"
)
return
"0"
return
{
"status_key"
:
0
,
"status_value"
:
"normal"
}
try
:
eval
(
tempval
)
except
:
print
(
"is isNumeric"
,
indexItem
.
FactorsValue
[
factorkey
])
return
"0"
return
{
"status_key"
:
0
,
"status_value"
:
"normal"
}
Y
.
append
(
float
(
indexItem
.
FactorsValue
[
factorkey
]))
V
[
factorkey
]
=
str
(
"Y["
+
str
(
i
)
+
"]"
)
S
.
append
(
factorkey
)
...
...
@@ -39,20 +40,36 @@ class IndexComputer:
strinfo
=
re
.
compile
(
r'X\[\d*\]='
)
funstr
=
strinfo
.
sub
(
""
,
funstr
)
try
:
funstr
=
funstr
.
replace
(
"[("
,
"(("
)
.
replace
(
")]"
,
"))"
)
print
(
funstr
,
"======funstr"
)
val
=
eval
(
funstr
)
X
.
append
(
val
)
j
=
j
+
1
except
ZeroDivisionError
as
err
:
print
(
'Handling run-time error:'
,
err
)
return
"0"
return
{
"status_key"
:
0
,
"status_value"
:
"normal"
}
except
(
ValueError
):
print
(
'other:'
,
ValueError
)
return
"0"
if
X
[
j
-
1
]
==
True
:
return
"2"
return
{
"status_key"
:
0
,
"status_value"
:
"normal"
}
if
X
[
j
-
1
]
==
False
:
if
indexItem
.
Name
in
[
"销售额变动率"
,
"销售毛利(益)率"
,
"税收负担率"
,
"税收负担变动率"
]:
last_gongshi
=
gongshi_list
[
-
1
]
print
(
last_gongshi
,
"=========last_gongshi"
)
# 2.以and进行分割
last_gongshi
=
last_gongshi
.
split
(
"and"
)
print
(
last_gongshi
[
0
],
last_gongshi
[
1
],
"=====aaa"
)
print
(
eval
(
last_gongshi
[
0
]),
"=====eval1"
)
print
(
eval
(
last_gongshi
[
1
]),
"=====eval2"
)
if
eval
(
last_gongshi
[
0
])
==
True
and
eval
(
last_gongshi
[
1
])
==
False
:
return
{
"status_key"
:
2
,
"status_value"
:
"big"
}
else
:
return
{
"status_key"
:
2
,
"status_value"
:
"small"
}
else
:
return
{
"status_key"
:
2
,
"status_value"
:
"normal"
}
else
:
return
"1"
return
{
"status_key"
:
1
,
"status_value"
:
"normal"
}
def
finance_Compute
(
self
,
indexItem
):
finance_result
=
{}
...
...
calc_result/RiskComputer.py
100755 → 100644
View file @
cc802e9e
...
...
@@ -38,7 +38,7 @@ class RiskComputer:
ret
=
ic
.
Compute
(
indexItem
)
self
.
IndexRes
[
indexItem
.
Name
]
=
ret
else
:
self
.
IndexRes
[
indexItem
.
Name
]
=
"0"
self
.
IndexRes
[
indexItem
.
Name
]
=
{
"status_key"
:
0
,
"status_value"
:
"normal"
}
else
:
if
flag
:
ret1
=
ic
.
finance_Compute
(
indexItem
)
...
...
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