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
13f6823a
Commit
13f6823a
authored
Jan 07, 2021
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
c12a315b
8f4aefd9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
2823 additions
and
1371 deletions
+2823
-1371
RB_Question_Type.cs
Edu.Model/Entity/Question/RB_Question_Type.cs
+0
-5
RB_OKR_KeyResult_ViewModel.cs
Edu.Model/ViewModel/OKR/RB_OKR_KeyResult_ViewModel.cs
+5
-0
RB_OKR_Objective_ViewModel.cs
Edu.Model/ViewModel/OKR/RB_OKR_Objective_ViewModel.cs
+5
-0
RB_Question_Type_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_Type_ViewModel.cs
+35
-4
OKRPeriodModule.cs
Edu.Module.OKR/OKRPeriodModule.cs
+2581
-1360
AnalysisQuestionTypeModule.cs
Edu.Module.Question/AnalysisQuestionTypeModule.cs
+80
-0
RB_OKR_ObjectiveRelationRepository.cs
Edu.Repository/OKR/RB_OKR_ObjectiveRelationRepository.cs
+24
-0
RB_QuestionRepository.cs
Edu.Repository/Question/RB_QuestionRepository.cs
+1
-0
OKRPeriodController.cs
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
+92
-2
No files found.
Edu.Model/Entity/Question/RB_Question_Type.cs
View file @
13f6823a
...
...
@@ -35,10 +35,5 @@ namespace Edu.Model.Entity.Question
/// 删除状态
/// </summary>
public
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// JSON配置
/// </summary>
public
string
JsonConfig
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/OKR/RB_OKR_KeyResult_ViewModel.cs
View file @
13f6823a
...
...
@@ -19,6 +19,11 @@ namespace Edu.Model.ViewModel.OKR
/// </summary>
public
int
IsLock
{
get
;
set
;
}
/// <summary>
/// 是否不可查看 1是 2否
/// </summary>
public
int
IsNotLook
{
get
;
set
;
}
/// <summary>
/// 分数名称
/// </summary>
...
...
Edu.Model/ViewModel/OKR/RB_OKR_Objective_ViewModel.cs
View file @
13f6823a
...
...
@@ -68,6 +68,11 @@ namespace Edu.Model.ViewModel.OKR
/// </summary>
public
int
IsLock
{
get
;
set
;
}
/// <summary>
/// 是否不可查看 1是 2否
/// </summary>
public
int
IsNotLook
{
get
;
set
;
}
/// <summary>
/// 是否已对齐
/// </summary>
...
...
Edu.Model/ViewModel/Question/RB_Question_Type_ViewModel.cs
View file @
13f6823a
...
...
@@ -30,15 +30,15 @@ namespace Edu.Model.ViewModel.Question
/// 选择题选项列表【单选、多选、判断题】
/// </summary>
public
class
optionItem
{
{
/// <summary>
/// 选项编号【例如:A,B,C,D】
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 选项内容
/// </summary>
/// <summary>
/// 选项内容
/// </summary>
public
string
Content
{
get
;
set
;
}
/// <summary>
...
...
@@ -73,4 +73,35 @@ namespace Edu.Model.ViewModel.Question
/// </summary>
public
string
Content
{
get
;
set
;
}
}
/// <summary>
/// 阅读理解
/// </summary>
public
class
readingComprehensioItem
{
/// <summary>
/// 问题类型(5-种基本题型)
/// </summary>
public
int
QuestionType
{
get
;
set
;
}
/// <summary>
/// 问题类型Key
/// </summary>
public
string
QuestionKey
{
get
;
set
;
}
/// <summary>
/// 问题类型名称
/// </summary>
public
string
QuestionName
{
get
;
set
;
}
/// <summary>
/// 题目名称
/// </summary>
public
string
SubTitle
{
get
;
set
;
}
/// <summary>
/// 题目答案内容
/// </summary>
public
object
SubAnwser
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.OKR/OKRPeriodModule.cs
View file @
13f6823a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Edu.Module.Question/AnalysisQuestionTypeModule.cs
View file @
13f6823a
...
...
@@ -73,6 +73,86 @@ namespace Edu.Module.Question
case
"cloze"
:
obj
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
List
<
optionItem
>>>(
data
);
break
;
//阅读理解
case
"reading-comprehensio"
:
var
readingList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
readingComprehensioItem
>>(
data
);
if
(
readingList
!=
null
&&
readingList
.
Count
>
0
)
{
foreach
(
var
item
in
readingList
)
{
switch
(
item
.
QuestionKey
)
{
//单选题
case
"single"
:
item
.
SubAnwser
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
optionItem
>>(
item
.
SubAnwser
.
ToString
());
break
;
//多选题
case
"multiple"
:
item
.
SubAnwser
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
optionItem
>>(
item
.
SubAnwser
.
ToString
());
break
;
//填空题
case
"fill-in"
:
item
.
SubAnwser
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
fillInItem
>>(
item
.
SubAnwser
.
ToString
());
break
;
//判断题
case
"judge"
:
item
.
SubAnwser
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
optionItem
>>(
item
.
SubAnwser
.
ToString
());
break
;
//简答题
case
"short-answer"
:
item
.
SubAnwser
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
fillInItem
>>(
item
.
SubAnwser
.
ToString
());
break
;
}
}
}
obj
=
readingList
;
break
;
//口语题
case
"spoken"
:
obj
=
data
;
break
;
//听力题
case
"listening"
:
var
listenList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
readingComprehensioItem
>>(
data
);
if
(
listenList
!=
null
&&
listenList
.
Count
>
0
)
{
foreach
(
var
item
in
listenList
)
{
switch
(
item
.
QuestionKey
)
{
//单选题
case
"single"
:
item
.
SubAnwser
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
optionItem
>>(
item
.
SubAnwser
.
ToString
());
break
;
//多选题
case
"multiple"
:
item
.
SubAnwser
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
optionItem
>>(
item
.
SubAnwser
.
ToString
());
break
;
//填空题
case
"fill-in"
:
item
.
SubAnwser
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
fillInItem
>>(
item
.
SubAnwser
.
ToString
());
break
;
//判断题
case
"judge"
:
item
.
SubAnwser
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
optionItem
>>(
item
.
SubAnwser
.
ToString
());
break
;
//简答题
case
"short-answer"
:
item
.
SubAnwser
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
fillInItem
>>(
item
.
SubAnwser
.
ToString
());
break
;
}
}
}
obj
=
listenList
;
break
;
//共用选择题
case
"sharing-choose"
:
obj
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
List
<
matchingItem
>>>(
data
);
break
;
//其它题
case
"other"
:
obj
=
data
;
break
;
}
return
obj
;
}
...
...
Edu.Repository/OKR/RB_OKR_ObjectiveRelationRepository.cs
View file @
13f6823a
...
...
@@ -56,5 +56,29 @@ namespace Edu.Repository.OKR
string
sql
=
$@" select ParentId,COUNT(0) AS ObjectiveId from RB_OKR_ObjectiveRelation WHERE ParentId in(
{
ObjectiveIds
}
) GROUP BY ParentId"
;
return
Get
<
RB_OKR_ObjectiveRelation
>(
sql
).
ToList
();
}
/// <summary>
/// 获取目标的上对齐 所有的目标
/// </summary>
/// <param name="objectiveId"></param>
/// <returns></returns>
public
string
GetObjectiveParentIds
(
int
objectiveId
)
{
string
sql
=
$" SELECT func_okr_getobjectiveparentids(
{
objectiveId
}
);"
;
var
obj
=
ExecuteScalar
(
sql
);
return
obj
==
null
?
""
:
obj
.
ToString
();
}
/// <summary>
/// 获取目标的下对齐 所有的目标
/// </summary>
/// <param name="objectiveId"></param>
/// <returns></returns>
public
string
GetObjectiveChildIds
(
int
objectiveId
)
{
string
sql
=
$" SELECT func_okr_getobjectivechildids(
{
objectiveId
}
);"
;
var
obj
=
ExecuteScalar
(
sql
);
return
obj
==
null
?
""
:
obj
.
ToString
();
}
}
}
Edu.Repository/Question/RB_QuestionRepository.cs
View file @
13f6823a
...
...
@@ -72,6 +72,7 @@ WHERE 1=1 ");
builder
.
AppendFormat
(
" AND A.{0} LIKE @Title "
,
nameof
(
RB_Question_ViewModel
.
Title
));
parameters
.
Add
(
"Title"
,
"%"
+
query
.
Title
.
Trim
()
+
"%"
);
}
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Question_ViewModel
.
QuestionId
));
return
GetPage
<
RB_Question_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
}
...
...
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
View file @
13f6823a
...
...
@@ -993,6 +993,39 @@ namespace Edu.WebApi.Controllers.OKR
return
ApiResult
.
Success
(
""
,
list
);
}
/// <summary>
/// 获取他人的单个目标
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOKROthersObjectiveInfo
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
ObjectiveId
=
parms
.
GetInt
(
"ObjectiveId"
,
0
);
int
PeriodId
=
parms
.
GetInt
(
"PeriodId"
,
0
);
int
UserId
=
parms
.
GetInt
(
"UserId"
,
0
);
if
(
ObjectiveId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递目标id"
);
}
if
(
PeriodId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递周期id"
);
}
if
(
UserId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递当前用户id"
);
}
if
(
UserId
==
userInfo
.
Id
)
{
return
ApiResult
.
Failed
(
"只能查看他人目标"
);
}
var
obj
=
okrPeriodModule
.
GetOKROthersObjectiveInfo
(
PeriodId
,
UserId
,
ObjectiveId
,
userInfo
);
return
ApiResult
.
Success
(
""
,
obj
);
}
#
endregion
#
region
关注
...
...
@@ -1234,12 +1267,69 @@ namespace Edu.WebApi.Controllers.OKR
return
ApiResult
.
Success
(
""
,
obj
);
}
#
endregion
/// <summary>
/// 获取管理员对齐视图
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOKRAdminAlignView
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
PeriodId
=
parms
.
GetInt
(
"PeriodId"
,
0
);
int
UserId
=
parms
.
GetInt
(
"UserId"
,
0
);
if
(
PeriodId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递周期id"
);
}
var
obj
=
okrPeriodModule
.
GetOKRAdminAlignView
(
PeriodId
,
UserId
,
userInfo
);
return
ApiResult
.
Success
(
""
,
obj
);
}
#
region
后台管理
/// <summary>
/// 获取管理员对齐视图 再下一级
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOKRAdminAlignViewNext
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
PeriodId
=
parms
.
GetInt
(
"PeriodId"
,
0
);
int
ObjectiveId
=
parms
.
GetInt
(
"ObjectiveId"
,
0
);
//目标id
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
//类型 1向上 2向下
if
(
PeriodId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递周期id"
);
}
if
(
ObjectiveId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递关联目标id"
);
}
var
obj
=
okrPeriodModule
.
GetOKRAdminAlignViewNext
(
PeriodId
,
ObjectiveId
,
Type
,
userInfo
);
return
ApiResult
.
Success
(
""
,
obj
);
}
/// <summary>
/// 获取管理员查看单个目标
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOKRAdminLookObjectiveInfo
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
ObjectiveId
=
parms
.
GetInt
(
"ObjectiveId"
,
0
);
if
(
ObjectiveId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递目标id"
);
}
var
obj
=
okrPeriodModule
.
GetOKRAdminLookObjectiveInfo
(
ObjectiveId
,
userInfo
);
return
ApiResult
.
Success
(
""
,
obj
);
}
#
endregion
#
region
okr
评论管理
...
...
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