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
b3d0d70a
Commit
b3d0d70a
authored
Jan 04, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
9031d6a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
66 deletions
+57
-66
OKRPeriodController.cs
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
+57
-66
No files found.
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
View file @
b3d0d70a
...
...
@@ -408,6 +408,15 @@ namespace Edu.WebApi.Controllers.OKR
return
ApiResult
.
Success
(
""
,
list
);
}
/// <summary>
/// 获取单个我的目标
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOKRMyObjectiveInfo
()
{
}
/// <summary>
/// 新增修改目标
/// </summary>
...
...
@@ -581,7 +590,7 @@ namespace Edu.WebApi.Controllers.OKR
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
KeyResultId
=
parms
.
GetInt
(
"KeyResultId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
0
);
// 类型 1自定义状态 2删除 3切换为简单模式 4切换为高级模式
int
Type
=
parms
.
GetInt
(
"Type"
,
0
);
// 类型 1自定义状态 2删除
(作废)
3切换为简单模式 4切换为高级模式
string
ProgressState
=
parms
.
GetStringValue
(
"ProgressState"
);
if
(
KeyResultId
<=
0
)
{
...
...
@@ -618,96 +627,78 @@ namespace Edu.WebApi.Controllers.OKR
{
return
ApiResult
.
ParamIsNull
();
}
if
(
Progress
<
0
||
StartValue
<
0
||
EndValue
<
0
||
CurrentValue
<
0
)
{
return
ApiResult
.
ParamIsNull
(
"不能小于0"
);
}
return
okrPeriodModule
.
SgetOKRMyKeyResultProgress
(
KeyResultId
,
Type
,
Progress
,
StartValue
,
EndValue
,
CurrentValue
,
userInfo
);
}
#
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
);
public
ApiResult
SgetOKRMyKeyResultWeight
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
KeyResultId
=
parms
.
GetInt
(
"KeyResultId"
,
0
);
decimal
Weight
=
parms
.
GetDecimal
(
"Weight"
);
if
(
KeyResultId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递结果Id"
);
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
.
Select
(
x
=>
new
{
x
.
CreateByName
,
x
.
CreateByIco
,
x
.
UpdateByName
,
x
.
Content
,
x
.
CreateTimeStr
});
return
ApiResult
.
Success
(
data
:
pageModel
);
if
(
Weight
<
0
||
Weight
>
100
)
{
return
ApiResult
.
ParamIsNull
(
"权重值有误"
);
}
return
okrPeriodModule
.
SgetOKRMyKeyResultWeight
(
KeyResultId
,
Weight
,
userInfo
);
}
/// <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
(
);
[
HttpPost
]
public
ApiResult
SgetOKRMyKeyResultScore
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
KeyResultId
=
parms
.
GetInt
(
"KeyResultId"
,
0
);
decimal
Score
=
parms
.
GetDecimal
(
"Score"
);
if
(
KeyResultId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递结果Id"
)
;
}
if
(
Score
<
0
||
Score
>
1
)
{
return
ApiResult
.
ParamIsNull
(
"分值有误"
)
;
}
return
okrPeriodModule
.
SgetOKRMyKeyResultScore
(
KeyResultId
,
Score
,
userInfo
);
}
/// <summary>
///
修改评论
状态
///
删除关键结果
状态
/// </summary>
/// <returns></returns>
public
ApiResult
SetCommentStatus
()
[
HttpPost
]
public
ApiResult
SgetOKRMyKeyResultDel
()
{
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
)
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
KeyResultId
=
parms
.
GetInt
(
"KeyResultId"
,
0
);
if
(
KeyResultId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请传递评论状态!"
);
return
ApiResult
.
ParamIsNull
();
}
extModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
bool
flag
=
okrPeriodModule
.
SetOKRComment
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
okrPeriodModule
.
SgetOKRMyKeyResultDel
(
KeyResultId
,
userInfo
);
}
//权限 添加对齐 审核 评论 左边人员列表 对齐视图 数据看板 (管理员版 对齐视图 数据看板)
#
endregion
#
endregion
}
}
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