Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 213718a9
authored
Feb 22, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时上个版本 联调中
1 parent
04198fa7
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
18 deletions
src/main/java/com/subsidy/controller/ClassDictController.java
src/main/java/com/subsidy/controller/SignInRecordController.java
src/main/java/com/subsidy/dto/sign/DataViewDTO.java
src/main/java/com/subsidy/model/ClassDictDO.java
src/main/java/com/subsidy/service/ClassDictService.java
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java
src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java
src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java
src/main/resources/mapper/ClassDictMapper.xml
src/main/java/com/subsidy/controller/ClassDictController.java
View file @
213718a
...
...
@@ -38,7 +38,7 @@ public class ClassDictController {
@PostMapping
(
"getAllClasses"
)
@ApiOperation
(
"获取某公司下的所有班级 companyId 所选企业id className 班级名称 openStatus 开放状态 startDate 开始时间 endDate 结束时间"
)
@LoginRequired
(
value
=
{
ConstantUtils
.
ADMINISTER_TERMINATE
})
public
ResponseVO
getAllClasses
(
@RequestBody
ClassDictDO
classDictDO
){
public
ResponseVO
getAllClasses
(
@RequestBody
ClassDictDO
classDictDO
)
throws
Exception
{
return
ResponseData
.
generateCreatedResponse
(
0
,
classDictService
.
getAllClasses
(
classDictDO
));
}
...
...
@@ -50,14 +50,14 @@ public class ClassDictController {
}
@PostMapping
(
"addClass"
)
@ApiOperation
(
"添加班级 userId:登录人id companyId courseId classType className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进 memberIds [] 班级学员 classNoticeDOS[noticeType noticeTime]"
)
@ApiOperation
(
"添加班级 userId:登录人id companyId courseId classType
Id
className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进 memberIds [] 班级学员 classNoticeDOS[noticeType noticeTime]"
)
@LoginRequired
(
value
=
{
ConstantUtils
.
ADMINISTER_TERMINATE
})
public
ResponseVO
addClass
(
@RequestBody
AddClassDTO
addClassDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
classDictService
.
addClass
(
addClassDTO
));
}
@PostMapping
(
"updateClass"
)
@ApiOperation
(
"修改班级 id companyId c
ourseId className
startDate endDate"
)
@ApiOperation
(
"修改班级 id companyId c
lassName classTypeId
startDate endDate"
)
@LoginRequired
(
value
=
{
ConstantUtils
.
ADMINISTER_TERMINATE
})
public
ResponseVO
updateClass
(
@RequestBody
ClassDictDO
classDictDO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
classDictService
.
updateClass
(
classDictDO
));
...
...
src/main/java/com/subsidy/controller/SignInRecordController.java
View file @
213718a
...
...
@@ -46,7 +46,7 @@ public class SignInRecordController {
}
@PostMapping
(
"dataView"
)
@ApiOperation
(
"数据概览 id 校区id className
courseName
pageSize pageNum"
)
@ApiOperation
(
"数据概览 id 校区id className pageSize pageNum"
)
@LoginRequired
(
value
=
{
ConstantUtils
.
ADMINISTER_TERMINATE
})
public
ResponseVO
dataView
(
@RequestBody
DataViewDTO
classSignInfoDTO
)
{
return
ResponseData
.
generateCreatedResponse
(
0
,
signInRecordService
.
dataView
(
classSignInfoDTO
));
...
...
src/main/java/com/subsidy/dto/sign/DataViewDTO.java
View file @
213718a
...
...
@@ -14,6 +14,6 @@ public class DataViewDTO {
private
Integer
pageNum
;
private
Integer
companyI
d
;
private
Integer
i
d
;
}
src/main/java/com/subsidy/model/ClassDictDO.java
View file @
213718a
...
...
@@ -68,10 +68,10 @@ public class ClassDictDO extends BaseModel {
*/
private
Integer
isFastPlay
;
/**
* 班级状态
*/
private
String
openStatus
;
/
//
**
//
* 班级状态
//
*/
//
private String openStatus;
/**
* 测试规则
...
...
src/main/java/com/subsidy/service/ClassDictService.java
View file @
213718a
...
...
@@ -22,7 +22,7 @@ import java.util.List;
*/
public
interface
ClassDictService
extends
IService
<
ClassDictDO
>
{
List
<
GetAllClassesVO
>
getAllClasses
(
ClassDictDO
classDictDO
);
List
<
GetAllClassesVO
>
getAllClasses
(
ClassDictDO
classDictDO
)
throws
Exception
;
String
deleteClasses
(
ClassDictDO
classDictDO
);
...
...
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
View file @
213718a
...
...
@@ -35,6 +35,8 @@ import org.springframework.scheduling.annotation.Async;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -69,8 +71,21 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
@Autowired
private
QuartzUtil
quartzUtil
;
public
List
<
GetAllClassesVO
>
getAllClasses
(
ClassDictDO
classDictDO
)
{
return
this
.
baseMapper
.
getAllClasses
(
classDictDO
);
public
List
<
GetAllClassesVO
>
getAllClasses
(
ClassDictDO
classDictDO
)
throws
Exception
{
DateFormat
fmt
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
List
<
GetAllClassesVO
>
getAllClassesVOS
=
this
.
baseMapper
.
getAllClasses
(
classDictDO
);
for
(
GetAllClassesVO
getAllClassesVO
:
getAllClassesVOS
){
if
(
new
Date
().
before
(
fmt
.
parse
(
getAllClassesVO
.
getStartDate
()))){
getAllClassesVO
.
setOpenStatus
(
"1"
);
//待开始
}
else
if
(
new
Date
().
after
(
fmt
.
parse
(
getAllClassesVO
.
getEndDate
()))){
getAllClassesVO
.
setOpenStatus
(
"2"
);
}
else
{
getAllClassesVO
.
setOpenStatus
(
"0"
);
}
}
return
getAllClassesVOS
;
}
@Transactional
...
...
src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java
View file @
213718a
...
...
@@ -118,7 +118,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
Page
pager
=
new
Page
(
classSignInfoDTO
.
getPageNum
(),
classSignInfoDTO
.
getPageSize
());
IPage
<
DataViewVO
>
classSignInfoVOIPage
=
this
.
baseMapper
.
classSignInfo
(
pager
,
classSignInfoDTO
.
getClassName
(),
classSignInfoDTO
.
getCourseName
(),
classSignInfoDTO
.
get
Company
Id
());
IPage
<
DataViewVO
>
classSignInfoVOIPage
=
this
.
baseMapper
.
classSignInfo
(
pager
,
classSignInfoDTO
.
getClassName
(),
classSignInfoDTO
.
getCourseName
(),
classSignInfoDTO
.
getId
());
List
<
DataViewVO
>
dataViewVOS
=
classSignInfoVOIPage
.
getRecords
();
for
(
DataViewVO
dataViewVO
:
dataViewVOS
)
{
...
...
src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java
View file @
213718a
...
...
@@ -23,5 +23,6 @@ public class GetAllClassesVO {
private
String
openStatus
;
private
Long
classTypeId
;
}
src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java
View file @
213718a
...
...
@@ -11,8 +11,14 @@ public class GetClassBaseInfoVO {
private
Integer
count
;
private
String
className
;
private
String
startDate
;
private
String
endDate
;
private
Long
courseId
;
private
Long
classTypeId
;
}
src/main/resources/mapper/ClassDictMapper.xml
View file @
213718a
...
...
@@ -32,7 +32,7 @@
t.end_date,
t4.cnt,
t5.class_type,
t
.open_status
t
5.id as class_type_id
FROM
class_dict t
left join class_type_dict t5 on t.class_type_id = t5.id
...
...
@@ -51,9 +51,6 @@
and t.end_date >= DATE_FORMAT( #{startDate}, '%Y-%m-%d' )
and t.start_date
<
DATE_FORMAT( #{endDate}, '%Y-%m-%d' )
</if>
<if
test=
"openStatus != null and openStatus != ''"
>
and t.open_status = #{openStatus}
</if>
order by t.create_date desc
</select>
...
...
@@ -130,10 +127,13 @@
<select
id=
"getClassBaseInfo"
parameterType=
"long"
resultType=
"com.subsidy.vo.classdict.GetClassBaseInfoVO"
>
SELECT
t3.class_type,
t.class_name,
t2.course_name,
t.start_date,
t.end_date,
ifnull( t4.cnt, 0 ) AS cnt
ifnull( t4.cnt, 0 ) AS count,
t2.id as courseId,
t3.id as classTypeId
FROM
class_dict t
LEFT JOIN course_dict t2 ON t.course_id = t2.id
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment