Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7acaa6ac
authored
Oct 29, 2021
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试版本
1 parent
bcbbb8c4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
8 deletions
src/main/java/com/subsidy/controller/CourseDictController.java
src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java
src/main/resources/mapper/CourseDictMapper.xml
src/main/java/com/subsidy/controller/CourseDictController.java
View file @
7acaa6a
...
...
@@ -45,7 +45,7 @@ public class CourseDictController {
}
@PostMapping
(
"queryCourses"
)
@ApiOperation
(
"平台运营者--查询课程 pageSize pageNum companyId courseName categoryId courseType courseSource"
)
@ApiOperation
(
"平台运营者--查询课程 pageSize pageNum
administerId
companyId courseName categoryId courseType courseSource"
)
@LoginRequired
(
value
=
{
ConstantUtils
.
ADMINISTER_TERMINATE
})
public
ResponseVO
queryCourses
(
@RequestBody
QueryCoursesDTO
queryCoursesDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
courseDictService
.
queryCourses
(
queryCoursesDTO
));
...
...
src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java
View file @
7acaa6a
...
...
@@ -19,7 +19,7 @@ public class QueryCoursesDTO {
private
String
courseSource
;
//
private Long administerId;
private
Long
administerId
;
private
Long
companyId
;
...
...
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
View file @
7acaa6a
...
...
@@ -164,6 +164,12 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
administerDO
.
setPassword
(
"admin123"
);
administerDO
.
setStatus
(
"1"
);
this
.
baseMapper
.
insert
(
administerDO
);
RoleAdministerMappingDO
roleAdministerMappingDO
=
new
RoleAdministerMappingDO
();
roleAdministerMappingDO
.
setAdministerId
(
administerDO
.
getId
());
roleAdministerMappingDO
.
setRoleId
(
1L
);
roleAdministerMappingMapper
.
insert
(
roleAdministerMappingDO
);
return
ConstantUtils
.
ADD_SUCCESS
;
}
...
...
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
View file @
7acaa6a
...
...
@@ -80,6 +80,11 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
administerDO
.
setRole
(
1
);
administerMapper
.
insert
(
administerDO
);
RoleAdministerMappingDO
roleAdministerMappingDO
=
new
RoleAdministerMappingDO
();
roleAdministerMappingDO
.
setAdministerId
(
administerDO
.
getId
());
roleAdministerMappingDO
.
setRoleId
(
2L
);
roleAdministerMappingMapper
.
insert
(
roleAdministerMappingDO
);
return
ConstantUtils
.
ADD_SUCCESS
;
}
...
...
src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java
View file @
7acaa6a
...
...
@@ -75,6 +75,17 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
public
IPage
queryCourses
(
QueryCoursesDTO
queryCoursesDTO
)
{
Page
pager
=
new
Page
(
queryCoursesDTO
.
getPageNum
(),
queryCoursesDTO
.
getPageSize
());
//判断当前用户是运营者还是企业者
Integer
count
=
roleAdministerMappingMapper
.
selectCount
(
new
QueryWrapper
<
RoleAdministerMappingDO
>()
.
lambda
()
.
eq
(
RoleAdministerMappingDO:
:
getAdministerId
,
queryCoursesDTO
.
getAdministerId
())
.
eq
(
RoleAdministerMappingDO:
:
getRoleId
,
1
));
if
(
count
>
0
){
queryCoursesDTO
.
setCompanyId
(
null
);
}
return
this
.
baseMapper
.
queryCourses
(
pager
,
queryCoursesDTO
.
getCourseName
(),
queryCoursesDTO
.
getCategoryId
(),
queryCoursesDTO
.
getCourseType
(),
queryCoursesDTO
.
getCourseSource
(),
queryCoursesDTO
.
getCompanyId
());
}
...
...
src/main/resources/mapper/CourseDictMapper.xml
View file @
7acaa6a
...
...
@@ -24,12 +24,7 @@
left join category t2 on t.category_id = t2.id
WHERE
t.delete_date IS NULL
<if
test=
"companyId ==null "
>
and t.company_id is null
</if>
<if
test=
"companyId !=null and companyId !='' "
>
and t.company_id = #{companyId}
</if>
and t.company_id is null
<if
test=
"categoryId != null"
>
AND t.category_id = #{categoryId}
</if>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment