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
bc5dbf09
Commit
bc5dbf09
authored
Jan 20, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
目标、结果更新历史
parent
45036650
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
247 additions
and
1 deletion
+247
-1
RB_OKR_UpdateHistory.cs
Edu.Model/Entity/OKR/RB_OKR_UpdateHistory.cs
+50
-0
RB_OKR_UpdateHistory_ViewModel.cs
Edu.Model/ViewModel/OKR/RB_OKR_UpdateHistory_ViewModel.cs
+14
-0
OKRPeriodModule.cs
Edu.Module.OKR/OKRPeriodModule.cs
+94
-1
RB_OKR_UpdateHistoryRepository.cs
Edu.Repository/OKR/RB_OKR_UpdateHistoryRepository.cs
+67
-0
OKRPeriodController.cs
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
+22
-0
No files found.
Edu.Model/Entity/OKR/RB_OKR_UpdateHistory.cs
0 → 100644
View file @
bc5dbf09
using
Edu.Common.Enum
;
using
Edu.Common.Enum.Course
;
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.OKR
{
/// <summary>
/// okr更新历史实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_OKR_UpdateHistory
{
/// <summary>
/// id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 类型 1目标 2结果 3进度
/// </summary>
public
int
Type
{
get
;
set
;
}
/// <summary>
/// 来源id
/// </summary>
public
int
SourceId
{
get
;
set
;
}
/// <summary>
/// 内容
/// </summary>
public
string
Content
{
get
;
set
;
}
/// <summary>
/// 集团id
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/OKR/RB_OKR_UpdateHistory_ViewModel.cs
0 → 100644
View file @
bc5dbf09
using
System
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.OKR
{
/// <summary>
/// OKR更新历史扩展类
/// </summary>
[
Serializable
]
public
class
RB_OKR_UpdateHistory_ViewModel
:
Model
.
Entity
.
OKR
.
RB_OKR_UpdateHistory
{
}
}
\ No newline at end of file
Edu.Module.OKR/OKRPeriodModule.cs
View file @
bc5dbf09
...
...
@@ -93,6 +93,10 @@ namespace Edu.Module.OKR
/// 规则关联
/// </summary>
private
readonly
RB_OKR_RuleRelationRepository
oKR_RuleRelationRepository
=
new
RB_OKR_RuleRelationRepository
();
/// <summary>
/// 修改历史
/// </summary>
private
readonly
RB_OKR_UpdateHistoryRepository
oKR_UpdateHistoryRepository
=
new
RB_OKR_UpdateHistoryRepository
();
#
region
基础配置
...
...
@@ -555,7 +559,7 @@ namespace Edu.Module.OKR
}
return
flag
;
}
}
}
/// <summary>
/// 获取分数配置
...
...
@@ -742,6 +746,19 @@ namespace Edu.Module.OKR
return
"类型不正确"
;
}
}
/// <summary>
/// 获取更新历史分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_OKR_UpdateHistory_ViewModel
>
GetOKRObjectiveUpdateHistoryList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_OKR_UpdateHistory_ViewModel
dmodel
)
{
return
oKR_UpdateHistoryRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
dmodel
);
}
#
endregion
#
region
规则管理
...
...
@@ -1138,6 +1155,19 @@ namespace Edu.Module.OKR
}
};
bool
flag
=
oKR_KeyResultRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
Id
=
0
,
Type
=
1
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
userInfo
.
Group_Id
,
LogContent
=
"取消OKR结果使用规则【"
+
keyResultId
+
"】"
,
School_Id
=
userInfo
.
School_Id
,
SourceId
=
0
});
}
return
flag
?
""
:
"出错了,请联系管理员"
;
}
...
...
@@ -3536,6 +3566,10 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{
if
(
dmodel
.
Id
>
0
)
{
var
hmodel
=
oKR_ObjectiveRepository
.
GetEntity
(
dmodel
.
Id
);
if
(
hmodel
.
ProgressRemark
==
dmodel
.
ProgressRemark
&&
hmodel
.
Title
==
dmodel
.
Title
)
{
return
""
;
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_OKR_Objective_ViewModel
.
Title
),
dmodel
.
Title
},
{
nameof
(
RB_OKR_Objective_ViewModel
.
ProgressRemark
),
dmodel
.
ProgressRemark
},
...
...
@@ -3563,6 +3597,31 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
School_Id
=
userInfo
.
School_Id
,
SourceId
=
0
});
if
(
hmodel
.
ProgressRemark
!=
dmodel
.
ProgressRemark
)
{
oKR_UpdateHistoryRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_UpdateHistory
()
{
Id
=
0
,
Type
=
3
,
SourceId
=
dmodel
.
Id
,
Content
=
dmodel
.
ProgressRemark
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
userInfo
.
Group_Id
});
}
if
(
hmodel
.
Title
==
dmodel
.
Title
)
{
oKR_UpdateHistoryRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_UpdateHistory
()
{
Id
=
0
,
Type
=
1
,
SourceId
=
dmodel
.
Id
,
Content
=
dmodel
.
Title
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
userInfo
.
Group_Id
});
}
//更新提示
Task
.
Run
(()
=>
AddMyEmployeeUpdateNotification
(
dmodel
.
PeriodId
,
userInfo
));
}
...
...
@@ -3651,6 +3710,16 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
School_Id
=
userInfo
.
School_Id
,
SourceId
=
0
});
oKR_UpdateHistoryRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_UpdateHistory
()
{
Id
=
0
,
Type
=
1
,
SourceId
=
Id
,
Content
=
dmodel
.
Title
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
userInfo
.
Group_Id
});
//更新提示
Task
.
Run
(()
=>
AddMyEmployeeUpdateNotification
(
dmodel
.
PeriodId
,
userInfo
));
}
...
...
@@ -3670,6 +3739,10 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
{
if
(
keyResultId
>
0
)
{
var
hmodel
=
oKR_KeyResultRepository
.
GetEntity
(
keyResultId
);
if
(
hmodel
.
Name
==
name
)
{
return
""
;
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_OKR_KeyResult_ViewModel
.
Name
),
name
},
{
nameof
(
RB_OKR_KeyResult_ViewModel
.
UpdateBy
),
userInfo
.
Id
},
...
...
@@ -3696,6 +3769,16 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
School_Id
=
userInfo
.
School_Id
,
SourceId
=
0
});
oKR_UpdateHistoryRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_UpdateHistory
()
{
Id
=
0
,
Type
=
2
,
SourceId
=
keyResultId
,
Content
=
name
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
userInfo
.
Group_Id
});
//更新提示
Task
.
Run
(()
=>
AddMyEmployeeUpdateNotification_V2
(
objectiveId
,
userInfo
));
}
...
...
@@ -3793,6 +3876,16 @@ and {ruleModel.Time} >='{dmodel.RuleSTime.Value.ToString("yyyy-MM-dd")}' and {ru
School_Id
=
userInfo
.
School_Id
,
SourceId
=
0
});
oKR_UpdateHistoryRepository
.
Insert
(
new
Model
.
Entity
.
OKR
.
RB_OKR_UpdateHistory
()
{
Id
=
0
,
Type
=
2
,
SourceId
=
keyResultId
,
Content
=
name
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
userInfo
.
Group_Id
});
//更新提示
Task
.
Run
(()
=>
AddMyEmployeeUpdateNotification_V2
(
objectiveId
,
userInfo
));
}
...
...
Edu.Repository/OKR/RB_OKR_UpdateHistoryRepository.cs
0 → 100644
View file @
bc5dbf09
using
Edu.Common.Enum
;
using
Edu.Model.Entity.OKR
;
using
Edu.Model.ViewModel.OKR
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.OKR
{
/// <summary>
/// OKR更新历史仓储层
/// </summary>
public
class
RB_OKR_UpdateHistoryRepository
:
BaseRepository
<
RB_OKR_UpdateHistory
>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_OKR_UpdateHistory_ViewModel
>
GetList
(
RB_OKR_UpdateHistory_ViewModel
demodel
)
{
string
where
=
$@" 1=1 and Status =0"
;
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_OKR_UpdateHistory
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
}
if
(
demodel
.
Type
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_OKR_UpdateHistory
.
Type
)}
=
{
demodel
.
Type
}
"
;
}
if
(
demodel
.
SourceId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_OKR_UpdateHistory
.
SourceId
)}
=
{
demodel
.
SourceId
}
"
;
}
string
sql
=
$@" select * from RB_OKR_UpdateHistory where
{
where
}
order by Id desc"
;
return
Get
<
RB_OKR_UpdateHistory_ViewModel
>(
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_OKR_UpdateHistory_ViewModel
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_OKR_UpdateHistory_ViewModel
demodel
)
{
string
where
=
$@" 1=1 and Status =0"
;
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_OKR_UpdateHistory
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
}
if
(
demodel
.
Type
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_OKR_UpdateHistory
.
Type
)}
=
{
demodel
.
Type
}
"
;
}
if
(
demodel
.
SourceId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_OKR_UpdateHistory
.
SourceId
)}
=
{
demodel
.
SourceId
}
"
;
}
string
sql
=
$@" select * from RB_OKR_UpdateHistory where
{
where
}
order by Id desc"
;
return
GetPage
<
RB_OKR_UpdateHistory_ViewModel
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
}
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
View file @
bc5dbf09
...
...
@@ -709,6 +709,28 @@ namespace Edu.WebApi.Controllers.OKR
return
okrPeriodModule
.
SgetOKRMyKeyResultDel
(
KeyResultId
,
userInfo
);
}
/// <summary>
/// 获取目标/关键结果 更新历史
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOKRObjectiveUpdateHistoryList
()
{
var
userInfo
=
base
.
UserInfo
;
var
pageModel
=
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
dmodel
=
JsonHelper
.
DeserializeObject
<
RB_OKR_UpdateHistory_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
dmodel
.
Group_Id
=
userInfo
.
Group_Id
;
var
list
=
okrPeriodModule
.
GetOKRObjectiveUpdateHistoryList
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
count
,
dmodel
);
pageModel
.
Count
=
Convert
.
ToInt32
(
count
);
pageModel
.
PageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Content
,
CreateTime
=
x
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
});
return
ApiResult
.
Success
(
""
,
pageModel
);
}
#
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