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
841c9b8d
Commit
841c9b8d
authored
Dec 10, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
3a77287a
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
187 additions
and
58 deletions
+187
-58
RB_Department_Post.cs
Edu.Model/Entity/User/RB_Department_Post.cs
+30
-0
RB_Post.cs
Edu.Model/Entity/User/RB_Post.cs
+0
-5
RB_Department_Post_ViewModel.cs
Edu.Model/ViewModel/User/RB_Department_Post_ViewModel.cs
+23
-0
RB_Department_ViewModel.cs
Edu.Model/ViewModel/User/RB_Department_ViewModel.cs
+10
-0
RB_Post_ViewModel.cs
Edu.Model/ViewModel/User/RB_Post_ViewModel.cs
+0
-5
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+1
-5
DepartmentModule.cs
Edu.Module.User/DepartmentModule.cs
+76
-35
PostModule.cs
Edu.Module.User/PostModule.cs
+0
-1
RB_Department_PostRepository.cs
Edu.Repository/User/RB_Department_PostRepository.cs
+45
-0
RB_PostRepository.cs
Edu.Repository/User/RB_PostRepository.cs
+2
-6
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+0
-1
No files found.
Edu.Model/Entity/User/RB_Department_Post.cs
0 → 100644
View file @
841c9b8d
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.User
{
/// <summary>
/// 部门岗位关联表实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Department_Post
{
/// <summary>
/// 部门岗位关联表主键Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 部门编号
/// </summary>
public
int
Dept_Id
{
get
;
set
;
}
/// <summary>
/// 岗位编号
/// </summary>
public
int
PostId
{
get
;
set
;
}
}
}
Edu.Model/Entity/User/RB_Post.cs
View file @
841c9b8d
...
...
@@ -21,11 +21,6 @@ namespace Edu.Model.Entity.User
/// </summary>
public
string
PostName
{
get
;
set
;
}
/// <summary>
/// 部门编号
/// </summary>
public
int
RB_Dept_Id
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
...
...
Edu.Model/ViewModel/User/RB_Department_Post_ViewModel.cs
0 → 100644
View file @
841c9b8d
using
Edu.Model.Entity.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.User
{
/// <summary>
/// 部门岗位关联表视图实体类
/// </summary>
public
class
RB_Department_Post_ViewModel
:
RB_Department_Post
{
/// <summary>
/// 岗位名称
/// </summary>
public
string
PostName
{
get
;
set
;
}
/// <summary>
/// 部门编号【查询使用,逗号分隔】
/// </summary>
public
string
QDeptIds
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/User/RB_Department_ViewModel.cs
View file @
841c9b8d
...
...
@@ -65,5 +65,15 @@ namespace Edu.Model.ViewModel.User
return
Common
.
ConvertHelper
.
StringToList
(
this
.
ManagerIds
);
}
}
/// <summary>
/// 部门管理岗位列表
/// </summary>
public
List
<
RB_Department_Post_ViewModel
>
DeptPostList
{
get
;
set
;
}
/// <summary>
/// 选择的岗位
/// </summary>
public
List
<
int
>
ChoosePostList
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/User/RB_Post_ViewModel.cs
View file @
841c9b8d
...
...
@@ -43,11 +43,6 @@ namespace Edu.Model.ViewModel.User
}
}
/// <summary>
/// 所属部门
/// </summary>
public
string
DeptName
{
get
;
set
;
}
/// <summary>
/// 岗位编号查询
/// </summary>
...
...
Edu.Module.Course/ClassModule.cs
View file @
841c9b8d
...
...
@@ -507,14 +507,10 @@ namespace Edu.Module.Course
{
extModel
.
DefaultTimeList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
RB_Class_Time_ViewModel
>>(
extModel
.
DefaultTimeJson
);
}
if
(!
string
.
IsNullOrEmpty
(
extModel
.
DateJson
))
if
(!
string
.
IsNullOrEmpty
(
extModel
.
DateJson
)
&&
extModel
.
ClassStyle
!=
Common
.
Enum
.
Course
.
ClassStyleEnum
.
OnLine
)
{
extModel
.
WeekDayList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
extModel
.
DateJson
);
}
if
(
extModel
.
ClassStyle
==
Common
.
Enum
.
Course
.
ClassStyleEnum
.
Month
)
{
}
}
return
extModel
;
}
...
...
Edu.Module.User/DepartmentModule.cs
View file @
841c9b8d
...
...
@@ -21,12 +21,16 @@ namespace Edu.Module.User
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// 岗位仓储层对象
/// </summary>
private
readonly
RB_PostRepository
postRepository
=
new
RB_PostRepository
();
/// <summary>
/// 部门岗位关联表仓储层对象
/// </summary>
private
readonly
RB_Department_PostRepository
department_PostRepository
=
new
RB_Department_PostRepository
();
/// <summary>
/// 获取部门分页列表
/// </summary>
...
...
@@ -40,6 +44,7 @@ namespace Edu.Module.User
var
list
=
departmentRepository
.
GetDepartmentPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
List
<
RB_Department_ViewModel
>
parentList
=
new
List
<
RB_Department_ViewModel
>();
List
<
Employee_ViewModel
>
empList
=
new
List
<
Employee_ViewModel
>();
List
<
RB_Department_Post_ViewModel
>
deptPostList
=
new
List
<
RB_Department_Post_ViewModel
>();
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
//查询部门列表
...
...
@@ -54,6 +59,12 @@ namespace Edu.Module.User
{
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Employee_ViewModel
()
{
QIds
=
persion
});
}
string
qDeptIds
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
DeptId
));
if
(!
string
.
IsNullOrEmpty
(
qDeptIds
))
{
deptPostList
=
department_PostRepository
.
GetDepartmentPostListRepository
(
new
RB_Department_Post_ViewModel
()
{
QDeptIds
=
qDeptIds
});
}
}
foreach
(
var
item
in
list
)
{
...
...
@@ -73,6 +84,7 @@ namespace Edu.Module.User
persionName
=
persionName
.
Substring
(
1
);
}
item
.
ManagerName
=
persionName
;
item
.
DeptPostList
=
deptPostList
?.
Where
(
qitem
=>
qitem
.
Dept_Id
==
item
.
DeptId
)?.
ToList
()
??
new
List
<
RB_Department_Post_ViewModel
>();
}
return
list
;
}
...
...
@@ -217,22 +229,22 @@ namespace Edu.Module.User
#
region
添加岗位
if
(
isQueryPost
)
{
var
tempPostList
=
postList
?.
Where
(
qitem
=>
qitem
.
RB_Dept_Id
==
fItem
.
DeptId
)?.
ToList
();
if
(
tempPostList
!=
null
&&
tempPostList
.
Count
>
0
)
{
foreach
(
var
pItem
in
tempPostList
)
{
tModel
.
ChildList
.
Add
(
new
DepartmentTree_ViewModel
()
{
DeptId
=
pItem
.
PostId
,
DeptName
=
pItem
.
PostName
,
ParentId
=
0
,
ChildList
=
new
List
<
DepartmentTree_ViewModel
>(),
School_Id
=
fItem
.
School_Id
,
DataType
=
3
,
});
}
}
//
var tempPostList = postList?.Where(qitem => qitem.RB_Dept_Id == fItem.DeptId)?.ToList();
//
if (tempPostList != null && tempPostList.Count > 0)
//
{
//
foreach (var pItem in tempPostList)
//
{
//
tModel.ChildList.Add(new DepartmentTree_ViewModel()
//
{
//
DeptId = pItem.PostId,
//
DeptName = pItem.PostName,
//
ParentId = 0,
//
ChildList = new List<DepartmentTree_ViewModel>(),
//
School_Id = fItem.School_Id,
//
DataType = 3,
//
});
//
}
//
}
}
#
endregion
...
...
@@ -296,22 +308,22 @@ namespace Edu.Module.User
#
region
添加岗位
if
(
postList
!=
null
&&
postList
.
Count
>
0
)
{
var
tempPostList
=
postList
?.
Where
(
qitem
=>
qitem
.
RB_Dept_Id
==
item
.
DeptId
)?.
ToList
();
if
(
tempPostList
!=
null
&&
tempPostList
.
Count
>
0
)
{
foreach
(
var
pItem
in
tempPostList
)
{
model
.
ChildList
.
Add
(
new
DepartmentTree_ViewModel
()
{
DeptId
=
pItem
.
PostId
,
DeptName
=
pItem
.
PostName
,
ParentId
=
0
,
ChildList
=
new
List
<
DepartmentTree_ViewModel
>(),
School_Id
=
item
.
School_Id
,
DataType
=
3
,
});
}
}
//
var tempPostList = postList?.Where(qitem => qitem.RB_Dept_Id == item.DeptId)?.ToList();
//
if (tempPostList != null && tempPostList.Count > 0)
//
{
//
foreach (var pItem in tempPostList)
//
{
//
model.ChildList.Add(new DepartmentTree_ViewModel()
//
{
//
DeptId = pItem.PostId,
//
DeptName = pItem.PostName,
//
ParentId = 0,
//
ChildList = new List<DepartmentTree_ViewModel>(),
//
School_Id = item.School_Id,
//
DataType = 3,
//
});
//
}
//
}
}
#
endregion
...
...
@@ -399,7 +411,7 @@ namespace Edu.Module.User
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetDepartmentModule
(
RB_Department_ViewModel
extModel
)
public
virtual
bool
SetDepartmentModule
(
RB_Department_ViewModel
extModel
)
{
bool
flag
;
if
(
extModel
.
DeptId
>
0
)
...
...
@@ -425,6 +437,20 @@ namespace Edu.Module.User
extModel
.
DeptId
=
newId
;
flag
=
newId
>
0
;
}
department_PostRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Department_Post_ViewModel
.
Dept_Id
),
extModel
.
DeptId
));
if
(
extModel
.
ChoosePostList
!=
null
&&
extModel
.
ChoosePostList
.
Count
>
0
)
{
foreach
(
var
item
in
extModel
.
ChoosePostList
)
{
var
deptPostModel
=
new
RB_Department_Post_ViewModel
()
{
Id
=
0
,
Dept_Id
=
extModel
.
DeptId
,
PostId
=
item
};
department_PostRepository
.
Insert
(
deptPostModel
);
}
}
return
flag
;
}
...
...
@@ -435,7 +461,22 @@ namespace Edu.Module.User
/// <returns></returns>
public
RB_Department_ViewModel
GetDepartmentModule
(
object
DeptId
)
{
return
departmentRepository
.
GetEntity
<
RB_Department_ViewModel
>(
DeptId
);
var
extModel
=
departmentRepository
.
GetEntity
<
RB_Department_ViewModel
>(
DeptId
);
if
(
extModel
!=
null
&&
extModel
.
DeptId
>
0
)
{
var
deptPostList
=
department_PostRepository
.
GetDepartmentPostListRepository
(
new
RB_Department_Post_ViewModel
()
{
Dept_Id
=
extModel
.
DeptId
});
extModel
.
ChoosePostList
=
new
List
<
int
>();
if
(
deptPostList
!=
null
&&
deptPostList
.
Count
>
0
)
{
}
extModel
.
DeptPostList
=
deptPostList
;
}
return
extModel
;
}
/// <summary>
...
...
Edu.Module.User/PostModule.cs
View file @
841c9b8d
...
...
@@ -61,7 +61,6 @@ namespace Edu.Module.User
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Post_ViewModel
.
PostName
),
extModel
.
PostName
},
{
nameof
(
RB_Post_ViewModel
.
RB_Dept_Id
),
extModel
.
RB_Dept_Id
},
{
nameof
(
RB_Post_ViewModel
.
UpdateBy
),
extModel
.
UpdateBy
},
{
nameof
(
RB_Post_ViewModel
.
UpdateTime
),
extModel
.
UpdateTime
},
};
...
...
Edu.Repository/User/RB_Department_PostRepository.cs
0 → 100644
View file @
841c9b8d
using
Edu.Model.Entity.User
;
using
Edu.Model.ViewModel.User
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Edu.Repository.User
{
/// <summary>
/// 部门岗位关联表仓储层
/// </summary>
public
class
RB_Department_PostRepository
:
BaseRepository
<
RB_Department_Post
>
{
/// <summary>
/// 获取部门管理岗位列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Department_Post_ViewModel
>
GetDepartmentPostListRepository
(
RB_Department_Post_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,IFNULL(B.PostName,'') AS PostName
FROM rb_department_post AS A LEFT JOIN rb_post AS B ON A.PostId=B.PostId
WHERE 1=1
"
);
if
(
query
==
null
)
{
return
new
List
<
RB_Department_Post_ViewModel
>();
}
else
{
if
(
query
.
Dept_Id
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Department_Post_ViewModel
.
Dept_Id
),
query
.
Dept_Id
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QDeptIds
))
{
builder
.
AppendFormat
(
" AND {0} IN ({1}) "
,
nameof
(
RB_Department_Post_ViewModel
.
Dept_Id
),
query
.
QDeptIds
);
}
}
return
Get
<
RB_Department_Post_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.Repository/User/RB_PostRepository.cs
View file @
841c9b8d
...
...
@@ -27,8 +27,8 @@ namespace Edu.Repository.User
DynamicParameters
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
,IFNULL(B.DeptName,'') AS DeptName
FROM rb_post AS A
LEFT JOIN rb_department AS B ON A.RB_Dept_Id=B.DeptId
SELECT A.*
FROM rb_post AS A
WHERE 1=1
"
);
if
(
query
!=
null
)
...
...
@@ -83,10 +83,6 @@ WHERE 1=1
{
builder
.
Append
(
$" AND A.
{
nameof
(
RB_Post_ViewModel
.
PostId
)}
=
{
query
.
PostId
}
"
);
}
if
(
query
.
RB_Dept_Id
>
0
)
{
builder
.
Append
(
$" AND A.
{
nameof
(
RB_Post_ViewModel
.
RB_Dept_Id
)}
=
{
query
.
RB_Dept_Id
}
"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QPostIds
))
{
builder
.
Append
(
$" AND A.
{
nameof
(
RB_Post_ViewModel
.
PostId
)}
IN(
{
query
.
QPostIds
}
) "
);
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
841c9b8d
...
...
@@ -1217,7 +1217,6 @@ namespace Edu.WebApi.Controllers.User
var
query
=
new
RB_Post_ViewModel
()
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
RB_Dept_Id
=
base
.
ParmJObj
.
GetInt
(
"RB_Dept_Id"
),
};
var
list
=
postModule
.
GetPostListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
...
...
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