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
5d9eb044
Commit
5d9eb044
authored
Mar 02, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
okrbug调整
parent
f37ed9f5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
43 deletions
+77
-43
OKRPeriodModule.cs
Edu.Module.OKR/OKRPeriodModule.cs
+76
-43
OKRPeriodController.cs
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
+1
-0
No files found.
Edu.Module.OKR/OKRPeriodModule.cs
View file @
5d9eb044
...
...
@@ -167,6 +167,24 @@ namespace Edu.Module.OKR
//更新所有历史周期
oKR_PeriodRepository
.
SetPeriodHistory
(
userInfo
.
Group_Id
);
var
nlist
=
oKR_PeriodRepository
.
GetList
(
new
RB_OKR_Period_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
Name
=
dmodel
.
StartDate
.
Value
.
ToString
(
"yyyy年MM月"
)
+
"-"
+
dmodel
.
EndDate
.
Value
.
ToString
(
"yyyy年MM月"
)
});
if
(
nlist
.
Any
())
{
var
nmodel
=
nlist
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_OKR_Period_ViewModel
.
IsNormal
),
1
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_OKR_Period_ViewModel
.
Id
),
FiledValue
=
nmodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
oKR_PeriodRepository
.
Update
(
keyValues1
,
wheres1
);
}
else
{
//生成对应期数
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
{
...
...
@@ -181,13 +199,18 @@ namespace Edu.Module.OKR
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
UpdateTime
=
DateTime
.
Now
,
IsNormal
=
1
});
}
}
if
(
dmodel
.
YearOKR
==
1
)
{
//今年
var
nlist
=
oKR_PeriodRepository
.
GetList
(
new
RB_OKR_Period_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
Name
=
dmodel
.
StartDate
.
Value
.
Year
+
"年度OKR"
});
if
(!
nlist
.
Any
())
{
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
{
Id
=
0
,
...
...
@@ -201,11 +224,16 @@ namespace Edu.Module.OKR
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
UpdateTime
=
DateTime
.
Now
,
IsNormal
=
1
});
}
if
(
dmodel
.
StartDate
.
Value
.
Year
!=
dmodel
.
EndDate
.
Value
.
Year
)
{
//明年
var
nextlist
=
oKR_PeriodRepository
.
GetList
(
new
RB_OKR_Period_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
Name
=
dmodel
.
StartDate
.
Value
.
Year
+
"年度OKR"
});
if
(!
nextlist
.
Any
())
{
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
{
Id
=
0
,
...
...
@@ -219,10 +247,12 @@ namespace Edu.Module.OKR
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
UpdateTime
=
DateTime
.
Now
,
IsNormal
=
1
});
}
}
}
//看最新的天数 是否满足生成下一周期
if
(
dmodel
.
BeforeType
==
1
)
{
...
...
@@ -285,7 +315,8 @@ namespace Edu.Module.OKR
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
UpdateTime
=
DateTime
.
Now
,
IsNormal
=
1
});
if
(
dmodel
.
YearOKR
==
1
)
{
...
...
@@ -306,7 +337,8 @@ namespace Edu.Module.OKR
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
UpdateTime
=
DateTime
.
Now
,
IsNormal
=
1
});
}
if
(
dmodel
.
StartDate
.
Value
.
Year
!=
dmodel
.
EndDate
.
Value
.
Year
)
...
...
@@ -328,7 +360,8 @@ namespace Edu.Module.OKR
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
UpdateTime
=
DateTime
.
Now
,
IsNormal
=
1
});
}
}
...
...
@@ -1838,7 +1871,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
q
.
Sort
,
q
.
IsLock
,
q
.
IsNotLook
,
KeyResultList
=
x
.
KeyResultList
.
Select
(
z
=>
new
KeyResultList
=
q
.
KeyResultList
.
Select
(
z
=>
new
{
z
.
Id
,
Name
=
z
.
IsNotLook
==
1
?
""
:
z
.
Name
,
...
...
@@ -1860,7 +1893,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
q
.
Sort
,
q
.
IsLock
,
q
.
IsNotLook
,
KeyResultList
=
x
.
KeyResultList
.
Select
(
z
=>
new
KeyResultList
=
q
.
KeyResultList
.
Select
(
z
=>
new
{
z
.
Id
,
Name
=
z
.
IsNotLook
==
1
?
""
:
z
.
Name
,
...
...
@@ -2117,7 +2150,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
q
.
Sort
,
q
.
IsLock
,
q
.
IsNotLook
,
KeyResultList
=
x
.
KeyResultList
.
Select
(
z
=>
new
KeyResultList
=
q
.
KeyResultList
.
Select
(
z
=>
new
{
z
.
Id
,
Name
=
z
.
IsNotLook
==
1
?
""
:
z
.
Name
,
...
...
@@ -2139,7 +2172,7 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
q
.
Sort
,
q
.
IsLock
,
q
.
IsNotLook
,
KeyResultList
=
x
.
KeyResultList
.
Select
(
z
=>
new
KeyResultList
=
q
.
KeyResultList
.
Select
(
z
=>
new
{
z
.
Id
,
Name
=
z
.
IsNotLook
==
1
?
""
:
z
.
Name
,
...
...
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
View file @
5d9eb044
...
...
@@ -1337,6 +1337,7 @@ namespace Edu.WebApi.Controllers.OKR
x
.
Table
,
x
.
Field
,
x
.
Way
,
WayName
=
x
.
Way
.
ToName
(),
x
.
State
,
x
.
Identity
,
x
.
Time
,
...
...
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