Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lecturer
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
lecturer
Commits
cd48104d
Commit
cd48104d
authored
Feb 09, 2021
by
liangkaiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy
parent
32404919
Hide whitespace changes
Inline
Side-by-side
Showing
108 changed files
with
7487 additions
and
2 deletions
+7487
-2
README.md
+0
-2
cloud-lecturer-api/pom.xml
+59
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/enums/DeleteFlag.java
+26
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/enums/ImportError.java
+23
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/enums/LecturerEnum.java
+38
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/feign/LecturerClassificationClient.java
+102
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/feign/LecturerClient.java
+226
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/CommonTree.java
+61
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/FileUploadModel.java
+11
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerApiVo.java
+46
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerApiVoParam.java
+34
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerClassificationRespVO.java
+25
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerClassificationVO.java
+80
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerCourseImport.java
+27
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerDetailVO.java
+95
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerDicVO.java
+37
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerGradeImport.java
+23
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerGradeVO.java
+51
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerImport.java
+21
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerInfoVO.java
+33
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerListVO.java
+86
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerQueryVO.java
+31
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerRelationVO.java
+36
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerScoreImport.java
+23
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerSetVO.java
+22
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerSortVO.java
+21
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerTemplateVO.java
+33
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerVO.java
+102
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/RelationAddVO.java
+31
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/RelationVO.java
+34
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/RelationVOList.java
+47
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/TemplateLecturerVO.java
+36
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/ClassificationVO.java
+52
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerClassificationVo.java
+85
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerCourseVo.java
+40
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerDicVo.java
+56
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerGradeVo.java
+68
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerInfoVo.java
+67
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerKeywordsVo.java
+33
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerRelationVo.java
+55
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerResponseVo.java
+16
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerResumeVo.java
+59
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerVo.java
+113
-0
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/TrLecturerClassificationVo.java
+41
-0
cloud-lecturer/pom.xml
+66
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerClassificationController.java
+109
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerController.java
+197
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerDicController.java
+37
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerGradeController.java
+73
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerImportController.java
+408
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerInfoController.java
+58
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerRelationController.java
+79
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerResumeController.java
+20
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/Test2.java
+33
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/remote/LecturerClassificationController.java
+115
-0
cloud-lecturer/src/main/java/com/yizhi/application/Controller/remote/LecturerDicController.java
+47
-0
cloud-lecturer/src/main/java/com/yizhi/application/LecturerApplication.java
+26
-0
cloud-lecturer/src/main/java/com/yizhi/application/MybatisPlusConfig.java
+27
-0
cloud-lecturer/src/main/java/com/yizhi/application/SwaggerConfig.java
+41
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/ClassificationVO.java
+58
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/Lecturer.java
+124
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerClassification.java
+98
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerCourse.java
+50
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerDic.java
+65
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerGrade.java
+79
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerInfo.java
+78
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerKeywords.java
+44
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerRelation.java
+66
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerResponse.java
+16
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerResume.java
+69
-0
cloud-lecturer/src/main/java/com/yizhi/application/domain/TrLecturerClassification.java
+51
-0
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerClassificationMapper.java
+78
-0
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerCourseMapper.java
+16
-0
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerDicMapper.java
+24
-0
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerGradeMapper.java
+20
-0
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerInfoMapper.java
+18
-0
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerKeywordsMapper.java
+16
-0
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerMapper.java
+132
-0
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerRelationMapper.java
+32
-0
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerResumeMapper.java
+16
-0
cloud-lecturer/src/main/java/com/yizhi/application/mapper/TrLecturerClassificationMapper.java
+16
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerClassificationService.java
+67
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerDicService.java
+32
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerGradeService.java
+42
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerImportService.java
+37
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerInfoService.java
+39
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerKeywordsService.java
+16
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerRelationService.java
+52
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerResumeService.java
+16
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerService.java
+133
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/ITrLecturerClassificationService.java
+23
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerClassificationServiceImpl.java
+354
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerDicServiceImpl.java
+34
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerGradeServiceImpl.java
+104
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerImportServiceImpl.java
+399
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerInfoServiceImpl.java
+97
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerKeywordsServiceImpl.java
+20
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerRelationServiceImpl.java
+106
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerResumeServiceImpl.java
+20
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerServiceImpl.java
+688
-0
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/TrLecturerClassificationServiceImpl.java
+57
-0
cloud-lecturer/src/main/resources/bootstrap.properties
+11
-0
cloud-lecturer/src/main/resources/mapper/LecturerClassificationMapper.xml
+86
-0
cloud-lecturer/src/main/resources/mapper/LecturerDicMapper.xml
+31
-0
cloud-lecturer/src/main/resources/mapper/LecturerGradeMapper.xml
+14
-0
cloud-lecturer/src/main/resources/mapper/LecturerMapper.xml
+234
-0
cloud-lecturer/src/main/resources/mapper/LecturerRelationMapper.xml
+31
-0
pom.xml
+37
-0
No files found.
README.md
View file @
cd48104d
# lecturer
cloud-lecturer-api/pom.xml
0 → 100644
View file @
cd48104d
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
lecturer
</artifactId>
<groupId>
com.yizhi
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cloud-lecturer-api
</artifactId>
<dependencies>
<dependency>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-core
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-common-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-orm
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-util
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>
true
</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/enums/DeleteFlag.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
enums
;
import
com.fasterxml.jackson.annotation.JsonCreator
;
import
com.fasterxml.jackson.annotation.JsonValue
;
/**
* 删除标记(0:否;1:是)
*
* @author lingye
* @date 2019-4-24
*/
public
enum
DeleteFlag
{
// 删除标记(0:否;1:是)
NO
,
YES
;
@JsonCreator
public
static
DeleteFlag
forValue
(
int
ordinal
)
{
return
DeleteFlag
.
values
()[
ordinal
];
}
@JsonValue
public
int
toValue
()
{
return
this
.
ordinal
();
}
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/enums/ImportError.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
enums
;
/**
* @description:
* @author: lly
* @date: 2019-11-12 17:46
**/
public
interface
ImportError
{
final
String
CODE_EMPTY
=
"讲师编码为空"
;
final
String
NAME_EMPTY
=
"讲师姓名为空"
;
final
String
SCORE_EMPTY
=
"讲师评分为空"
;
final
String
LECTURER_NOT_EXIST
=
"编码匹配的讲师不存在"
;
final
String
COURSE_NOT_EXIST
=
"课程不存在"
;
final
String
GRADE_NOT_EXIST
=
"级别不存在"
;
final
String
COURSE_TYPE_ERROR
=
"课程类型不正确"
;
final
String
GRADE_EMPTY
=
"评级为空"
;
final
String
SCORE_FORMAT_ERROR
=
"评分必须在区间0~5,保留小数点后一位"
;
final
String
COURSE_EXIST
=
"课程已经关联讲师"
;
final
String
REPEAT_CODE
=
"讲师重复"
;
final
String
COURSE_CODE_NOT_EXIST
=
"课程code不能为空"
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/enums/LecturerEnum.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
enums
;
/**
* 操作枚举类
* @author lingye
* @date 2019-4-19
*/
public
enum
LecturerEnum
{
UP
(
"up"
,
"上移"
),
DOWN
(
"down"
,
"下移"
),
TOP
(
"top"
,
"置顶"
),
STOP
(
"stop"
,
"停用"
),
START
(
"start"
,
"启用"
);
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
private
String
key
;
private
String
value
;
LecturerEnum
(
String
key
,
String
value
)
{
this
.
key
=
key
;
this
.
value
=
value
;
}
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/feign/LecturerClassificationClient.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
feign
;
import
com.yizhi.lecturer.application.vo.*
;
import
com.yizhi.lecturer.application.vo.domain.LecturerClassificationVo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerGradeVo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerResponseVo
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author lilingye
* @date 2019-11-7
*/
@FeignClient
(
name
=
"lecturer"
,
contextId
=
"LecturerClassificationClient"
)
public
interface
LecturerClassificationClient
{
/**
* 获分类列表
*
* @param type
* @return
*/
@GetMapping
(
value
=
"/classification/list"
)
List
<
CommonTree
>
getClassificationList
(
@RequestParam
(
name
=
"type"
,
defaultValue
=
"1"
,
required
=
false
)
Integer
type
);
/**
* 新增分类
*
* @param lecturerClassificationVO
* @return
*/
@PostMapping
(
value
=
"/classification/add"
)
LecturerClassificationVO
addClassification
(
@RequestBody
LecturerClassificationVO
lecturerClassificationVO
);
/**
* 修改分类
*
* @param lecturerClassificationVO
* @return
*/
@PostMapping
(
value
=
"/classification/update"
)
LecturerClassificationVO
updateClassification
(
@RequestBody
LecturerClassificationVO
lecturerClassificationVO
);
/**
* 上下架
* @param lecturerClassificationVO
* @return
*/
@PostMapping
(
value
=
"/classification/upOrDown"
)
LecturerClassificationRespVO
upOrDown
(
@RequestBody
LecturerClassificationVO
lecturerClassificationVO
);
/**
* 删除分类
*
* @param id
* @return
*/
@GetMapping
(
value
=
"/classification/del"
)
LecturerResponseVo
del
(
@RequestParam
(
name
=
"id"
)
Long
id
);
@PostMapping
(
value
=
"/classification/sort"
)
Boolean
sort
(
@RequestBody
LecturerSortVO
lecturerSortVO
);
/**
* 获取分类详情
* @param id
* @return
*/
@GetMapping
(
value
=
"/classification/get/id"
)
LecturerClassificationVo
getById
(
@RequestParam
(
name
=
"id"
)
Long
id
);
/**
* 新增讲师评级
*
* @param lecturerGradeVO
* @return
*/
@PostMapping
(
value
=
"/grade/add"
)
LecturerGradeVO
add
(
@RequestBody
LecturerGradeVO
lecturerGradeVO
);
/**
* 修改,删除,上下架
*
* @param lecturerGradeVO
* @return
*/
@PostMapping
(
value
=
"/grade/update"
)
LecturerGradeVO
update
(
@RequestBody
LecturerGradeVO
lecturerGradeVO
);
/**
* 根据站点获取江湖级别列表
*
* @return
*/
@GetMapping
(
value
=
"/grade/list"
)
List
<
LecturerGradeVo
>
list
(
@RequestParam
(
value
=
"status"
)
Integer
status
);
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/feign/LecturerClient.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
feign
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.lecturer.application.vo.*
;
import
com.yizhi.lecturer.application.vo.domain.LecturerVo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerDicVo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerResponseVo
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author lingye
* @date 2019-4-17
*/
@FeignClient
(
name
=
"lecturer"
,
contextId
=
"LecturerClient"
)
public
interface
LecturerClient
{
/**
* 获取用户
*
* @param code
* @return
*/
@GetMapping
(
"/lecturerdic/list/code"
)
List
<
LecturerDicVo
>
getLecturerDicList
(
@RequestParam
(
name
=
"code"
)
String
code
);
/**
* 添加讲师
*
* @param lecturerVO
* @return
* @date 2019-4-24
*/
@PostMapping
(
"/lecturer/add"
)
LecturerVO
saveLecturer
(
@RequestBody
LecturerVO
lecturerVO
);
/**
* 修改讲师
*
* @param lecturerVO
* @return
*/
@PostMapping
(
"/lecturer/update"
)
LecturerVO
updateLecturer
(
@RequestBody
LecturerVO
lecturerVO
);
@PostMapping
(
"/lecturer/upOrDown"
)
LecturerResponseVo
upOrDown
(
@RequestBody
LecturerVo
lecturerVo
);
/**
* 查询讲师的详情
*
* @param id
* @return
*/
@GetMapping
(
"/lecturer/get"
)
LecturerVO
queryLecturer
(
@RequestParam
(
"id"
)
Long
id
);
/**
* 交银康联接口
* @param lecturerApiVoParam
* @return
*/
@PostMapping
(
"/lecturer/find"
)
Page
<
LecturerApiVo
>
findLecturer
(
@RequestBody
LecturerApiVoParam
lecturerApiVoParam
);
@GetMapping
(
"/lecturer/detail"
)
public
LecturerVO
queryLecturerByLecturerId
(
@RequestParam
(
"id"
)
Long
id
);
/**
* 查询讲师列表
*
* @param name
* @param mobile
* @param sourceCode 来源code
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping
(
"/lecturer/list"
)
Page
<
LecturerListVO
>
queryLecturer
(
@RequestParam
(
name
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
name
=
"mobile"
,
required
=
false
)
String
mobile
,
@RequestParam
(
name
=
"sourceCode"
,
required
=
false
)
String
sourceCode
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
);
/**
* 导入讲师excel
*
* @return
*/
@GetMapping
(
"/lecturer/export"
)
List
<
LecturerListVO
>
exportLecturer
(
@RequestParam
(
name
=
"keywords"
,
required
=
false
)
String
keywords
,
@RequestParam
(
name
=
"sourceCode"
,
required
=
false
)
String
sourceCode
,
@RequestParam
(
name
=
"mobile"
,
required
=
false
)
String
mobile
);
/**
* 排序
*
* @param lecturerSortVO
* @return
*/
@PostMapping
(
"/lecturer/sortLecturer"
)
boolean
sortLecturer
(
@RequestBody
LecturerSortVO
lecturerSortVO
);
/**
* 删除讲师
*
* @param lecturerSetVO
* @return
*/
@PostMapping
(
"/lecturer/del"
)
LecturerResponseVo
delLecturer
(
@RequestBody
LecturerSetVO
lecturerSetVO
);
/**
* 通过id获取讲师
*
* @param id
* @return
*/
@GetMapping
(
"/lecturer/view"
)
LecturerVo
getLecturerById
(
@RequestParam
(
name
=
"id"
)
Long
id
);
/**
* 获取模块的列表
*
* @param lecturerTemplateVO
* @return
*/
@PostMapping
(
"/lecturer/query"
)
Page
<
TemplateLecturerVO
>
queryLecturerByTemplateId
(
@RequestBody
(
required
=
false
)
LecturerTemplateVO
lecturerTemplateVO
);
/**
* 获取关联列表
*
* @param id
* @return
*/
@GetMapping
(
"/lecturer/relation/get"
)
List
<
RelationVO
>
getRelationsById
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
Long
id
);
/**
* 获取讲师关联的课程/培训
*
* @param lecturerVO
* @return
*/
@PostMapping
(
"/lecturer/relation/update"
)
boolean
updateRelation
(
@RequestBody
LecturerVO
lecturerVO
);
/**
* 获取讲师课程和培训
*
* @param id
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping
(
"/lecturer/relation/query"
)
Page
<
RelationVOList
>
getRelationListByLecturerId
(
@RequestParam
(
name
=
"id"
,
required
=
false
)
Long
id
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
);
/**
* 新增讲师基本信息
*
* @param lecturerInfoVO
* @return
*/
@PostMapping
(
value
=
"/info/add"
)
LecturerInfoVO
add
(
@RequestBody
LecturerInfoVO
lecturerInfoVO
);
/**
* 修改讲师基本信息
*
* @param lecturerInfoVO
* @return
*/
@PostMapping
(
value
=
"/info/update"
)
LecturerInfoVO
update
(
@RequestBody
LecturerInfoVO
lecturerInfoVO
);
/**
* 获取基本信息
*
* @return
*/
@GetMapping
(
value
=
"/info/get"
)
LecturerInfoVO
get
();
/**
* 评分导入
* @param model
* @return
*/
@PostMapping
(
"/lecturer/import/score"
)
String
importScore
(
@RequestBody
FileUploadModel
model
);
/**
* 评级导入
* @param model
* @return
*/
@PostMapping
(
"/lecturer/import/grade"
)
String
importGrade
(
@RequestBody
FileUploadModel
model
);
/**
* 讲师库课程导入
* @param model
* @return
*/
@PostMapping
(
value
=
"/lecturer/import/course"
)
String
importCourse
(
@RequestBody
FileUploadModel
model
);
/**
* 修改评级和评分
* @param lecturerVo
* @return
*/
@PostMapping
(
value
=
"/lecturer/grade"
)
Boolean
updateGrade
(
@RequestBody
LecturerVo
lecturerVo
);
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/CommonTree.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 树结构的基本节点
*
* @Author: shengchenglong
* @Date: 2018/5/18 10:59
*/
@Data
public
class
CommonTree
<
K
,
N
>
implements
Serializable
,
Comparable
{
/**
* 当前节点标识
*/
private
K
id
;
/**
* 当前节点的父节点标识
*/
private
K
pId
;
/**
* 当前节点的父节点name
*/
private
String
pName
;
/**
* 当前节点名称
*/
private
String
name
;
/**
* 当前节点
*/
private
N
node
;
private
Integer
right
;
private
Integer
left
;
private
Integer
sort
;
/**
* 下层节点
*/
private
List
<
CommonTree
>
children
;
@Override
public
int
compareTo
(
Object
o
)
{
CommonTree
node
=
(
CommonTree
)
o
;
if
(
null
==
node
.
getSort
()
||
null
==
this
.
getSort
())
{
return
0
;
}
return
this
.
getSort
()
-
node
.
getSort
();
}
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/FileUploadModel.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
lombok.Data
;
@Data
public
class
FileUploadModel
{
//文件名
private
String
fileName
;
//文件url
private
String
fileUrl
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerApiVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 交银康联 讲师库vo
* </p>
*
* @author lingye
* @since 2020-5-12
*/
@Data
@ApiModel
(
value
=
"LecturerVo"
,
description
=
"讲师详情表"
)
public
class
LecturerApiVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"用户名-系统"
)
private
String
name
;
@ApiModelProperty
(
value
=
"系统用户的accountId"
)
private
Long
accountId
;
@ApiModelProperty
(
value
=
"讲师名称"
)
private
String
lecturerName
;
@ApiModelProperty
(
value
=
"讲师头像"
)
private
String
avatar
;
@ApiModelProperty
(
value
=
"讲师的来源inner内部/outer外部"
)
private
String
source
;
@ApiModelProperty
(
value
=
"头衔"
)
private
String
title
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerApiVoParam.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* <p>
* 交银康联 讲师库vo
* </p>
*
* @author lingye
* @since 2020-5-12
*/
@Data
@ApiModel
(
value
=
"LecturerApiVoParam"
,
description
=
"讲师详情表"
)
public
class
LecturerApiVoParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"页码"
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页的数量"
)
private
Integer
pageSize
;
@ApiModelProperty
(
value
=
"分类id列表"
)
private
List
<
String
>
ids
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerClassificationRespVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
* 讲师库分类表返回
* </p>
*
* @author lingye
* @since 2019-12-3
*/
@Data
@Api
(
tags
=
"LecturerClassificationVO"
,
value
=
"讲师库分类VO"
)
public
class
LecturerClassificationRespVO
{
@ApiModelProperty
(
value
=
"code,1.成功;0.失败"
)
private
Integer
code
;
@ApiModelProperty
(
value
=
"返回信息"
)
private
String
msg
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerClassificationVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 讲师库分类表
* </p>
*
* @author lingye
* @since 2019-09-09
*/
@Data
@Api
(
tags
=
"LecturerClassificationVO"
,
description
=
"讲师库分类表"
)
public
class
LecturerClassificationVO
extends
Model
<
LecturerClassificationVO
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"分类名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"父id,默认为0 时,是最皇父级"
)
private
Long
parentId
;
@ApiModelProperty
(
value
=
"父级ids"
)
private
String
parentIds
;
@ApiModelProperty
(
value
=
"层级,默认是1,第一层"
)
private
Integer
layer
;
@ApiModelProperty
(
value
=
"分类描述"
)
private
String
classificationDes
;
@ApiModelProperty
(
value
=
"删除标记 1 是;0 否;"
)
private
Integer
delFlag
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"创建人的id"
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"更新人的id"
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"公司id"
)
private
Long
companyId
;
@ApiModelProperty
(
value
=
"站点id"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"站点id"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"上下架 1 上架,0 下架"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"父皇级名称"
)
private
String
topName
;
@ApiModelProperty
(
value
=
"父皇id"
)
private
Long
topId
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerCourseImport.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @description: 导入实体
* @author: lly
* @date: 2019-11-12 17:22
**/
@Data
public
class
LecturerCourseImport
implements
Serializable
{
private
String
code
;
private
String
name
;
private
String
type
;
private
String
courseCode
;
private
String
courseName
;
private
String
result
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerDetailVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerClassificationVo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerRelationVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* <p>
* 讲师详情表
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Data
@ApiModel
(
value
=
"LecturerDetailVO"
,
description
=
"讲师详情表"
)
public
class
LecturerDetailVO
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"用户名-系统"
)
private
String
name
;
@ApiModelProperty
(
value
=
"系统用户的accountId"
)
private
Long
accountId
;
@ApiModelProperty
(
value
=
"讲师名称"
)
private
String
lecturerName
;
@ApiModelProperty
(
value
=
"讲师手机号"
)
private
String
mobile
;
@ApiModelProperty
(
value
=
"讲师头像"
)
private
String
avatar
;
@ApiModelProperty
(
value
=
"履历id"
)
private
Long
resumeId
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"讲师关键字"
)
private
List
<
String
>
keywords
;
@ApiModelProperty
(
value
=
"讲师关联内容"
)
private
List
<
LecturerRelationVo
>
lecturerRelationVoVOS
;
@ApiModelProperty
(
value
=
"讲师简历内容"
)
private
String
resume
;
@ApiModelProperty
(
value
=
"讲师的来源inner内部/outer外部"
)
private
String
sourceCode
;
@ApiModelProperty
(
value
=
"头衔"
)
private
String
title
;
@ApiModelProperty
(
value
=
"0,停用;1,启用"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"讲师编码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"模板编号"
)
private
String
templateNo
;
@ApiModelProperty
(
value
=
"评分"
)
private
Float
score
;
@ApiModelProperty
(
value
=
"学历"
)
private
String
edu
;
@ApiModelProperty
(
value
=
"讲师级别"
)
private
Integer
grade
;
@ApiModelProperty
(
value
=
"级别名称"
)
private
String
gradeName
;
@ApiModelProperty
(
value
=
"个性签名"
)
private
String
signature
;
@ApiModelProperty
(
value
=
"所属单位(手动输入)"
)
private
String
companyName
;
@ApiModelProperty
(
value
=
"讲师分类id"
)
private
List
<
LecturerClassificationVo
>
classifications
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerDicVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 讲师库系统字典VO
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Data
@ApiModel
(
value
=
"LecturerDicVO"
,
description
=
"讲师库系统字典"
)
public
class
LecturerDicVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"记录id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"父节点id"
)
private
Long
parentId
;
@ApiModelProperty
(
value
=
"字典名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"字典代码"
)
private
String
code
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerGradeImport.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @description: pinfeng导入
* @author: lly
* @date: 2019-11-12 17:22
**/
@Data
public
class
LecturerGradeImport
implements
Serializable
{
private
String
code
;
private
String
name
;
private
String
grade
;
private
String
result
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerGradeVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 讲师级别表VO
* </p>
*
* @author lingye
* @since 2019-11-05
*/
@Data
@Api
(
tags
=
"LecturerGradeVO"
)
public
class
LecturerGradeVO
extends
Model
<
LecturerGradeVO
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"级别名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"编码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"状态,1 上架,0 下架"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"删除标志,1是,0否"
)
@TableField
(
"del_flag"
)
private
Integer
delFlag
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerImport.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @description: 导入实体
* @author: lly
* @date: 2019-11-12 17:22
**/
@Data
public
class
LecturerImport
implements
Serializable
{
private
String
code
;
private
String
name
;
private
String
score
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerInfoVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
*
* </p>
*
* @author lingye
* @since 2019-11-06
*/
@Data
@Api
(
tags
=
"LecturerInfoVO"
,
description
=
""
)
public
class
LecturerInfoVO
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
companyName
;
@ApiModelProperty
(
value
=
"头衔"
)
private
String
title
;
@ApiModelProperty
(
value
=
"模板"
)
private
String
templateNo
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerListVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 讲师列表VO
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Data
@ApiModel
(
value
=
"LecturerVo"
,
description
=
"讲师详情表"
)
public
class
LecturerListVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师名字"
)
private
String
lecturerName
;
@ApiModelProperty
(
value
=
"讲师手机号"
)
private
String
mobile
;
@ApiModelProperty
(
value
=
"讲师来源"
)
private
String
sourceCode
;
@ApiModelProperty
(
value
=
"关联课程的数量"
)
private
Integer
count
;
@ApiModelProperty
(
value
=
"启用状态:1启动 0 没启用"
)
private
Long
status
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"头衔"
)
private
String
title
;
@ApiModelProperty
(
value
=
"在线课程数量"
)
private
Integer
courseCount
;
@ApiModelProperty
(
value
=
"线下课程的数量"
)
private
Integer
offlineCount
;
@ApiModelProperty
(
value
=
"培训数量"
)
private
Integer
trainingCount
;
@ApiModelProperty
(
value
=
"讲师编码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"模板编号"
)
private
String
templateNo
;
@ApiModelProperty
(
value
=
"评分"
)
private
Float
score
;
@ApiModelProperty
(
value
=
"学历"
)
private
String
edu
;
@ApiModelProperty
(
value
=
"所属单位"
)
private
String
companyName
;
@ApiModelProperty
(
value
=
"讲师级别"
)
private
Integer
grade
;
@ApiModelProperty
(
value
=
"级别名称"
)
private
String
gradeName
;
@ApiModelProperty
(
value
=
"个性签名"
)
private
String
signature
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerQueryVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @description: 讲师操作VO
* @author: lingye
* @date: 2019-04-23 10:18
**/
@Data
public
class
LecturerQueryVO
implements
Serializable
{
@ApiModelProperty
(
value
=
"讲师来源inner 内部/outer 外部"
)
private
String
sourceCode
;
@ApiModelProperty
(
value
=
"讲师名称/课程名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"mobile"
)
private
String
mobile
;
@ApiModelProperty
(
value
=
"当前页"
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页条数"
)
private
Integer
pageSize
;
@ApiModelProperty
(
value
=
"templateId"
)
private
Long
templateId
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerRelationVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
* 讲师库管理列表
* </p>
*
* @author lilingye
* @since 2019-05-06
*/
@Data
@Api
(
tags
=
"LecturerRelationVO"
,
description
=
"讲师关联课程表"
)
public
class
LecturerRelationVO
{
@ApiModelProperty
(
value
=
"主键id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"关联id"
)
private
Long
relationId
;
@ApiModelProperty
(
value
=
"关联名称"
)
private
String
relationName
;
@ApiModelProperty
(
value
=
"1.在线课程; 2.线下课程;3.培训项目"
)
private
Integer
type
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerScoreImport.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @description: 导入实体
* @author: lly
* @date: 2019-11-12 17:22
**/
@Data
public
class
LecturerScoreImport
implements
Serializable
{
private
String
code
;
private
String
name
;
private
String
score
;
private
String
result
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerSetVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @author lingye
* @since 2019-04-17
*/
@Data
@ApiModel
(
value
=
"LecturerSetVO"
,
description
=
"讲师库id列表"
)
public
class
LecturerSetVO
implements
Serializable
{
@ApiModelProperty
(
value
=
"讲师库id列表"
)
private
List
<
Long
>
ids
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerSortVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @description: 讲师操作VO
* @author: lingye
* @date: 2019-04-23 10:18
**/
@Data
public
class
LecturerSortVO
implements
Serializable
{
@ApiModelProperty
(
value
=
"记录id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"操作code,向上:up;向下:down;指定:top;"
)
private
String
code
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerTemplateVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @description: 讲师操作VO
* @author: lingye
* @date: 2019-04-23 10:18
**/
@Data
public
class
LecturerTemplateVO
implements
Serializable
{
@ApiModelProperty
(
value
=
"讲师名称/课程名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"当前页"
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页条数"
)
private
Integer
pageSize
;
@ApiModelProperty
(
value
=
"templateId"
)
private
Long
templateId
;
@ApiModelProperty
(
value
=
"plateIds"
)
private
List
<
Long
>
ids
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/LecturerVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerClassificationVo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerRelationVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* <p>
* 讲师详情表
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Data
@ApiModel
(
value
=
"LecturerVO"
,
description
=
"讲师详情表"
)
public
class
LecturerVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"用户名-系统"
)
private
String
name
;
@ApiModelProperty
(
value
=
"系统用户的accountId"
)
private
Long
accountId
;
@ApiModelProperty
(
value
=
"讲师名称"
)
private
String
lecturerName
;
@ApiModelProperty
(
value
=
"讲师手机号"
)
private
String
mobile
;
@ApiModelProperty
(
value
=
"讲师头像"
)
private
String
avatar
;
@ApiModelProperty
(
value
=
"履历id"
)
private
Long
resumeId
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"讲师关键字"
)
private
List
<
String
>
keywords
;
@ApiModelProperty
(
value
=
"讲师关联内容"
)
private
List
<
LecturerRelationVo
>
lecturerRelationVOS
;
@ApiModelProperty
(
value
=
"讲师简历内容"
)
private
String
resume
;
@ApiModelProperty
(
value
=
"讲师的来源inner内部/outer外部"
)
private
String
sourceCode
;
@ApiModelProperty
(
value
=
"头衔"
)
private
String
title
;
@ApiModelProperty
(
value
=
"0,停用;1,启用"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"讲师编码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"模板编号"
)
private
String
templateNo
;
@ApiModelProperty
(
value
=
"评分"
)
private
Float
score
;
@ApiModelProperty
(
value
=
"讲师级别"
)
private
Integer
grade
;
@ApiModelProperty
(
value
=
"级别名称"
)
private
String
gradeName
;
@ApiModelProperty
(
value
=
"学历"
)
private
String
edu
;
@ApiModelProperty
(
value
=
"所属单位(手动输入)"
)
private
String
companyName
;
@ApiModelProperty
(
value
=
"个性签名"
)
private
String
signature
;
@ApiModelProperty
(
value
=
"讲师分类id"
)
private
List
<
Long
>
classificationIds
;
@ApiModelProperty
(
value
=
"讲师分类id"
)
private
List
<
LecturerClassificationVo
>
classificationList
;
@ApiModelProperty
(
value
=
"讲师分类列表"
)
private
List
<
LecturerClassificationVO
>
classificationVOList
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/RelationAddVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* <p>
* 关联VO
* </p>
*
* @author lingye
* @since 2019-5-10
*/
@Data
@ApiModel
(
value
=
"RelationVO"
,
description
=
"讲师列表"
)
public
class
RelationAddVO
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"关联的参数"
)
List
<
RelationVO
>
relationVOS
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/RelationVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 关联VO
* </p>
*
* @author lingye
* @since 2019-5-10
*/
@Data
@ApiModel
(
value
=
"RelationVO"
,
description
=
"讲师列表"
)
public
class
RelationVO
implements
Serializable
{
@ApiModelProperty
(
value
=
"关联的课程/培训的id"
)
private
Long
relationId
;
@ApiModelProperty
(
value
=
"名称"
)
private
String
relationName
;
@ApiModelProperty
(
value
=
"1.在线课程; 2.线下课程;3.培训项目"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"权限:1 有;0 没"
)
private
Integer
flag
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/RelationVOList.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 关联VO
* </p>
*
* @author lingye
* @since 2019-5-10
*/
@Data
@ApiModel
(
value
=
"RelationVOList"
,
description
=
"讲师列表"
)
public
class
RelationVOList
implements
Serializable
{
@ApiModelProperty
(
value
=
"关联的课程/培训的id"
)
private
Long
relationId
;
@ApiModelProperty
(
value
=
"名称"
)
private
String
relationName
;
@ApiModelProperty
(
value
=
"1.在线课程; 2.线下课程;3.培训项目"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"权限:1 有;0 没"
)
private
Integer
flag
;
@ApiModelProperty
(
value
=
"线下课程图片"
)
private
String
image
;
@ApiModelProperty
(
value
=
"线下课程简介"
)
private
String
des
;
@ApiModelProperty
(
value
=
"开始时间"
)
private
Date
startTime
;
@ApiModelProperty
(
value
=
"结束时间"
)
private
Date
endTime
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/TemplateLecturerVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 移动门户添加讲师返回VO
* </p>
*
* @author lingye
* @since 2019-5-12
*/
@Data
@ApiModel
(
value
=
"TemplateLecturerVO"
,
description
=
"讲师详情表"
)
public
class
TemplateLecturerVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师名字"
)
private
String
name
;
@ApiModelProperty
(
value
=
"讲师图片"
)
private
String
imgPath
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/ClassificationVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 讲师库分类VO
* </p>
*
* @author lingye
* @since 2019-09-09
*/
@Data
@Api
(
tags
=
"ClassificationVO"
)
public
class
ClassificationVO
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"分类名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"父id,默认为0 时,是最皇父级"
)
private
Long
parentId
;
@ApiModelProperty
(
value
=
"层级,默认是1,第一层"
)
private
Integer
layer
;
@ApiModelProperty
(
value
=
"分类描述"
)
private
String
classificationDes
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"站点id"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"子列表"
)
List
<
ClassificationVO
>
classificationVOList
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerClassificationVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 讲师库分类表
* </p>
*
* @author lingye
* @since 2019-09-09
*/
@Data
@Api
(
tags
=
"LecturerClassificationVo"
,
description
=
"讲师库分类表"
)
public
class
LecturerClassificationVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"分类名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"父id,默认为0 时,是最皇父级"
)
private
Long
parentId
;
@ApiModelProperty
(
value
=
"父级ids"
)
private
String
parentIds
;
@ApiModelProperty
(
value
=
"层级,默认是1,第一层"
)
private
Integer
layer
;
@ApiModelProperty
(
value
=
"分类描述"
)
private
String
classificationDes
;
@ApiModelProperty
(
value
=
"是否被删除 1 删除;0 正常;"
)
private
Integer
delFlag
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"创建人的id"
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"更新人的id"
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"公司id"
)
private
Long
companyId
;
@ApiModelProperty
(
value
=
"组织id"
)
private
Long
orgId
;
@ApiModelProperty
(
value
=
"站点id"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"排序"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"上下架 1 上架,0 下架"
)
private
Integer
status
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerCourseVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 讲师关联课程表
* </p>
*
* @author lingye
* @since 2019-04-23
*/
@Data
@ApiModel
(
value
=
"LecturerCourseVo"
,
description
=
"讲师关联课程表"
)
public
class
LecturerCourseVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"课程名称"
)
private
String
courseName
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerDicVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 讲师库系统字典
* </p>
*
* @author lilingye
* @since 2019-04-23
*/
@Data
@ApiModel
(
value
=
"LecturerDicVo"
,
description
=
"讲师库系统字典"
)
public
class
LecturerDicVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"记录id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"父节点id"
)
private
Long
parentId
;
@ApiModelProperty
(
value
=
"字典名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"字典代码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"描述"
)
private
String
des
;
@ApiModelProperty
(
value
=
"启用状态 1 启用 2失效"
)
private
String
status
;
@ApiModelProperty
(
value
=
"字典类型"
)
private
String
type
;
@ApiModelProperty
(
value
=
"添加时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
Date
updateTime
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerGradeVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 讲师级别表
* </p>
*
* @author lingye
* @since 2019-11-05
*/
@Data
@Api
(
tags
=
"LecturerGradeVo"
,
description
=
"讲师级别表"
)
public
class
LecturerGradeVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"级别名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"编码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"状态,1 上架,0 下架"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"删除标志,1是,0否"
)
private
Integer
delFlag
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"创建id"
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"修改人id"
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"站点id"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"公司id"
)
private
Long
companyId
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerInfoVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author lingye
* @since 2019-11-06
*/
@Data
@Api
(
tags
=
"LecturerInfoVo"
,
description
=
""
)
public
class
LecturerInfoVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
companyName
;
@ApiModelProperty
(
value
=
"头衔"
)
private
String
title
;
@ApiModelProperty
(
value
=
"模板"
)
private
String
templateNo
;
@ApiModelProperty
(
value
=
"站点id"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"公司id"
)
private
Long
companyId
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"创建人id"
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"更新人id"
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"删除标记,1,是 0,否"
)
private
Integer
delFlag
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerKeywordsVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
* 关键字
* </p>
*
* @author lilingye
* @since 2019-05-06
*/
@Data
@Api
(
tags
=
"LecturerKeywordsVo"
,
description
=
""
)
public
class
LecturerKeywordsVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"关键字"
)
private
String
keywords
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerRelationVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 讲师关联课程表
* </p>
*
* @author lingye
* @since 2019-05-06
*/
@Data
@Api
(
tags
=
"LecturerRelationVo"
,
description
=
"讲师关联课程表"
)
public
class
LecturerRelationVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"关联id"
)
private
Long
relationId
;
@ApiModelProperty
(
value
=
"关联名称"
)
private
String
relationName
;
@ApiModelProperty
(
value
=
"1.在线课程; 2.线下课程;3.培训项目"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"1.删除 默认0"
)
private
Integer
delFlag
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerResponseVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
lombok.Data
;
/**
* @description: 讲师库返回
* @author: lingye
* @date: 2019-11-07 10:49
**/
@Data
public
class
LecturerResponseVo
{
private
String
code
;
private
String
msg
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerResumeVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 讲师履历表
* </p>
*
* @author lingye
* @since 2019-04-23
*/
@Data
@ApiModel
(
value
=
"LecturerResumeVo"
,
description
=
"讲师履历表"
)
public
class
LecturerResumeVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"个人履历内容"
)
private
String
resume
;
@ApiModelProperty
(
value
=
"签名"
)
private
String
personalSign
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"1 删除"
)
private
Integer
delFlag
;
@ApiModelProperty
(
value
=
"创建人"
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"修改人"
)
private
Long
updateById
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/LecturerVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 讲师详情表
* </p>
*
* @author lingye
* @since 2019-05-06
*/
@Data
@Api
(
tags
=
"LecturerVo"
,
description
=
"讲师详情表"
)
public
class
LecturerVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"用户名-系统"
)
private
String
name
;
@ApiModelProperty
(
value
=
"内部讲师的accoun_id"
)
private
Long
accountId
;
@ApiModelProperty
(
value
=
"讲师名字"
)
private
String
lecturerName
;
@ApiModelProperty
(
value
=
"讲师的来源inner内部/outer外部"
)
private
String
sourceCode
;
@ApiModelProperty
(
value
=
"讲师手机号"
)
private
String
mobile
;
@ApiModelProperty
(
value
=
"讲师头像"
)
private
String
avatar
;
@ApiModelProperty
(
value
=
"讲师职称"
)
private
String
title
;
@ApiModelProperty
(
value
=
"0,停用;1,启用"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"创建讲师的站点id"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"创建讲师的公司id"
)
private
Long
companyId
;
@ApiModelProperty
(
value
=
"是否删除 1已删除 默认0"
)
private
Integer
delFlag
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"创建人"
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"修改人"
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"讲师编码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"模板编号"
)
private
String
templateNo
;
@ApiModelProperty
(
value
=
"评分"
)
private
Float
score
;
@ApiModelProperty
(
value
=
"讲师级别"
)
private
Integer
grade
;
@ApiModelProperty
(
value
=
"级别名称"
)
private
String
gradeName
;
@ApiModelProperty
(
value
=
"学历"
)
private
String
edu
;
@ApiModelProperty
(
value
=
"所属单位(手动输入)"
)
private
String
companyName
;
@ApiModelProperty
(
value
=
"个性签名"
)
private
String
signature
;
}
cloud-lecturer-api/src/main/java/com/yizhi/lecturer/application/vo/domain/TrLecturerClassificationVo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
lecturer
.
application
.
vo
.
domain
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* <p>
* 讲师库、分类关系表
* </p>
*
* @author lingye
* @since 2019-10-08
*/
@Data
@Api
(
tags
=
"TrLecturerClassificationVo"
,
description
=
"讲师库、分类关系表"
)
public
class
TrLecturerClassificationVo
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师库id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"分类id"
)
private
Long
classificationId
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
}
cloud-lecturer/pom.xml
0 → 100644
View file @
cd48104d
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
lecturer
</artifactId>
<groupId>
com.yizhi
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cloud-lecturer
</artifactId>
<dependencies>
<dependency>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-lecturer-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<!--添加system依赖-->
<dependency>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-system-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-core
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-course-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-site-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-course-studyLog-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- deploy 时跳过该模块 -->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-deploy-plugin
</artifactId>
<configuration>
<skip>
true
</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerClassificationController.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
;
import
com.yizhi.application.domain.LecturerClassification
;
import
com.yizhi.application.domain.LecturerResponse
;
import
com.yizhi.application.service.ILecturerClassificationService
;
import
com.yizhi.lecturer.application.vo.LecturerClassificationRespVO
;
import
com.yizhi.lecturer.application.vo.LecturerClassificationVO
;
import
com.yizhi.lecturer.application.vo.LecturerSortVO
;
import
com.yizhi.util.application.tree.CommonTree
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* <p>
* 讲师库分类表 前端控制器
* </p>
*
* @author lilingye
* @since 2019-09-09
*/
@Api
(
value
=
"讲师库分类"
,
tags
=
"讲师库分类"
)
@RestController
@RequestMapping
(
"/classification"
)
public
class
LecturerClassificationController
{
@Autowired
private
ILecturerClassificationService
classificationService
;
/**
* 分类列表
*
* @param type
* @return
*/
@GetMapping
(
value
=
"/list"
)
public
List
<
CommonTree
>
getClassificationList
(
@RequestParam
(
name
=
"type"
,
defaultValue
=
"1"
,
required
=
false
)
Integer
type
)
{
return
classificationService
.
getClassificationList
(
type
);
}
/**
* 新增分类
*
* @param lecturerClassificationVO
* @return
*/
@PostMapping
(
value
=
"/add"
)
public
LecturerClassificationVO
addClassification
(
@RequestBody
LecturerClassificationVO
lecturerClassificationVO
)
{
return
classificationService
.
add
(
lecturerClassificationVO
);
}
/**
* 修改分类
*
* @param lecturerClassificationVO
* @return
*/
@PostMapping
(
value
=
"/update"
)
public
LecturerClassificationVO
updateClassification
(
@RequestBody
LecturerClassificationVO
lecturerClassificationVO
)
{
return
classificationService
.
update
(
lecturerClassificationVO
);
}
/**
* 上下架分类
* @param lecturerClassificationVO
* @return
*/
@PostMapping
(
value
=
"/upOrDown"
)
public
LecturerClassificationRespVO
upOrDown
(
@RequestBody
LecturerClassificationVO
lecturerClassificationVO
)
{
return
classificationService
.
upOrDown
(
lecturerClassificationVO
);
}
/**
* 删除分类
*
* @param id
* @return
*/
@GetMapping
(
value
=
"/del"
)
public
LecturerResponse
del
(
@RequestParam
(
name
=
"id"
)
Long
id
)
{
return
classificationService
.
del
(
id
);
}
/**
* 分类排序
*
* @param lecturerSortVO
* @return
*/
@PostMapping
(
value
=
"/sort"
)
public
Boolean
sort
(
@RequestBody
LecturerSortVO
lecturerSortVO
)
{
return
classificationService
.
sortClassification
(
lecturerSortVO
);
}
/**
* 获取实体
* @param id
* @return
*/
@GetMapping
(
value
=
"/get/id"
)
public
LecturerClassification
getById
(
@RequestParam
(
name
=
"id"
)
Long
id
)
{
return
classificationService
.
selectById
(
id
);
}
}
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerController.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.application.domain.Lecturer
;
import
com.yizhi.application.domain.LecturerResponse
;
import
com.yizhi.lecturer.application.enums.DeleteFlag
;
import
com.yizhi.application.service.ILecturerService
;
import
com.yizhi.lecturer.application.vo.*
;
import
com.yizhi.lecturer.application.vo.domain.LecturerResponseVo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* <p>
* 讲师详情表 前端控制器
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Api
(
tags
=
"讲师库"
,
value
=
"讲师库"
)
@RestController
@RequestMapping
(
"/lecturer"
)
public
class
LecturerController
{
@Autowired
private
ILecturerService
lecturerService
;
/**
* 新增讲师
*
* @param lecturerVO
* @return
*/
@PostMapping
(
"/add"
)
public
LecturerVO
saveLecturer
(
@RequestBody
LecturerVO
lecturerVO
)
{
return
lecturerService
.
addLecturer
(
lecturerVO
);
}
/**
* 修改讲师
*
* @param lecturerVO
* @return
*/
@PostMapping
(
"/update"
)
public
LecturerVO
updateLecturer
(
@RequestBody
LecturerVO
lecturerVO
)
{
boolean
updateLecturer
=
lecturerService
.
updateLecturer
(
lecturerVO
);
if
(
updateLecturer
)
{
return
queryLecturer
(
lecturerVO
.
getId
());
}
else
{
return
null
;
}
}
/**
* 讲师库的停用/
* @param lecturer
* @return
*/
@PostMapping
(
"/upOrDown"
)
public
LecturerResponseVo
upOrDown
(
@RequestBody
Lecturer
lecturer
)
{
LecturerResponse
list
=
lecturerService
.
upOrDownLecturer
(
lecturer
);
LecturerResponseVo
list2
=
new
LecturerResponseVo
();
BeanUtils
.
copyProperties
(
list
,
list2
);
return
list2
;
}
/**
* 查询讲师列表
*
* @param id
* @return
*/
@GetMapping
(
"/get"
)
public
LecturerVO
queryLecturer
(
@RequestParam
(
"id"
)
Long
id
)
{
return
lecturerService
.
queryLecturerById
(
id
);
}
/**
* 交银康联接口
* @param lecturerApiVoParam
* @return
*/
@PostMapping
(
"/find"
)
Page
<
LecturerApiVo
>
findLecturer
(
@RequestBody
LecturerApiVoParam
lecturerApiVoParam
){
return
lecturerService
.
findLecturer
(
lecturerApiVoParam
);
}
/**
* 学员端-讲师详情
*
* @param id
* @return
*/
@GetMapping
(
"/detail"
)
public
LecturerDetailVO
queryLecturerByLecturerId
(
@RequestParam
(
"id"
)
Long
id
)
{
return
lecturerService
.
queryLecturerByLecturerId
(
id
);
}
@GetMapping
(
"/list"
)
public
Page
<
LecturerListVO
>
queryLecturer
(
@RequestParam
(
name
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
name
=
"mobile"
,
required
=
false
)
String
mobile
,
@RequestParam
(
name
=
"sourceCode"
,
required
=
false
)
String
sourceCode
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
)
{
return
lecturerService
.
queryLecturer
(
name
,
mobile
,
sourceCode
,
pageNo
,
pageSize
);
}
/**
* 导出讲师列表
*
* @return
*/
@GetMapping
(
"/export"
)
public
List
<
LecturerListVO
>
exportLecturer
(
@ApiParam
(
name
=
"keywords"
,
value
=
"讲师名称/课程名称"
)
@RequestParam
(
name
=
"keywords"
,
required
=
false
)
String
keywords
,
@ApiParam
(
name
=
"sourceCode"
,
value
=
"讲师来源inner 内部/outer 外部"
)
@RequestParam
(
name
=
"sourceCode"
,
required
=
false
)
String
sourceCode
,
@ApiParam
(
name
=
"mobile"
,
value
=
"手机号码"
)
@RequestParam
(
name
=
"mobile"
,
required
=
false
)
String
mobile
)
{
return
lecturerService
.
exportLecturer
(
keywords
,
sourceCode
,
mobile
);
}
/**
* 排序
*
* @param lecturerSortVO
* @return
*/
@PostMapping
(
"/sortLecturer"
)
public
boolean
sortLecturer
(
@RequestBody
LecturerSortVO
lecturerSortVO
)
{
return
lecturerService
.
sortLecturer
(
lecturerSortVO
);
}
/**
* 删除讲师库
*
* @param lecturerSetVO
* @return
*/
@PostMapping
(
"/del"
)
public
LecturerResponseVo
delLecturer
(
@RequestBody
LecturerSetVO
lecturerSetVO
)
{
LecturerResponse
lecturerResponse
=
lecturerService
.
delLecturer
(
lecturerSetVO
.
getIds
());
LecturerResponseVo
lecturerResponseVo1
=
new
LecturerResponseVo
();
BeanUtils
.
copyProperties
(
lecturerResponse
,
lecturerResponseVo1
);
return
lecturerResponseVo1
;
}
/**
* 通过id获取讲师
*
* @param id
* @return
*/
@GetMapping
(
"/view"
)
public
LecturerVo
getLecturerById
(
@RequestParam
(
name
=
"id"
)
Long
id
)
{
Lecturer
lecturer
=
lecturerService
.
getLecturerById
(
id
);
LecturerVo
lecturerVo1
=
new
LecturerVo
();
BeanUtils
.
copyProperties
(
lecturer
,
lecturerVo1
);
return
lecturerVo1
;
}
/**
* 移动模块的添加
*
* @param lecturerTemplateVO
* @return
*/
@PostMapping
(
"/query"
)
public
Page
<
TemplateLecturerVO
>
queryLecturerByTemplateId
(
@RequestBody
(
required
=
false
)
LecturerTemplateVO
lecturerTemplateVO
)
{
Integer
pageNo
=
lecturerTemplateVO
.
getPageNo
()
!=
null
?
lecturerTemplateVO
.
getPageNo
()
:
DeleteFlag
.
NO
.
ordinal
();
Integer
pageSize
=
lecturerTemplateVO
.
getPageSize
()
!=
null
?
lecturerTemplateVO
.
getPageSize
()
:
20
;
return
lecturerService
.
queryLecturerByTemplateId
(
lecturerTemplateVO
.
getName
(),
pageNo
,
pageSize
,
lecturerTemplateVO
.
getIds
());
}
/**
* 修改评级和积分
* @param lecturer
* @return
*/
@PostMapping
(
"/grade"
)
public
Boolean
updateGrade
(
@RequestBody
Lecturer
lecturer
)
{
return
lecturerService
.
updateById
(
lecturer
);
}
}
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerDicController.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
;
import
com.yizhi.application.domain.LecturerDic
;
import
com.yizhi.application.service.ILecturerDicService
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* <p>
* 讲师库系统字典 前端控制器
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Api
(
value
=
"讲师字典"
)
@RestController
@RequestMapping
(
"/lecturerdic"
)
public
class
LecturerDicController
{
@Autowired
private
ILecturerDicService
lecturerDicService
;
@GetMapping
(
"/list/code"
)
public
List
<
LecturerDic
>
getLecturerDicList
(
@RequestParam
(
name
=
"code"
)
String
code
)
{
return
lecturerDicService
.
getLecturerDicListByCode
(
code
);
}
}
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerGradeController.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
;
import
com.yizhi.application.domain.LecturerGrade
;
import
com.yizhi.application.service.ILecturerGradeService
;
import
com.yizhi.lecturer.application.vo.LecturerGradeVO
;
import
com.yizhi.lecturer.application.vo.domain.LecturerGradeVo
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* 讲师级别表 前端控制器
* </p>
*
* @author lingye
* @since 2019-11-05
*/
@Api
(
value
=
"讲师等级"
,
tags
=
"讲师等级"
)
@RestController
@RequestMapping
(
"/grade"
)
public
class
LecturerGradeController
{
@Autowired
private
ILecturerGradeService
gradeService
;
/**
* 新增讲师评级
*
* @param lecturerGradeVO
* @return
*/
@PostMapping
(
value
=
"/add"
)
public
LecturerGradeVO
add
(
@RequestBody
LecturerGradeVO
lecturerGradeVO
)
{
return
gradeService
.
add
(
lecturerGradeVO
);
}
/**
* 修改,删除,上下架
*
* @param lecturerGradeVO
* @return
*/
@PostMapping
(
value
=
"/update"
)
public
LecturerGradeVO
update
(
@RequestBody
LecturerGradeVO
lecturerGradeVO
)
{
return
gradeService
.
update
(
lecturerGradeVO
);
}
/**
* 根据站点获取江湖级别列表
*
* @return
*/
@GetMapping
(
value
=
"/list"
)
public
List
<
LecturerGradeVo
>
list
(
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
)
{
List
<
LecturerGrade
>
list
=
gradeService
.
list
(
status
);
List
<
LecturerGradeVo
>
list2
=
new
ArrayList
<>();
for
(
LecturerGrade
l:
list
)
{
LecturerGradeVo
lecturerGradeVo
=
new
LecturerGradeVo
();
BeanUtils
.
copyProperties
(
l
,
lecturerGradeVo
);
list2
.
add
(
lecturerGradeVo
);
}
return
list2
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerImportController.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
;
import
com.alibaba.fastjson.JSON
;
import
com.yizhi.application.orm.id.IdGenerator
;
import
com.yizhi.application.orm.util.DomainConverter
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.application.service.ILecturerImportService
;
import
com.yizhi.application.service.impl.LecturerClassificationServiceImpl
;
import
com.yizhi.core.application.context.TaskContext
;
import
com.yizhi.core.application.file.constant.FileConstant
;
import
com.yizhi.core.application.file.domain.FileInfo
;
import
com.yizhi.core.application.file.domain.Template
;
import
com.yizhi.core.application.file.domain.TemplateColumn
;
import
com.yizhi.core.application.file.exp.ExcelExportor
;
import
com.yizhi.core.application.file.imp.AbstractImporter
;
import
com.yizhi.core.application.file.imp.ImportCallBack
;
import
com.yizhi.core.application.file.util.OssUpload
;
import
com.yizhi.core.application.log.LogEventPublisher
;
import
com.yizhi.core.application.log.TaskLogEvent
;
import
com.yizhi.core.application.task.TaskExecutor
;
import
com.yizhi.core.application.task.TaskHandler
;
import
com.yizhi.lecturer.application.vo.FileUploadModel
;
import
com.yizhi.lecturer.application.vo.LecturerCourseImport
;
import
com.yizhi.lecturer.application.vo.LecturerGradeImport
;
import
com.yizhi.lecturer.application.vo.LecturerScoreImport
;
import
com.yizhi.system.application.model.ImportModel
;
import
com.yizhi.util.application.clazz.ClassUtil
;
import
com.yizhi.util.application.date.DateUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.hssf.usermodel.HSSFRow
;
import
org.apache.poi.hssf.usermodel.HSSFSheet
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 讲师详情表 前端控制器
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Api
(
tags
=
"讲师库导入"
,
value
=
"讲师库导入"
)
@RestController
@RequestMapping
(
"/lecturer/import"
)
public
class
LecturerImportController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
LecturerClassificationServiceImpl
.
class
);
@Autowired
IdGenerator
idGenerator
;
@Autowired
DomainConverter
converter
;
@Autowired
private
ILecturerImportService
lecturerImportService
;
@Autowired
LogEventPublisher
publisher
;
@Autowired
TaskExecutor
taskExecutor
;
@ApiOperation
(
value
=
"评分导入"
,
notes
=
"评分导入"
)
@PostMapping
(
value
=
"/score"
)
public
String
importScore
(
@RequestBody
FileUploadModel
model
)
{
logger
.
info
(
"导入文件信息====="
+
JSON
.
toJSONString
(
model
));
String
taskLogSerialNo
=
"LECTURER_SCORE-"
+
DateUtil
.
getYMDHMSS
();
try
{
Long
taskId
=
idGenerator
.
generate
();
RequestContext
context
=
ContextHolder
.
get
();
Long
companyId
=
context
.
getCompanyId
();
// Long companyId = 1314L;
Long
siteId
=
context
.
getSiteId
();
// Long siteId = 1314L;
Long
accountId
=
context
.
getAccountId
();
// Long accountId = 1314L;
TaskContext
taskContext
=
new
TaskContext
(
taskId
,
taskLogSerialNo
,
"讲师库批量导入评分"
,
accountId
,
new
Date
(),
siteId
,
companyId
);
ImportModel
importModel
=
(
ImportModel
)
converter
.
toDO
(
context
,
ImportModel
.
class
);
importModel
.
setTaskId
(
taskId
);
ImportCallBack
callBack
=
new
ImportCallBack
()
{
@Override
public
Boolean
exec
(
TaskHandler
taskHandler
,
List
dataObjs
)
{
importModel
.
setData
(
dataObjs
);
List
<
LecturerScoreImport
>
models
=
lecturerImportService
.
importScore
(
importModel
,
1
,
context
);
// 所有的信息要上传到oss服务器
ExcelForAccountImportExporter
<
LecturerScoreImport
>
exporter
=
new
ExcelForAccountImportExporter
<>(
createExpTemplate
(
1
),
models
);
exporter
.
bindContext
(
taskContext
);
exporter
.
bindPublisher
(
publisher
);
exporter
.
handle
();
return
true
;
}
};
AbstractImporter
importer
=
AbstractImporter
.
build
(
model
.
getFileUrl
(),
null
,
model
.
getFileName
(),
callBack
,
createScoreImpTemplate
(),
LecturerScoreImport
.
class
);
importer
.
bindContext
(
taskContext
);
importer
.
bindPublisher
(
publisher
);
taskExecutor
.
asynExecute
(
importer
);
}
catch
(
Exception
e
)
{
logger
.
error
(
""
,
e
);
// return Response.fail(ReturnCode.SERVICE_UNAVAILABLE);
}
return
taskLogSerialNo
;
}
@ApiOperation
(
value
=
"评级导入"
,
notes
=
"评级导入"
)
@PostMapping
(
value
=
"/grade"
)
public
String
importGrade
(
@RequestBody
FileUploadModel
model
)
{
logger
.
info
(
"导入文件信息====="
+
JSON
.
toJSONString
(
model
));
String
taskLogSerialNo
=
"LECTURER_GRADE-"
+
DateUtil
.
getYMDHMSS
();
try
{
Long
taskId
=
idGenerator
.
generate
();
RequestContext
context
=
ContextHolder
.
get
();
Long
companyId
=
context
.
getCompanyId
();
// Long companyId = 1314L;
Long
siteId
=
context
.
getSiteId
();
// Long siteId = 1314L;
Long
accountId
=
context
.
getAccountId
();
// Long accountId = 1314L;
TaskContext
taskContext
=
new
TaskContext
(
taskId
,
taskLogSerialNo
,
"讲师库批量导入评级"
,
accountId
,
new
Date
(),
siteId
,
companyId
);
ImportModel
importModel
=
(
ImportModel
)
converter
.
toDO
(
context
,
ImportModel
.
class
);
importModel
.
setTaskId
(
taskId
);
ImportCallBack
callBack
=
new
ImportCallBack
()
{
@Override
public
Boolean
exec
(
TaskHandler
taskHandler
,
List
dataObjs
)
{
importModel
.
setData
(
dataObjs
);
List
<
LecturerScoreImport
>
models
=
lecturerImportService
.
importScore
(
importModel
,
2
,
context
);
ExcelForAccountImportExporter
<
LecturerGradeImport
>
exporter
=
new
ExcelForAccountImportExporter
<>(
createExpTemplate
(
2
),
models
);
exporter
.
bindContext
(
taskContext
);
exporter
.
bindPublisher
(
publisher
);
exporter
.
handle
();
return
true
;
}
};
AbstractImporter
importer
=
AbstractImporter
.
build
(
model
.
getFileUrl
(),
null
,
model
.
getFileName
(),
callBack
,
createScoreImpTemplate
(),
LecturerScoreImport
.
class
);
importer
.
bindContext
(
taskContext
);
importer
.
bindPublisher
(
publisher
);
taskExecutor
.
asynExecute
(
importer
);
}
catch
(
Exception
e
)
{
logger
.
error
(
""
,
e
);
// return Response.fail(ReturnCode.SERVICE_UNAVAILABLE);
}
return
taskLogSerialNo
;
}
@ApiOperation
(
value
=
"课程导入"
,
notes
=
"课程导入"
)
@PostMapping
(
value
=
"/course"
)
public
String
importCourse
(
@RequestBody
FileUploadModel
model
)
{
logger
.
info
(
"导入文件信息====="
+
JSON
.
toJSONString
(
model
));
String
taskLogSerialNo
=
"LECTURER_COURSE-"
+
DateUtil
.
getYMDHMSS
();
try
{
Long
taskId
=
idGenerator
.
generate
();
RequestContext
context
=
ContextHolder
.
get
();
Long
companyId
=
context
.
getCompanyId
();
// Long companyId = 1314L;
Long
siteId
=
context
.
getSiteId
();
// Long siteId =1314L;
Long
accountId
=
context
.
getAccountId
();
// Long accountId = 1314L;
TaskContext
taskContext
=
new
TaskContext
(
taskId
,
taskLogSerialNo
,
"讲师库批量导入关联课程"
,
accountId
,
new
Date
(),
siteId
,
companyId
);
ImportModel
importModel
=
(
ImportModel
)
converter
.
toDO
(
context
,
ImportModel
.
class
);
importModel
.
setTaskId
(
taskId
);
ImportCallBack
callBack
=
new
ImportCallBack
()
{
@Override
public
Boolean
exec
(
TaskHandler
taskHandler
,
List
dataObjs
)
{
importModel
.
setData
(
dataObjs
);
List
<
LecturerCourseImport
>
models
=
lecturerImportService
.
importCourse
(
importModel
,
context
);
ExcelForAccountImportExporter
<
LecturerCourseImport
>
exporter
=
new
ExcelForAccountImportExporter
<>(
createExpTemplate
(
3
),
models
);
exporter
.
bindContext
(
taskContext
);
exporter
.
bindPublisher
(
publisher
);
exporter
.
handle
();
return
true
;
}
};
AbstractImporter
importer
=
AbstractImporter
.
build
(
model
.
getFileUrl
(),
null
,
model
.
getFileName
(),
callBack
,
createCourseImpTemplate
(),
LecturerCourseImport
.
class
);
importer
.
bindContext
(
taskContext
);
importer
.
bindPublisher
(
publisher
);
taskExecutor
.
asynExecute
(
importer
);
}
catch
(
Exception
e
)
{
logger
.
error
(
""
,
e
);
// return Response.fail(ReturnCode.SERVICE_UNAVAILABLE);
}
return
taskLogSerialNo
;
}
class
ExcelForAccountImportExporter
<
T
>
extends
ExcelExportor
<
T
>
{
public
ExcelForAccountImportExporter
(
Template
template
,
List
data
)
{
super
(
template
,
data
);
}
@Override
public
FileInfo
render
()
{
FileInfo
fileInfo
=
new
FileInfo
();
fileInfo
.
setFileType
(
template
.
getFileType
());
// 创建HSSFWorkbook对象(excel的文档对象)
HSSFWorkbook
wb
=
new
HSSFWorkbook
();
// 建立新的sheet对象(excel的表单)
HSSFSheet
sheet
=
wb
.
createSheet
();
// 在sheet里创建第一行,标题行
HSSFRow
row1
=
sheet
.
createRow
((
int
)
0
);
// 标题目录
List
<
TemplateColumn
>
columns
=
template
.
getColumns
();
for
(
int
i
=
0
;
i
<
columns
.
size
();
i
++)
{
Cell
cell
=
row1
.
createCell
(
i
);
cell
.
setCellValue
(
columns
.
get
(
i
).
getColumnName
().
toString
());
}
// 行数据
HSSFRow
row2
=
null
;
int
passCount
=
0
;
int
failCount
=
0
;
if
(
CollectionUtils
.
isNotEmpty
(
data
))
{
for
(
int
j
=
0
;
j
<
data
.
size
();
j
++)
{
T
t
=
data
.
get
(
j
);
row2
=
sheet
.
createRow
((
int
)
j
+
1
);
for
(
int
m
=
0
;
m
<
columns
.
size
();
m
++)
{
TemplateColumn
templateColumn
=
columns
.
get
(
m
);
String
cellValue
=
ClassUtil
.
invokeMethod
(
t
,
templateColumn
.
getColumn
()).
toString
();
row2
.
createCell
(
m
).
setCellValue
(
cellValue
);
}
if
(
StringUtils
.
isNotEmpty
(
ClassUtil
.
invokeMethod
(
t
,
columns
.
get
(
columns
.
size
()
-
1
).
getColumn
()).
toString
()))
{
failCount
++;
}
else
{
passCount
++;
}
}
}
String
fileName
=
template
.
getFileName
();
if
(
StringUtils
.
isEmpty
(
fileName
))
{
fileName
=
"导出文件"
.
concat
(
String
.
valueOf
(
System
.
currentTimeMillis
())).
concat
(
".xls"
);
}
fileInfo
.
setFileName
(
fileName
);
if
(
template
.
getBrowserExport
())
{
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
fileName
);
response
.
setContentType
(
"application/vnd.ms-excel"
);
OutputStream
output
=
null
;
try
{
output
=
response
.
getOutputStream
();
wb
.
write
(
output
);
output
.
flush
();
publishTaskEvent
(
TaskLogEvent
.
success
(
taskContext
,
"导入成功"
,
null
));
}
catch
(
IOException
e
)
{
publishTaskEvent
(
TaskLogEvent
.
fail
(
taskContext
,
"文件导入异常:"
+
e
.
getMessage
()));
logger
.
error
(
"文件导入异常"
,
e
);
}
finally
{
try
{
output
.
close
();
}
catch
(
IOException
e
)
{
logger
.
error
(
"文件导入关闭流异常"
,
e
);
}
}
}
else
{
String
path
=
new
StringBuffer
().
append
(
FileConstant
.
SAVE_PATH
).
append
(
File
.
separator
).
append
(
fileName
)
.
toString
();
// //文件保存位置
File
saveDir
=
new
File
(
FileConstant
.
SAVE_PATH
);
if
(!
saveDir
.
exists
())
{
saveDir
.
mkdir
();
}
File
file
=
new
File
(
saveDir
+
File
.
separator
+
fileName
);
try
{
FileOutputStream
os
=
new
FileOutputStream
(
file
);
wb
.
write
(
os
);
os
.
close
();
// 阿里云返回url
String
upLoadUrl
=
OssUpload
.
upload
(
path
,
fileName
);
// path, fileName
publishTaskEvent
(
TaskLogEvent
.
success
(
taskContext
,
"成功导入"
+
passCount
+
"条,失败"
+
failCount
+
"条"
,
upLoadUrl
));
file
.
delete
();
}
catch
(
Exception
e
)
{
publishTaskEvent
(
TaskLogEvent
.
fail
(
taskContext
,
"写入过程中发生错误:"
+
e
.
getMessage
()));
logger
.
error
(
"写入过程中发生错误"
,
e
);
}
}
return
fileInfo
;
}
}
/**
* 讲师评级
*
* @return
*/
private
Template
createExpTemplate
(
Integer
type
)
{
Template
template
=
new
Template
();
if
(
type
==
2
)
{
template
=
createGradeImpTemplate
();
}
else
if
(
type
==
1
)
{
template
=
createScoreImpTemplate
();
}
else
if
(
type
==
3
)
{
template
=
createCourseImpTemplate
();
}
if
(
type
==
3
)
{
logger
.
info
(
"课程创建模板"
);
List
<
TemplateColumn
>
columns
=
template
.
getColumns
();
columns
.
add
(
new
TemplateColumn
(
"result"
,
"结果"
,
6
));
template
.
setColumns
(
columns
);
template
.
setBrowserExport
(
false
);
}
else
{
List
<
TemplateColumn
>
columns
=
template
.
getColumns
();
columns
.
add
(
new
TemplateColumn
(
"result"
,
"结果"
,
4
));
template
.
setColumns
(
columns
);
template
.
setBrowserExport
(
false
);
}
return
template
;
}
/**
* 讲师评级模板
*
* @return
*/
private
Template
createGradeImpTemplate
()
{
Template
template
=
new
Template
();
List
<
TemplateColumn
>
columns
=
new
ArrayList
<>();
columns
.
add
(
new
TemplateColumn
(
"code"
,
"讲师编码"
,
1
));
columns
.
add
(
new
TemplateColumn
(
"name"
,
"讲师姓名"
,
2
));
columns
.
add
(
new
TemplateColumn
(
"score"
,
"讲师评级"
,
3
));
template
.
setColumns
(
columns
);
return
template
;
}
/**
* 讲师评分模板
*
* @return
*/
private
Template
createScoreExpTemplate
()
{
Template
template
=
createScoreImpTemplate
();
List
<
TemplateColumn
>
columns
=
template
.
getColumns
();
columns
.
add
(
new
TemplateColumn
(
"result"
,
"结果"
,
4
));
template
.
setColumns
(
columns
);
template
.
setBrowserExport
(
false
);
return
template
;
}
/**
* 讲师评分模板
*
* @return
*/
private
Template
createScoreImpTemplate
()
{
Template
template
=
new
Template
();
List
<
TemplateColumn
>
columns
=
new
ArrayList
<>();
columns
.
add
(
new
TemplateColumn
(
"code"
,
"讲师编码"
,
1
));
columns
.
add
(
new
TemplateColumn
(
"name"
,
"讲师姓名"
,
2
));
columns
.
add
(
new
TemplateColumn
(
"score"
,
"讲师评分"
,
3
));
template
.
setColumns
(
columns
);
return
template
;
}
/**
* 课程导入
*
* @return
*/
private
Template
createCourseImpTemplate
()
{
Template
template
=
new
Template
();
List
<
TemplateColumn
>
columns
=
new
ArrayList
<>();
columns
.
add
(
new
TemplateColumn
(
"code"
,
"讲师编码"
,
1
));
columns
.
add
(
new
TemplateColumn
(
"name"
,
"讲师姓名"
,
2
));
columns
.
add
(
new
TemplateColumn
(
"type"
,
"课程类型"
,
3
));
columns
.
add
(
new
TemplateColumn
(
"courseCode"
,
"课程编码"
,
4
));
columns
.
add
(
new
TemplateColumn
(
"courseName"
,
"课程名称"
,
5
));
template
.
setColumns
(
columns
);
return
template
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerInfoController.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
;
import
com.yizhi.application.service.ILecturerInfoService
;
import
com.yizhi.lecturer.application.vo.LecturerInfoVO
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* <p>
* 前端控制器
* </p>
*
* @author lingye
* @since 2019-11-06
*/
@Api
(
value
=
"讲师基本信息"
,
tags
=
"讲师基本信息"
)
@RestController
@RequestMapping
(
"/info"
)
public
class
LecturerInfoController
{
@Autowired
private
ILecturerInfoService
lecturerInfoService
;
/**
* 新增讲师基本信息
*
* @param lecturerInfoVO
* @return
*/
@PostMapping
(
value
=
"/add"
)
public
LecturerInfoVO
add
(
@RequestBody
LecturerInfoVO
lecturerInfoVO
)
{
return
lecturerInfoService
.
add
(
lecturerInfoVO
);
}
/**
* 修改讲师基本信息
*
* @param lecturerInfoVO
* @return
*/
@PostMapping
(
value
=
"/update"
)
public
LecturerInfoVO
update
(
@RequestBody
LecturerInfoVO
lecturerInfoVO
)
{
return
lecturerInfoService
.
update
(
lecturerInfoVO
);
}
/**
* 获取基本信息
*
* @return
*/
@GetMapping
(
value
=
"/get"
)
public
LecturerInfoVO
get
()
{
return
lecturerInfoService
.
getBySiteId
();
}
}
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerRelationController.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.application.domain.LecturerRelation
;
import
com.yizhi.application.service.ILecturerRelationService
;
import
com.yizhi.lecturer.application.vo.LecturerVO
;
import
com.yizhi.lecturer.application.vo.RelationVO
;
import
com.yizhi.lecturer.application.vo.RelationVOList
;
import
com.yizhi.lecturer.application.vo.domain.LecturerRelationVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* 讲师详情表 前端控制器
* </p>
*
* @author lingye
* @since 2019-5-10
*/
@RestController
@RequestMapping
(
"/lecturer/relation"
)
public
class
LecturerRelationController
{
@Autowired
private
ILecturerRelationService
lecturerRelationService
;
/**
* 通过讲师id获取讲师关联的内容
*
* @param id
* @return
*/
@GetMapping
(
"/get"
)
public
List
<
RelationVO
>
getRelationsById
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
Long
id
)
{
return
lecturerRelationService
.
getRelationsById
(
id
);
}
/**
* 更新关联
*
* @param lecturerVO
* @return
*/
@PostMapping
(
"/update"
)
public
boolean
updateRelation
(
@RequestBody
LecturerVO
lecturerVO
)
{
List
<
LecturerRelationVo
>
lecturerRelationVoVOS
=
lecturerVO
.
getLecturerRelationVOS
();
List
<
LecturerRelation
>
lecturerRelation
=
new
ArrayList
<>();
for
(
LecturerRelationVo
l:
lecturerRelationVoVOS
)
{
LecturerRelation
l1
=
new
LecturerRelation
();
BeanUtils
.
copyProperties
(
l
,
l1
);
lecturerRelation
.
add
(
l1
);
}
return
lecturerRelationService
.
updateLecturerRelation
(
lecturerRelation
,
lecturerVO
.
getId
());
}
/**
* 查询讲师库关联的接口
*
* @param id
* @return
*/
@GetMapping
(
"/query"
)
public
Page
<
RelationVOList
>
getRelationListByLecturerId
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
Long
id
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
)
{
return
lecturerRelationService
.
getRelationListByLecturerId
(
id
,
pageNo
,
pageSize
);
}
}
cloud-lecturer/src/main/java/com/yizhi/application/Controller/LecturerResumeController.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 讲师履历表 前端控制器
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@RestController
@RequestMapping
(
"/lecturerResume"
)
public
class
LecturerResumeController
{
}
cloud-lecturer/src/main/java/com/yizhi/application/Controller/Test2.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
;
public
class
Test2
{
/**
* 生成规则设备编号:设备类型+五位编号(从1开始,不够前补0)
*
* @param equipmentType 设备类型
* @param equipmentNo 最新设备编号
* @return
*/
// public static String getNewEquipmentNo(String equipmentType, String equipmentNo) {
// String newEquipmentNo = "00001";
//
// if (equipmentNo != null && !equipmentNo.isEmpty()) {
// int newEquipment = Integer.parseInt(equipmentNo) + 1;
// newEquipmentNo = String.format(equipmentType + "%05d", newEquipment);
// }
//
// return newEquipmentNo;
// }
public
static
void
main
(
String
[]
args
)
{
// String equipmentNo = Test2.getNewEquipmentNo("T", "1000056");
// System.out.println("生成设备编号:" + equipmentNo);
String
str
=
"0,"
;
String
[]
strArray
=
str
.
split
(
","
);
System
.
out
.
printf
(
strArray
[
1
]);
}
}
\ No newline at end of file
cloud-lecturer/src/main/java/com/yizhi/application/Controller/remote/LecturerClassificationController.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
.
remote
;
import
com.yizhi.application.domain.LecturerClassification
;
import
com.yizhi.application.domain.LecturerResponse
;
import
com.yizhi.application.service.ILecturerClassificationService
;
import
com.yizhi.lecturer.application.vo.LecturerClassificationRespVO
;
import
com.yizhi.lecturer.application.vo.LecturerClassificationVO
;
import
com.yizhi.lecturer.application.vo.LecturerSortVO
;
import
com.yizhi.lecturer.application.vo.domain.LecturerClassificationVo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerResponseVo
;
import
com.yizhi.util.application.tree.CommonTree
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* <p>
* 讲师库分类表 前端控制器
* </p>
*
* @author lilingye
* @since 2019-09-09
*/
@Api
(
value
=
"讲师库分类"
,
tags
=
"讲师库分类"
)
@RequestMapping
(
"/remote/classification"
)
public
class
LecturerClassificationController
{
@Autowired
private
ILecturerClassificationService
classificationService
;
/**
* 分类列表
*
* @param type
* @return
*/
@GetMapping
(
value
=
"/list"
)
public
List
<
CommonTree
>
getClassificationList
(
@RequestParam
(
name
=
"type"
,
defaultValue
=
"1"
,
required
=
false
)
Integer
type
)
{
return
classificationService
.
getClassificationList
(
type
);
}
/**
* 新增分类
*
* @param lecturerClassificationVO
* @return
*/
@PostMapping
(
value
=
"/add"
)
public
LecturerClassificationVO
addClassification
(
@RequestBody
LecturerClassificationVO
lecturerClassificationVO
)
{
return
classificationService
.
add
(
lecturerClassificationVO
);
}
/**
* 修改分类
*
* @param lecturerClassificationVO
* @return
*/
@PostMapping
(
value
=
"/update"
)
public
LecturerClassificationVO
updateClassification
(
@RequestBody
LecturerClassificationVO
lecturerClassificationVO
)
{
return
classificationService
.
update
(
lecturerClassificationVO
);
}
/**
* 上下架分类
* @param lecturerClassificationVO
* @return
*/
@PostMapping
(
value
=
"/upOrDown"
)
public
LecturerClassificationRespVO
upOrDown
(
@RequestBody
LecturerClassificationVO
lecturerClassificationVO
)
{
return
classificationService
.
upOrDown
(
lecturerClassificationVO
);
}
/**
* 删除分类
*
* @param id
* @return
*/
@GetMapping
(
value
=
"/del"
)
public
LecturerResponseVo
del
(
@RequestParam
(
name
=
"id"
)
Long
id
)
{
LecturerResponse
lecturerResponse1
=
classificationService
.
del
(
id
);
LecturerResponseVo
lecturerResponseVo
=
null
;
BeanUtils
.
copyProperties
(
lecturerResponse1
,
lecturerResponseVo
);
return
lecturerResponseVo
;
}
/**
* 分类排序
*
* @param lecturerSortVO
* @return
*/
@PostMapping
(
value
=
"/sort"
)
public
Boolean
sort
(
@RequestBody
LecturerSortVO
lecturerSortVO
)
{
return
classificationService
.
sortClassification
(
lecturerSortVO
);
}
/**
* 获取实体
* @param id
* @return
*/
@GetMapping
(
value
=
"/get/id"
)
public
LecturerClassificationVo
getById
(
@RequestParam
(
name
=
"id"
)
Long
id
)
{
LecturerClassification
lecturerClassification
=
classificationService
.
selectById
(
id
);
LecturerClassificationVo
lecturerClassificationVo1
=
null
;
BeanUtils
.
copyProperties
(
lecturerClassification
,
lecturerClassificationVo1
);
return
lecturerClassificationVo1
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/Controller/remote/LecturerDicController.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
Controller
.
remote
;
import
com.yizhi.application.domain.LecturerDic
;
import
com.yizhi.application.service.ILecturerDicService
;
import
com.yizhi.lecturer.application.vo.domain.LecturerDicVo
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* 讲师库系统字典 前端控制器
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Api
(
value
=
"讲师字典"
)
@RequestMapping
(
"/remote/lecturerdic"
)
public
class
LecturerDicController
{
@Autowired
private
ILecturerDicService
lecturerDicService
;
@GetMapping
(
"/list/code"
)
public
List
<
LecturerDicVo
>
getLecturerDicList
(
@RequestParam
(
name
=
"code"
)
String
code
)
{
List
<
LecturerDic
>
list
=
lecturerDicService
.
getLecturerDicListByCode
(
code
);
List
<
LecturerDicVo
>
list2
=
new
ArrayList
<>();
for
(
LecturerDic
l:
list
)
{
LecturerDicVo
l1
=
new
LecturerDicVo
();
BeanUtils
.
copyProperties
(
l
,
l1
);
list2
.
add
(
l1
);
}
return
list2
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/LecturerApplication.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
/**
* @author lingye
* @date 2019-4-17
*/
@EnableTransactionManagement
@EnableDiscoveryClient
@SpringBootApplication
@EnableFeignClients
(
basePackages
=
{
"com.yizhi"
})
@ComponentScan
(
basePackages
=
{
"com.yizhi"
})
public
class
LecturerApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
LecturerApplication
.
class
,
args
);
}
}
cloud-lecturer/src/main/java/com/yizhi/application/MybatisPlusConfig.java
0 → 100644
View file @
cd48104d
//package com.fulan.application;
//
//import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.transaction.annotation.EnableTransactionManagement;
//
///**
// * @description: dd
// * @author: lingye
// * @date: 2019-04-24 14:09
// **/
//@EnableTransactionManagement
//@Configuration
//@MapperScan("com.fulan.application.mapper.*")
//public class MybatisPlusConfig {
//
//
// /**
// * 分页插件
// */
// @Bean
// public PaginationInterceptor paginationInterceptor() {
// return new PaginationInterceptor();
// }
//}
cloud-lecturer/src/main/java/com/yizhi/application/SwaggerConfig.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.context.request.async.DeferredResult
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
static
com
.
google
.
common
.
base
.
Predicates
.
or
;
import
static
springfox
.
documentation
.
builders
.
PathSelectors
.
regex
;
@Configuration
@EnableSwagger2
public
class
SwaggerConfig
{
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
groupName
(
"讲师库系统"
)
.
genericModelSubstitutes
(
DeferredResult
.
class
)
.
genericModelSubstitutes
(
ResponseEntity
.
class
)
.
useDefaultResponseMessages
(
false
)
.
forCodeGeneration
(
true
)
.
pathMapping
(
"/"
)
.
select
()
.
build
()
.
apiInfo
(
apiInfo
());
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"讲师库系统"
)
.
version
(
"1.0"
)
//版本
.
build
();
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/ClassificationVO.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 讲师库分类VO
* </p>
*
* @author lingye
* @since 2019-09-09
*/
@Data
@Api
(
tags
=
"ClassificationVO"
)
public
class
ClassificationVO
extends
Model
<
ClassificationVO
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"分类名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"父id,默认为0 时,是最皇父级"
)
private
Long
parentId
;
@ApiModelProperty
(
value
=
"层级,默认是1,第一层"
)
private
Integer
layer
;
@ApiModelProperty
(
value
=
"分类描述"
)
private
String
classificationDes
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"站点id"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"子列表"
)
List
<
ClassificationVO
>
classificationVOList
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/Lecturer.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.FieldFill
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 讲师详情表
* </p>
*
* @author lingye
* @since 2019-05-06
*/
@Data
@Api
(
tags
=
"LecturerVo"
,
description
=
"讲师详情表"
)
@TableName
(
"lecturer"
)
public
class
Lecturer
extends
Model
<
Lecturer
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"唯一主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"用户名-系统"
)
private
String
name
;
@ApiModelProperty
(
value
=
"内部讲师的accoun_id"
)
@TableField
(
"account_id"
)
private
Long
accountId
;
@ApiModelProperty
(
value
=
"讲师名字"
)
@TableField
(
"lecturer_name"
)
private
String
lecturerName
;
@ApiModelProperty
(
value
=
"讲师的来源inner内部/outer外部"
)
@TableField
(
"source_code"
)
private
String
sourceCode
;
@ApiModelProperty
(
value
=
"讲师手机号"
)
private
String
mobile
;
@ApiModelProperty
(
value
=
"讲师头像"
)
private
String
avatar
;
@ApiModelProperty
(
value
=
"讲师职称"
)
private
String
title
;
@ApiModelProperty
(
value
=
"0,停用;1,启用"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"创建讲师的站点id"
)
@TableField
(
"site_id"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"创建讲师的公司id"
)
@TableField
(
"company_id"
)
private
Long
companyId
;
@ApiModelProperty
(
value
=
"是否删除 1已删除 默认0"
)
@TableField
(
"del_flag"
)
private
Integer
delFlag
;
@ApiModelProperty
(
value
=
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"创建人"
)
@TableField
(
value
=
"create_by_id"
,
fill
=
FieldFill
.
INSERT
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"修改人"
)
@TableField
(
value
=
"update_by_id"
,
fill
=
FieldFill
.
INSERT
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"讲师编码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"模板编号"
)
private
String
templateNo
;
@ApiModelProperty
(
value
=
"评分"
)
private
Float
score
;
@ApiModelProperty
(
value
=
"讲师级别"
)
private
Integer
grade
;
@ApiModelProperty
(
value
=
"级别名称"
)
private
String
gradeName
;
@ApiModelProperty
(
value
=
"学历"
)
private
String
edu
;
@ApiModelProperty
(
value
=
"所属单位(手动输入)"
)
private
String
companyName
;
@ApiModelProperty
(
value
=
"个性签名"
)
private
String
signature
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerClassification.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableId
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.FieldFill
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 讲师库分类表
* </p>
*
* @author lingye
* @since 2019-09-09
*/
@Data
@Api
(
tags
=
"LecturerClassificationVo"
,
description
=
"讲师库分类表"
)
@TableName
(
"lecturer_classification"
)
public
class
LecturerClassification
extends
Model
<
LecturerClassification
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
@TableId
private
Long
id
;
@ApiModelProperty
(
value
=
"分类名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"父id,默认为0 时,是最皇父级"
)
@TableField
(
"parent_id"
)
private
Long
parentId
;
@ApiModelProperty
(
value
=
"父级ids"
)
@TableField
(
"parent_ids"
)
private
String
parentIds
;
@ApiModelProperty
(
value
=
"层级,默认是1,第一层"
)
private
Integer
layer
;
@ApiModelProperty
(
value
=
"分类描述"
)
@TableField
(
"classification_des"
)
private
String
classificationDes
;
@ApiModelProperty
(
value
=
"是否被删除 1 删除;0 正常;"
)
@TableField
(
"del_flag"
)
private
Integer
delFlag
;
@ApiModelProperty
(
value
=
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"更新时间"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"创建人的id"
)
@TableField
(
value
=
"create_by_id"
,
fill
=
FieldFill
.
INSERT
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"更新人的id"
)
@TableField
(
value
=
"update_by_id"
,
fill
=
FieldFill
.
INSERT
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"公司id"
)
@TableField
(
"company_id"
)
private
Long
companyId
;
@ApiModelProperty
(
value
=
"组织id"
)
@TableField
(
"org_id"
)
private
Long
orgId
;
@ApiModelProperty
(
value
=
"站点id"
)
@TableField
(
"sort"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"排序"
)
@TableField
(
"site_id"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"上下架 1 上架,0 下架"
)
private
Integer
status
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerCourse.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.FieldFill
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 讲师关联课程表
* </p>
*
* @author lingye
* @since 2019-04-23
*/
@Data
@ApiModel
(
value
=
"LecturerCourseVo"
,
description
=
"讲师关联课程表"
)
@TableName
(
"lecturer_course"
)
public
class
LecturerCourse
extends
Model
<
LecturerCourse
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师id"
)
@TableField
(
"lecturer_id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"课程名称"
)
@TableField
(
"course_name"
)
private
String
courseName
;
@ApiModelProperty
(
value
=
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@Override
protected
Serializable
pkVal
()
{
return
null
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerDic.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.FieldFill
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 讲师库系统字典
* </p>
*
* @author lilingye
* @since 2019-04-23
*/
@Data
@ApiModel
(
value
=
"LecturerDicVo"
,
description
=
"讲师库系统字典"
)
@TableName
(
"lecturer_dic"
)
public
class
LecturerDic
extends
Model
<
LecturerDic
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"记录id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"父节点id"
)
@TableField
(
"parent_id"
)
private
Long
parentId
;
@ApiModelProperty
(
value
=
"字典名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"字典代码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"描述"
)
private
String
des
;
@ApiModelProperty
(
value
=
"启用状态 1 启用 2失效"
)
private
String
status
;
@ApiModelProperty
(
value
=
"字典类型"
)
private
String
type
;
@ApiModelProperty
(
value
=
"添加时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
updateTime
;
@Override
protected
Serializable
pkVal
()
{
return
null
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerGrade.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.FieldFill
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 讲师级别表
* </p>
*
* @author lingye
* @since 2019-11-05
*/
@Data
@Api
(
tags
=
"LecturerGradeVo"
,
description
=
"讲师级别表"
)
@TableName
(
"lecturer_grade"
)
public
class
LecturerGrade
extends
Model
<
LecturerGrade
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"级别名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"编码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"状态,1 上架,0 下架"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"删除标志,1是,0否"
)
@TableField
(
"del_flag"
)
private
Integer
delFlag
;
@ApiModelProperty
(
value
=
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"创建id"
)
@TableField
(
value
=
"create_by_id"
,
fill
=
FieldFill
.
INSERT
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"修改人id"
)
@TableField
(
value
=
"update_by_id"
,
fill
=
FieldFill
.
INSERT
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"站点id"
)
@TableField
(
"site_id"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"公司id"
)
@TableField
(
"company_id"
)
private
Long
companyId
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerInfo.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.FieldFill
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author lingye
* @since 2019-11-06
*/
@Data
@Api
(
tags
=
"LecturerInfoVo"
,
description
=
""
)
@TableName
(
"lecturer_info"
)
public
class
LecturerInfo
extends
Model
<
LecturerInfo
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"单位名称"
)
@TableField
(
"company_name"
)
private
String
companyName
;
@ApiModelProperty
(
value
=
"头衔"
)
private
String
title
;
@ApiModelProperty
(
value
=
"模板"
)
@TableField
(
"template_no"
)
private
String
templateNo
;
@ApiModelProperty
(
value
=
"站点id"
)
@TableField
(
"site_id"
)
private
Long
siteId
;
@ApiModelProperty
(
value
=
"公司id"
)
@TableField
(
"company_id"
)
private
Long
companyId
;
@ApiModelProperty
(
value
=
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"创建人id"
)
@TableField
(
value
=
"create_by_id"
,
fill
=
FieldFill
.
INSERT
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"更新人id"
)
@TableField
(
value
=
"update_by_id"
,
fill
=
FieldFill
.
INSERT
)
private
Long
updateById
;
@ApiModelProperty
(
value
=
"删除标记,1,是 0,否"
)
@TableField
(
"del_flag"
)
private
Integer
delFlag
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerKeywords.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 关键字
* </p>
*
* @author lilingye
* @since 2019-05-06
*/
@Data
@Api
(
tags
=
"LecturerKeywordsVo"
,
description
=
""
)
@TableName
(
"lecturer_keywords"
)
public
class
LecturerKeywords
extends
Model
<
LecturerKeywords
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师id"
)
@TableField
(
"lecturer_id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"关键字"
)
private
String
keywords
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerRelation.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.FieldFill
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 讲师关联课程表
* </p>
*
* @author lingye
* @since 2019-05-06
*/
@Data
@Api
(
tags
=
"LecturerRelationVo"
,
description
=
"讲师关联课程表"
)
@TableName
(
"lecturer_relation"
)
public
class
LecturerRelation
extends
Model
<
LecturerRelation
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师id"
)
@TableField
(
"lecturer_id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"关联id"
)
@TableField
(
"relation_id"
)
private
Long
relationId
;
@ApiModelProperty
(
value
=
"关联名称"
)
@TableField
(
"relation_name"
)
private
String
relationName
;
@ApiModelProperty
(
value
=
"1.在线课程; 2.线下课程;3.培训项目"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"更新时间"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"1.删除 默认0"
)
@TableField
(
"del_flag"
)
private
Integer
delFlag
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerResponse.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
lombok.Data
;
/**
* @description: 讲师库返回
* @author: lingye
* @date: 2019-11-07 10:49
**/
@Data
public
class
LecturerResponse
{
private
String
code
;
private
String
msg
;
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/LecturerResume.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.FieldFill
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 讲师履历表
* </p>
*
* @author lingye
* @since 2019-04-23
*/
@Data
@ApiModel
(
value
=
"LecturerResumeVo"
,
description
=
"讲师履历表"
)
@TableName
(
"lecturer_resume"
)
public
class
LecturerResume
extends
Model
<
LecturerResume
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师id"
)
@TableField
(
"lecturer_id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"个人履历内容"
)
private
String
resume
;
@ApiModelProperty
(
value
=
"签名"
)
@TableField
(
"personal_sign"
)
private
String
personalSign
;
@ApiModelProperty
(
value
=
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"1 删除"
)
@TableField
(
"del_flag"
)
private
Integer
delFlag
;
@ApiModelProperty
(
value
=
"创建人"
)
@TableField
(
value
=
"create_by_id"
,
fill
=
FieldFill
.
INSERT
)
private
Long
createById
;
@ApiModelProperty
(
value
=
"修改人"
)
@TableField
(
value
=
"update_by_id"
,
fill
=
FieldFill
.
INSERT
)
private
Long
updateById
;
@Override
protected
Serializable
pkVal
()
{
return
null
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/domain/TrLecturerClassification.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
domain
;
import
com.baomidou.mybatisplus.activerecord.Model
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.FieldFill
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 讲师库、分类关系表
* </p>
*
* @author lingye
* @since 2019-10-08
*/
@Data
@Api
(
tags
=
"TrLecturerClassificationVo"
,
description
=
"讲师库、分类关系表"
)
@TableName
(
"tr_lecturer_classification"
)
public
class
TrLecturerClassification
extends
Model
<
TrLecturerClassification
>
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"讲师库id"
)
@TableField
(
"lecturer_id"
)
private
Long
lecturerId
;
@ApiModelProperty
(
value
=
"分类id"
)
@TableField
(
"classification_id"
)
private
Long
classificationId
;
@ApiModelProperty
(
value
=
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerClassificationMapper.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.yizhi.application.domain.LecturerClassification
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
/**
* <p>
* 讲师库分类表 Mapper 接口
* </p>
*
* @author lingye
* @since 2019-09-09
*/
public
interface
LecturerClassificationMapper
extends
BaseMapper
<
LecturerClassification
>
{
/**
* 根据站点返回排序
*
* @param siteId
* @return
*/
@Select
(
"select IFNULL(max(sort),0) from lecturer_classification where site_id =#{siteId} and parent_id =#{parentId}"
)
int
queryClassificationMaxSort
(
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"parentId"
)
Long
parentId
);
/**
* 查询前一个讲师库分类的sort
*
* @param siteId
* @param sort
* @return
*/
LecturerClassification
getClassificationBeforeSort
(
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"sort"
)
int
sort
,
@Param
(
"parentId"
)
Long
parentId
);
/**
* 查询后一个讲师库分类的sort
*
* @param siteId
* @param sort
* @return
*/
LecturerClassification
getClassificationAfterSort
(
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"sort"
)
int
sort
,
@Param
(
"parentId"
)
Long
parentId
);
/**
* 查询列表
*
* @param siteId
* @param sort
* @return
*/
List
<
LecturerClassification
>
getClassificationBeforeSortList
(
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"sort"
)
int
sort
);
/**
* 查询分类列表
* @param id
* @return
*/
List
<
LecturerClassification
>
selectClassificationList
(
@Param
(
"id"
)
Long
id
);
/**
* 学员端接口
* @param siteId 站点id
* @param id 分类id
* @return
*/
List
<
LecturerClassification
>
selectStuClassificationList
(
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"id"
)
Long
id
);
/**
* 获取所有的分类
* @param siteId
* @return
*/
List
<
LecturerClassification
>
selectStuParentIds
(
@Param
(
"siteId"
)
Long
siteId
);
}
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerCourseMapper.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.yizhi.application.domain.LecturerCourse
;
/**
* <p>
* 讲师关联课程表 Mapper 接口
* </p>
*
* @author lingye
* @since 2019-04-17
*/
public
interface
LecturerCourseMapper
extends
BaseMapper
<
LecturerCourse
>
{
}
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerDicMapper.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.yizhi.application.domain.LecturerDic
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* <p>
* 讲师库系统字典 Mapper 接口
* </p>
*
* @author lingye
* @since 2019-04-17
*/
public
interface
LecturerDicMapper
extends
BaseMapper
<
LecturerDic
>
{
/**
* 获取字典列表
* @param code
* @return
*/
List
<
LecturerDic
>
getLecturerDicListByCode
(
@Param
(
"code"
)
String
code
);
}
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerGradeMapper.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.yizhi.application.domain.LecturerGrade
;
import
org.apache.ibatis.annotations.Param
;
/**
* <p>
* 讲师级别表 Mapper 接口
* </p>
*
* @author lingye
* @since 2019-11-05
*/
public
interface
LecturerGradeMapper
extends
BaseMapper
<
LecturerGrade
>
{
Integer
selectMaxCode
(
@Param
(
"siteId"
)
Long
siteId
);
Integer
selectMaxSort
(
@Param
(
"siteId"
)
Long
siteId
);
}
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerInfoMapper.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.yizhi.application.domain.LecturerInfo
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lingye
* @since 2019-11-06
*/
public
interface
LecturerInfoMapper
extends
BaseMapper
<
LecturerInfo
>
{
}
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerKeywordsMapper.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.yizhi.application.domain.LecturerKeywords
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author lingye
* @since 2019-05-06
*/
public
interface
LecturerKeywordsMapper
extends
BaseMapper
<
LecturerKeywords
>
{
}
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerMapper.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.application.domain.Lecturer
;
import
com.yizhi.lecturer.application.vo.*
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* <p>
* 讲师详情表 Mapper 接口
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Repository
public
interface
LecturerMapper
extends
BaseMapper
<
Lecturer
>
{
/**
* 查询讲师最后添加的sort
*
* @param siteId 站点id
* @return
*/
@Select
(
"select IFNULL(max(sort),0) from lecturer where site_id =#{siteId}"
)
int
queryLecturerMaxSort
(
@Param
(
"siteId"
)
Long
siteId
);
/**
* 查询前一个sort
*
* @param siteId
* @param sort
* @return
*/
Lecturer
getLecturerBeforeSort
(
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"sort"
)
int
sort
);
/**
* 查询后一个讲师的sort
*
* @param siteId
* @param sort
* @return
*/
Lecturer
getLecturerAfterSort
(
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"sort"
)
int
sort
);
/**
* 查询列表
*
* @param siteId
* @param sort
* @return
*/
List
<
Lecturer
>
getLecturerBeforeSortList
(
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"sort"
)
int
sort
);
/**
* 讲师列表
*
* @param page
* @param name
* @param mobile
* @param sourceCode 来源code
* @param siteId
* @return
*/
List
<
LecturerListVO
>
getLecturerList
(
Page
<
LecturerListVO
>
page
,
@Param
(
"name"
)
String
name
,
@Param
(
"mobile"
)
String
mobile
,
@Param
(
"sourceCode"
)
String
sourceCode
,
@Param
(
"siteId"
)
Long
siteId
);
/**
* 导出excel
*
* @param siteId
* @return
*/
List
<
LecturerListVO
>
exportLecturer
(
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"keywords"
)
String
keywords
,
@Param
(
"sourceCode"
)
String
sourceCode
,
@Param
(
"mobile"
)
String
mobile
);
/**
* 根据id获取讲师详情
*
* @param id
* @return
*/
LecturerVO
getLecturerVOById
(
@Param
(
"id"
)
Long
id
);
/**
* 查询模块列表
*
* @param page
* @param name
* @param siteId
* @param ids
* @return
*/
List
<
TemplateLecturerVO
>
queryLecturerList
(
Page
<
TemplateLecturerVO
>
page
,
@Param
(
"name"
)
String
name
,
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"ids"
)
List
<
Long
>
ids
);
@Select
(
"select IFNULL(max(substring(`code`,2)), '0') from lecturer where site_id =#{siteId}"
)
String
queryLecturerCodexSort
(
@Param
(
"siteId"
)
Long
siteId
);
/**
* 学员端- 讲师详情
*
* @param id
* @return
*/
LecturerDetailVO
getStuLecturerDetail
(
@Param
(
"id"
)
Long
id
);
/**
* 查询讲师库
* @param page
* @param companyId
* @param siteId
* @param ids
* @return
*/
List
<
LecturerApiVo
>
selectLecturerList
(
@Param
(
"page"
)
Page
<
LecturerApiVo
>
page
,
@Param
(
"companyId"
)
Long
companyId
,
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"ids"
)
List
<
String
>
ids
);
}
\ No newline at end of file
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerRelationMapper.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.application.domain.LecturerRelation
;
import
com.yizhi.lecturer.application.vo.RelationVOList
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* <p>
* 讲师关联 Mapper 接口
* </p>
*
* @author lilingye
* @since 2019-05-06
*/
@Repository
public
interface
LecturerRelationMapper
extends
BaseMapper
<
LecturerRelation
>
{
/**
* 获取用户的讲师关联的列表
* @param page
* @param id 讲师id
* @return
*/
List
<
RelationVOList
>
getRelationListByLecturerId
(
Page
<
RelationVOList
>
page
,
@Param
(
"id"
)
Long
id
);
}
cloud-lecturer/src/main/java/com/yizhi/application/mapper/LecturerResumeMapper.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.yizhi.application.domain.LecturerResume
;
/**
* <p>
* 讲师履历表 Mapper 接口
* </p>
*
* @author lingye
* @since 2019-04-17
*/
public
interface
LecturerResumeMapper
extends
BaseMapper
<
LecturerResume
>
{
}
cloud-lecturer/src/main/java/com/yizhi/application/mapper/TrLecturerClassificationMapper.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.yizhi.application.domain.TrLecturerClassification
;
/**
* <p>
* 讲师库、分类关系表 Mapper 接口
* </p>
*
* @author lingye
* @since 2019-10-08
*/
public
interface
TrLecturerClassificationMapper
extends
BaseMapper
<
TrLecturerClassification
>
{
}
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerClassificationService.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.yizhi.application.domain.LecturerClassification
;
import
com.yizhi.application.domain.LecturerResponse
;
import
com.yizhi.lecturer.application.vo.LecturerClassificationRespVO
;
import
com.yizhi.lecturer.application.vo.LecturerClassificationVO
;
import
com.yizhi.lecturer.application.vo.LecturerSortVO
;
import
com.yizhi.util.application.tree.CommonTree
;
import
java.util.List
;
/**
* <p>
* 讲师库分类表 服务类
* </p>
*
* @author lingye
* @since 2019-09-09
*/
public
interface
ILecturerClassificationService
extends
IService
<
LecturerClassification
>
{
/**
* 添加讲师库分类
*
* @param lecturerClassificationVO
* @return
*/
LecturerClassificationVO
add
(
LecturerClassificationVO
lecturerClassificationVO
);
/**
* 更新分类
*
* @param lecturerClassificationVO
* @return
*/
LecturerClassificationVO
update
(
LecturerClassificationVO
lecturerClassificationVO
);
/**
* 分类上下架
* @param lecturerClassificationVO
* @return
*/
LecturerClassificationRespVO
upOrDown
(
LecturerClassificationVO
lecturerClassificationVO
);
/**
* 分类排序
*
* @param lecturerSortVO
* @return
*/
boolean
sortClassification
(
LecturerSortVO
lecturerSortVO
);
/**
* 列表
*
* @return
*/
List
<
CommonTree
>
getClassificationList
(
Integer
type
);
/**
* 删除讲师分类
*
* @param id
* @return
*/
LecturerResponse
del
(
Long
id
);
}
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerDicService.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.yizhi.application.domain.LecturerDic
;
import
java.util.List
;
/**
* <p>
* 讲师库系统字典 服务类
* </p>
*
* @author lingye
* @since 2019-04-17
*/
public
interface
ILecturerDicService
extends
IService
<
LecturerDic
>
{
/**
* 根据code获取字典列表
*
* @param code
* @return
*/
List
<
LecturerDic
>
getLecturerDicListByCode
(
String
code
);
/**
* 根据code获取字典id
*
* @param code
* @return
*/
LecturerDic
queryLecturerDic
(
String
code
);
}
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerGradeService.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.yizhi.application.domain.LecturerGrade
;
import
com.yizhi.lecturer.application.vo.LecturerGradeVO
;
import
java.util.List
;
/**
* <p>
* 讲师级别表 服务类
* </p>
*
* @author lingye
* @since 2019-11-05
*/
public
interface
ILecturerGradeService
extends
IService
<
LecturerGrade
>
{
/**
* 新增讲师级别
*
* @param lecturerGradeVO
* @return
*/
LecturerGradeVO
add
(
LecturerGradeVO
lecturerGradeVO
);
/**
* 修改讲师级别
*
* @param lecturerGradeVO
* @return
*/
LecturerGradeVO
update
(
LecturerGradeVO
lecturerGradeVO
);
/**
* 讲师级别列表
*
* @return
*/
List
<
LecturerGrade
>
list
(
Integer
status
);
}
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerImportService.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.lecturer.application.vo.LecturerCourseImport
;
import
com.yizhi.lecturer.application.vo.LecturerScoreImport
;
import
com.yizhi.system.application.model.ImportModel
;
import
java.util.List
;
/**
* <p>
* 讲师详情表 服务类
* </p>
*
* @author lingye
* @since 2019-04-17
*/
public
interface
ILecturerImportService
{
/**
* 评分导入
* @return
*/
List
<
LecturerScoreImport
>
importScore
(
ImportModel
importModel
,
Integer
type
,
RequestContext
context
);
/**
* 讲师级别导入
* @return
*/
List
<
LecturerScoreImport
>
importGrade
(
ImportModel
importModel
);
/**
* 导入课程
* @param importModel
* @return
*/
List
<
LecturerCourseImport
>
importCourse
(
ImportModel
importModel
,
RequestContext
context
);
}
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerInfoService.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.yizhi.application.domain.LecturerInfo
;
import
com.yizhi.lecturer.application.vo.LecturerInfoVO
;
/**
* <p>
* 服务类
* </p>
*
* @author lingye
* @since 2019-11-06
*/
public
interface
ILecturerInfoService
extends
IService
<
LecturerInfo
>
{
/**
* 基本信息新增
*
* @param lecturerInfoVO
* @return
*/
LecturerInfoVO
add
(
LecturerInfoVO
lecturerInfoVO
);
/**
* 修改
*
* @param lecturerInfoVO
* @return
*/
LecturerInfoVO
update
(
LecturerInfoVO
lecturerInfoVO
);
/**
* 根据站点获取讲师基本信息
*
* @return
*/
LecturerInfoVO
getBySiteId
();
}
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerKeywordsService.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.yizhi.application.domain.LecturerKeywords
;
/**
* <p>
* 服务类
* </p>
*
* @author lingye
* @since 2019-05-06
*/
public
interface
ILecturerKeywordsService
extends
IService
<
LecturerKeywords
>
{
}
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerRelationService.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.application.domain.LecturerRelation
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.yizhi.lecturer.application.vo.RelationVO
;
import
com.yizhi.lecturer.application.vo.RelationVOList
;
import
java.util.List
;
/**
* <p>
* 讲师关联课程表 服务类
* </p>
*
* @author lingye
* @since 2019-05-06
*/
public
interface
ILecturerRelationService
extends
IService
<
LecturerRelation
>
{
/**
* 新增关联
* @param relationVOS
* @param lecturerId
* @return
*/
boolean
insertLecturerRelation
(
List
<
LecturerRelation
>
relationVOS
,
Long
lecturerId
);
/**
* 通过讲师id 获取讲师列表
* @param id
* @return
*/
List
<
RelationVO
>
getRelationsById
(
Long
id
);
/**
* 修改讲师关联
* @param relationVOS
* @param lecturerId
* @return
*/
boolean
updateLecturerRelation
(
List
<
LecturerRelation
>
relationVOS
,
Long
lecturerId
);
/**
*获取关联列表
* @param id
* @param pageNo
* @param pageSize
* @return
*/
Page
<
RelationVOList
>
getRelationListByLecturerId
(
Long
id
,
Integer
pageNo
,
Integer
pageSize
);
}
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerResumeService.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
;
import
com.yizhi.application.domain.LecturerResume
;
import
com.baomidou.mybatisplus.service.IService
;
/**
* <p>
* 讲师履历表 服务类
* </p>
*
* @author lingye
* @since 2019-04-17
*/
public
interface
ILecturerResumeService
extends
IService
<
LecturerResume
>
{
}
cloud-lecturer/src/main/java/com/yizhi/application/service/ILecturerService.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.application.domain.Lecturer
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.yizhi.application.domain.LecturerResponse
;
import
com.yizhi.lecturer.application.vo.*
;
import
java.util.List
;
/**
* <p>
* 讲师详情表 服务类
* </p>
*
* @author lingye
* @since 2019-04-17
*/
public
interface
ILecturerService
extends
IService
<
Lecturer
>
{
/**
* 添加讲师库
*
* @param lecturerVO 讲师库参数
* @return
* @author lilingye
*/
LecturerVO
addLecturer
(
LecturerVO
lecturerVO
);
/**
* 修改讲师库
*
* @param lecturerVO
* @return
*/
boolean
updateLecturer
(
LecturerVO
lecturerVO
);
/**
* 删除讲师库
*
* @param ids
* @return
*/
LecturerResponse
delLecturer
(
List
<
Long
>
ids
);
/**
* 讲师的操作
*
* @param lecturerSortVO
* @return
*/
boolean
sortLecturer
(
LecturerSortVO
lecturerSortVO
);
/**
* 获取讲师详情的接口
*
* @param id
* @return
*/
LecturerVO
queryLecturerById
(
Long
id
);
/**
* 讲师列表
*
* @param name
* @param mobile
* @param sourceCode
* @param pageNo
* @param pageSize
* @return
*/
Page
<
LecturerListVO
>
queryLecturer
(
String
name
,
String
mobile
,
String
sourceCode
,
Integer
pageNo
,
Integer
pageSize
);
/**
* 交银康联 接口
* @param lecturerApiVoParam
* @return
*/
Page
<
LecturerApiVo
>
findLecturer
(
LecturerApiVoParam
lecturerApiVoParam
);
/**
* 导出讲师列表的excel
*
* @return
*/
List
<
LecturerListVO
>
exportLecturer
(
String
keywords
,
String
sourceCode
,
String
mobile
);
/**
* 通过id获取讲师的详情
*
* @param id
* @return
*/
Lecturer
getLecturerById
(
Long
id
);
/**
* 添加模块查询讲师列表
*
* @param name
* @param pageNo
* @param pageSize
* @param ids
* @return
*/
Page
<
TemplateLecturerVO
>
queryLecturerByTemplateId
(
String
name
,
Integer
pageNo
,
Integer
pageSize
,
List
<
Long
>
ids
);
/**
* 学员端获取讲师详情
*
* @param id 讲师Id
* @return
*/
LecturerDetailVO
queryLecturerByLecturerId
(
Long
id
);
/**
* 查询讲师不存在
*
* @param code
* @param name
* @return
*/
Lecturer
getLecturerByCodeAndName
(
String
code
,
String
name
,
Long
siteId
);
/**
* 讲师库启用停用
* @param lecturer
* @return
*/
LecturerResponse
upOrDownLecturer
(
Lecturer
lecturer
);
}
cloud-lecturer/src/main/java/com/yizhi/application/service/ITrLecturerClassificationService.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
;
import
com.yizhi.application.domain.TrLecturerClassification
;
import
com.baomidou.mybatisplus.service.IService
;
/**
* <p>
* 讲师库、分类关系表 服务类
* </p>
*
* @author lingye
* @since 2019-10-08
*/
public
interface
ITrLecturerClassificationService
extends
IService
<
TrLecturerClassification
>
{
/**
* 查询分类是否被关联
* @param classificationId 分类id
* @return
*/
boolean
getRelateLecturer
(
Long
classificationId
);
}
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerClassificationServiceImpl.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.domain.Lecturer
;
import
com.yizhi.application.domain.LecturerClassification
;
import
com.yizhi.application.domain.LecturerResponse
;
import
com.yizhi.application.domain.TrLecturerClassification
;
import
com.yizhi.application.orm.hierarchicalauthorization.HQueryUtil
;
import
com.yizhi.application.orm.id.IdGenerator
;
import
com.yizhi.application.orm.util.QueryUtil
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.lecturer.application.enums.DeleteFlag
;
import
com.yizhi.lecturer.application.enums.LecturerEnum
;
import
com.yizhi.application.mapper.LecturerClassificationMapper
;
import
com.yizhi.application.service.ILecturerClassificationService
;
import
com.yizhi.application.service.ITrLecturerClassificationService
;
import
com.yizhi.lecturer.application.vo.LecturerClassificationRespVO
;
import
com.yizhi.lecturer.application.vo.LecturerClassificationVO
;
import
com.yizhi.lecturer.application.vo.LecturerSortVO
;
import
com.yizhi.util.application.tree.CommonTree
;
import
com.yizhi.util.application.tree.TreeUtil
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
/**
* <p>
* 讲师库分类表 服务实现类
* </p>
*
* @author lingye
* @since 2019-09-09
*/
@Service
public
class
LecturerClassificationServiceImpl
extends
ServiceImpl
<
LecturerClassificationMapper
,
LecturerClassification
>
implements
ILecturerClassificationService
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
LecturerClassificationServiceImpl
.
class
);
@Autowired
IdGenerator
idGenerator
;
@Autowired
ITrLecturerClassificationService
trLecturerClassificationService
;
@Override
public
LecturerClassificationVO
add
(
LecturerClassificationVO
lecturerClassificationVO
)
{
RequestContext
context
=
ContextHolder
.
get
();
Long
id
=
idGenerator
.
generate
();
Integer
layer
=
0
;
LecturerClassification
lecturerClassification
=
new
LecturerClassification
();
BeanUtils
.
copyProperties
(
lecturerClassificationVO
,
lecturerClassification
);
if
((
DeleteFlag
.
NO
.
ordinal
())
!=
lecturerClassificationVO
.
getParentId
())
{
LOGGER
.
info
(
"非父级类"
);
LecturerClassification
classification
=
new
LecturerClassification
();
classification
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
classification
.
setId
(
lecturerClassificationVO
.
getParentId
());
LecturerClassification
c
=
this
.
baseMapper
.
selectOne
(
classification
);
layer
=
c
.
getLayer
()
+
DeleteFlag
.
YES
.
toValue
();
}
else
{
lecturerClassification
.
setStatus
(
DeleteFlag
.
YES
.
ordinal
());
LOGGER
.
info
(
"实体:{}"
,
lecturerClassificationVO
);
}
lecturerClassification
.
setId
(
id
);
lecturerClassification
.
setCompanyId
(
context
.
getCompanyId
());
lecturerClassification
.
setSiteId
(
context
.
getSiteId
());
lecturerClassification
.
setOrgId
(
context
.
getOrgId
());
lecturerClassification
.
setCreateById
(
context
.
getAccountId
());
lecturerClassification
.
setUpdateById
(
context
.
getAccountId
());
lecturerClassification
.
setLayer
(
layer
);
lecturerClassification
.
setCreateTime
(
new
Date
());
lecturerClassification
.
setUpdateTime
(
new
Date
());
this
.
classificationSetParentIds
(
lecturerClassification
);
int
lastSort
=
this
.
baseMapper
.
queryClassificationMaxSort
(
context
.
getSiteId
(),
lecturerClassification
.
getParentId
());
lecturerClassification
.
setSort
(
lastSort
+
DeleteFlag
.
YES
.
toValue
());
this
.
baseMapper
.
insert
(
lecturerClassification
);
BeanUtils
.
copyProperties
(
lecturerClassification
,
lecturerClassificationVO
);
return
lecturerClassificationVO
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LecturerClassificationVO
update
(
LecturerClassificationVO
lecturerClassificationVO
)
{
RequestContext
context
=
ContextHolder
.
get
();
LecturerClassification
lecturerClassification
=
new
LecturerClassification
();
BeanUtils
.
copyProperties
(
lecturerClassificationVO
,
lecturerClassification
);
lecturerClassification
.
setCompanyId
(
context
.
getCompanyId
());
lecturerClassification
.
setSiteId
(
context
.
getSiteId
());
lecturerClassification
.
setCreateById
(
context
.
getAccountId
());
lecturerClassification
.
setUpdateTime
(
new
Date
());
lecturerClassification
.
setStatus
(
null
);
boolean
flag
=
this
.
updateById
(
lecturerClassification
);
LOGGER
.
info
(
"修改成功:"
+
flag
);
BeanUtils
.
copyProperties
(
lecturerClassification
,
lecturerClassificationVO
);
return
lecturerClassificationVO
;
}
/**
* 分类的上架和下架
*
* @param lecturerClassificationVO
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LecturerClassificationRespVO
upOrDown
(
LecturerClassificationVO
lecturerClassificationVO
)
{
LecturerClassification
lecturerClassification
=
new
LecturerClassification
();
BeanUtils
.
copyProperties
(
lecturerClassificationVO
,
lecturerClassification
);
LecturerClassificationRespVO
lecturerClassificationRespVO
=
new
LecturerClassificationRespVO
();
//下架下面所有的分类
LecturerClassification
lc
=
null
;
if
(
lecturerClassificationVO
.
getStatus
()
==
DeleteFlag
.
NO
.
ordinal
())
{
this
.
updateById
(
lecturerClassification
);
lc
=
new
LecturerClassification
();
lc
.
setParentId
(
lecturerClassificationVO
.
getId
());
lc
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
// 子分类
List
<
LecturerClassification
>
lcOnes
=
this
.
selectList
(
QueryUtil
.
condition
(
lc
));
if
(
CollectionUtils
.
isNotEmpty
(
lcOnes
))
{
List
<
LecturerClassification
>
lecturerClassifications
=
this
.
baseMapper
.
selectClassificationList
(
lecturerClassificationVO
.
getId
());
lecturerClassifications
=
lecturerClassifications
.
parallelStream
().
map
(
lcs
->{
lcs
.
setStatus
(
DeleteFlag
.
NO
.
ordinal
());
return
lcs
;
}).
collect
(
toList
());
this
.
updateBatchById
(
lecturerClassifications
);
}
else
{
this
.
updateById
(
lecturerClassification
);
}
lecturerClassificationRespVO
.
setCode
(
1
);
}
else
if
(
lecturerClassificationVO
.
getStatus
()
==
DeleteFlag
.
YES
.
ordinal
())
{
LecturerClassification
le
=
this
.
selectById
(
lecturerClassificationVO
.
getId
());
le
=
this
.
selectById
(
le
.
getParentId
());
Integer
status
=
0
;
if
(
le
!=
null
)
{
status
=
le
.
getStatus
();
if
(
status
==
DeleteFlag
.
NO
.
ordinal
())
{
lecturerClassificationRespVO
.
setCode
(
DeleteFlag
.
NO
.
ordinal
());
}
else
{
boolean
flag
=
this
.
updateById
(
lecturerClassification
);
lecturerClassificationRespVO
.
setCode
(
DeleteFlag
.
YES
.
ordinal
());
LOGGER
.
info
(
"操作结果:"
+
flag
);
}
}
else
{
boolean
flag
=
this
.
updateById
(
lecturerClassification
);
lecturerClassificationRespVO
.
setCode
(
DeleteFlag
.
YES
.
ordinal
());
LOGGER
.
info
(
"操作结果:"
+
flag
);
}
}
return
lecturerClassificationRespVO
;
}
@Override
public
boolean
sortClassification
(
LecturerSortVO
lecturerSortVO
)
{
RequestContext
context
=
ContextHolder
.
get
();
String
code
=
lecturerSortVO
.
getCode
();
Long
id
=
lecturerSortVO
.
getId
();
LecturerClassification
currentLecturer
=
this
.
selectById
(
id
);
int
currentSort
=
currentLecturer
.
getSort
();
Long
parentId
=
currentLecturer
.
getParentId
();
if
(
code
.
equals
(
LecturerEnum
.
UP
.
getKey
()))
{
//上移
LecturerClassification
beforeSortLecturer
=
this
.
baseMapper
.
getClassificationBeforeSort
(
context
.
getSiteId
(),
currentSort
,
parentId
);
if
(
beforeSortLecturer
!=
null
)
{
int
beforeSort
=
beforeSortLecturer
.
getSort
();
beforeSortLecturer
.
setSort
(
currentSort
);
this
.
updateById
(
beforeSortLecturer
);
currentLecturer
.
setSort
(
beforeSort
);
this
.
updateById
(
currentLecturer
);
}
}
else
if
(
code
.
equals
(
LecturerEnum
.
DOWN
.
getKey
()))
{
//下移
LecturerClassification
beforeSortLecturer
=
this
.
baseMapper
.
getClassificationAfterSort
(
context
.
getSiteId
(),
currentSort
,
parentId
);
if
(
beforeSortLecturer
!=
null
)
{
int
beforeSort
=
beforeSortLecturer
.
getSort
();
if
(
beforeSort
!=
DeleteFlag
.
NO
.
ordinal
())
{
beforeSortLecturer
.
setSort
(
currentSort
);
this
.
updateById
(
beforeSortLecturer
);
currentLecturer
.
setSort
(
beforeSort
);
this
.
updateById
(
currentLecturer
);
}
}
}
else
if
(
code
.
equals
(
LecturerEnum
.
TOP
.
getKey
()))
{
//置顶
List
<
LecturerClassification
>
lecturerBeforeSortList
=
this
.
baseMapper
.
getClassificationBeforeSortList
(
context
.
getSiteId
(),
currentSort
);
lecturerBeforeSortList
=
lecturerBeforeSortList
.
parallelStream
().
map
(
lecturer
->
{
lecturer
.
setSort
(
lecturer
.
getSort
()
+
DeleteFlag
.
YES
.
ordinal
());
return
lecturer
;
}).
collect
(
toList
());
this
.
updateBatchById
(
lecturerBeforeSortList
);
Lecturer
lecturer
=
new
Lecturer
();
lecturer
.
setId
(
id
);
LecturerClassification
updateLecturer
=
this
.
selectById
(
lecturer
);
updateLecturer
.
setSort
(
DeleteFlag
.
NO
.
ordinal
());
this
.
updateById
(
updateLecturer
);
}
return
true
;
}
/**
* 父级i的保存
*
* @param classification
*/
private
void
classificationSetParentIds
(
LecturerClassification
classification
)
{
if
(
classification
.
getParentId
()==
null
||
classification
.
getParentId
().
equals
(
0L
))
{
classification
.
setParentId
(
0L
);
classification
.
setParentIds
(
"0,"
);
}
else
{
Long
pid
=
classification
.
getParentId
();
LecturerClassification
temp
=
this
.
selectById
(
pid
);
String
pids
=
temp
.
getParentIds
();
classification
.
setParentId
(
pid
);
classification
.
setParentIds
(
pids
+
pid
+
","
);
}
}
@Override
public
List
<
CommonTree
>
getClassificationList
(
Integer
type
)
{
RequestContext
context
=
ContextHolder
.
get
();
HQueryUtil
.
startHQ
(
LecturerClassification
.
class
);
List
<
LecturerClassification
>
lecturerClassificationList
=
getClassificationList
(
context
.
getCompanyId
(),
context
.
getSiteId
(),
type
);
if
(
CollectionUtils
.
isNotEmpty
(
lecturerClassificationList
))
{
List
<
CommonTree
>
orgTreeList
=
new
ArrayList
<>(
lecturerClassificationList
.
size
());
for
(
LecturerClassification
classification
:
lecturerClassificationList
)
{
CommonTree
commonTree
=
new
CommonTree
();
commonTree
.
setPId
(
classification
.
getParentId
());
commonTree
.
setId
(
classification
.
getId
());
commonTree
.
setName
(
classification
.
getName
());
commonTree
.
setNode
(
classification
);
orgTreeList
.
add
(
commonTree
);
}
orgTreeList
=
TreeUtil
.
buildTree
(
orgTreeList
);
return
orgTreeList
;
}
return
null
;
}
/**
* 删除讲师分类
*
* @param id
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LecturerResponse
del
(
Long
id
)
{
LecturerResponse
lecturerResponse
=
new
LecturerResponse
();
if
(!
trLecturerClassificationService
.
getRelateLecturer
(
id
))
{
LecturerClassification
classification
=
new
LecturerClassification
();
classification
.
setDelFlag
(
0
);
classification
.
setParentId
(
id
);
int
count
=
this
.
selectCount
(
QueryUtil
.
condition
(
classification
));
if
(
count
>
0
)
{
//存在子类不能删除
lecturerResponse
.
setCode
(
"fail"
);
lecturerResponse
.
setMsg
(
"请删除子类后,再进行删除"
);
return
lecturerResponse
;
}
else
{
lecturerResponse
.
setCode
(
"success"
);
classification
.
setDelFlag
(
DeleteFlag
.
YES
.
ordinal
());
classification
.
setParentId
(
null
);
classification
.
setId
(
id
);
TrLecturerClassification
tlc
=
new
TrLecturerClassification
();
tlc
.
setClassificationId
(
id
);
List
<
TrLecturerClassification
>
trLecturerClassifications
=
trLecturerClassificationService
.
selectList
(
QueryUtil
.
condition
(
tlc
));
LOGGER
.
info
(
"返回的列表:"
+
trLecturerClassifications
);
this
.
updateById
(
classification
);
if
(
CollectionUtils
.
isNotEmpty
(
trLecturerClassifications
)){
// trLecturerClassificationService.deleteBatchIds(trLecturerClassifications);
for
(
TrLecturerClassification
tr:
trLecturerClassifications
){
trLecturerClassificationService
.
deleteById
(
tr
.
getId
());
}
}
return
lecturerResponse
;
}
}
else
{
lecturerResponse
.
setCode
(
"fail"
);
lecturerResponse
.
setMsg
(
"该分类已被讲师使用,无法删除!"
);
return
lecturerResponse
;
}
}
private
List
<
LecturerClassification
>
getClassificationList
(
Long
companyId
,
Long
siteId
,
Integer
type
)
{
LecturerClassification
classification
=
new
LecturerClassification
();
classification
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
classification
.
setCompanyId
(
companyId
);
classification
.
setSiteId
(
siteId
);
if
(
type
==
DeleteFlag
.
YES
.
ordinal
())
{
//type 为0 的时候显示上架的分类
LOGGER
.
info
(
"管理端的参数"
);
EntityWrapper
<
LecturerClassification
>
condition
=
QueryUtil
.
condition
(
classification
);
condition
.
orderBy
(
"sort"
,
true
);
return
this
.
baseMapper
.
selectList
(
condition
);
}
else
{
List
<
LecturerClassification
>
lecturerClassifications
=
new
ArrayList
<>();
List
<
LecturerClassification
>
ids
=
this
.
baseMapper
.
selectStuParentIds
(
siteId
);
if
(
CollectionUtils
.
isNotEmpty
(
ids
))
{
for
(
LecturerClassification
lct:
ids
){
lecturerClassifications
.
add
(
lct
);
List
<
LecturerClassification
>
lecturerClassificationList
=
this
.
baseMapper
.
selectStuClassificationList
(
siteId
,
lct
.
getId
());
lecturerClassifications
.
addAll
(
lecturerClassificationList
);
}
return
lecturerClassifications
;
}
else
{
return
new
ArrayList
<>();
}
}
}
}
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerDicServiceImpl.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
.
impl
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.domain.LecturerDic
;
import
com.yizhi.application.mapper.LecturerDicMapper
;
import
com.yizhi.application.orm.util.QueryUtil
;
import
com.yizhi.application.service.ILecturerDicService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* <p>
* 讲师库系统字典 服务实现类
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Service
public
class
LecturerDicServiceImpl
extends
ServiceImpl
<
LecturerDicMapper
,
LecturerDic
>
implements
ILecturerDicService
{
@Override
public
List
<
LecturerDic
>
getLecturerDicListByCode
(
String
code
)
{
return
this
.
baseMapper
.
getLecturerDicListByCode
(
code
);
}
@Override
public
LecturerDic
queryLecturerDic
(
String
code
)
{
LecturerDic
ld
=
new
LecturerDic
();
ld
.
setCode
(
code
.
trim
());
return
this
.
selectOne
(
QueryUtil
.
condition
(
ld
));
}
}
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerGradeServiceImpl.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.orm.util.QueryUtil
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.application.domain.LecturerGrade
;
import
com.yizhi.application.mapper.LecturerGradeMapper
;
import
com.yizhi.application.orm.id.IdGenerator
;
import
com.yizhi.application.service.ILecturerGradeService
;
import
com.yizhi.lecturer.application.vo.LecturerGradeVO
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 讲师级别表 服务实现类
* </p>
*
* @author lingye
* @since 2019-11-05
*/
@Service
public
class
LecturerGradeServiceImpl
extends
ServiceImpl
<
LecturerGradeMapper
,
LecturerGrade
>
implements
ILecturerGradeService
{
@Autowired
private
IdGenerator
idGenerator
;
/**
* 新增讲师级别
*
* @param lecturerGradeVO
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LecturerGradeVO
add
(
LecturerGradeVO
lecturerGradeVO
)
{
RequestContext
context
=
ContextHolder
.
get
();
LecturerGrade
lecturerGrade
=
new
LecturerGrade
();
BeanUtils
.
copyProperties
(
lecturerGradeVO
,
lecturerGrade
);
Long
id
=
idGenerator
.
generate
();
lecturerGrade
.
setCompanyId
(
context
.
getCompanyId
());
lecturerGrade
.
setSiteId
(
context
.
getSiteId
());
Integer
gradeCode
=
this
.
baseMapper
.
selectMaxCode
(
context
.
getSiteId
());
Integer
sort
=
this
.
baseMapper
.
selectMaxSort
(
context
.
getSiteId
());
Integer
code
=
0
;
if
(
gradeCode
!=
null
)
{
code
=
gradeCode
>=
10
?
gradeCode
+
1
:
10
;
}
else
{
code
=
10
;
}
lecturerGrade
.
setSort
(
sort
==
0
?
1
:
sort
+
1
);
lecturerGrade
.
setCode
(
code
.
toString
());
lecturerGrade
.
setCreateById
(
context
.
getAccountId
());
lecturerGrade
.
setId
(
id
);
this
.
insert
(
lecturerGrade
);
lecturerGradeVO
.
setId
(
id
);
lecturerGradeVO
.
setCode
(
code
.
toString
());
return
lecturerGradeVO
;
}
/**
* 修改讲师级别
*
* @param lecturerGradeVO
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LecturerGradeVO
update
(
LecturerGradeVO
lecturerGradeVO
)
{
RequestContext
context
=
ContextHolder
.
get
();
LecturerGrade
lecturerGrade
=
new
LecturerGrade
();
BeanUtils
.
copyProperties
(
lecturerGradeVO
,
lecturerGrade
);
lecturerGrade
.
setUpdateById
(
context
.
getAccountId
());
lecturerGrade
.
setUpdateTime
(
new
Date
());
this
.
updateById
(
lecturerGrade
);
return
lecturerGradeVO
;
}
/**
* 讲师级别列表
*
* @return
*/
@Override
public
List
<
LecturerGrade
>
list
(
Integer
status
)
{
RequestContext
context
=
ContextHolder
.
get
();
LecturerGrade
lecturerGrade
=
new
LecturerGrade
();
lecturerGrade
.
setSiteId
(
context
.
getSiteId
());
lecturerGrade
.
setStatus
(
status
);
lecturerGrade
.
setDelFlag
(
0
);
EntityWrapper
<
LecturerGrade
>
condition
=
QueryUtil
.
condition
(
lecturerGrade
);
condition
.
orderBy
(
"sort"
,
true
);
return
this
.
selectList
(
condition
);
}
}
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerImportServiceImpl.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.yizhi.application.orm.util.QueryUtil
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.application.domain.Lecturer
;
import
com.yizhi.application.domain.LecturerGrade
;
import
com.yizhi.application.domain.LecturerRelation
;
import
com.yizhi.course.application.feign.CourseClient
;
import
com.yizhi.course.application.feign.OfflineCourseClient
;
import
com.yizhi.course.application.vo.CourseVo
;
import
com.yizhi.course.application.vo.OfflineCourseVo
;
import
com.yizhi.course.application.vo.domain.CourseEntityVo
;
import
com.yizhi.lecturer.application.enums.DeleteFlag
;
import
com.yizhi.lecturer.application.enums.ImportError
;
import
com.yizhi.core.application.exception.BizException
;
import
com.yizhi.core.application.log.LogQueue
;
import
com.yizhi.core.application.log.TaskLogDetailEvent
;
import
com.yizhi.system.application.model.ImportModel
;
import
com.yizhi.application.service.ILecturerGradeService
;
import
com.yizhi.application.service.ILecturerImportService
;
import
com.yizhi.application.service.ILecturerRelationService
;
import
com.yizhi.application.service.ILecturerService
;
import
com.yizhi.lecturer.application.vo.LecturerCourseImport
;
import
com.yizhi.lecturer.application.vo.LecturerScoreImport
;
import
com.yizhi.util.application.constant.ReturnCode
;
import
com.yizhi.util.application.regex.RegexUtil
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* 讲师详情表 服务类
* </p>
*
* @author lingye
* @since 2019年11月12日
*/
@Service
public
class
LecturerImportServiceImpl
implements
ILecturerImportService
{
@Autowired
private
ILecturerService
lecturerService
;
@Autowired
private
CourseClient
courseClient
;
@Autowired
private
OfflineCourseClient
offlineCourseClient
;
@Autowired
private
ILecturerGradeService
lecturerGradeService
;
@Autowired
private
ILecturerRelationService
lecturerRelationService
;
@Autowired
private
RabbitTemplate
rabbitTemplate
;
public
final
String
COURSE
=
"线上"
;
public
final
String
OFFLINE_COURSE
=
"线下"
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
LecturerClassificationServiceImpl
.
class
);
/**
* 评分导入
*
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
LecturerScoreImport
>
importScore
(
ImportModel
importModel
,
Integer
type
,
RequestContext
context
)
{
logger
.
info
(
"+++++++++++++++++++++++++++++++++"
);
logger
.
info
(
"站点id:"
+
context
);
List
<
LecturerScoreImport
>
models
=
importModel
.
getData
();
Long
taskId
=
importModel
.
getTaskId
();
List
<
TaskLogDetailEvent
>
failEvents
=
new
ArrayList
<
TaskLogDetailEvent
>();
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
List
<
Lecturer
>
lecturers
=
new
ArrayList
<>();
List
<
String
>
codes
=
new
ArrayList
<>();
Lecturer
lecturer
=
new
Lecturer
();
for
(
int
j
=
2
;
j
<
models
.
size
();
j
++)
{
int
i
=
j
+
2
;
LecturerScoreImport
model
=
models
.
get
(
j
);
String
code
=
model
.
getCode
();
if
(
StringUtils
.
isEmpty
(
code
))
{
model
.
setResult
(
ImportError
.
CODE_EMPTY
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
CODE_EMPTY
));
continue
;
}
else
{
if
(
codes
.
contains
(
code
.
trim
()))
{
model
.
setResult
(
ImportError
.
REPEAT_CODE
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
REPEAT_CODE
));
continue
;
}
codes
.
add
(
code
.
trim
());
}
String
score
=
model
.
getScore
();
logger
.
info
(
"score:----"
+
score
);
lecturer
=
lecturerService
.
getLecturerByCodeAndName
(
code
.
trim
(),
null
,
context
.
getSiteId
());
logger
.
info
(
"返回讲师:"
+
lecturer
);
if
(
lecturer
==
null
)
{
model
.
setResult
(
ImportError
.
LECTURER_NOT_EXIST
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
LECTURER_NOT_EXIST
));
continue
;
}
else
{
if
(
type
==
1
)
{
if
(
StringUtils
.
isEmpty
(
score
))
{
model
.
setResult
(
ImportError
.
SCORE_EMPTY
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
SCORE_EMPTY
));
continue
;
}
try
{
Double
importScore
=
Double
.
valueOf
(
score
);
logger
.
info
(
"importScore:{}"
,
importScore
);
int
result
=
importScore
.
compareTo
(
5.0
);
logger
.
info
(
"result:{}"
,
result
);
if
(
result
==
1
){
model
.
setResult
(
ImportError
.
SCORE_FORMAT_ERROR
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
SCORE_FORMAT_ERROR
));
continue
;
}
else
{
if
(!
RegexUtil
.
lecturerRegex
(
score
))
{
model
.
setResult
(
ImportError
.
SCORE_FORMAT_ERROR
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
SCORE_FORMAT_ERROR
));
continue
;
}
}
}
catch
(
Exception
e
)
{
model
.
setResult
(
ImportError
.
SCORE_FORMAT_ERROR
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
SCORE_FORMAT_ERROR
));
continue
;
}
lecturer
.
setScore
(
Float
.
parseFloat
(
model
.
getScore
()));
}
else
if
(
type
==
2
)
{
if
(
StringUtils
.
isEmpty
(
score
))
{
model
.
setResult
(
ImportError
.
SCORE_EMPTY
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
GRADE_EMPTY
));
continue
;
}
LecturerGrade
lecturerGrade
=
new
LecturerGrade
();
lecturerGrade
.
setName
(
score
.
trim
());
lecturerGrade
.
setSiteId
(
context
.
getSiteId
());
lecturerGrade
.
setDelFlag
(
0
);
LecturerGrade
lg
=
lecturerGradeService
.
selectOne
(
QueryUtil
.
condition
(
lecturerGrade
));
if
(
lg
==
null
)
{
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
GRADE_NOT_EXIST
));
continue
;
}
else
{
lecturer
.
setGrade
(
lg
.
getSort
());
lecturer
.
setGradeName
(
score
);
}
}
lecturers
.
add
(
lecturer
);
}
model
.
setResult
(
""
);
}
logger
.
info
(
"讲师库列表:"
+
lecturers
);
if
(
CollectionUtils
.
isNotEmpty
(
lecturers
))
{
boolean
b
=
lecturerService
.
updateBatchById
(
lecturers
);
logger
.
info
(
"修改后的讲师:"
+
b
);
}
logger
.
info
(
"======success!======="
);
models
.
remove
(
0
);
models
.
remove
(
0
);
//错误的信息发送给任务详情表
if
(
CollectionUtils
.
isNotEmpty
(
failEvents
))
{
rabbitTemplate
.
convertAndSend
(
LogQueue
.
BATCH_TASK_LOG_DETAIL_QUEUE
,
failEvents
);
}
}
else
{
logger
.
info
(
ReturnCode
.
RESOURCE_NOT_FOUND
.
getMsg
());
// throw new BizException(ReturnCode.RESOURCE_NOT_FOUND.getCode(), ReturnCode.RESOURCE_NOT_FOUND.getMsg());
}
return
models
;
}
/**
* 讲师级别导入
*
* @param importModel
* @return
*/
@Override
public
List
<
LecturerScoreImport
>
importGrade
(
ImportModel
importModel
)
{
RequestContext
context
=
ContextHolder
.
get
();
List
<
LecturerScoreImport
>
models
=
importModel
.
getData
();
Long
taskId
=
importModel
.
getTaskId
();
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
List
<
TaskLogDetailEvent
>
failEvents
=
new
ArrayList
<
TaskLogDetailEvent
>();
List
<
Lecturer
>
lecturers
=
new
ArrayList
<>();
Lecturer
lecturer
=
new
Lecturer
();
for
(
int
j
=
1
;
j
<=
models
.
size
()
-
1
;
j
++)
{
int
i
=
j
+
2
;
LecturerScoreImport
model
=
models
.
get
(
j
);
String
code
=
model
.
getCode
();
if
(
StringUtils
.
isEmpty
(
code
))
{
model
.
setResult
(
ImportError
.
CODE_EMPTY
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
CODE_EMPTY
));
continue
;
}
String
name
=
model
.
getName
();
if
(
StringUtils
.
isEmpty
(
name
))
{
model
.
setResult
(
ImportError
.
NAME_EMPTY
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
NAME_EMPTY
));
continue
;
}
String
score
=
model
.
getScore
();
if
(
StringUtils
.
isEmpty
(
score
))
{
model
.
setResult
(
ImportError
.
SCORE_EMPTY
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
SCORE_EMPTY
));
continue
;
}
lecturer
=
lecturerService
.
getLecturerByCodeAndName
(
code
,
name
,
ContextHolder
.
get
().
getSiteId
());
if
(
lecturer
==
null
)
{
model
.
setResult
(
ImportError
.
LECTURER_NOT_EXIST
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
LECTURER_NOT_EXIST
));
continue
;
}
else
{
lecturer
.
setScore
(
Float
.
parseFloat
(
model
.
getScore
()));
lecturers
.
add
(
lecturer
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
lecturers
))
{
if
(!
lecturerService
.
updateBatchById
(
lecturers
))
{
throw
new
BizException
(
ReturnCode
.
SAVE_FAIL
.
getCode
(),
ReturnCode
.
SAVE_FAIL
.
getMsg
());
}
}
return
models
;
}
else
{
throw
new
BizException
(
ReturnCode
.
RESOURCE_NOT_FOUND
.
getCode
(),
ReturnCode
.
RESOURCE_NOT_FOUND
.
getMsg
());
}
}
/**
* 导入课程
*
* @param importModel
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
LecturerCourseImport
>
importCourse
(
ImportModel
importModel
,
RequestContext
context
)
{
// RequestContext context = ContextHolder.get();
logger
.
info
(
"上下文信息:"
+
JSON
.
toJSONString
(
context
));
List
<
LecturerCourseImport
>
models
=
importModel
.
getData
();
Long
taskId
=
importModel
.
getTaskId
();
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
List
<
TaskLogDetailEvent
>
failEvents
=
new
ArrayList
<
TaskLogDetailEvent
>();
List
<
LecturerRelation
>
lecturerRelations
=
new
ArrayList
<
LecturerRelation
>();
List
<
String
>
codes
=
new
ArrayList
<
String
>();
for
(
int
j
=
2
;
j
<
models
.
size
();
j
++)
{
int
i
=
j
+
2
;
LecturerCourseImport
model
=
models
.
get
(
j
);
String
code
=
model
.
getCode
();
if
(
StringUtils
.
isEmpty
(
code
))
{
model
.
setResult
(
ImportError
.
CODE_EMPTY
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
CODE_EMPTY
));
continue
;
}
// else {
// if (codes.contains(code.trim())) {
// model.setResult(ImportError.REPEAT_CODE);
// failEvents.add(new TaskLogDetailEvent(taskId, "第" + i + "行:" + ImportError.REPEAT_CODE));
// continue;
// }
// codes.add(code.trim());
// }
String
courseCode
=
model
.
getCourseCode
();
logger
.
info
(
"课程code:"
+
courseCode
);
if
(
StringUtils
.
isEmpty
(
code
))
{
model
.
setResult
(
ImportError
.
COURSE_CODE_NOT_EXIST
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
COURSE_CODE_NOT_EXIST
));
continue
;
}
String
type
=
model
.
getType
();
if
(
StringUtils
.
isEmpty
(
type
))
{
model
.
setResult
(
ImportError
.
COURSE_TYPE_ERROR
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
COURSE_TYPE_ERROR
));
continue
;
}
if
(
COURSE
.
equals
(
type
.
trim
())
||
OFFLINE_COURSE
.
equals
(
type
.
trim
()))
{
logger
.
info
(
"课程类型正确"
);
}
else
{
model
.
setResult
(
ImportError
.
COURSE_TYPE_ERROR
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
COURSE_TYPE_ERROR
));
continue
;
}
Lecturer
lecturer
=
lecturerService
.
getLecturerByCodeAndName
(
code
,
null
,
context
.
getSiteId
());
if
(
lecturer
==
null
)
{
model
.
setResult
(
ImportError
.
LECTURER_NOT_EXIST
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
LECTURER_NOT_EXIST
));
continue
;
}
else
{
Long
lecturerId
=
lecturer
.
getId
();
LecturerRelation
lecturerRelation
=
new
LecturerRelation
();
if
(
type
.
equals
(
COURSE
))
{
Long
siteId
=
context
.
getSiteId
();
logger
.
info
(
"参数id:"
+
siteId
);
CourseEntityVo
course
=
courseClient
.
getCourseByCode
(
model
.
getCourseCode
().
trim
(),
siteId
,
context
.
getCompanyId
());
logger
.
info
(
"查询的课程:"
+
course
);
if
(
course
!=
null
)
{
lecturerRelation
.
setLecturerId
(
lecturerId
);
lecturerRelation
.
setRelationId
(
course
.
getId
());
lecturerRelation
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
LecturerRelation
lr
=
lecturerRelationService
.
selectOne
(
QueryUtil
.
condition
(
lecturerRelation
));
if
(
lr
!=
null
){
model
.
setResult
(
ImportError
.
COURSE_EXIST
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
COURSE_EXIST
));
continue
;
}
lecturerRelation
.
setRelationName
(
course
.
getName
());
lecturerRelation
.
setType
(
1
);
}
else
{
model
.
setResult
(
ImportError
.
COURSE_NOT_EXIST
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
COURSE_NOT_EXIST
));
continue
;
}
}
else
if
(
type
.
equals
(
OFFLINE_COURSE
))
{
Long
siteId
=
context
.
getSiteId
();
logger
.
info
(
"参数id:"
+
siteId
);
OfflineCourseVo
offlineCourse
=
offlineCourseClient
.
getOfflineCourseByCode
(
model
.
getCourseCode
().
trim
(),
siteId
);
if
(
offlineCourse
!=
null
)
{
lecturerRelationService
.
selectOne
(
QueryUtil
.
condition
(
lecturerRelation
));
lecturerRelation
.
setRelationId
(
offlineCourse
.
getId
());
lecturerRelation
.
setLecturerId
(
lecturerId
);
lecturerRelation
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
LecturerRelation
lr
=
lecturerRelationService
.
selectOne
(
QueryUtil
.
condition
(
lecturerRelation
));
if
(
lr
!=
null
){
model
.
setResult
(
ImportError
.
COURSE_EXIST
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
COURSE_EXIST
));
continue
;
}
lecturerRelation
.
setRelationName
(
offlineCourse
.
getName
());
lecturerRelation
.
setType
(
2
);
}
else
{
model
.
setResult
(
ImportError
.
COURSE_NOT_EXIST
);
failEvents
.
add
(
new
TaskLogDetailEvent
(
taskId
,
"第"
+
i
+
"行:"
+
ImportError
.
COURSE_NOT_EXIST
));
continue
;
}
}
lecturerRelations
.
add
(
lecturerRelation
);
}
model
.
setResult
(
""
);
}
boolean
flag
=
false
;
if
(
CollectionUtils
.
isNotEmpty
(
lecturerRelations
))
{
flag
=
lecturerRelationService
.
insertBatch
(
lecturerRelations
);
}
logger
.
info
(
"新增关系:"
+
flag
);
logger
.
info
(
"======success!======="
);
models
.
remove
(
0
);
models
.
remove
(
0
);
//错误的信息发送给任务详情表
if
(
CollectionUtils
.
isNotEmpty
(
failEvents
))
{
rabbitTemplate
.
convertAndSend
(
LogQueue
.
BATCH_TASK_LOG_DETAIL_QUEUE
,
failEvents
);
}
}
else
{
logger
.
info
(
ReturnCode
.
RESOURCE_NOT_FOUND
.
getMsg
());
}
return
models
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerInfoServiceImpl.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
.
impl
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.orm.id.IdGenerator
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.application.domain.LecturerInfo
;
import
com.yizhi.application.mapper.LecturerInfoMapper
;
import
com.yizhi.application.orm.util.QueryUtil
;
import
com.yizhi.application.service.ILecturerInfoService
;
import
com.yizhi.lecturer.application.vo.LecturerInfoVO
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* <p>
* 服务实现类
* </p>
*
* @author lingye
* @since 2019-11-06
*/
@Service
public
class
LecturerInfoServiceImpl
extends
ServiceImpl
<
LecturerInfoMapper
,
LecturerInfo
>
implements
ILecturerInfoService
{
@Autowired
IdGenerator
idGenerator
;
/**
* 基本信息新增
*
* @param lecturerInfoVO
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LecturerInfoVO
add
(
LecturerInfoVO
lecturerInfoVO
)
{
LecturerInfo
lecturerInfo
=
new
LecturerInfo
();
RequestContext
context
=
ContextHolder
.
get
();
lecturerInfo
.
setSiteId
(
context
.
getSiteId
());
// 先删除配置信息
this
.
delete
(
QueryUtil
.
condition
(
lecturerInfo
));
BeanUtils
.
copyProperties
(
lecturerInfoVO
,
lecturerInfo
);
lecturerInfo
.
setId
(
idGenerator
.
generate
());
lecturerInfo
.
setCreateById
(
context
.
getAccountId
());
lecturerInfo
.
setCompanyId
(
context
.
getCompanyId
());
this
.
insert
(
lecturerInfo
);
BeanUtils
.
copyProperties
(
lecturerInfo
,
lecturerInfoVO
);
return
lecturerInfoVO
;
}
/**
* 修改
*
* @param lecturerInfoVO
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LecturerInfoVO
update
(
LecturerInfoVO
lecturerInfoVO
)
{
LecturerInfo
lecturerInfo
=
new
LecturerInfo
();
BeanUtils
.
copyProperties
(
lecturerInfoVO
,
lecturerInfo
);
RequestContext
context
=
ContextHolder
.
get
();
lecturerInfo
.
setCreateById
(
context
.
getAccountId
());
lecturerInfo
.
setSiteId
(
context
.
getSiteId
());
lecturerInfo
.
setCompanyId
(
context
.
getCompanyId
());
this
.
updateById
(
lecturerInfo
);
BeanUtils
.
copyProperties
(
lecturerInfo
,
lecturerInfoVO
);
return
lecturerInfoVO
;
}
/**
* 根据站点获取讲师基本信息
*
* @return
*/
@Override
public
LecturerInfoVO
getBySiteId
()
{
LecturerInfoVO
lecturerInfoVO
=
new
LecturerInfoVO
();
RequestContext
context
=
ContextHolder
.
get
();
LecturerInfo
lecturerInfo
=
new
LecturerInfo
();
lecturerInfo
.
setSiteId
(
context
.
getSiteId
());
LecturerInfo
info
=
this
.
selectOne
(
QueryUtil
.
condition
(
lecturerInfo
));
if
(
info
!=
null
)
{
BeanUtils
.
copyProperties
(
info
,
lecturerInfoVO
);
return
lecturerInfoVO
;
}
else
{
return
null
;
}
}
}
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerKeywordsServiceImpl.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
.
impl
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.domain.LecturerKeywords
;
import
com.yizhi.application.mapper.LecturerKeywordsMapper
;
import
com.yizhi.application.service.ILecturerKeywordsService
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 服务实现类
* </p>
*
* @author lingye
* @since 2019-05-06
*/
@Service
public
class
LecturerKeywordsServiceImpl
extends
ServiceImpl
<
LecturerKeywordsMapper
,
LecturerKeywords
>
implements
ILecturerKeywordsService
{
}
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerRelationServiceImpl.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
.
impl
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.domain.LecturerRelation
;
import
com.yizhi.lecturer.application.enums.DeleteFlag
;
import
com.yizhi.application.mapper.LecturerRelationMapper
;
import
com.yizhi.application.orm.util.QueryUtil
;
import
com.yizhi.application.service.ILecturerRelationService
;
import
com.yizhi.lecturer.application.vo.RelationVO
;
import
com.yizhi.lecturer.application.vo.RelationVOList
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
/**
* <p>
* 讲师关联课程表 服务实现类
* </p>
*
* @author lilingye
* @since 2019-05-06
*/
@Service
@Log4j2
public
class
LecturerRelationServiceImpl
extends
ServiceImpl
<
LecturerRelationMapper
,
LecturerRelation
>
implements
ILecturerRelationService
{
@Autowired
private
LecturerRelationMapper
lecturerRelationMapper
;
@Override
public
boolean
insertLecturerRelation
(
List
<
LecturerRelation
>
relationVOS
,
Long
lecturerId
)
{
log
.
info
(
"参数签:"
+
relationVOS
);
List
<
LecturerRelation
>
lecturerRelations
=
relationVOS
.
parallelStream
().
map
(
lecturerRelationVO
->
{
LecturerRelation
lr
=
new
LecturerRelation
();
BeanUtils
.
copyProperties
(
lecturerRelationVO
,
lr
);
lr
.
setLecturerId
(
lecturerId
);
return
lr
;
}).
collect
(
toList
());
log
.
info
(
"参数后:"
+
lecturerRelations
);
return
this
.
insertBatch
(
lecturerRelations
);
}
@Override
public
List
<
RelationVO
>
getRelationsById
(
Long
id
)
{
List
<
RelationVO
>
relationVOS
=
new
ArrayList
<>();
LecturerRelation
lecturerRelation
=
new
LecturerRelation
();
lecturerRelation
.
setLecturerId
(
id
);
lecturerRelation
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
List
<
LecturerRelation
>
lecturerRelations
=
this
.
selectList
(
QueryUtil
.
condition
(
lecturerRelation
));
if
(
CollectionUtils
.
isNotEmpty
(
lecturerRelations
))
{
relationVOS
=
lecturerRelations
.
parallelStream
().
map
(
lr
->
{
RelationVO
relationVO
=
new
RelationVO
();
relationVO
.
setRelationId
(
lr
.
getRelationId
());
relationVO
.
setRelationName
(
lr
.
getRelationName
());
relationVO
.
setType
(
lr
.
getType
());
return
relationVO
;
}).
collect
(
toList
());
}
return
relationVOS
;
}
@Override
public
boolean
updateLecturerRelation
(
List
<
LecturerRelation
>
relationVOS
,
Long
lecturerId
)
{
LecturerRelation
lecturerRelation
=
new
LecturerRelation
();
lecturerRelation
.
setLecturerId
(
lecturerId
);
lecturerRelation
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
List
<
LecturerRelation
>
lecturerRelations
=
this
.
selectList
(
QueryUtil
.
condition
(
lecturerRelation
));
if
(
CollectionUtils
.
isNotEmpty
(
lecturerRelations
))
{
lecturerRelations
=
lecturerRelations
.
parallelStream
().
map
(
lr
->
{
lr
.
setDelFlag
(
DeleteFlag
.
YES
.
ordinal
());
return
lr
;
}).
collect
(
toList
());
// 删除原来的
this
.
updateBatchById
(
lecturerRelations
);
}
if
(
CollectionUtils
.
isNotEmpty
(
relationVOS
))
{
//新增
this
.
insertLecturerRelation
(
relationVOS
,
lecturerId
);
}
return
true
;
}
@Override
public
Page
<
RelationVOList
>
getRelationListByLecturerId
(
Long
id
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
RelationVOList
>
page
=
new
Page
<>();
page
.
setCurrent
(
pageNo
);
page
.
setSize
(
pageSize
);
List
<
RelationVOList
>
relationVOS
=
lecturerRelationMapper
.
getRelationListByLecturerId
(
page
,
id
);
page
.
setRecords
(
relationVOS
);
return
page
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerResumeServiceImpl.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
.
impl
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.domain.LecturerResume
;
import
com.yizhi.application.mapper.LecturerResumeMapper
;
import
com.yizhi.application.service.ILecturerResumeService
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 讲师履历表 服务实现类
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Service
public
class
LecturerResumeServiceImpl
extends
ServiceImpl
<
LecturerResumeMapper
,
LecturerResume
>
implements
ILecturerResumeService
{
}
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/LecturerServiceImpl.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
.
impl
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.orm.hierarchicalauthorization.HQueryUtil
;
import
com.yizhi.application.orm.id.IdGenerator
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.application.domain.*
;
import
com.yizhi.application.service.*
;
import
com.yizhi.lecturer.application.enums.DeleteFlag
;
import
com.yizhi.lecturer.application.enums.LecturerEnum
;
import
com.yizhi.application.mapper.LecturerMapper
;
import
com.yizhi.application.orm.util.QueryUtil
;
import
com.yizhi.lecturer.application.vo.*
;
import
com.yizhi.lecturer.application.vo.domain.LecturerClassificationVo
;
import
com.yizhi.lecturer.application.vo.domain.LecturerRelationVo
;
import
com.yizhi.site.application.feign.PortalManagePCFeignClients
;
import
com.yizhi.site.application.vo.domain.ProtalPlateVo
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
/**
* <p>
* 讲师详情表 服务实现类
* </p>
*
* @author lingye
* @since 2019-04-17
*/
@Service
@Log4j2
public
class
LecturerServiceImpl
extends
ServiceImpl
<
LecturerMapper
,
Lecturer
>
implements
ILecturerService
{
@Autowired
private
IdGenerator
idGenerator
;
@Autowired
private
ILecturerService
lecturerService
;
@Autowired
private
ILecturerRelationService
lecturerRelationService
;
@Autowired
private
ILecturerResumeService
lecturerResumeService
;
@Autowired
private
LecturerMapper
lecturerMapper
;
@Autowired
private
ILecturerKeywordsService
lecturerKeywordsService
;
@Autowired
private
ITrLecturerClassificationService
trLecturerClassificationService
;
@Autowired
private
ILecturerClassificationService
lecturerClassificationService
;
@Autowired
private
ILecturerInfoService
lecturerInfoService
;
@Autowired
private
ILecturerGradeService
lecturerGradeService
;
@Autowired
PortalManagePCFeignClients
portalManagePCFeignClient
;
/**
*
* @param lecturerVO 讲师库参数
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LecturerVO
addLecturer
(
LecturerVO
lecturerVO
)
{
RequestContext
context
=
ContextHolder
.
get
();
Lecturer
lecturer
=
new
Lecturer
();
BeanUtils
.
copyProperties
(
lecturerVO
,
lecturer
);
Long
lecturerId
=
idGenerator
.
generate
();
log
.
info
(
"讲师id:"
+
lecturerId
);
lecturer
.
setId
(
lecturerId
);
lecturer
.
setCreateById
(
context
.
getAccountId
());
lecturer
.
setUpdateById
(
context
.
getAccountId
());
lecturer
.
setSiteId
(
context
.
getSiteId
());
lecturer
.
setCompanyId
(
context
.
getCompanyId
());
String
code
=
this
.
baseMapper
.
queryLecturerCodexSort
(
context
.
getSiteId
());
String
lecturerNo
=
getLecturerNo
(
code
);
lecturer
.
setCode
(
lecturerNo
);
// 分类新增
List
<
LecturerClassificationVo
>
lecturerClassificationVos
=
lecturerVO
.
getClassificationList
();
if
(
CollectionUtils
.
isNotEmpty
(
lecturerClassificationVos
))
{
List
<
TrLecturerClassification
>
classificationList
=
lecturerClassificationVos
.
parallelStream
().
map
(
lc
->
{
TrLecturerClassification
tlc
=
new
TrLecturerClassification
();
tlc
.
setId
(
idGenerator
.
generate
());
tlc
.
setLecturerId
(
lecturerId
);
tlc
.
setClassificationId
(
lc
.
getId
());
return
tlc
;
}
).
collect
(
toList
());
trLecturerClassificationService
.
insertBatch
(
classificationList
);
}
// 讲师简历
if
(
StringUtils
.
isNotEmpty
(
lecturerVO
.
getResume
()))
{
LecturerResume
lecturerResume
=
new
LecturerResume
();
Long
lrId
=
idGenerator
.
generate
();
lecturerResume
.
setId
(
lrId
);
lecturerResume
.
setLecturerId
(
lecturerId
);
lecturerResume
.
setResume
(
lecturerVO
.
getResume
());
lecturerResume
.
setCreateById
(
context
.
getAccountId
());
lecturerResume
.
setUpdateById
(
context
.
getAccountId
());
boolean
resumeInsert
=
lecturerResumeService
.
insert
(
lecturerResume
);
log
.
info
(
"讲师简历参数:"
+
lecturerResume
);
log
.
info
(
"讲师简历结果:"
+
resumeInsert
);
}
if
(
CollectionUtils
.
isNotEmpty
(
lecturerVO
.
getKeywords
()))
{
List
<
LecturerKeywords
>
lkList
=
lecturerVO
.
getKeywords
().
parallelStream
().
map
(
keyWords
->
{
LecturerKeywords
lecturerKeywords
=
new
LecturerKeywords
();
lecturerKeywords
.
setId
(
idGenerator
.
generate
());
lecturerKeywords
.
setLecturerId
(
lecturerId
);
lecturerKeywords
.
setKeywords
(
keyWords
);
return
lecturerKeywords
;
}
).
collect
(
toList
());
lecturerKeywordsService
.
insertBatch
(
lkList
);
}
// 排序
int
lastedSort
=
lecturerMapper
.
queryLecturerMaxSort
(
context
.
getSiteId
());
lecturer
.
setSort
(
lastedSort
+
DeleteFlag
.
YES
.
ordinal
());
lecturer
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
lecturer
.
setId
(
lecturerId
);
log
.
info
(
"请求的参数:"
+
lecturer
);
this
.
insert
(
lecturer
);
lecturerVO
.
setId
(
lecturerId
);
return
lecturerVO
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
updateLecturer
(
LecturerVO
lecturerVO
)
{
RequestContext
context
=
ContextHolder
.
get
();
Date
currentDate
=
new
Date
();
Lecturer
lecturer
=
new
Lecturer
();
// 讲师库主表id
Long
lecturerId
=
lecturerVO
.
getId
();
lecturer
.
setUpdateTime
(
currentDate
);
lecturer
.
setUpdateById
(
context
.
getAccountId
());
// if (CollectionUtils.isNotEmpty(lecturerVO.getLecturerRelationVoVOS())) {
// // 删除管理课程
// LecturerRelationVo lr = new LecturerRelationVo();
// lr.setLecturerId(lecturerId);
//
// List<LecturerRelationVo> relations = lecturerRelationService.selectList(QueryUtil.condition(lr));
// if (CollectionUtils.isNotEmpty(relations)) {
// relations = relations.parallelStream().map(lecturerRelation -> {
// lecturerRelation.setDelFlag(DeleteFlag.YES.ordinal());
// return lecturerRelation;
//
// }).collect(toList());
//
// // 删除关联课程/或培训
// boolean delResult = lecturerRelationService.updateBatchById(relations);
// log.info("删除的结果" + delResult);
// }
//
//
// // 新增关联课程
// List<LecturerRelationVo> lecturerRelationVoVOS = lecturerVO.getLecturerRelationVoVOS();
// if (CollectionUtils.isNotEmpty(lecturerRelationVoVOS)) {
// // 讲师库关联的课程
// boolean addResult = lecturerRelationService.insertLecturerRelation(lecturerRelationVoVOS, lecturerId);
// log.info("新增关联的结果:" + addResult);
// }
// }
// 删除关键字
List
<
String
>
keywords
=
lecturerVO
.
getKeywords
();
LecturerKeywords
lecturerKeywords
=
new
LecturerKeywords
();
lecturerKeywords
.
setLecturerId
(
lecturerVO
.
getId
());
List
<
LecturerKeywords
>
lecturerKeywordsList
=
lecturerKeywordsService
.
selectList
(
QueryUtil
.
condition
(
lecturerKeywords
));
log
.
info
(
"删除关键字"
);
for
(
LecturerKeywords
lw
:
lecturerKeywordsList
)
{
lecturerKeywordsService
.
deleteById
(
lw
);
}
// 新增关键字
if
(
CollectionUtils
.
isNotEmpty
(
keywords
))
{
List
<
LecturerKeywords
>
lkList
=
lecturerVO
.
getKeywords
().
parallelStream
().
map
(
keyWords
->
{
LecturerKeywords
words
=
new
LecturerKeywords
();
words
.
setId
(
idGenerator
.
generate
());
words
.
setLecturerId
(
lecturerVO
.
getId
());
words
.
setKeywords
(
keyWords
);
return
words
;
}
).
collect
(
toList
());
lecturerKeywordsService
.
insertBatch
(
lkList
);
}
// 讲师库分类
List
<
LecturerClassificationVo
>
lecturerClassificationVos
=
lecturerVO
.
getClassificationList
();
TrLecturerClassification
lc
=
new
TrLecturerClassification
();
lc
.
setLecturerId
(
lecturerVO
.
getId
());
List
<
TrLecturerClassification
>
lcList
=
trLecturerClassificationService
.
selectList
(
QueryUtil
.
condition
(
lc
));
log
.
info
(
"删除分类关系"
);
for
(
TrLecturerClassification
tlc
:
lcList
)
{
trLecturerClassificationService
.
deleteById
(
tlc
);
}
if
(
CollectionUtils
.
isNotEmpty
(
lecturerClassificationVos
))
{
// 新增分类关系
List
<
TrLecturerClassification
>
classificationList
=
lecturerClassificationVos
.
parallelStream
().
map
(
lct
->
{
TrLecturerClassification
tlc
=
new
TrLecturerClassification
();
tlc
.
setId
(
idGenerator
.
generate
());
tlc
.
setLecturerId
(
lecturerId
);
tlc
.
setClassificationId
(
lct
.
getId
());
return
tlc
;
}
).
collect
(
toList
());
trLecturerClassificationService
.
insertBatch
(
classificationList
);
}
// 讲师简历
log
.
info
(
"参数:"
+
lecturerVO
);
String
resume
=
lecturerVO
.
getResume
();
log
.
info
(
"参数:"
+
resume
);
if
(
StringUtils
.
isNotEmpty
(
resume
))
{
LecturerResume
resumeParam
=
new
LecturerResume
();
resumeParam
.
setLecturerId
(
lecturerId
);
resumeParam
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
LecturerResume
lecturerResume
=
lecturerResumeService
.
selectOne
(
QueryUtil
.
condition
(
resumeParam
));
if
(
lecturerResume
!=
null
)
{
// 修改
lecturerResume
.
setResume
(
resume
);
lecturerResume
.
setUpdateTime
(
currentDate
);
lecturerResume
.
setUpdateById
(
context
.
getAccountId
());
lecturerResumeService
.
updateById
(
lecturerResume
);
}
else
{
// 新增
resumeParam
.
setCreateTime
(
currentDate
);
resumeParam
.
setCreateById
(
context
.
getAccountId
());
resumeParam
.
setResume
(
lecturerVO
.
getResume
());
resumeParam
.
setId
(
idGenerator
.
generate
());
lecturerResumeService
.
insert
(
resumeParam
);
}
}
BeanUtils
.
copyProperties
(
lecturerVO
,
lecturer
);
return
this
.
updateById
(
lecturer
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LecturerResponse
delLecturer
(
List
<
Long
>
ids
)
{
StringBuffer
sb
=
new
StringBuffer
();
LecturerResponse
lecturerResponse
=
new
LecturerResponse
();
List
<
Lecturer
>
lecturerList
=
new
ArrayList
<>(
16
);
Integer
count
=
0
;
StringBuffer
sbMsg
=
new
StringBuffer
();
for
(
Long
id:
ids
)
{
Lecturer
lecturer
=
this
.
selectById
(
id
);
ProtalPlateVo
protalPlate
=
new
ProtalPlateVo
();
protalPlate
.
setLinkContent
(
id
);
protalPlate
.
setState
(
DeleteFlag
.
YES
.
ordinal
());
ProtalPlateVo
plate
=
portalManagePCFeignClient
.
getPlate
(
protalPlate
);
if
(
plate
!=
null
)
{
sbMsg
.
append
(
lecturer
.
getLecturerName
());
sbMsg
.
append
(
","
);
continue
;
}
lecturer
.
setDelFlag
(
DeleteFlag
.
YES
.
ordinal
());
if
(
lecturer
.
getStatus
()==
1
)
{
sb
.
append
(
lecturer
.
getLecturerName
());
sb
.
append
(
","
);
}
else
{
count
++;
lecturerList
.
add
(
lecturer
);
}
}
// 删除讲师库表
if
(
CollectionUtils
.
isNotEmpty
(
lecturerList
))
{
this
.
updateBatchById
(
lecturerList
);
}
LecturerRelation
lr
;
for
(
Lecturer
l
:
lecturerList
)
{
// 删除相关联的课程/培训
lr
=
new
LecturerRelation
();
lr
.
setLecturerId
(
l
.
getId
());
List
<
LecturerRelation
>
lecturerRelations
=
lecturerRelationService
.
selectList
(
QueryUtil
.
condition
(
lr
));
if
(
CollectionUtils
.
isNotEmpty
(
lecturerRelations
))
{
List
<
LecturerRelation
>
lecturerRelationList
=
lecturerRelations
.
parallelStream
().
map
(
lecturerRelation
->
{
lecturerRelation
.
setDelFlag
(
DeleteFlag
.
YES
.
ordinal
());
return
lecturerRelation
;
}).
collect
(
toList
());
lecturerRelationService
.
updateBatchById
(
lecturerRelationList
);
}
// 个人简历删除
LecturerResume
lecturerResume
=
new
LecturerResume
();
lecturerResume
.
setDelFlag
(
DeleteFlag
.
YES
.
ordinal
());
lecturerResume
.
setLecturerId
(
l
.
getId
());
List
<
LecturerResume
>
lecturerResumes
=
lecturerResumeService
.
selectList
(
QueryUtil
.
condition
(
lecturerResume
));
if
(
CollectionUtils
.
isNotEmpty
(
lecturerResumes
))
{
List
<
LecturerResume
>
lecturerResumeList
=
lecturerResumes
.
parallelStream
().
map
(
lre
->
{
lre
.
setDelFlag
(
DeleteFlag
.
YES
.
ordinal
());
return
lre
;
}).
collect
(
toList
());
lecturerResumeService
.
updateBatchById
(
lecturerResumeList
);
}
// 关键字删除
LecturerKeywords
lecturerKeywords
=
new
LecturerKeywords
();
lecturerKeywords
.
setLecturerId
(
l
.
getId
());
List
<
LecturerKeywords
>
lecturerKeywordsList
=
lecturerKeywordsService
.
selectList
(
QueryUtil
.
condition
(
lecturerKeywords
));
if
(
CollectionUtils
.
isNotEmpty
(
lecturerKeywordsList
))
{
log
.
info
(
"删除关键字"
);
for
(
LecturerKeywords
lw
:
lecturerKeywordsList
)
{
lecturerKeywordsService
.
deleteById
(
lw
);
}
}
}
String
msg
=
sb
.
toString
()+
sbMsg
.
toString
();
if
(
StringUtils
.
isNotEmpty
(
msg
)){
String
rMsg
=
"共有"
+
count
+
"位讲师被删除!其中:"
+
msg
.
substring
(
0
,
msg
.
length
()
-
1
)+
"为启用状态的讲师,不能删除。"
;
if
(
StringUtils
.
isNotEmpty
(
sbMsg
))
{
String
bMsg
=
sbMsg
+
"需下架首页推荐模块,才能删除!"
;
lecturerResponse
.
setMsg
(
bMsg
+
rMsg
);
}
else
{
lecturerResponse
.
setMsg
(
rMsg
);
}
lecturerResponse
.
setCode
(
"01"
);
}
else
{
lecturerResponse
.
setMsg
(
"删除成功!"
);
lecturerResponse
.
setCode
(
"02"
);
}
return
lecturerResponse
;
}
@Override
public
boolean
sortLecturer
(
LecturerSortVO
lecturerSortVO
)
{
RequestContext
context
=
ContextHolder
.
get
();
// context.setSiteId(1314L);
// context.setCompanyId(1314L);
String
code
=
lecturerSortVO
.
getCode
();
Long
id
=
lecturerSortVO
.
getId
();
Lecturer
currentLecturer
=
this
.
selectById
(
id
);
int
currentSort
=
currentLecturer
.
getSort
();
if
(
code
.
equals
(
LecturerEnum
.
UP
.
getKey
()))
{
//上移
Lecturer
beforeSortLecturer
=
lecturerMapper
.
getLecturerBeforeSort
(
context
.
getSiteId
(),
currentSort
);
if
(
beforeSortLecturer
!=
null
)
{
int
beforeSort
=
beforeSortLecturer
.
getSort
();
beforeSortLecturer
.
setSort
(
currentSort
);
this
.
updateById
(
beforeSortLecturer
);
currentLecturer
.
setSort
(
beforeSort
);
this
.
updateById
(
currentLecturer
);
}
}
else
if
(
code
.
equals
(
LecturerEnum
.
DOWN
.
getKey
()))
{
//下移
Lecturer
beforeSortLecturer
=
lecturerMapper
.
getLecturerAfterSort
(
context
.
getSiteId
(),
currentSort
);
if
(
beforeSortLecturer
!=
null
)
{
int
beforeSort
=
beforeSortLecturer
.
getSort
();
if
(
beforeSort
!=
DeleteFlag
.
NO
.
ordinal
())
{
beforeSortLecturer
.
setSort
(
currentSort
);
this
.
updateById
(
beforeSortLecturer
);
currentLecturer
.
setSort
(
beforeSort
);
this
.
updateById
(
currentLecturer
);
}
}
}
else
if
(
code
.
equals
(
LecturerEnum
.
TOP
.
getKey
()))
{
//置顶
List
<
Lecturer
>
lecturerBeforeSortList
=
lecturerMapper
.
getLecturerBeforeSortList
(
context
.
getSiteId
(),
currentSort
);
lecturerBeforeSortList
=
lecturerBeforeSortList
.
parallelStream
().
map
(
lecturer
->
{
lecturer
.
setSort
(
lecturer
.
getSort
()
+
DeleteFlag
.
YES
.
ordinal
());
return
lecturer
;
}).
collect
(
toList
());
this
.
updateBatchById
(
lecturerBeforeSortList
);
Lecturer
lecturer
=
new
Lecturer
();
lecturer
.
setId
(
id
);
Lecturer
updateLecturer
=
lecturerService
.
selectById
(
lecturer
);
updateLecturer
.
setSort
(
DeleteFlag
.
NO
.
ordinal
());
this
.
updateById
(
updateLecturer
);
}
return
true
;
}
@Override
public
LecturerVO
queryLecturerById
(
Long
id
)
{
LecturerVO
lecturerVO
=
lecturerMapper
.
getLecturerVOById
(
id
);
LecturerRelation
lr
=
new
LecturerRelation
();
lr
.
setLecturerId
(
id
);
lr
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
// 关联课程/培训项目
List
<
LecturerRelation
>
lecturerRelations
=
lecturerRelationService
.
selectList
(
QueryUtil
.
condition
(
lr
));
List
<
LecturerRelationVo
>
lecturerRelationss
=
new
ArrayList
<>();
for
(
LecturerRelation
l:
lecturerRelations
)
{
LecturerRelationVo
lecturerRelationVo
=
new
LecturerRelationVo
();
BeanUtils
.
copyProperties
(
l
,
lecturerRelationVo
);
lecturerRelationss
.
add
(
lecturerRelationVo
);
}
if
(
CollectionUtils
.
isNotEmpty
(
lecturerRelations
))
{
lecturerVO
.
setLecturerRelationVOS
(
lecturerRelationss
);
}
// 简历
LecturerResume
lecturerResume
=
new
LecturerResume
();
lecturerResume
.
setLecturerId
(
id
);
lecturerResume
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
LecturerResume
ls
=
lecturerResumeService
.
selectOne
(
QueryUtil
.
condition
(
lecturerResume
));
if
(
ls
!=
null
)
{
lecturerVO
.
setResumeId
(
ls
.
getId
());
lecturerVO
.
setResume
(
ls
.
getResume
());
}
//关键字
LecturerKeywords
lecturerKeywords
=
new
LecturerKeywords
();
lecturerKeywords
.
setLecturerId
(
id
);
List
<
LecturerKeywords
>
lecturerKeywordsList
=
lecturerKeywordsService
.
selectList
(
QueryUtil
.
condition
(
lecturerKeywords
));
List
<
String
>
keywordList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
lecturerKeywordsList
))
{
keywordList
=
lecturerKeywordsList
.
parallelStream
().
map
(
lk
->
{
return
lk
.
getKeywords
();
}).
collect
(
toList
());
lecturerVO
.
setKeywords
(
keywordList
);
}
// 分类查询
TrLecturerClassification
trLecturerClassification
=
new
TrLecturerClassification
();
trLecturerClassification
.
setLecturerId
(
id
);
List
<
TrLecturerClassification
>
trLecturerClassifications
=
trLecturerClassificationService
.
selectList
(
QueryUtil
.
condition
(
trLecturerClassification
));
List
<
LecturerClassification
>
classifications
=
trLecturerClassifications
.
parallelStream
().
map
(
tr
->
{
LecturerClassification
trc
=
lecturerClassificationService
.
selectById
(
tr
.
getClassificationId
());
return
trc
;
}
).
collect
(
toList
());
List
<
LecturerClassificationVO
>
classificationVOS
=
classifications
.
parallelStream
().
map
(
tr
->
{
LecturerClassificationVO
vo
=
new
LecturerClassificationVO
();
BeanUtils
.
copyProperties
(
tr
,
vo
);
LecturerClassification
topClassification
=
getTopClassification
(
tr
);
vo
.
setTopId
(
topClassification
.
getId
());
vo
.
setTopName
(
topClassification
.
getName
());
return
vo
;
}
).
collect
(
toList
());
// 分类
// lecturerVO.setClassificationList(classifications);
lecturerVO
.
setClassificationVOList
(
classificationVOS
);
return
lecturerVO
;
}
public
LecturerClassification
getTopClassification
(
LecturerClassification
lc
)
{
LecturerClassification
lecturerClassification
=
new
LecturerClassification
();
if
(
lc
.
getLayer
()
==
0
)
{
return
lc
;
}
else
{
String
[]
strArray
=
lc
.
getParentIds
().
split
(
","
);
Long
id
=
Long
.
valueOf
(
strArray
[
1
]);
return
lecturerClassification
.
selectById
(
id
);
}
}
@Override
public
Page
<
LecturerListVO
>
queryLecturer
(
String
name
,
String
mobile
,
String
sourceCode
,
Integer
pageNo
,
Integer
pageSize
)
{
HQueryUtil
.
startHQ
(
LecturerListVO
.
class
);
Page
<
LecturerListVO
>
page
=
new
Page
<>();
page
.
setCurrent
(
pageNo
);
page
.
setSize
(
pageSize
);
RequestContext
context
=
ContextHolder
.
get
();
List
<
LecturerListVO
>
lecturerListVOList
=
lecturerMapper
.
getLecturerList
(
page
,
name
,
mobile
,
sourceCode
,
context
.
getSiteId
());
page
.
setRecords
(
lecturerListVOList
);
return
page
;
}
@Override
public
Page
<
LecturerApiVo
>
findLecturer
(
LecturerApiVoParam
lecturerApiVoParam
)
{
Page
<
LecturerApiVo
>
page
=
new
Page
<>();
page
.
setCurrent
(
lecturerApiVoParam
.
getPageNo
());
page
.
setSize
(
lecturerApiVoParam
.
getPageSize
());
RequestContext
context
=
ContextHolder
.
get
();
List
<
String
>
ids
=
lecturerApiVoParam
.
getIds
();
ids
=
CollectionUtils
.
isNotEmpty
(
ids
)?
ids:
null
;
List
<
LecturerApiVo
>
lecturerListVOList
=
lecturerMapper
.
selectLecturerList
(
page
,
context
.
getCompanyId
(),
context
.
getSiteId
(),
ids
);
page
.
setRecords
(
lecturerListVOList
);
return
page
;
}
@Override
public
List
<
LecturerListVO
>
exportLecturer
(
String
keywords
,
String
sourceCode
,
String
mobile
)
{
RequestContext
context
=
ContextHolder
.
get
();
Long
siteId
=
context
.
getSiteId
();
return
lecturerMapper
.
exportLecturer
(
siteId
,
keywords
,
sourceCode
,
mobile
);
}
@Override
public
Lecturer
getLecturerById
(
Long
id
)
{
return
this
.
selectById
(
id
);
}
@Override
public
Page
<
TemplateLecturerVO
>
queryLecturerByTemplateId
(
String
name
,
Integer
pageNo
,
Integer
pageSize
,
List
<
Long
>
ids
)
{
Page
<
TemplateLecturerVO
>
page
=
new
Page
<>();
page
.
setCurrent
(
pageNo
);
page
.
setSize
(
pageSize
);
RequestContext
context
=
ContextHolder
.
get
();
List
<
TemplateLecturerVO
>
lecturerListVOList
=
lecturerMapper
.
queryLecturerList
(
page
,
name
,
context
.
getSiteId
(),
ids
);
page
.
setRecords
(
lecturerListVOList
);
return
page
;
}
@Override
public
LecturerDetailVO
queryLecturerByLecturerId
(
Long
id
)
{
Lecturer
lecturer
=
selectById
(
id
);
LecturerDetailVO
detailVO
=
lecturerMapper
.
getStuLecturerDetail
(
id
);
if
(
lecturer
!=
null
&&
lecturer
.
getCompanyName
()!=
null
){
detailVO
.
setCompanyName
(
lecturer
.
getCompanyName
());
}
return
detailVO
;
//初始化返回参数
// LecturerDetailVO lecturerDetailVO = new LecturerDetailVO();
// LecturerVo lecturer = this.selectById(id);
// BeanUtils.copyProperties(lecturer, lecturerDetailVO);
// // 简历
// LecturerResumeVo lecturerResume = new LecturerResumeVo();
// lecturerResume.setLecturerId(id);
// lecturerResume.setDelFlag(DeleteFlag.NO.ordinal());
// LecturerResumeVo ls = lecturerResumeService.selectOne(QueryUtil.condition(lecturerResume));
// if (ls != null) {
// lecturerDetailVO.setResumeId(ls.getId());
// lecturerDetailVO.setResume(ls.getResume());
// }
//讲师分类
// TrLecturerClassificationVo trLecturerClassification = new TrLecturerClassificationVo();
// trLecturerClassification.setLecturerId(id);
// List<TrLecturerClassificationVo> trLecturerClassifications = trLecturerClassificationService.selectList(QueryUtil.condition(trLecturerClassification));
// List<LecturerClassificationVo> classificationList = trLecturerClassifications.parallelStream().map(trlc -> {
// return lecturerClassificationService.selectById(trlc.getClassificationId());
// }).collect(toList());
// lecturerDetailVO.setClassifications(classificationList);
//关键字
// LecturerKeywordsVo lecturerKeywords = new LecturerKeywordsVo();
// lecturerKeywords.setLecturerId(id);
// List<LecturerKeywordsVo> lecturerKeywordsList = lecturerKeywordsService.selectList(QueryUtil.condition(lecturerKeywords));
// List<String> keywords = null;
// if (CollectionUtils.isNotEmpty(lecturerKeywordsList)) {
// keywords = lecturerKeywordsList.stream().map(LecturerKeywordsVo::getKeywords).collect(toList());
// }
// lecturerDetailVO.setKeywords(keywords);
// LecturerInfoVo lecturerInfo = new LecturerInfoVo();
// lecturerInfo.setSiteId(ContextHolder.get().getSiteId());
// lecturerInfo.setDelFlag(DeleteFlag.NO.ordinal());
// lecturerInfo = lecturerInfoService.selectOne(QueryUtil.condition(lecturerInfo));
// String templateNO = lecturerInfo != null ? lecturerInfo.getTemplateNo() : "1";
// lecturerDetailVO.setTemplateNo(templateNO);
// 讲师级名称
// LecturerGradeVo lecturerGrade = new LecturerGradeVo();
// lecturerGrade.setSort(lecturer.getGrade());
// if (lecturer.getGrade()!=null) {
// lecturerGrade.setSiteId(ContextHolder.get().getSiteId());
// lecturerGrade = lecturerGradeService.selectOne(QueryUtil.condition(lecturerGrade));
// lecturerDetailVO.setGradeName(lecturerGrade != null ? lecturerGrade.getName() : "");
// } else {
// lecturerDetailVO.setGradeName("");
// }
// return lecturerDetailVO;
}
/**
* @param code
* @param name
* @return
*/
@Override
public
Lecturer
getLecturerByCodeAndName
(
String
code
,
String
name
,
Long
siteId
)
{
Lecturer
lecturer
=
new
Lecturer
();
lecturer
.
setCode
(
code
);
lecturer
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
lecturer
.
setSiteId
(
siteId
);
Lecturer
le
=
this
.
selectOne
(
QueryUtil
.
condition
(
lecturer
));
return
le
;
}
/**
* 讲师库启用和停用
*
* @param lecturer
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LecturerResponse
upOrDownLecturer
(
Lecturer
lecturer
)
{
LecturerResponse
lecturerResponse
=
new
LecturerResponse
();
if
(
DeleteFlag
.
NO
.
ordinal
()
==
lecturer
.
getStatus
())
{
ProtalPlateVo
protalPlate
=
new
ProtalPlateVo
();
protalPlate
.
setLinkContent
(
lecturer
.
getId
());
protalPlate
.
setState
(
DeleteFlag
.
YES
.
ordinal
());
ProtalPlateVo
plate
=
portalManagePCFeignClient
.
getPlate
(
protalPlate
);
if
(
plate
!=
null
)
{
lecturerResponse
.
setCode
(
"fail"
);
lecturerResponse
.
setMsg
(
"该讲师已在平台首页讲师模块展示,无法禁用!"
);
return
lecturerResponse
;
}
else
{
this
.
updateById
(
lecturer
);
lecturerResponse
.
setCode
(
"success"
);
return
lecturerResponse
;
}
}
else
{
this
.
updateById
(
lecturer
);
return
lecturerResponse
;
}
}
public
static
String
getLecturerNo
(
String
equipmentNo
)
{
String
newEquipmentNo
=
"T000001"
;
if
(
equipmentNo
!=
null
&&
!
equipmentNo
.
isEmpty
())
{
int
newEquipment
=
Integer
.
parseInt
(
equipmentNo
)
+
1
;
newEquipmentNo
=
String
.
format
(
"T"
+
"%06d"
,
newEquipment
);
}
return
newEquipmentNo
;
}
}
cloud-lecturer/src/main/java/com/yizhi/application/service/impl/TrLecturerClassificationServiceImpl.java
0 → 100644
View file @
cd48104d
package
com
.
yizhi
.
application
.
service
.
impl
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.domain.Lecturer
;
import
com.yizhi.application.domain.TrLecturerClassification
;
import
com.yizhi.lecturer.application.enums.DeleteFlag
;
import
com.yizhi.application.mapper.TrLecturerClassificationMapper
;
import
com.yizhi.application.orm.util.QueryUtil
;
import
com.yizhi.application.service.ILecturerService
;
import
com.yizhi.application.service.ITrLecturerClassificationService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* <p>
* 讲师库、分类关系表 服务实现类
* </p>
*
* @author lingye
* @since 2019-10-08
*/
@Service
public
class
TrLecturerClassificationServiceImpl
extends
ServiceImpl
<
TrLecturerClassificationMapper
,
TrLecturerClassification
>
implements
ITrLecturerClassificationService
{
@Autowired
private
ILecturerService
lecturerService
;
/**
* 查询分类是否被关联
*
* @param classificationId 分类id
* @return
*/
@Override
public
boolean
getRelateLecturer
(
Long
classificationId
)
{
TrLecturerClassification
trLecturerClassification
=
new
TrLecturerClassification
();
trLecturerClassification
.
setClassificationId
(
classificationId
);
TrLecturerClassification
lc
=
this
.
selectOne
(
QueryUtil
.
condition
(
trLecturerClassification
));
if
(
lc
!=
null
)
{
Lecturer
lecturer
=
new
Lecturer
();
lecturer
.
setId
(
lc
.
getLecturerId
());
lecturer
.
setDelFlag
(
DeleteFlag
.
NO
.
ordinal
());
List
<
Lecturer
>
lecturers
=
lecturerService
.
selectList
(
QueryUtil
.
condition
(
lecturer
));
if
(
CollectionUtils
.
isNotEmpty
(
lecturers
))
{
return
true
;
}
return
false
;
}
else
{
return
false
;
}
}
}
cloud-lecturer/src/main/resources/bootstrap.properties
0 → 100644
View file @
cd48104d
server.port
=
38001
spring.application.name
=
lecturer
ACTIVE
=
${spring.profiles.active}
spring.profiles.active
=
dev
# nacos
spring.cloud.nacos.config.shared-dataids
=
common-${spring.profiles.active}.properties
spring.cloud.nacos.config.namespace
=
${spring.profiles.active}
spring.cloud.nacos.config.prefix
=
${spring.application.name}
spring.cloud.nacos.config.file-extension
=
properties
spring.cloud.nacos.config.server-addr
=
192.168.1.22:3333
\ No newline at end of file
cloud-lecturer/src/main/resources/mapper/LecturerClassificationMapper.xml
0 → 100644
View file @
cd48104d
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yizhi.application.mapper.LecturerClassificationMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yizhi.application.domain.LecturerClassification"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"parent_id"
property=
"parentId"
jdbcType=
"BIGINT"
/>
<result
column=
"parent_ids"
property=
"parentIds"
jdbcType=
"VARCHAR"
/>
<result
column=
"layer"
property=
"layer"
jdbcType=
"TINYINT"
/>
<result
column=
"classification_des"
property=
"classificationDes"
jdbcType=
"VARCHAR"
/>
<result
column=
"del_flag"
property=
"delFlag"
jdbcType=
"BIT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_by_id"
property=
"createById"
jdbcType=
"BIGINT"
/>
<result
column=
"update_by_id"
property=
"updateById"
jdbcType=
"BIGINT"
/>
<result
column=
"company_id"
property=
"companyId"
jdbcType=
"BIGINT"
/>
<result
column=
"site_id"
property=
"siteId"
jdbcType=
"BIGINT"
/>
<result
column=
"sort"
property=
"sort"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, name, parent_id, parent_ids, layer, classification_des, del_flag, create_time,
update_time, create_by_id, update_by_id, company_id, site_id, sort
</sql>
<select
id=
"getClassificationBeforeSort"
resultType=
"com.yizhi.application.domain.LecturerClassification"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM lecturer_classification l WHERE l.del_flag = 0 AND l.site_id = #{siteId} AND l.parent_id = #{parentId} AND
l.sort
<
#{sort} ORDER BY
l.sort DESC LIMIT 1
</select>
<select
id=
"getClassificationAfterSort"
resultType=
"com.yizhi.application.domain.LecturerClassification"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM lecturer_classification l WHERE l.del_flag = 0 AND l.site_id = #{siteId} AND l.parent_id = #{parentId} AND
l.sort
>
#{sort} ORDER BY
l.sort ASC LIMIT 1
</select>
<select
id=
"getClassificationBeforeSortList"
resultType=
"com.yizhi.application.domain.LecturerClassification"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM lecturer_classification l WHERE l.del_flag = 0 AND l.site_id = #{siteId} AND l.sort
<
#{sort} ORDER BY
l.sort DESC
</select>
<select
id=
"selectClassificationList"
resultType=
"com.yizhi.application.domain.LecturerClassification"
>
select
<include
refid=
"Base_Column_List"
/>
FROM lecturer_classification lc WHERE lc.del_flag = 0 AND lc.parent_ids like concat('%',#{id},'%');
</select>
<select
id=
"selectStuParentIds"
resultType=
"com.yizhi.application.domain.LecturerClassification"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM
lecturer_classification lct
WHERE
lct.id IN (
SELECT lc.parent_id FROM lecturer_classification lc WHERE lc.layer=1 AND lc.del_flag=0 AND lc.`status`=1 AND
lc.site_id=#{siteId} GROUP BY lc.parent_id)
ORDER BY
lct.sort ASC
</select>
<select
id=
"selectStuClassificationList"
resultType=
"com.yizhi.application.domain.LecturerClassification"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM
lecturer_classification lct
WHERE
lct.del_flag = 0
AND lct.`status` = 1
AND lct.site_id = #{siteId}
AND lct.parent_ids LIKE concat('%',#{id},'%') order by lct.sort ASC
</select>
</mapper>
\ No newline at end of file
cloud-lecturer/src/main/resources/mapper/LecturerDicMapper.xml
0 → 100644
View file @
cd48104d
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yizhi.application.mapper.LecturerDicMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yizhi.application.domain.LecturerDic"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"parent_id"
jdbcType=
"BIGINT"
property=
"parentId"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"code"
jdbcType=
"VARCHAR"
property=
"code"
/>
<result
column=
"des"
jdbcType=
"VARCHAR"
property=
"des"
/>
<result
column=
"status"
jdbcType=
"CHAR"
property=
"status"
/>
<result
column=
"type"
jdbcType=
"CHAR"
property=
"type"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, parent_id, name, code, des, status, type, create_time, update_time
</sql>
<select
id=
"getLecturerDicListByCode"
resultType=
"com.yizhi.application.domain.LecturerDic"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM
lecturer_dic
WHERE
parent_id = ( SELECT ld.id FROM lecturer_dic ld WHERE ld.`code` = #{code}) AND `status` = 1
</select>
</mapper>
\ No newline at end of file
cloud-lecturer/src/main/resources/mapper/LecturerGradeMapper.xml
0 → 100644
View file @
cd48104d
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yizhi.application.mapper.LecturerGradeMapper"
>
<select
id=
"selectMaxCode"
resultType=
"java.lang.Integer"
>
SELECT IFNULL(MAX(`code`),0) FROM lecturer_grade WHERE site_id = #{siteId}
</select>
<select
id=
"selectMaxSort"
resultType=
"java.lang.Integer"
>
SELECT IFNULL(MAX(`sort`),0) FROM lecturer_grade WHERE del_flag =0 AND site_id = #{siteId}
</select>
</mapper>
\ No newline at end of file
cloud-lecturer/src/main/resources/mapper/LecturerMapper.xml
0 → 100644
View file @
cd48104d
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yizhi.application.mapper.LecturerMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yizhi.application.domain.Lecturer"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"account_id"
jdbcType=
"BIGINT"
property=
"accountId"
/>
<result
column=
"lecturer_name"
jdbcType=
"VARCHAR"
property=
"lecturerName"
/>
<result
column=
"source_code"
jdbcType=
"BIGINT"
property=
"sourceCode"
/>
<result
column=
"mobile"
jdbcType=
"VARCHAR"
property=
"mobile"
/>
<result
column=
"avatar"
jdbcType=
"VARCHAR"
property=
"avatar"
/>
<result
column=
"title"
jdbcType=
"VARCHAR"
property=
"title"
/>
<result
column=
"status"
jdbcType=
"BIT"
property=
"status"
/>
<result
column=
"sort"
jdbcType=
"INTEGER"
property=
"sort"
/>
<result
column=
"site_id"
jdbcType=
"BIGINT"
property=
"siteId"
/>
<result
column=
"company_id"
jdbcType=
"BIGINT"
property=
"companyId"
/>
<result
column=
"del_flag"
jdbcType=
"CHAR"
property=
"delFlag"
/>
<result
column=
"create_time"
jdbcType=
"DATE"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"DATE"
property=
"updateTime"
/>
<result
column=
"create_by_id"
jdbcType=
"BIGINT"
property=
"createById"
/>
<result
column=
"update_by_id"
jdbcType=
"BIGINT"
property=
"updateById"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, name, account_id, lecturer_name, source_code, mobile, avatar,
title, status, sort, site_id, company_id, del_flag, create_time, update_time, create_by_id,
update_by_id
</sql>
<select
id=
"getLecturerBeforeSort"
resultType=
"com.yizhi.application.domain.Lecturer"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM lecturer l WHERE l.del_flag = 0 AND l.site_id = #{siteId} AND l.sort
<
#{sort} ORDER BY l.sort DESC LIMIT
1
</select>
<select
id=
"getLecturerAfterSort"
resultType=
"com.yizhi.application.domain.Lecturer"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM lecturer l WHERE l.del_flag = 0 AND l.site_id = #{siteId} AND l.sort
>
#{sort} ORDER BY l.sort ASC LIMIT 1
</select>
<select
id=
"getLecturerBeforeSortList"
resultType=
"com.yizhi.application.domain.Lecturer"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM lecturer l WHERE l.del_flag = 0 AND l.site_id = #{siteId} AND l.sort
<
#{sort} ORDER BY l.sort DESC
</select>
<select
id=
"getLecturerList"
resultType=
"com.yizhi.lecturer.application.vo.LecturerListVO"
>
SELECT
l.id,
l.lecturer_name,
mobile,
l.title,
l.source_code sourceCode,
( SELECT COUNT( 1 ) FROM lecturer_relation WHERE lecturer_id = l.id AND del_flag = 0 ) count,
l.score,
l.grade,
l.`status`,
l.code,
lg.name gradeName
FROM
lecturer l
LEFT JOIN lecturer_relation lc ON (l.id = lc.lecturer_id AND lc.del_flag = 0)
LEFT JOIN ( SELECT * FROM lecturer_grade WHERE site_id = #{siteId} ) lg ON lg.sort = l.grade
WHERE
l.del_flag = 0 AND 1=1
<if
test=
"name!=null and name!=''"
>
AND l.lecturer_name LIKE concat('%',#{name},'%')
</if>
<if
test=
"mobile!=null and mobile!=''"
>
AND (l.mobile LIKE concat('%',#{mobile},'%'))
</if>
<if
test=
"sourceCode!=null and sourceCode!=''"
>
AND l.source_code = #{sourceCode}
</if>
<if
test=
"siteId!='' and siteId !=null"
>
and l.site_id = #{siteId}
</if>
group by l.id
order by l.update_time desc
</select>
<select
id=
"getLecturerVOById"
resultType=
"com.yizhi.lecturer.application.vo.LecturerVO"
>
SELECT DISTINCT
l.id,
l.NAME,
l.lecturer_name,
l.mobile,
l.avatar,
l.title,
l.source_code,
lr.personal_sign,
lr.resume,
`status`,
l.code,
l.grade,
l.score,
l.edu,
l.company_name,
l.signature
FROM
lecturer l
LEFT JOIN lecturer_relation lc ON l.id = lc.lecturer_id
LEFT JOIN lecturer_resume lr ON l.id = lr.lecturer_id
WHERE
l.id = #{id}
</select>
<select
id=
"exportLecturer"
resultType=
"com.yizhi.lecturer.application.vo.LecturerListVO"
>
SELECT
l.id,
l.lecturer_name lecturerName,
l.CODE,
l.mobile,
l.title,
l.edu,
l.company_name,
l.source_code sourceCode,
l.score,
l.grade,
lg.name gradeName,
l.create_time createTime,
l.`status`,
count(case when ltb.type = 1 then '' end) courseCount,
count(case when ltb.type = 2 then '' end) offlineCount,
count(case when ltb.type = 3 then '' end) trainingCount,
count( l.id ) count
FROM
lecturer l
LEFT JOIN lecturer_relation ltb ON l.id = ltb.lecturer_id
AND ltb.del_flag = 0
LEFT JOIN lecturer_grade lg ON lg.sort = l.grade
WHERE
l.del_flag =0
<if
test=
"siteId!='' and siteId !=null"
>
and l.site_id = #{siteId}
</if>
<if
test=
"keywords != '' and keywords != null"
>
AND l.`lecturer_name` like concat('%',#{keywords},'%')
</if>
<if
test=
"mobile != '' and mobile != null"
>
AND l.mobile LIKE concat('%',#{mobile},'%')
</if>
<if
test=
"sourceCode != '' and sourceCode != null"
>
AND l.source_code = #{sourceCode}
</if>
GROUP BY l.id
ORDER BY l.create_time DESC
</select>
<select
id=
"queryLecturerList"
resultType=
"com.yizhi.lecturer.application.vo.TemplateLecturerVO"
>
SELECT DISTINCT
l.id,
l.lecturer_name name,
l.avatar imgPath
FROM
lecturer l
LEFT JOIN lecturer_relation lc ON l.id = lc.lecturer_id
left join lecturer_keywords lk ON l.id = lk.lecturer_id
WHERE l.del_flag =0 and l.status = 1 and 1=1
<if
test=
"name!=null and name!=''"
>
AND (l.lecturer_name LIKE concat('%',#{name},'%') OR lk.keywords like concat('%', #{name}, '%'))
</if>
<if
test=
"siteId!='' and siteId !=null"
>
and site_id = #{siteId}
</if>
<if
test=
"ids != null and ids.size > 0"
>
and l.id not in
<foreach
collection=
"ids"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</if>
order by l.update_time desc
</select>
<select
id=
"getStuLecturerDetail"
resultType=
"com.yizhi.lecturer.application.vo.LecturerDetailVO"
>
SELECT
l.id,
l.`name` name,
l.avatar,
l.lecturer_name lecturerName,
l.mobile,
l.title,
l.source_code sourceCode,
l.score,
l.grade,
l.`status`,
l.code,l.edu,l.signature,
lg.name gradeName,lr.resume,li.template_no templateNo,li.company_name companyName
FROM
lecturer l
LEFT JOIN lecturer_grade lg ON lg.sort = l.grade AND lg.del_flag = 0
LEFT JOIN lecturer_resume lr ON lr.lecturer_id = l.id AND l.del_flag = 0
LEFT JOIN lecturer_info li ON li.site_id = l.site_id
WHERE
l.del_flag = 0
AND l.id = #{id} GROUP BY l.id
</select>
<select
id=
"selectLecturerList"
resultType=
"com.yizhi.lecturer.application.vo.LecturerApiVo"
>
SELECT
DISTINCT l.id,
l.account_id accountId,
l.`name`,
l.lecturer_name lecturerName,
l.source_code sourse,
l.title,
l.avatar,
l.`status`,
l.company_id companyId,
l.site_id siteId
FROM
lecturer l
LEFT JOIN tr_lecturer_classification lc ON l.id = lc.lecturer_id
WHERE
l.del_flag = 0
AND l.`status` = 1
<if
test=
"companyId != null and companyId != ''"
>
AND l.company_id = #{companyId}
</if>
<if
test=
"siteId!='' and siteId !=null"
>
AND l.site_id = #{siteId}
</if>
<if
test=
"ids != null and ids.size > 0"
>
AND lc.classification_id IN
<foreach
collection=
"ids"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
cloud-lecturer/src/main/resources/mapper/LecturerRelationMapper.xml
0 → 100644
View file @
cd48104d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yizhi.application.mapper.LecturerRelationMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yizhi.application.domain.LecturerRelation"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"lecturer_id"
jdbcType=
"BIGINT"
property=
"lecturerId"
/>
<result
column=
"relation_id"
jdbcType=
"BIGINT"
property=
"relationId"
/>
<result
column=
"relation_name"
jdbcType=
"VARCHAR"
property=
"relationName"
/>
<result
column=
"type"
jdbcType=
"BIT"
property=
"type"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, lecturer_id, relation_id, relation_name, type, create_time, update_time, del_flag
</sql>
<select
id=
"getRelationListByLecturerId"
resultType=
"com.yizhi.lecturer.application.vo.RelationVOList"
>
SELECT
lr.relation_id relationId,
lr.relation_name,
lr.type
FROM
lecturer_relation lr
WHERE
lr.lecturer_id = #{id}
AND lr.del_flag = 0
</select>
</mapper>
\ No newline at end of file
pom.xml
0 → 100644
View file @
cd48104d
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
com.yizhi
</groupId>
<artifactId>
wmy-parent
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<groupId>
com.yizhi
</groupId>
<artifactId>
lecturer
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<modules>
<module>
cloud-lecturer-api
</module>
<module>
cloud-lecturer
</module>
</modules>
<name>
lecturer
</name>
<description>
讲师库系统
</description>
<packaging>
pom
</packaging>
<repositories>
<repository>
<id>
wmy4.0
</id>
<url>
http://mvn.km365.pw/nexus/content/groups/wmy4.0-group/
</url>
<releases>
<enabled>
true
</enabled>
</releases>
<snapshots>
<enabled>
true
</enabled>
<updatePolicy>
always
</updatePolicy>
</snapshots>
</repository>
</repositories>
</project>
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