diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index d13e30b..37d0b3d 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -95,7 +95,7 @@ public class AdministerController { @PostMapping("classDetail") @ApiOperation("班级管理--班级成员 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO classDetail(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.classDetail(classDetailDTO)); } @@ -198,7 +198,7 @@ public class AdministerController { @PostMapping("exportZip") @ApiOperation("下载压缩包 id 班级id") @CrossOrigin - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ administerService.export(classDetailDTO); } diff --git a/src/main/java/com/subsidy/controller/ClassDictController.java b/src/main/java/com/subsidy/controller/ClassDictController.java index 20edd88..3124ce7 100644 --- a/src/main/java/com/subsidy/controller/ClassDictController.java +++ b/src/main/java/com/subsidy/controller/ClassDictController.java @@ -66,7 +66,7 @@ public class ClassDictController { @PostMapping("classDetail") @ApiOperation("获取一个班级详情 id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO classDetail(@RequestBody ClassDictDO classDictDO){ return ResponseData.generateCreatedResponse(0,classDictService.classDetail(classDictDO)); } diff --git a/src/main/java/com/subsidy/controller/ClassNoticeController.java b/src/main/java/com/subsidy/controller/ClassNoticeController.java index 1e7540f..b69d979 100644 --- a/src/main/java/com/subsidy/controller/ClassNoticeController.java +++ b/src/main/java/com/subsidy/controller/ClassNoticeController.java @@ -50,7 +50,7 @@ public class ClassNoticeController { } @PostMapping("queryClassNotices") - @ApiOperation("查看某个课程的通知提醒 classId 课程id status 状态(待发送/已发送)") + @ApiOperation("查看某个课程的通知提醒 classId 课程id noticeType 状态(待发送/已发送)") public ResponseVO queryClassNotices(@RequestBody ClassNoticeDO classNoticeDO){ return ResponseData.generateCreatedResponse(0,classNoticeService.queryClassNotices(classNoticeDO)); } diff --git a/src/main/java/com/subsidy/controller/CourseDictController.java b/src/main/java/com/subsidy/controller/CourseDictController.java index e40b22b..f2d7671 100644 --- a/src/main/java/com/subsidy/controller/CourseDictController.java +++ b/src/main/java/com/subsidy/controller/CourseDictController.java @@ -50,7 +50,7 @@ public class CourseDictController { @PostMapping("queryCourses") @ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId rankId courseType openStatus") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){ return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO)); } diff --git a/src/main/java/com/subsidy/jobs/CourseNotificationJob.java b/src/main/java/com/subsidy/jobs/CourseNotificationJob.java index d4b2a30..3771ed1 100644 --- a/src/main/java/com/subsidy/jobs/CourseNotificationJob.java +++ b/src/main/java/com/subsidy/jobs/CourseNotificationJob.java @@ -67,7 +67,7 @@ public class CourseNotificationJob implements Job { } ClassNoticeDO classNotice = new ClassNoticeDO(); classNotice.setId(classNoticeDO.getId()); - classNotice.setStatus(CourseNotification.SENT); + //classNotice.setStatus(CourseNotification.SENT); classNoticeMapper.updateById(classNotice); } } diff --git a/src/main/java/com/subsidy/model/ClassNoticeDO.java b/src/main/java/com/subsidy/model/ClassNoticeDO.java index 8f48268..db2c169 100644 --- a/src/main/java/com/subsidy/model/ClassNoticeDO.java +++ b/src/main/java/com/subsidy/model/ClassNoticeDO.java @@ -41,9 +41,5 @@ public class ClassNoticeDO extends BaseModel { */ private String noticeTime; - /** - * 发送状态 - */ - private String status; } diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index 22c7b1b..6b10d9a 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -25,6 +25,7 @@ import com.subsidy.mapper.FieldDictMapper; import com.subsidy.mapper.MemberDepartmentMappingMapper; import com.subsidy.mapper.MemberMapper; import com.subsidy.mapper.OprAdmDictMapper; +import com.subsidy.mapper.PaperDictMapper; import com.subsidy.mapper.RoleAdministerMappingMapper; import com.subsidy.mapper.SignInRecordMapper; import com.subsidy.mapper.VodDictMapper; @@ -41,6 +42,7 @@ import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDepartmentMappingDO; import com.subsidy.model.OprAdmDictDO; +import com.subsidy.model.PaperDictDO; import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.model.SignInRecordDO; import com.subsidy.model.VodDictDO; @@ -187,6 +189,9 @@ public class AdministerServiceImpl extends ServiceImpl() - .lambda() - .eq(AdministerDO::getAccountName, administerDO.getAccountName())); - //redisUtil.set(RedisPrefixConstant.SUBSIDY_ADMINISTER_PREFIX + administerDO.getAccountName(), administerDO1); + /** + * 查表,并将数据写入到redis + */ + AdministerDO administerDO1 = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(AdministerDO::getAccountName, administerDO.getAccountName())); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_ADMINISTER_PREFIX + administerDO.getAccountName(), administerDO1); //} if (null == administerDO1) { @@ -322,7 +327,7 @@ public class AdministerServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); - IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), null,0); + IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), null, 0); List operatorsVOS = operatorsVOIPage.getRecords(); for (OperatorsVO operatorsVO : operatorsVOS) { @@ -421,7 +426,7 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } @@ -472,7 +477,7 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } @@ -512,9 +517,9 @@ public class AdministerServiceImpl extends ServiceImpl() - .lambda() - .eq(SignInRecordDO::getClassId,classDetailDTO.getId()) - .eq(SignInRecordDO::getMemberId,classDetailVO.getId())); + .lambda() + .eq(SignInRecordDO::getClassId, classDetailDTO.getId()) + .eq(SignInRecordDO::getMemberId, classDetailVO.getId())); classDetailVO.setSignCounts(set); @@ -543,7 +548,7 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } @@ -592,8 +597,8 @@ public class AdministerServiceImpl extends ServiceImpl() .lambda() - .eq(SignInRecordDO::getClassId,classDetailDTO.getId()) - .eq(SignInRecordDO::getMemberId,classDetailVO.getId())); + .eq(SignInRecordDO::getClassId, classDetailDTO.getId()) + .eq(SignInRecordDO::getMemberId, classDetailVO.getId())); classDetailVO.setSignCounts(set); @@ -624,7 +629,7 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } @@ -645,9 +650,9 @@ public class AdministerServiceImpl extends ServiceImpl set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() .lambda() - .eq(SignInRecordDO::getClassId,classDetailDTO.getId()) - .eq(SignInRecordDO::getMemberId,classSignVO.getId()) - .orderByAsc(SignInRecordDO::getSignInDate)); + .eq(SignInRecordDO::getClassId, classDetailDTO.getId()) + .eq(SignInRecordDO::getMemberId, classSignVO.getId()) + .orderByAsc(SignInRecordDO::getSignInDate)); classSignVO.setSignCounts(signInRecordDOS.size()); StringBuilder stringBuilder = new StringBuilder(); @@ -655,7 +660,7 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } @@ -702,8 +707,8 @@ public class AdministerServiceImpl extends ServiceImpl set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() .lambda() - .eq(SignInRecordDO::getClassId,classDetailDTO.getId()) - .eq(SignInRecordDO::getMemberId,classSignVO.getId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId()) + .eq(SignInRecordDO::getMemberId, classSignVO.getId()) .orderByAsc(SignInRecordDO::getSignInDate)); classSignVO.setSignCounts(signInRecordDOS.size()); @@ -715,7 +720,7 @@ public class AdministerServiceImpl extends ServiceImpl exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper() + //查看这个班级的课程下有几个试卷 + + //通过班级找课程 + ClassDictDO classDictDO1 = classDictMapper.selectById(classDetailDTO.getId()); + //通过课程id去找这个课程有几套卷子 + List paperDictDOS = paperDictMapper.selectList(new QueryWrapper() .lambda() - .eq(ExerciseDoneResultDO::getClassId,classDetailDTO.getId())); + .eq(PaperDictDO::getCourseId, classDictDO1.getCourseId())); - for (int i = 0 ; i < exerciseDoneResultDOS.size();i++){ + for (int i = 0 ; i < paperDictDOS.size() ; i ++){ ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); classDetailDTO.setFlag(false); - classDetailDTO.setPaperId(exerciseDoneResultDOS.get(i).getPaperId()); + classDetailDTO.setPaperId(paperDictDOS.get(i).getId()); List exerciseTestVOS = exportExerciseTest(classDetailDTO); testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2); - compressFileToZipStream(zipOutputStream, baos2, "test"+i+".xlsx"); + compressFileToZipStream(zipOutputStream, baos2, "test" + i + ".xlsx"); } - - /** * 答疑记录 */ @@ -1317,7 +1324,7 @@ public class AdministerServiceImpl extends ServiceImpl params = new HashMap<>(); params.put("classId", classNoticeDO.getClassId()); diff --git a/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java index a16fa8f..3543fb6 100644 --- a/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java @@ -87,10 +87,14 @@ public class ClassHourDictServiceImpl extends ServiceImpl() + .lambda() + .eq(ClassHourDictDO::getCompanyId,getSettingVO.getCompanyId())); + String[] nullParams = MyBeanUtils.getNullPropertyNames(getSettingVO); + BeanUtils.copyProperties(getSettingVO,classHourDictDO1,nullParams); + this.baseMapper.updateById(classHourDictDO1); if (getSettingVO.getRotationImgDictDOS().size()>0){ List rotationImgDictDOS = getSettingVO.getRotationImgDictDOS(); diff --git a/src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java index 5959c56..d8bbb62 100644 --- a/src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java @@ -22,6 +22,7 @@ import com.subsidy.vo.classdict.ClassAndCompanyInfoVO; 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.HashMap; import java.util.List; @@ -50,19 +51,18 @@ public class ClassNoticeServiceImpl extends ServiceImpl params = new HashMap<>(); params.put("classId", classNoticeDO.getClassId()); params.put("id", classNoticeDO.getId()); - String name = classDictDO.getClassName()+"-"+classNoticeDO.getNoticeType()+"-"+classNoticeDO.getNoticeTime(); - quartzUtil.addSimpleJob(CourseNotificationJob.class,DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH:mm:ss") , params, name, "CourseNotificationJob"); + String name = classDictDO.getClassName() + "-" + classNoticeDO.getNoticeType() + "-" + classNoticeDO.getNoticeTime(); + quartzUtil.addSimpleJob(CourseNotificationJob.class, DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH:mm:ss"), params, name, "CourseNotificationJob"); return ConstantUtils.ADD_SUCCESS; } @@ -78,41 +78,41 @@ public class ClassNoticeServiceImpl extends ServiceImpl queryClassNotices(ClassNoticeDO classNoticeDO){ + public List queryClassNotices(ClassNoticeDO classNoticeDO) { return this.baseMapper.selectList(new QueryWrapper() - .lambda() - .eq(ClassNoticeDO::getStatus, classNoticeDO.getStatus()) - .eq(ClassNoticeDO::getClassId,classNoticeDO.getClassId())); + .lambda() + .eq(ClassNoticeDO::getNoticeType, classNoticeDO.getNoticeType()) + .eq(ClassNoticeDO::getClassId, classNoticeDO.getClassId())); } @Override public void sendNotification(SendNotificationDTO sendNotificationDTO) { ClassAndCompanyInfoVO cmInfo = classDictMapper.getClassAndCompanyInfoVO(sendNotificationDTO.getClassId()); - if(sendNotificationDTO.getSendType().equals(SmsCode.ALL.getType())) { - String params = "{\"company\":\""+ cmInfo.getCompany() +"\", \"course\":\""+ cmInfo.getCourseName() +"\", \"startDate\": \""+ cmInfo.getStartDate()+"\", \"endDate\": \""+ cmInfo.getEndDate()+"\"}"; + if (sendNotificationDTO.getSendType().equals(SmsCode.ALL.getType())) { + String params = "{\"company\":\"" + cmInfo.getCompany() + "\", \"course\":\"" + cmInfo.getCourseName() + "\", \"startDate\": \"" + cmInfo.getStartDate() + "\", \"endDate\": \"" + cmInfo.getEndDate() + "\"}"; List list = memberMapper.getMemberList(sendNotificationDTO.getClassId()); - if(list != null) { + if (list != null) { for (MemberDO memberDO : list) { SMSUtils.sendNoticeSMS(SmsCode.ALL.getCode(), memberDO.getTelephone(), params); } } - } else if(sendNotificationDTO.getSendType().equals(SmsCode.NOT_SIGNED_IN.getType())) { - String params = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}"; + } else if (sendNotificationDTO.getSendType().equals(SmsCode.NOT_SIGNED_IN.getType())) { + String params = "{ \"name\": \"" + cmInfo.getName() + "\", \"course\":\"" + cmInfo.getCourseName() + "\"}"; List list = memberMapper.getMemberListBySignInRecord(sendNotificationDTO.getClassId()); - if(list != null) { + if (list != null) { for (MemberDO memberDO : list) { SMSUtils.sendNoticeSMS(SmsCode.NOT_SIGNED_IN.getCode(), memberDO.getTelephone(), params); } } - } else if(sendNotificationDTO.getSendType().equals(SmsCode.UNFINISHED.getType())) { - String params = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}"; + } else if (sendNotificationDTO.getSendType().equals(SmsCode.UNFINISHED.getType())) { + String params = "{ \"name\": \"" + cmInfo.getName() + "\", \"course\":\"" + cmInfo.getCourseName() + "\"}"; List list = memberMapper.getUnfinishedMemberList(sendNotificationDTO.getClassId()); - if(list != null) { + if (list != null) { for (MemberDO memberDO : list) { SMSUtils.sendNoticeSMS(SmsCode.UNFINISHED.getCode(), memberDO.getTelephone(), params); } diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java index 8e6f367..465fc8c 100644 --- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -687,7 +687,7 @@ public class MemberServiceImpl extends ServiceImpl imple for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { List vodDictDOS = classDictMapper.getClassVods(classMemberMappingDO.getClassId()); for (VodDictDO vodDictDO : vodDictDOS) { - int playLength = vodPlayHistoryMapper.memberVodTotalLength(memberDO.getId(), vodDictDO.getId(), classMemberMappingDO.getClassId()); + int playLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getClassId(),memberDO.getId(), vodDictDO.getId()); if (playLength < vodDictDO.getVodLength()) { break; } diff --git a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java index 52c75e9..10bfbaa 100644 --- a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -158,7 +158,7 @@ public class SignInRecordServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } diff --git a/src/main/java/com/subsidy/util/excel/ExcelUtil.java b/src/main/java/com/subsidy/util/excel/ExcelUtil.java index 1e7c63d..33855ed 100644 --- a/src/main/java/com/subsidy/util/excel/ExcelUtil.java +++ b/src/main/java/com/subsidy/util/excel/ExcelUtil.java @@ -466,7 +466,7 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress21); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 10); + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 11); sheet.addMergedRegion(cellRangeAddress22); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 @@ -482,7 +482,7 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress31); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 10); + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 11); sheet.addMergedRegion(cellRangeAddress32); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 thirdRow.createCell(0).setCellValue(thirdHead[0]); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a62a220..37ce64a 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ # 环境配置 -spring.profiles.active=dev +spring.profiles.active=prod # 端口号 -spring.server.port=23457 +spring.server.port=23459 #嵌入tomcat配置 #和CPU数 spring.server.acceptorThreadCount=600