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
93b710f2
Commit
93b710f2
authored
4 years ago
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交评论
parent
634e13c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
142 additions
and
1 deletion
+142
-1
OKRPeriodModule.cs
Edu.Module.OKR/OKRPeriodModule.cs
+57
-0
OKRPeriodController.cs
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
+85
-1
No files found.
Edu.Module.OKR/OKRPeriodModule.cs
View file @
93b710f2
...
...
@@ -2086,5 +2086,62 @@ namespace Edu.Module.OKR
}
#
endregion
#
region
okr
任务评论
/// <summary>
/// 获取评论分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_OKR_Comment_ViewModel
>
GetCommentPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_OKR_Comment_ViewModel
demodel
)
{
return
oKR_CommentRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
rowsCount
,
demodel
);
}
/// <summary>
/// 获取评论列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_OKR_Comment_ViewModel
>
GetCommentList
(
RB_OKR_Comment_ViewModel
demodel
)
{
return
oKR_CommentRepository
.
GetList
(
demodel
);
}
/// <summary>
/// 新增/修改ork评论
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetOKRComment
(
RB_OKR_Comment_ViewModel
model
)
{
if
(
model
.
Id
==
0
)
{
return
oKR_CommentRepository
.
Insert
(
model
)
>
0
;
}
else
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_OKR_Comment_ViewModel
.
State
),
model
.
State
},
{
nameof
(
RB_OKR_Comment_ViewModel
.
UpdateBy
),
model
.
UpdateBy
},
{
nameof
(
RB_OKR_Comment_ViewModel
.
UpdateTime
),
DateTime
.
Now
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_OKR_Comment_ViewModel
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
oKR_CommentRepository
.
Update
(
keyValues
,
wheres
);
}
}
#
endregion
}
}
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
View file @
93b710f2
...
...
@@ -741,7 +741,91 @@ namespace Edu.WebApi.Controllers.OKR
#
endregion
#
endregion
#
region
okr
评论管理
/// <summary>
/// 获取评论分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetCommentPageList
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_OKR_Comment_ViewModel
()
{
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
),
State
=
base
.
ParmJObj
.
GetInt
(
"State"
,
0
),
PeriodId
=
base
.
ParmJObj
.
GetInt
(
"PeriodId"
,
0
)
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
okrPeriodModule
.
GetCommentPageList
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
item
.
CreateByIco
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
UserIcon
??
""
;
}
if
(
item
.
UpdateBy
>
0
)
{
item
.
UpdateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
UpdateBy
)?.
AccountName
??
""
;
}
item
.
CreateTimeStr
=
StringHelper
.
DateFormatToString
(
item
.
CreateTime
);
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
.
Select
(
x
=>
new
{
x
.
CreateByName
,
x
.
CreateByIco
,
x
.
UpdateByName
,
x
.
Content
,
x
.
CreateTimeStr
});
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 新增评论状态
/// </summary>
/// <returns></returns>
public
ApiResult
SetComment
()
{
var
extModel
=
new
RB_OKR_Comment_ViewModel
()
{
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
),
PeriodId
=
base
.
ParmJObj
.
GetInt
(
"PeriodId"
),
Content
=
base
.
ParmJObj
.
GetStringValue
(
"Content"
),
};
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
State
=
1
;
extModel
.
CreateTime
=
System
.
DateTime
.
Now
;
extModel
.
UpdateTime
=
System
.
DateTime
.
Now
;
extModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
extModel
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
bool
flag
=
okrPeriodModule
.
SetOKRComment
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 修改评论状态
/// </summary>
/// <returns></returns>
public
ApiResult
SetCommentStatus
()
{
var
extModel
=
new
RB_OKR_Comment_ViewModel
()
{
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
State
=
base
.
ParmJObj
.
GetInt
(
"State"
),
};
if
(
extModel
.
Id
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"未获取到评论编号,请刷新页面重试!"
);
}
if
(
extModel
.
State
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请传递评论状态!"
);
}
extModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
bool
flag
=
okrPeriodModule
.
SetOKRComment
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
}
}
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