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
5b726456
Commit
5b726456
authored
Jan 04, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交okr评论
parent
9c6f6bc2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
407 additions
and
96 deletions
+407
-96
StringHelper.cs
Edu.Common/Plugin/StringHelper.cs
+58
-1
RB_OKR_Comment_ViewModel.cs
Edu.Model/ViewModel/OKR/RB_OKR_Comment_ViewModel.cs
+18
-0
OKRPeriodModule.cs
Edu.Module.OKR/OKRPeriodModule.cs
+133
-41
RB_OKR_CommentRepository.cs
Edu.Repository/OKR/RB_OKR_CommentRepository.cs
+8
-2
OKRPeriodController.cs
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
+190
-52
No files found.
Edu.Common/Plugin/StringHelper.cs
View file @
5b726456
...
@@ -50,6 +50,62 @@ namespace Edu.Common.Plugin
...
@@ -50,6 +50,62 @@ namespace Edu.Common.Plugin
#
endregion
#
endregion
#
region
"日期相关"
#
region
"日期相关"
public
static
string
DateFormatToString
(
DateTime
dt
)
{
//TimeSpan表示时间间隔
TimeSpan
span
=
(
DateTime
.
Now
-
dt
).
Duration
();
//表示取timespan绝对值
//if (span.TotalDays > 60)
//{
// return dt.ToString("yyyy-MM-dd");
//}
//else if (span.TotalDays > 30)
//{
// return "1个月前";
//}
//else if (span.TotalDays > 14)
//{
// return "2周前";
//}
if
(
dt
.
Year
==
DateTime
.
Now
.
Year
)
{
if
(
span
.
TotalDays
>
7
)
{
return
dt
.
ToString
(
"yyyy-MM-dd"
);
}
else
if
(
span
.
TotalDays
>
1
)
{
return
string
.
Format
(
"{0}天前"
,
(
int
)
Math
.
Floor
(
span
.
TotalDays
));
}
else
if
(
span
.
TotalHours
>
1
)
{
return
string
.
Format
(
"{0}小时前"
,
(
int
)
Math
.
Floor
(
span
.
TotalHours
));
}
else
if
(
span
.
TotalMinutes
>
1
)
{
return
string
.
Format
(
"{0}分钟前"
,
(
int
)
Math
.
Floor
(
span
.
TotalMinutes
));
}
else
if
(
span
.
TotalSeconds
>=
1
)
{
return
string
.
Format
(
"{0}秒前"
,
(
int
)
Math
.
Floor
(
span
.
TotalSeconds
));
}
else
{
return
"1秒前"
;
}
}
else
{
return
dt
.
ToString
(
"yyyy-MM-dd"
);
}
}
/// <summary>
/// <summary>
/// 获取星期的字符串
/// 获取星期的字符串
/// </summary>
/// </summary>
...
@@ -472,7 +528,8 @@ namespace Edu.Common.Plugin
...
@@ -472,7 +528,8 @@ namespace Edu.Common.Plugin
{
{
TotalDay
=
Saturday
+
Sunday
+
2
;
TotalDay
=
Saturday
+
Sunday
+
2
;
}
}
else
{
else
{
TotalDay
=
Saturday
+
Sunday
+
1
;
TotalDay
=
Saturday
+
Sunday
+
1
;
}
}
}
}
...
...
Edu.Model/ViewModel/OKR/RB_OKR_Comment_ViewModel.cs
View file @
5b726456
...
@@ -9,6 +9,24 @@ namespace Edu.Model.ViewModel.OKR
...
@@ -9,6 +9,24 @@ namespace Edu.Model.ViewModel.OKR
[
Serializable
]
[
Serializable
]
public
class
RB_OKR_Comment_ViewModel
:
Model
.
Entity
.
OKR
.
RB_OKR_Comment
public
class
RB_OKR_Comment_ViewModel
:
Model
.
Entity
.
OKR
.
RB_OKR_Comment
{
{
/// <summary>
/// 创建人
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
/// <summary>
/// 创建人头像
/// </summary>
public
string
CreateByIco
{
get
;
set
;
}
/// <summary>
/// 操作人
/// </summary>
public
string
UpdateByName
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
string
CreateTimeStr
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Edu.Module.OKR/OKRPeriodModule.cs
View file @
5b726456
This diff is collapsed.
Click to expand it.
Edu.Repository/OKR/RB_OKR_CommentRepository.cs
View file @
5b726456
...
@@ -37,7 +37,10 @@ namespace Edu.Repository.OKR
...
@@ -37,7 +37,10 @@ namespace Edu.Repository.OKR
{
{
where
+=
$@" and
{
nameof
(
RB_OKR_Comment_ViewModel
.
State
)}
=
{
demodel
.
State
}
"
;
where
+=
$@" and
{
nameof
(
RB_OKR_Comment_ViewModel
.
State
)}
=
{
demodel
.
State
}
"
;
}
}
if
(
demodel
.
CreateBy
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_OKR_Comment_ViewModel
.
CreateBy
)}
=
{
demodel
.
CreateBy
}
"
;
}
string
sql
=
$@" select * from RB_OKR_Comment where
{
where
}
order by Id desc"
;
string
sql
=
$@" select * from RB_OKR_Comment where
{
where
}
order by Id desc"
;
return
GetPage
<
RB_OKR_Comment_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
sql
).
ToList
();
return
GetPage
<
RB_OKR_Comment_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
sql
).
ToList
();
}
}
...
@@ -62,7 +65,10 @@ namespace Edu.Repository.OKR
...
@@ -62,7 +65,10 @@ namespace Edu.Repository.OKR
{
{
where
+=
$@" and
{
nameof
(
RB_OKR_Comment_ViewModel
.
State
)}
=
{
demodel
.
State
}
"
;
where
+=
$@" and
{
nameof
(
RB_OKR_Comment_ViewModel
.
State
)}
=
{
demodel
.
State
}
"
;
}
}
if
(
demodel
.
CreateBy
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_OKR_Comment_ViewModel
.
CreateBy
)}
=
{
demodel
.
CreateBy
}
"
;
}
string
sql
=
$@" select * from RB_OKR_Comment where
{
where
}
order by Id desc"
;
string
sql
=
$@" select * from RB_OKR_Comment where
{
where
}
order by Id desc"
;
return
Get
<
RB_OKR_Comment_ViewModel
>(
sql
).
ToList
();
return
Get
<
RB_OKR_Comment_ViewModel
>(
sql
).
ToList
();
}
}
...
...
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
View file @
5b726456
This diff is collapsed.
Click to expand it.
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