From 213718a9f423944cd5a2b21945557665e0cbf771 Mon Sep 17 00:00:00 2001 From: Administrator Date: Tue, 22 Feb 2022 13:36:42 +0800 Subject: [PATCH] 临时上个版本 联调中 --- src/main/java/com/subsidy/controller/ClassDictController.java | 6 +++--- src/main/java/com/subsidy/controller/SignInRecordController.java | 2 +- src/main/java/com/subsidy/dto/sign/DataViewDTO.java | 2 +- src/main/java/com/subsidy/model/ClassDictDO.java | 8 ++++---- src/main/java/com/subsidy/service/ClassDictService.java | 2 +- src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java | 19 +++++++++++++++++-- src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java | 2 +- src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java | 1 + src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java | 6 ++++++ src/main/resources/mapper/ClassDictMapper.xml | 10 +++++----- 10 files changed, 40 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/subsidy/controller/ClassDictController.java b/src/main/java/com/subsidy/controller/ClassDictController.java index 2d99aa4..143848a 100644 --- a/src/main/java/com/subsidy/controller/ClassDictController.java +++ b/src/main/java/com/subsidy/controller/ClassDictController.java @@ -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 classTypeId 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 courseId className startDate endDate") + @ApiOperation("修改班级 id companyId className classTypeId startDate endDate") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO updateClass(@RequestBody ClassDictDO classDictDO){ return ResponseData.generateCreatedResponse(0,classDictService.updateClass(classDictDO)); diff --git a/src/main/java/com/subsidy/controller/SignInRecordController.java b/src/main/java/com/subsidy/controller/SignInRecordController.java index d904899..f20654a 100644 --- a/src/main/java/com/subsidy/controller/SignInRecordController.java +++ b/src/main/java/com/subsidy/controller/SignInRecordController.java @@ -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)); diff --git a/src/main/java/com/subsidy/dto/sign/DataViewDTO.java b/src/main/java/com/subsidy/dto/sign/DataViewDTO.java index d12b31d..2f6feea 100644 --- a/src/main/java/com/subsidy/dto/sign/DataViewDTO.java +++ b/src/main/java/com/subsidy/dto/sign/DataViewDTO.java @@ -14,6 +14,6 @@ public class DataViewDTO { private Integer pageNum; - private Integer companyId; + private Integer id; } diff --git a/src/main/java/com/subsidy/model/ClassDictDO.java b/src/main/java/com/subsidy/model/ClassDictDO.java index 1f82aa6..512ff4c 100644 --- a/src/main/java/com/subsidy/model/ClassDictDO.java +++ b/src/main/java/com/subsidy/model/ClassDictDO.java @@ -68,10 +68,10 @@ public class ClassDictDO extends BaseModel { */ private Integer isFastPlay; - /** - * 班级状态 - */ - private String openStatus; + ///** + // * 班级状态 + // */ + //private String openStatus; /** * 测试规则 diff --git a/src/main/java/com/subsidy/service/ClassDictService.java b/src/main/java/com/subsidy/service/ClassDictService.java index 8eae7fe..7c93c14 100644 --- a/src/main/java/com/subsidy/service/ClassDictService.java +++ b/src/main/java/com/subsidy/service/ClassDictService.java @@ -22,7 +22,7 @@ import java.util.List; */ public interface ClassDictService extends IService { - List getAllClasses(ClassDictDO classDictDO); + List getAllClasses(ClassDictDO classDictDO)throws Exception; String deleteClasses(ClassDictDO classDictDO); diff --git a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java index 105329d..c0b9405 100644 --- a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java @@ -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 getAllClasses(ClassDictDO classDictDO) { - return this.baseMapper.getAllClasses(classDictDO); + public List getAllClasses(ClassDictDO classDictDO) throws Exception{ + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); + + List 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 diff --git a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java index b53d095..6c1aba2 100644 --- a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -118,7 +118,7 @@ public class SignInRecordServiceImpl extends ServiceImpl classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(), classSignInfoDTO.getCompanyId()); + IPage classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(), classSignInfoDTO.getId()); List dataViewVOS = classSignInfoVOIPage.getRecords(); for (DataViewVO dataViewVO : dataViewVOS) { diff --git a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java index a151b2e..ed22a59 100644 --- a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java +++ b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java @@ -23,5 +23,6 @@ public class GetAllClassesVO { private String openStatus; + private Long classTypeId; } diff --git a/src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java b/src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java index fc659d7..14b0642 100644 --- a/src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java +++ b/src/main/java/com/subsidy/vo/classdict/GetClassBaseInfoVO.java @@ -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; + } diff --git a/src/main/resources/mapper/ClassDictMapper.xml b/src/main/resources/mapper/ClassDictMapper.xml index 88df559..f50fdbe 100644 --- a/src/main/resources/mapper/ClassDictMapper.xml +++ b/src/main/resources/mapper/ClassDictMapper.xml @@ -32,7 +32,7 @@ t.end_date, t4.cnt, t5.class_type, - t.open_status + t5.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' ) - - and t.open_status = #{openStatus} - order by t.create_date desc @@ -130,10 +127,13 @@