Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
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
黄奎
Education
Commits
d5f566ad
Commit
d5f566ad
authored
Mar 05, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f3279cea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
73 deletions
+69
-73
OKRPeriodModule.cs
Edu.Module.OKR/OKRPeriodModule.cs
+67
-72
appsettings.json
Edu.WebApi/appsettings.json
+2
-1
No files found.
Edu.Module.OKR/OKRPeriodModule.cs
View file @
d5f566ad
...
...
@@ -8037,33 +8037,39 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{
//查询未填写
int
Number
=
oKR_ObjectiveRepository
.
GetNotFilledList
(
userInfo
.
Group_Id
,
periodId
,
userIds
);
RList
.
Add
(
new
{
Id
=
Num
,
Days
=
SDays
,
TotalNum
,
PeopleNum
=
TotalNum
-
Number
,
Type
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotFilled
,
TypeName
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotFilled
.
ToName
(),
SelectType
=
1
,
});
Num
++;
if
(
TotalNum
-
Number
>
0
)
{
RList
.
Add
(
new
{
Id
=
Num
,
Days
=
SDays
,
TotalNum
,
PeopleNum
=
TotalNum
-
Number
,
Type
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotFilled
,
TypeName
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotFilled
.
ToName
(),
SelectType
=
1
,
});
Num
++;
}
}
if
(!
list
.
Where
(
x
=>
x
.
Type
==
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotAlign
).
Any
()
&&
(
SValue
==
0
||
(
SValue
>
0
&&
SDays
>=
SValue
)))
{
//查询未对齐
int
Number
=
oKR_ObjectiveRepository
.
GetAlignPeopleNum
(
userInfo
.
Group_Id
,
periodId
,
userIds
);
RList
.
Add
(
new
{
Id
=
Num
,
Days
=
SDays
,
TotalNum
,
PeopleNum
=
TotalNum
-
Number
,
Type
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotAlign
,
TypeName
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotAlign
.
ToName
(),
SelectType
=
2
,
});
Num
++;
if
(
TotalNum
-
Number
>
0
)
{
RList
.
Add
(
new
{
Id
=
Num
,
Days
=
SDays
,
TotalNum
,
PeopleNum
=
TotalNum
-
Number
,
Type
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotAlign
,
TypeName
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotAlign
.
ToName
(),
SelectType
=
2
,
});
Num
++;
}
}
if
(!
list
.
Where
(
x
=>
x
.
Type
==
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotUpdated
).
Any
()
&&
(
EValue
==
0
||
(
EValue
>
0
&&
EDays
<=
EValue
)))
{
...
...
@@ -8083,18 +8089,21 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
if
(!
list
.
Where
(
x
=>
x
.
Type
==
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotScore
).
Any
()
&&
(
EValue
==
0
||
(
EValue
>
0
&&
EDays
<=
EValue
)))
{
//查询未打分
int
Number
=
oKR_ObjectiveRepository
.
GetNotScoreList
(
userInfo
.
Group_Id
,
periodId
,
userIds
);
RList
.
Add
(
new
{
Id
=
Num
,
Days
=
EDays
,
TotalNum
,
PeopleNum
=
Number
,
Type
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotScore
,
TypeName
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotScore
.
ToName
(),
SelectType
=
4
,
});
Num
++;
int
Number
=
oKR_ObjectiveRepository
.
GetNotScoreList
(
userInfo
.
Group_Id
,
periodId
,
userIds
,
2
);
if
(
TotalNum
-
Number
>
0
)
{
RList
.
Add
(
new
{
Id
=
Num
,
Days
=
EDays
,
TotalNum
,
PeopleNum
=
TotalNum
-
Number
,
Type
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotScore
,
TypeName
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
NotScore
.
ToName
(),
SelectType
=
4
,
});
Num
++;
}
}
}
}
...
...
@@ -8119,8 +8128,6 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{
int
TotalPeopleNum
=
userIdList
.
Count
();
string
userIds
=
string
.
Join
(
","
,
userIdList
);
List
<
RB_OKR_Objective_ViewModel
>
NRList
=
new
List
<
RB_OKR_Objective_ViewModel
>();
List
<
RB_OKR_Objective_ViewModel
>
LastRList
=
new
List
<
RB_OKR_Objective_ViewModel
>();
string
OKRMatterValue
=
Common
.
Config
.
OKRMatterValue
;
int
EValue
=
0
;
if
(!
string
.
IsNullOrEmpty
(
OKRMatterValue
))
...
...
@@ -8130,27 +8137,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
if
(!
list
.
Where
(
x
=>
x
.
Type
==
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
Write
).
Any
()
&&
(
EValue
==
0
||
(
EValue
>
0
&&
EDays
<=
EValue
)))
{
NRList
=
new
List
<
RB_OKR_Objective_ViewModel
>();
LastRList
=
new
List
<
RB_OKR_Objective_ViewModel
>();
//查询填写
NRList
=
oKR_ObjectiveRepository
.
GetWritePageList
(
1
,
100000
,
out
long
count
,
userInfo
.
Group_Id
,
periodId
,
userIds
,
1
);
int
OKPNum
=
oKR_ObjectiveRepository
.
GetNotFilledList
(
userInfo
.
Group_Id
,
periodId
,
userIds
);
int
LastPNum
=
0
;
if
(
lastPeriodId
>
0
)
{
Last
RList
=
oKR_ObjectiveRepository
.
GetWritePageList
(
1
,
100000
,
out
count
,
userInfo
.
Group_Id
,
lastPeriodId
,
userIds
,
1
);
Last
PNum
=
oKR_ObjectiveRepository
.
GetNotFilledList
(
userInfo
.
Group_Id
,
lastPeriodId
,
userIds
);
}
#
region
计算概率
int
PeopleNum
=
NRList
.
Count
();
int
OKPNum
=
NRList
.
Where
(
x
=>
x
.
Status
==
1
).
Count
();
decimal
nowRate
=
0
;
if
(
PeopleNum
>
0
)
if
(
Total
PeopleNum
>
0
)
{
nowRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
OKPNum
)
/
PeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
nowRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
OKPNum
)
/
Total
PeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
}
int
lPeopleNum
=
LastRList
.
Count
();
decimal
lastRate
=
0
;
if
(
lPeopleNum
>
0
)
if
(
Tota
lPeopleNum
>
0
)
{
lastRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
Last
RList
.
Where
(
x
=>
x
.
Status
==
1
).
Count
())
/
lPeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
lastRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
Last
PNum
)
/
Tota
lPeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
}
//只查询同比下降的
decimal
UpRate
=
0
;
...
...
@@ -8168,7 +8171,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{
Id
=
Num
,
Days
=
EDays
,
TotalNum
=
PeopleNum
,
TotalNum
=
Total
PeopleNum
,
PeopleNum
=
OKPNum
,
UpRate
,
Type
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
Write
,
...
...
@@ -8181,27 +8184,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
if
(!
list
.
Where
(
x
=>
x
.
Type
==
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
Align
).
Any
()
&&
(
EValue
==
0
||
(
EValue
>
0
&&
EDays
<=
EValue
)))
{
NRList
=
new
List
<
RB_OKR_Objective_ViewModel
>();
LastRList
=
new
List
<
RB_OKR_Objective_ViewModel
>();
//查询对齐
NRList
=
oKR_ObjectiveRepository
.
GetAlignPageList
(
1
,
100000
,
out
long
count
,
userInfo
.
Group_Id
,
periodId
,
userIds
,
1
);
int
OKPNum
=
oKR_ObjectiveRepository
.
GetAlignPeopleNum
(
userInfo
.
Group_Id
,
periodId
,
userIds
);
int
LastPNum
=
0
;
if
(
lastPeriodId
>
0
)
{
Last
RList
=
oKR_ObjectiveRepository
.
GetAlignPageList
(
1
,
100000
,
out
count
,
userInfo
.
Group_Id
,
lastPeriodId
,
userIds
,
1
);
Last
PNum
=
oKR_ObjectiveRepository
.
GetAlignPeopleNum
(
userInfo
.
Group_Id
,
lastPeriodId
,
userIds
);
}
#
region
计算概率
int
PeopleNum
=
NRList
.
Count
();
int
OKPNum
=
NRList
.
Where
(
x
=>
x
.
Status
==
1
).
Count
();
decimal
nowRate
=
0
;
if
(
PeopleNum
>
0
)
if
(
Total
PeopleNum
>
0
)
{
nowRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
OKPNum
)
/
PeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
nowRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
OKPNum
)
/
Total
PeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
}
int
lPeopleNum
=
LastRList
.
Count
();
decimal
lastRate
=
0
;
if
(
lPeopleNum
>
0
)
if
(
Tota
lPeopleNum
>
0
)
{
lastRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
Last
RList
.
Where
(
x
=>
x
.
Status
==
1
).
Count
())
/
lPeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
lastRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
Last
PNum
)
/
Tota
lPeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
}
//只查询同比下降的
decimal
UpRate
=
0
;
...
...
@@ -8219,7 +8218,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{
Id
=
Num
,
Days
=
EDays
,
TotalNum
=
PeopleNum
,
TotalNum
=
Total
PeopleNum
,
PeopleNum
=
OKPNum
,
UpRate
,
Type
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
Align
,
...
...
@@ -8232,27 +8231,23 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
}
if
(!
list
.
Where
(
x
=>
x
.
Type
==
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
Score
).
Any
()
&&
(
EValue
==
0
||
(
EValue
>
0
&&
EDays
<=
EValue
)))
{
NRList
=
new
List
<
RB_OKR_Objective_ViewModel
>();
LastRList
=
new
List
<
RB_OKR_Objective_ViewModel
>();
//查询打分
NRList
=
oKR_ObjectiveRepository
.
GetScorePageList
(
1
,
100000
,
out
long
count
,
userInfo
.
Group_Id
,
periodId
,
userIds
,
1
);
int
OKPNum
=
oKR_ObjectiveRepository
.
GetNotScoreList
(
userInfo
.
Group_Id
,
periodId
,
userIds
,
2
);
int
LastPNum
=
0
;
if
(
lastPeriodId
>
0
)
{
Last
RList
=
oKR_ObjectiveRepository
.
GetScorePageList
(
1
,
100000
,
out
count
,
userInfo
.
Group_Id
,
lastPeriodId
,
userIds
,
1
);
Last
PNum
=
oKR_ObjectiveRepository
.
GetNotScoreList
(
userInfo
.
Group_Id
,
lastPeriodId
,
userIds
,
2
);
}
#
region
计算概率
int
PeopleNum
=
NRList
.
Count
();
int
OKPNum
=
NRList
.
Where
(
x
=>
x
.
Status
==
1
).
Count
();
decimal
nowRate
=
0
;
if
(
PeopleNum
>
0
)
if
(
Total
PeopleNum
>
0
)
{
nowRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
OKPNum
)
/
PeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
nowRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
OKPNum
)
/
Total
PeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
}
int
lPeopleNum
=
LastRList
.
Count
();
decimal
lastRate
=
0
;
if
(
lPeopleNum
>
0
)
if
(
Tota
lPeopleNum
>
0
)
{
lastRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
Last
RList
.
Where
(
x
=>
x
.
Status
==
1
).
Count
())
/
lPeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
lastRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
Last
PNum
)
/
Tota
lPeopleNum
,
3
,
MidpointRounding
.
AwayFromZero
)
*
100
;
}
//只查询同比下降的
decimal
UpRate
=
0
;
...
...
@@ -8270,7 +8265,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{
Id
=
Num
,
Days
=
EDays
,
TotalNum
=
PeopleNum
,
TotalNum
=
Total
PeopleNum
,
PeopleNum
=
OKPNum
,
UpRate
,
Type
=
Common
.
Enum
.
OKR
.
MatterTypeEnum
.
Score
,
...
...
Edu.WebApi/appsettings.json
View file @
d5f566ad
...
...
@@ -37,7 +37,8 @@
"RedisPwd"
:
"Viitto2018"
},
"VirtualDirectory"
:
"WebFile"
,
"OKRMatterValue"
:
"30,100"
,
//未填写
未打分
下降比例
"OKRMatterValue"
:
"30,100,100"
,
//是否是线上环境
"IsOnline"
:
false
,
//退课流程编号
...
...
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