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
23f94a39
Commit
23f94a39
authored
Jan 08, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周期生成调整
parent
bfc76adb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
36 deletions
+114
-36
QuarzHelper.cs
Edu.EducationCore/Helper/QuarzHelper.cs
+2
-2
OKRPeriodModule.cs
Edu.Module.OKR/OKRPeriodModule.cs
+112
-34
No files found.
Edu.EducationCore/Helper/QuarzHelper.cs
View file @
23f94a39
...
@@ -162,7 +162,7 @@ namespace Edu.Education.Helper
...
@@ -162,7 +162,7 @@ namespace Edu.Education.Helper
{
{
dmodel
.
EndDate
=
model
.
EndDate
;
dmodel
.
EndDate
=
model
.
EndDate
;
//生成下一个周期
//生成下一个周期
oKRPeriodModule
.
CreatePeriodNext
(
dmodel
);
oKRPeriodModule
.
CreatePeriodNext
(
dmodel
,
true
);
}
}
}
}
else
else
...
@@ -173,7 +173,7 @@ namespace Edu.Education.Helper
...
@@ -173,7 +173,7 @@ namespace Edu.Education.Helper
{
{
dmodel
.
EndDate
=
model
.
EndDate
;
dmodel
.
EndDate
=
model
.
EndDate
;
//生成下一个周期
//生成下一个周期
oKRPeriodModule
.
CreatePeriodNext
(
dmodel
);
oKRPeriodModule
.
CreatePeriodNext
(
dmodel
,
true
);
}
}
}
}
}
}
...
...
Edu.Module.OKR/OKRPeriodModule.cs
View file @
23f94a39
...
@@ -166,6 +166,45 @@ namespace Edu.Module.OKR
...
@@ -166,6 +166,45 @@ namespace Edu.Module.OKR
UpdateTime
=
DateTime
.
Now
UpdateTime
=
DateTime
.
Now
});
});
}
}
if
(
dmodel
.
YearOKR
==
1
)
{
//今年
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
{
Id
=
0
,
IsYear
=
1
,
Status
=
0
,
Name
=
dmodel
.
StartDate
.
Value
.
Year
+
"年度OKR"
,
StartDate
=
Convert
.
ToDateTime
(
dmodel
.
StartDate
.
Value
.
Year
+
"-01-01"
),
EndDate
=
Convert
.
ToDateTime
(
dmodel
.
StartDate
.
Value
.
Year
+
"-01-01 23:59:59"
).
AddYears
(
1
).
AddDays
(-
1
),
Group_Id
=
dmodel
.
Group_Id
,
School_Id
=
dmodel
.
School_Id
,
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
});
if
(
dmodel
.
StartDate
.
Value
.
Year
!=
dmodel
.
EndDate
.
Value
.
Year
)
{
//明年
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
{
Id
=
0
,
IsYear
=
1
,
Status
=
0
,
Name
=
dmodel
.
EndDate
.
Value
.
Year
+
"年度OKR"
,
StartDate
=
Convert
.
ToDateTime
(
dmodel
.
EndDate
.
Value
.
Year
+
"-01-01"
),
EndDate
=
Convert
.
ToDateTime
(
dmodel
.
EndDate
.
Value
.
Year
+
"-01-01 23:59:59"
).
AddYears
(
1
).
AddDays
(-
1
),
Group_Id
=
dmodel
.
Group_Id
,
School_Id
=
dmodel
.
School_Id
,
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
});
}
}
//看最新的天数 是否满足生成下一周期
//看最新的天数 是否满足生成下一周期
if
(
dmodel
.
BeforeType
==
1
)
if
(
dmodel
.
BeforeType
==
1
)
{
{
...
@@ -227,12 +266,15 @@ namespace Edu.Module.OKR
...
@@ -227,12 +266,15 @@ namespace Edu.Module.OKR
});
});
if
(
dmodel
.
YearOKR
==
1
)
{
if
(
dmodel
.
YearOKR
==
1
)
{
//今年
//今年
string
YearName
=
dmodel
.
StartDate
.
Value
.
Year
+
"年度OKR"
;
if
(!
oKR_PeriodRepository
.
GetList
(
new
RB_OKR_Period_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
IsNormal
=
1
,
Name
=
YearName
}).
Any
())
{
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
{
{
Id
=
0
,
Id
=
0
,
IsYear
=
1
,
IsYear
=
1
,
Status
=
0
,
Status
=
0
,
Name
=
dmodel
.
StartDate
.
Value
.
Year
+
"年度OKR"
,
Name
=
YearName
,
StartDate
=
Convert
.
ToDateTime
(
dmodel
.
StartDate
.
Value
.
Year
+
"-01-01"
),
StartDate
=
Convert
.
ToDateTime
(
dmodel
.
StartDate
.
Value
.
Year
+
"-01-01"
),
EndDate
=
Convert
.
ToDateTime
(
dmodel
.
StartDate
.
Value
.
Year
+
"-01-01 23:59:59"
).
AddYears
(
1
).
AddDays
(-
1
),
EndDate
=
Convert
.
ToDateTime
(
dmodel
.
StartDate
.
Value
.
Year
+
"-01-01 23:59:59"
).
AddYears
(
1
).
AddDays
(-
1
),
Group_Id
=
dmodel
.
Group_Id
,
Group_Id
=
dmodel
.
Group_Id
,
...
@@ -242,15 +284,21 @@ namespace Edu.Module.OKR
...
@@ -242,15 +284,21 @@ namespace Edu.Module.OKR
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
UpdateTime
=
DateTime
.
Now
});
});
}
if
(
dmodel
.
StartDate
.
Value
.
Year
!=
dmodel
.
EndDate
.
Value
.
Year
)
{
//明年
//明年
string
YearName1
=
dmodel
.
EndDate
.
Value
.
Year
+
"年度OKR"
;
if
(!
oKR_PeriodRepository
.
GetList
(
new
RB_OKR_Period_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
IsNormal
=
1
,
Name
=
YearName1
}).
Any
())
{
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
{
{
Id
=
0
,
Id
=
0
,
IsYear
=
1
,
IsYear
=
1
,
Status
=
0
,
Status
=
0
,
Name
=
dmodel
.
StartDate
.
Value
.
AddYears
(
1
).
Year
+
"年度OKR"
,
Name
=
YearName1
,
StartDate
=
Convert
.
ToDateTime
(
dmodel
.
StartDate
.
Value
.
AddYears
(
1
)
.
Year
+
"-01-01"
),
StartDate
=
Convert
.
ToDateTime
(
dmodel
.
EndDate
.
Value
.
Year
+
"-01-01"
),
EndDate
=
Convert
.
ToDateTime
(
dmodel
.
StartDate
.
Value
.
AddYears
(
1
)
.
Year
+
"-01-01 23:59:59"
).
AddYears
(
1
).
AddDays
(-
1
),
EndDate
=
Convert
.
ToDateTime
(
dmodel
.
EndDate
.
Value
.
Year
+
"-01-01 23:59:59"
).
AddYears
(
1
).
AddDays
(-
1
),
Group_Id
=
dmodel
.
Group_Id
,
Group_Id
=
dmodel
.
Group_Id
,
School_Id
=
dmodel
.
School_Id
,
School_Id
=
dmodel
.
School_Id
,
CreateBy
=
dmodel
.
CreateBy
,
CreateBy
=
dmodel
.
CreateBy
,
...
@@ -259,6 +307,8 @@ namespace Edu.Module.OKR
...
@@ -259,6 +307,8 @@ namespace Edu.Module.OKR
UpdateTime
=
DateTime
.
Now
UpdateTime
=
DateTime
.
Now
});
});
}
}
}
}
//看最新的天数 是否满足生成下一周期
//看最新的天数 是否满足生成下一周期
if
(
dmodel
.
BeforeType
==
1
)
if
(
dmodel
.
BeforeType
==
1
)
...
@@ -303,7 +353,7 @@ namespace Edu.Module.OKR
...
@@ -303,7 +353,7 @@ namespace Edu.Module.OKR
/// 创建下一个周期
/// 创建下一个周期
/// </summary>
/// </summary>
/// <param name="dmodel"></param>
/// <param name="dmodel"></param>
public
void
CreatePeriodNext
(
RB_OKR_PeriodConfig_ViewModel
dmodel
)
public
void
CreatePeriodNext
(
RB_OKR_PeriodConfig_ViewModel
dmodel
,
bool
IsCreateYear
=
false
)
{
{
DateTime
STime
=
Convert
.
ToDateTime
(
dmodel
.
EndDate
.
Value
.
AddDays
(
1
).
ToString
(
"yyyy-MM-dd"
));
DateTime
STime
=
Convert
.
ToDateTime
(
dmodel
.
EndDate
.
Value
.
AddDays
(
1
).
ToString
(
"yyyy-MM-dd"
));
DateTime
ETime
=
Convert
.
ToDateTime
(
STime
.
AddMonths
((
int
)
dmodel
.
PeriodMonth
).
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
)
+
" 23:59:59"
);
DateTime
ETime
=
Convert
.
ToDateTime
(
STime
.
AddMonths
((
int
)
dmodel
.
PeriodMonth
).
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
)
+
" 23:59:59"
);
...
@@ -311,7 +361,7 @@ namespace Edu.Module.OKR
...
@@ -311,7 +361,7 @@ namespace Edu.Module.OKR
string
Name
=
STime
.
ToString
(
"yyyy年MM月"
)
+
"-"
+
ETime
.
ToString
(
"yyyy年MM月"
);
string
Name
=
STime
.
ToString
(
"yyyy年MM月"
)
+
"-"
+
ETime
.
ToString
(
"yyyy年MM月"
);
if
(!
oKR_PeriodRepository
.
GetList
(
new
RB_OKR_Period_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
IsNormal
=
1
,
Name
=
Name
}).
Any
())
if
(!
oKR_PeriodRepository
.
GetList
(
new
RB_OKR_Period_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
IsNormal
=
1
,
Name
=
Name
}).
Any
())
{
{
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
bool
flag
=
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
{
{
Id
=
0
,
Id
=
0
,
IsYear
=
2
,
IsYear
=
2
,
...
@@ -324,10 +374,38 @@ namespace Edu.Module.OKR
...
@@ -324,10 +374,38 @@ namespace Edu.Module.OKR
CreateBy
=
dmodel
.
CreateBy
,
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
UpdateTime
=
DateTime
.
Now
,
IsNormal
=
1
})
>
0
;
if
(
flag
&&
IsCreateYear
&&
dmodel
.
YearOKR
==
1
)
{
DateTime
YearStart
=
Convert
.
ToDateTime
(
ETime
.
Year
+
"-01-01"
);
if
(
STime
<=
YearStart
&&
YearStart
<
ETime
)
{
string
YearName
=
YearStart
.
Year
+
"年度OKR"
;
if
(!
oKR_PeriodRepository
.
GetList
(
new
RB_OKR_Period_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
IsNormal
=
1
,
Name
=
YearName
}).
Any
())
{
//跨年了 直接新增该年 年度周期
oKR_PeriodRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_Period
()
{
Id
=
0
,
IsYear
=
1
,
Status
=
0
,
Name
=
YearName
,
StartDate
=
YearStart
,
EndDate
=
Convert
.
ToDateTime
(
YearStart
.
Year
+
"-01-01 23:59:59"
).
AddYears
(
1
).
AddDays
(-
1
),
Group_Id
=
dmodel
.
Group_Id
,
School_Id
=
dmodel
.
School_Id
,
CreateBy
=
dmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
,
IsNormal
=
1
});
});
}
}
}
}
}
}
}
/// <summary>
/// <summary>
/// 获取提醒设置列表
/// 获取提醒设置列表
...
@@ -665,7 +743,7 @@ namespace Edu.Module.OKR
...
@@ -665,7 +743,7 @@ namespace Edu.Module.OKR
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_OKR_Period_ViewModel
>
GetCurrentPeriodList
(
int
GroupId
)
public
List
<
RB_OKR_Period_ViewModel
>
GetCurrentPeriodList
(
int
GroupId
)
{
{
return
oKR_PeriodRepository
.
GetList
(
new
RB_OKR_Period_ViewModel
()
{
Group_Id
=
GroupId
,
IsCurrent
=
1
,
IsNormal
=
1
});
return
oKR_PeriodRepository
.
GetList
(
new
RB_OKR_Period_ViewModel
()
{
Group_Id
=
GroupId
,
IsCurrent
=
1
,
IsNormal
=
1
,
IsYear
=
2
});
}
}
/// <summary>
/// <summary>
...
...
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