diff --git a/pom.xml b/pom.xml index 6e083c4..03da5bf 100644 --- a/pom.xml +++ b/pom.xml @@ -55,6 +55,13 @@ + com.belerweb + pinyin4j + 2.5.1 + + + + com.tencentcloudapi tencentcloud-sdk-java 3.1.64 diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index 439e1a5..66d69d2 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -84,7 +84,7 @@ public class AdministerController { @PostMapping("classSummary") @ApiOperation("课程汇总 id 班级id ") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.classSummary(classDetailDTO)); } @@ -98,7 +98,7 @@ public class AdministerController { @PostMapping("exportClassDetail") @ApiOperation("班级管理--班级成员--导出 id 班级id userName") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ classDetailDTO.setFlag(true); administerService.exportClassDetail(classDetailDTO); diff --git a/src/main/java/com/subsidy/controller/ClassDictController.java b/src/main/java/com/subsidy/controller/ClassDictController.java index 48ed80d..ba15b88 100644 --- a/src/main/java/com/subsidy/controller/ClassDictController.java +++ b/src/main/java/com/subsidy/controller/ClassDictController.java @@ -4,11 +4,13 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.classDict.AddClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO; import com.subsidy.dto.classDict.GetAllClassesDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.model.CourseDictDO; import com.subsidy.service.ClassDictService; import com.subsidy.util.ConstantUtils; import io.swagger.annotations.ApiOperation; @@ -51,10 +53,10 @@ public class ClassDictController { } @PostMapping("addClass") - @ApiOperation("添加课程 ** companyId courseId className startDate endDate") + @ApiOperation("添加课程 ** userId:登录人id companyId courseId className startDate endDate") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) - public ResponseVO addClass(@RequestBody ClassDictDO classDictDO){ - return ResponseData.generateCreatedResponse(0,classDictService.addClass(classDictDO)); + public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){ + return ResponseData.generateCreatedResponse(0,classDictService.addClass(addClassDTO)); } @PostMapping("updateClass") @@ -80,7 +82,7 @@ public class ClassDictController { @PostMapping("getSpareMembers") @ApiOperation("获取不在某班级的某企业里所有成员 ** companyId 企业id classId 班级id") - @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO getSpareMembers(@RequestBody GetSpareMembersDTO getSpareMembersDTO){ return ResponseData.generateCreatedResponse(0,classDictService.getSpareMembers(getSpareMembersDTO)); } @@ -93,4 +95,11 @@ public class ClassDictController { } + @PostMapping("batchSms") + @ApiOperation("批量发送班级短信 {id 班级id}") + public ResponseVO batchSms(@RequestBody ClassDictDO classDictDO){ + return ResponseData.generateCreatedResponse(0,classDictService.batchSms(classDictDO)); + } + + } diff --git a/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java b/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java new file mode 100644 index 0000000..4736d2c --- /dev/null +++ b/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java @@ -0,0 +1,11 @@ +package com.subsidy.dto.classDict; + +import com.subsidy.model.ClassDictDO; +import lombok.Data; + +@Data +public class AddClassDTO extends ClassDictDO { + + private Long userId; + +} diff --git a/src/main/java/com/subsidy/mapper/ClassDictMapper.java b/src/main/java/com/subsidy/mapper/ClassDictMapper.java index bf30e6f..7058b5a 100644 --- a/src/main/java/com/subsidy/mapper/ClassDictMapper.java +++ b/src/main/java/com/subsidy/mapper/ClassDictMapper.java @@ -38,5 +38,9 @@ public interface ClassDictMapper extends BaseMapper { */ List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO); + /** + * 查询班级里的学生信息 + */ + List classMembers(Long classId); } diff --git a/src/main/java/com/subsidy/mapper/CourseDictMapper.java b/src/main/java/com/subsidy/mapper/CourseDictMapper.java index 0aa8478..750b60f 100644 --- a/src/main/java/com/subsidy/mapper/CourseDictMapper.java +++ b/src/main/java/com/subsidy/mapper/CourseDictMapper.java @@ -45,4 +45,5 @@ public interface CourseDictMapper extends BaseMapper { */ IPage queryCompanyCourse(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId); + } diff --git a/src/main/java/com/subsidy/model/ClassDictDO.java b/src/main/java/com/subsidy/model/ClassDictDO.java index a89a813..ec59e43 100644 --- a/src/main/java/com/subsidy/model/ClassDictDO.java +++ b/src/main/java/com/subsidy/model/ClassDictDO.java @@ -39,6 +39,11 @@ public class ClassDictDO extends BaseModel { private String className; /** + * 班级类型 + */ + private String classType; + + /** * 课程id */ private Long courseId; diff --git a/src/main/java/com/subsidy/service/ClassDictService.java b/src/main/java/com/subsidy/service/ClassDictService.java index 7719ead..ca6f06b 100644 --- a/src/main/java/com/subsidy/service/ClassDictService.java +++ b/src/main/java/com/subsidy/service/ClassDictService.java @@ -1,11 +1,13 @@ package com.subsidy.service; +import com.subsidy.dto.classDict.AddClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO; import com.subsidy.dto.classDict.GetAllClassesDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.model.ClassDictDO; import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.model.CourseDictDO; import com.subsidy.model.MemberDO; import com.subsidy.vo.classdict.GetAllClassesVO; @@ -25,7 +27,7 @@ public interface ClassDictService extends IService { String deleteClasses(ClassDictDO classDictDO); - String addClass(ClassDictDO classDictDO); + String addClass(AddClassDTO addClassDTO); String updateClass(ClassDictDO classDictDO); @@ -37,4 +39,5 @@ public interface ClassDictService extends IService { String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO); + String batchSms(ClassDictDO classDictDO); } diff --git a/src/main/java/com/subsidy/service/CourseDictService.java b/src/main/java/com/subsidy/service/CourseDictService.java index 59f9db7..c345b91 100644 --- a/src/main/java/com/subsidy/service/CourseDictService.java +++ b/src/main/java/com/subsidy/service/CourseDictService.java @@ -24,4 +24,5 @@ public interface CourseDictService extends IService { String updateCourses(CourseDictDO courseDictDO); IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO); + } diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index 175458b..93e60ca 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -18,6 +18,11 @@ import com.subsidy.vo.administer.*; import com.subsidy.vo.classdict.ClassDetailVO; import com.subsidy.vo.member.ClassSignVO; import com.subsidy.vo.sign.AnswerRecordVO; +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.util.CellRangeAddress; @@ -38,6 +43,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.*; +import java.lang.reflect.Member; import java.math.BigDecimal; import java.util.*; import java.util.zip.ZipEntry; @@ -233,7 +239,7 @@ public class AdministerServiceImpl extends ServiceImpl vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() .lambda() - .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getId()) + .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId()) .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) .orderByDesc(VodPlayHistoryDO::getPlayRecord)); @@ -242,13 +248,13 @@ public class AdministerServiceImpl extends ServiceImpl 0) { - if (vodPlayHistoryDOS.get(0).getPlayRecord() < vodDictDO.getVodLength() * 0.8) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() >= vodDictDO.getVodLength() * 0.8) { totalStudyVods++; } } } } - classSummaryVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods, vodDictDOS.size())); + classSummaryVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods,classMemberMappingDOS.size())); //平均完成时长 学生观看课程视频的全部时长/总人数 int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size()); @@ -305,7 +311,7 @@ public class AdministerServiceImpl extends ServiceImpl vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() @@ -314,24 +320,37 @@ public class AdministerServiceImpl extends ServiceImpl 0) { if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { i++; } } + + for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS){ + playLength += vodPlayHistoryDO.getPlayLength(); + } + } classDetailVO.setStudyVodCounts(i); //学生测试完成情况 ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() .lambda() - .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId()) + .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId())); if (null != exerciseDoneResultDO) { classDetailVO.setRightCounts(exerciseDoneResultDO.getRightCounts()); classDetailVO.setTotalExeCounts(exerciseDoneResultDO.getTotalCounts()); classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); + + if (classDetailVO.getScore()>=60){ + classDetailVO.setResult("合格"); + }else { + classDetailVO.setResult("不合格"); + } + } classDetailVO.setClassProcess(i+"/"+vodDictDOS.size()); @@ -350,7 +369,7 @@ public class AdministerServiceImpl extends ServiceImpl vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() @@ -389,17 +408,22 @@ public class AdministerServiceImpl extends ServiceImpl() .lambda() - .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId()) + .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId())); if (null != exerciseDoneResultDO) { - classDetailVO.setScore(MathUtil.intDivCeil(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); + classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); } else { classDetailVO.setScore(0); } @@ -419,14 +443,14 @@ public class AdministerServiceImpl extends ServiceImpl memberList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "账号", "联系方式", "签到次数", "课程进度", "培训时长", "答疑数", "测试成绩", "总评价"}); String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); - ExcelUtil.writeMemberExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "授课记录汇总表", classDetailVOS, memberList); + ExcelUtil.writeMemberExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "授课记录汇总表", classDetailVOS, ExcelFormatUtils.memberList); } return classDetailVOS; } @@ -449,7 +473,7 @@ public class AdministerServiceImpl extends ServiceImpl vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() @@ -463,6 +487,9 @@ public class AdministerServiceImpl extends ServiceImpl vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() @@ -525,6 +552,9 @@ public class AdministerServiceImpl extends ServiceImpl signList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "培训时长", "课程进度", "完成率", "签到次数", "签到日期"}); String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); - ExcelUtil.writeSignExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "注册签到表", classSignVOS, signList); + ExcelUtil.writeSignExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "注册签到表", classSignVOS, ExcelFormatUtils.signList); } return classSignVOS; @@ -582,7 +612,7 @@ public class AdministerServiceImpl extends ServiceImpl() .lambda() - .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId()) + .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) .eq(ExerciseDoneResultDO::getMemberId, exerciseTestVO.getId())); if (null != exerciseDoneResultDO) { @@ -595,9 +625,12 @@ public class AdministerServiceImpl extends ServiceImpl() .lambda() - .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId()) + .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) .eq(ExerciseDoneResultDO::getMemberId, exerciseTestVO.getId())); if (null != exerciseDoneResultDO) { int rights = exerciseDoneResultDO.getRightCounts(); int total = exerciseDoneResultDO.getTotalCounts(); - int score = MathUtil.intDivCeil(rights, total); + int score = MathUtil.intDivFloorPercent(rights, total); exerciseTestVO.setScore(score); if (score >= 60) { exerciseTestVO.setResult("合格"); @@ -633,16 +666,15 @@ public class AdministerServiceImpl extends ServiceImpl testList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "测试最高成绩", "测试次数", "总评价"}); String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); - ExcelUtil.writeTestExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", exerciseTestVOS, testList); + ExcelUtil.writeTestExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", exerciseTestVOS, ExcelFormatUtils.scoreList); } return exerciseTestVOS; @@ -662,9 +694,8 @@ public class AdministerServiceImpl extends ServiceImpl answersList = Arrays.asList(new String[]{"序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间"}); String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); - ExcelUtil.writeAnswerExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "答疑记录表", answerRecordVOS, answersList); + ExcelUtil.writeAnswerExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "答疑记录表", answerRecordVOS, ExcelFormatUtils.answersList); } return answerRecordVOS; } @@ -689,21 +720,19 @@ public class AdministerServiceImpl extends ServiceImpl memberList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "账号", "联系方式", "签到次数", "课程进度", "培训时长", "答疑数", "测试成绩", "总评价"}); classDetailDTO.setFlag(false); List classDetailVOS = exportClassDetail(classDetailDTO); String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); - membersListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "授课记录汇总表", memberList, classDetailVOS, null, 0, baos); + membersListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "授课记录汇总表", ExcelFormatUtils.memberList, classDetailVOS, null, 0, baos); compressFileToZipStream(zipOutputStream, baos, "member.xlsx"); /** * 注册签到 */ ByteArrayOutputStream baos1 = new ByteArrayOutputStream(); - List signList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "培训时长", "课程进度", "完成率", "签到次数", "签到日期"}); classDetailDTO.setFlag(false); List classSignVOS = exportSignDetail(classDetailDTO); - signListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "注册签到", signList, classSignVOS, null, 0, baos1); + signListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "注册签到", ExcelFormatUtils.signList, classSignVOS, null, 0, baos1); compressFileToZipStream(zipOutputStream, baos1, "sign.xlsx"); @@ -711,10 +740,9 @@ public class AdministerServiceImpl extends ServiceImpl scoreList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "测试最高成绩", "测试次数", "总评价"}); classDetailDTO.setFlag(false); List exerciseTestVOS = exportExerciseTest(classDetailDTO); - testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩", scoreList, exerciseTestVOS, null, 0, baos2); + testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2); compressFileToZipStream(zipOutputStream, baos2, "test.xlsx"); @@ -722,9 +750,8 @@ public class AdministerServiceImpl extends ServiceImpl answerList = Arrays.asList(new String[]{"序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间"}); List answerRecordVOS = exportAnswerRecord(classDetailDTO); - askListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "答疑记录", answerList, answerRecordVOS, null, 0, baos3); + askListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "答疑记录", ExcelFormatUtils.answersList, answerRecordVOS, null, 0, baos3); compressFileToZipStream(zipOutputStream, baos3, "answer.xlsx"); zipOutputStream.flush(); @@ -748,7 +775,11 @@ public class AdministerServiceImpl extends ServiceImpl memberDOS = new ArrayList<>(); + HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); + //拼音小写 + format.setCaseType(HanyuPinyinCaseType.LOWERCASE); + //不带声调 + format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); ExcelUtil.readExcel(null, ImportMemberDTO.class, multipartFile).forEach(s -> { @@ -757,15 +788,32 @@ public class AdministerServiceImpl extends ServiceImpl memberDOS1 = memberMapper.selectList(new QueryWrapper() + //.lambda() + //.like(MemberDO::getAccountName,accountName) + //.orderByDesc(MemberDO::getCreateDate)); + //if (memberDOS1.size()>0){ + // MemberDO mem = memberDOS1.get(0); + // Integer num = Integer.valueOf(mem.getAccountName().substring(mem.getAccountName().length()-4))+1; + // memberDO1.setAccountName(accountName+num); + //}else { + memberDO1.setAccountName(accountName); + //} + }catch (BadHanyuPinyinOutputFormatCombination ex) { + + } + //memberDO1.setAccountName(s.getAccountName()); memberDO1.setTelephone(s.getTelephone()); memberDO1.setIdCard(s.getIdCard()); memberDO1.setStatus("启用"); + memberDO1.setPassword("123456"); memberMapper.insert(memberDO1); //找到该公司最大的部门 @@ -977,7 +1025,7 @@ public class AdministerServiceImpl extends ServiceImpl getAllClasses(ClassDictDO classDictDO) { return this.baseMapper.getAllClasses(classDictDO); @@ -50,7 +60,23 @@ public class ClassDictServiceImpl extends ServiceImpl() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,addClassDTO.getUserId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + + ClassDictDO classDictDO = new ClassDictDO(); + BeanUtils.copyProperties(addClassDTO,classDictDO); + + if (count>0){ + classDictDO.setClassType("平台支持"); + }else{ + classDictDO.setClassType("企业自建"); + } + this.baseMapper.insert(classDictDO); return ConstantUtils.ADD_SUCCESS; } @@ -89,4 +115,27 @@ public class ClassDictServiceImpl extends ServiceImpl memberDOS = this.baseMapper.classMembers(classDictDO.getId()); + + StringBuilder telephone = new StringBuilder(); + String param = "{\"company\":\""+companyDictDO.getCompanyName()+ "\",course\":\""+courseDictDO.getCourseName()+ "\",\"startDate\":\""+classDictDO1.getStartDate() +"\",\"endDate\":\""+classDictDO1.getEndDate() +"\"}"; + if (memberDOS.size()>0){ + for (int i = 0 ;i< memberDOS.size();i++){ + telephone.append(memberDOS.get(i).getTelephone()); + if (i!=memberDOS.size()-1){ + telephone.append(","); + } + } + SMSUtils.sendNoticeSMS("SMS_228117919",telephone.toString(),param); + } + return ConstantUtils.SUCCESS_SEND_OUT; + } + } diff --git a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java index 091446c..fd7b16e 100644 --- a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java @@ -8,15 +8,13 @@ import com.subsidy.dto.course.QueryCoursesDTO; import com.subsidy.mapper.AdministerMapper; import com.subsidy.mapper.CompanyDictMapper; import com.subsidy.mapper.RoleAdministerMappingMapper; -import com.subsidy.model.AdministerDO; -import com.subsidy.model.CompanyDictDO; -import com.subsidy.model.CourseDictDO; +import com.subsidy.model.*; import com.subsidy.mapper.CourseDictMapper; -import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.service.CompanyDictService; import com.subsidy.service.CourseDictService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; +import com.subsidy.util.SMSUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -37,12 +35,6 @@ public class CourseDictServiceImpl extends ServiceImpl imple if (vodPlayHistoryDOS.size()>0){ VodPlayHistoryDO vodPlayHistoryDO = vodPlayHistoryDOS.get(0); VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO.getVodId()); - BeanUtils.copyProperties(vodDictDO,contentVodNewVO); - contentVodNewVO.setPlayRecord(vodPlayHistoryDO.getPlayRecord()); + if (null!=vodDictDO){ + BeanUtils.copyProperties(vodDictDO,contentVodNewVO); + contentVodNewVO.setPlayRecord(vodPlayHistoryDO.getPlayRecord()); + } } return contentVodNewVO; } @@ -435,12 +437,21 @@ public class MemberServiceImpl extends ServiceImpl imple ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() .lambda() - .eq(ExerciseDoneResultDO::getCourseId, courseDictDO.getId()) + .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) .eq(ExerciseDoneResultDO::getMemberId, contentMemberDTO.getMemberId())); if (null != exerciseDoneResultDO) { getCourseTestVO.setRightCount(String.valueOf(exerciseDoneResultDO.getRightCounts())); getCourseTestVO.setTotalCount(String.valueOf(exerciseDoneResultDO.getTotalCounts())); + + //正确率 + Integer percent = MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(),exerciseDoneResultDO.getTotalCounts()); + if(percent>=60){ + getCourseTestVO.setResult("合格"); + }else { + getCourseTestVO.setResult("不合格"); + } + getCourseTestVO.setPercent(String.valueOf(percent)); } else { getCourseTestVO.setRightCount("-"); //该课程下有多少习题 @@ -448,6 +459,8 @@ public class MemberServiceImpl extends ServiceImpl imple .lambda() .eq(ExerciseDictDO::getCourseId, courseDictDO.getId())); getCourseTestVO.setTotalCount(String.valueOf(count)); + getCourseTestVO.setPercent("-"); + getCourseTestVO.setResult("不合格"); } return getCourseTestVO; } @@ -459,7 +472,7 @@ public class MemberServiceImpl extends ServiceImpl imple MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId()); //第几天 - long diff = Duration.between(LocalDateTime.now(), memberDO1.getCreateDate()).toDays(); + long diff = Duration.between(memberDO1.getCreateDate(),LocalDateTime.now()).toDays(); getStudyInfoVO.setDiff(diff); //已学课程 diff --git a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java index 68947a7..8459e40 100644 --- a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -65,11 +65,11 @@ public class SignInRecordServiceImpl extends ServiceImpl classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); this.baseMapper.delete(new QueryWrapper() - .lambda() - .eq(SignInRecordDO::getMemberId,signInRecordDO.getMemberId()) - .gt(SignInRecordDO::getSignInDate, LocalDate.now())); + .lambda() + .eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId()) + .gt(SignInRecordDO::getSignInDate, LocalDate.now())); - for (ClassDictDO classDictDO : classDictDOS){ + for (ClassDictDO classDictDO : classDictDOS) { SignInRecordDO signInRecordDO1 = new SignInRecordDO(); signInRecordDO1.setClassId(classDictDO.getId()); signInRecordDO1.setMemberId(signInRecordDO.getMemberId()); @@ -84,15 +84,15 @@ 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.getCompanyId()); List classSignInfoVOS = classSignInfoVOIPage.getRecords(); - for (ClassSignInfoVO classSignInfoVO : classSignInfoVOS){ + for (ClassSignInfoVO classSignInfoVO : classSignInfoVOS) { //班级人数 List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() - .lambda() - .eq(ClassMemberMappingDO::getClassId,classSignInfoVO.getClassId())); + .lambda() + .eq(ClassMemberMappingDO::getClassId, classSignInfoVO.getClassId())); classSignInfoVO.setMemberCount(classMemberMappingDOS.size()); @@ -103,29 +103,29 @@ public class SignInRecordServiceImpl extends ServiceImpl vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() .lambda() - .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getId()) + .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId()) .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) .orderByDesc(VodPlayHistoryDO::getPlayRecord)); - for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS){ - totalStudyLength+=vodPlayHistoryDO.getPlayLength(); + for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { + totalStudyLength += vodPlayHistoryDO.getPlayLength(); } if (vodPlayHistoryDOS.size() > 0) { - if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() >= vodDictDO.getVodLength() * 0.8) { totalStudyVods++; } } } } - classSignInfoVO.setStudyVodCounts(MathUtil.intDivFloorPercent(totalStudyVods, vodDictDOS.size())); + classSignInfoVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods, classMemberMappingDOS.size() )); //平均完成时长 学生观看课程视频的全部时长/总人数 - int avg = MathUtil.intDivCeil(totalStudyLength,classMemberMappingDOS.size()); + int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size()); classSignInfoVO.setAvgVodPlayLength(avg); //测试通过率 @@ -136,19 +136,19 @@ public class SignInRecordServiceImpl extends ServiceImpl exerciseDoneResultDO.getTotalCounts()*0.6){ + if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts() * 0.6) { passNum++; } } - classSignInfoVO.setPassRate(MathUtil.intDivFloorPercent(passNum,classMemberMappingDOS.size())); + classSignInfoVO.setPassRate(MathUtil.intDivFloorPercent(passNum, classMemberMappingDOS.size())); //平均签到数 向上取整 //签到总次数 Integer signCount = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .eq(SignInRecordDO::getClassId,classSignInfoVO.getClassId())); - classSignInfoVO.setAvgSignCount(MathUtil.intDivCeil(signCount,classMemberMappingDOS.size())); + .eq(SignInRecordDO::getClassId, classSignInfoVO.getClassId())); + classSignInfoVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classMemberMappingDOS.size())); //答疑数 Integer count = answeringQuestionMapper.selectCount(new QueryWrapper() @@ -162,7 +162,7 @@ public class SignInRecordServiceImpl extends ServiceImpl classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); - - for (ClassDictDO classDictDO : classDictDOS){ + for (ClassDictDO classDictDO : classDictDOS) { Integer count = this.baseMapper.selectCount(new QueryWrapper() - .lambda() - .eq(SignInRecordDO::getClassId,classDictDO.getId()) - .eq(SignInRecordDO::getMemberId,signInRecordDO.getMemberId()) - .gt(SignInRecordDO::getSignInDate,LocalDate.now())); + .lambda() + .eq(SignInRecordDO::getClassId, classDictDO.getId()) + .eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId()) + .gt(SignInRecordDO::getSignInDate, LocalDate.now())); - if (count == 0 ){ + if (count == 0) { flag = false; } diff --git a/src/main/java/com/subsidy/util/ConstantUtils.java b/src/main/java/com/subsidy/util/ConstantUtils.java index 72603a6..2acfc09 100644 --- a/src/main/java/com/subsidy/util/ConstantUtils.java +++ b/src/main/java/com/subsidy/util/ConstantUtils.java @@ -44,6 +44,8 @@ public class ConstantUtils { public static final String NOTICE_NAME = "有课进度通知"; + public static final String TECH_NAME = "有课互联科技"; + public static final String PUBLISH_SUCCESS = "发布成功"; public static final String LOGIN_OUT ="登出成功"; diff --git a/src/main/java/com/subsidy/util/ExcelFormatUtils.java b/src/main/java/com/subsidy/util/ExcelFormatUtils.java new file mode 100644 index 0000000..4c8a077 --- /dev/null +++ b/src/main/java/com/subsidy/util/ExcelFormatUtils.java @@ -0,0 +1,17 @@ +package com.subsidy.util; + +import java.util.Arrays; +import java.util.List; + +public class ExcelFormatUtils { + + + public static final List memberList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "账号", "联系方式", "签到次数", "课程进度", "培训时长", "答疑数", "测试成绩", "总评价"}); + + public static final List signList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "培训时长", "课程进度", "完成率", "签到次数", "签到日期"}); + + public static final List scoreList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "测试最高成绩", "测试次数", "总评价"}); + + public static final List answersList = Arrays.asList(new String[]{"序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间"}); + +} diff --git a/src/main/java/com/subsidy/util/MathUtil.java b/src/main/java/com/subsidy/util/MathUtil.java index 30f4816..26e07a4 100644 --- a/src/main/java/com/subsidy/util/MathUtil.java +++ b/src/main/java/com/subsidy/util/MathUtil.java @@ -89,12 +89,13 @@ public class MathUtil { return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString() + "%"; } } + //百分比 不带%输出 public static String getPercentAvgIndexWithPercent(BigDecimal counts, BigDecimal total) { if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { return "0"; } else { - return counts.multiply(new BigDecimal(100)).divide(total,2,BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); + return counts.multiply(new BigDecimal(100)).divide(total, 2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); } } @@ -103,7 +104,7 @@ public class MathUtil { if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { return "0"; } else { - return counts.multiply(new BigDecimal(100)).divide(total,2,BigDecimal.ROUND_CEILING).stripTrailingZeros().toPlainString(); + return counts.multiply(new BigDecimal(100)).divide(total, 2, BigDecimal.ROUND_CEILING).stripTrailingZeros().toPlainString(); } } @@ -124,7 +125,7 @@ public class MathUtil { return (int) Math.floor((double) a * 100 / b); } - public static Integer getRandomNum(Integer i){ + public static Integer getRandomNum(Integer i) { Random random = new Random(); return random.nextInt(i); } @@ -134,4 +135,36 @@ public class MathUtil { // System.out.println(getRandomNum(2)); // } // } + + public static String secToTime(int time) { + String timeStr = null; + int hour = 0; + int minute = 0; + int second = 0; + if (time <= 0) { + return "00:00"; + } else { + minute = time / 60; + if (minute < 60) { + second = time % 60; + timeStr = unitFormat(minute) + ":" + unitFormat(second); + } else { + hour = minute / 60; + minute = minute % 60; + second = time - hour * 3600 - minute * 60; + timeStr = unitFormat(hour) + ":" + unitFormat(minute) + ":" + unitFormat(second); + } + } + return timeStr; + } + + public static String unitFormat(int i) { + String retStr = null; + if (i >= 0 && i < 10) { + retStr = "0" + Integer.toString(i); + } else { + retStr = "" + i; + } + return retStr; + } } diff --git a/src/main/java/com/subsidy/util/SMSUtils.java b/src/main/java/com/subsidy/util/SMSUtils.java index 7772f13..e038dd6 100644 --- a/src/main/java/com/subsidy/util/SMSUtils.java +++ b/src/main/java/com/subsidy/util/SMSUtils.java @@ -11,6 +11,11 @@ import com.aliyuncs.profile.DefaultProfile; import com.aliyuncs.profile.IClientProfile; import com.subsidy.common.configure.AliyunSmsProperties; import com.subsidy.common.exception.HttpException; +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -110,7 +115,7 @@ public class SMSUtils { request.setSysAction("SendSms"); request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); request.putQueryParameter("PhoneNumbers",telephone); - request.putQueryParameter("SignName",ConstantUtils.NOTICE_NAME); + request.putQueryParameter("SignName",ConstantUtils.TECH_NAME); request.putQueryParameter("TemplateCode",templateId); // if (StringUtils.isEmpty(param)){ // request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); @@ -131,9 +136,22 @@ public class SMSUtils { } } - public static void main(String[] args) { - String param = "{ \"company\":\""+"基金会"+ "\",\"time\":\""+"2020-01-02" +"\",\"address\":\""+"上海市" +"\"}"; - sendNoticeSMS("SMS_215336604","15201936167",param); + //public static void main(String[] args) { + // String param = "{ \"course\":\""+"语文课"+ "\",\"time\":\""+"2020-01-02" +"\",\"address\":\""+"上海市" +"\"}"; + // sendNoticeSMS("SMS_215336604","15201936167,18201963812",param); + //} + + public static void main(String[] args) throws BadHanyuPinyinOutputFormatCombination { + HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); + //拼音小写 + format.setCaseType(HanyuPinyinCaseType.LOWERCASE); + //不带声调 + format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + + //format.setVCharType(); + //要转换的中文,格式,转换之后的拼音的分隔符,遇到不能转换的是否保留 wo,shi,zhong,guo,ren,,hello + System.out.println(PinyinHelper.toHanYuPinyinString("我是中国人", format, "", false)); } + } diff --git a/src/main/java/com/subsidy/util/excel/ExcelUtil.java b/src/main/java/com/subsidy/util/excel/ExcelUtil.java index 3efb47d..81d85ce 100644 --- a/src/main/java/com/subsidy/util/excel/ExcelUtil.java +++ b/src/main/java/com/subsidy/util/excel/ExcelUtil.java @@ -267,7 +267,7 @@ public class ExcelUtil { titleFont.setBoldweight((short) 700); titleStyle.setFont(titleFont); - //第二行 + //第二行/第三行样式 CellStyle secondStyle = workbook.createCellStyle(); secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 @@ -277,16 +277,6 @@ public class ExcelUtil { Font secondFont = workbook.createFont(); secondStyle.setFont(secondFont); - //第三行 - CellStyle thirdStyle = workbook.createCellStyle(); - thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 - thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 - thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 - thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 - secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); - Font thirdFont = workbook.createFont(); - thirdStyle.setFont(thirdFont); - // 列头样式 CellStyle headerStyle = workbook.createCellStyle(); setStyle(headerStyle); @@ -384,10 +374,10 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress32); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 thirdRow.createCell(0).setCellValue(thirdHead[0]); - thirdRow.getCell(0).setCellStyle(thirdStyle); + thirdRow.getCell(0).setCellStyle(secondStyle); thirdRow.createCell(5).setCellValue(thirdHead[1]); - thirdRow.getCell(5).setCellStyle(thirdStyle); + thirdRow.getCell(5).setCellStyle(secondStyle); //标题 3 SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 @@ -444,7 +434,7 @@ public class ExcelUtil { newCell = dataRow.createCell(7); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classDetailVO.getTrainingLength()); + newCell.setCellValue(classDetailVO.getTrainingLengthStr()); newCell = dataRow.createCell(8); newCell.setCellStyle(cellStyle); @@ -660,7 +650,7 @@ public class ExcelUtil { newCell = dataRow.createCell(4); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classSignVO.getTrainingLength()); + newCell.setCellValue(classSignVO.getTrainingLengthStr()); newCell = dataRow.createCell(5); newCell.setCellStyle(cellStyle); diff --git a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java index 17e1c5b..24114d9 100644 --- a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java +++ b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java @@ -24,4 +24,5 @@ public class ExerciseTestVO { private String telephone; + private Integer count; } diff --git a/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java b/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java index 8f607c7..8132f30 100644 --- a/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java +++ b/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java @@ -4,7 +4,7 @@ import com.subsidy.util.excel.ExcelColumn; import lombok.Data; @Data -public class ClassDetailVO { +public class ClassDetailVO{ private Long id; @@ -40,9 +40,12 @@ public class ClassDetailVO { @ExcelColumn(col = 6,value = "课程进度") private String classProcess; - @ExcelColumn(col = 7,value = "培训时长") private Integer trainingLength; + @ExcelColumn(col = 7,value = "培训时长") + private String trainingLengthStr; + + /** * 作对个数 */ @@ -66,7 +69,7 @@ public class ClassDetailVO { private Integer askCounts; - + private String result; diff --git a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java index dcd7fab..29cd7a5 100644 --- a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java +++ b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java @@ -19,4 +19,6 @@ public class GetAllClassesVO { private Integer cnt; + private String classType; + } diff --git a/src/main/java/com/subsidy/vo/member/ClassSignVO.java b/src/main/java/com/subsidy/vo/member/ClassSignVO.java index cbc8204..9390669 100644 --- a/src/main/java/com/subsidy/vo/member/ClassSignVO.java +++ b/src/main/java/com/subsidy/vo/member/ClassSignVO.java @@ -29,9 +29,11 @@ public class ClassSignVO { /** * 培训时长 */ - @ExcelColumn(col = 4,value = "培训时长") private Integer trainingLength; + @ExcelColumn(col = 4,value = "培训时长") + private String trainingLengthStr; + /** * 已看视频 */ diff --git a/src/main/java/com/subsidy/vo/member/GetCourseTestVO.java b/src/main/java/com/subsidy/vo/member/GetCourseTestVO.java index b324245..05d6c00 100644 --- a/src/main/java/com/subsidy/vo/member/GetCourseTestVO.java +++ b/src/main/java/com/subsidy/vo/member/GetCourseTestVO.java @@ -15,4 +15,8 @@ public class GetCourseTestVO { private String deadline; + private String result; + + private String percent; + } diff --git a/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java b/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java index 1480ef4..91a0d04 100644 --- a/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java +++ b/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java @@ -53,5 +53,8 @@ public class ClassSignInfoVO { */ private Integer answerCount; + private String classType; + + } diff --git a/src/main/resources/mapper/AnsweringQuestionMapper.xml b/src/main/resources/mapper/AnsweringQuestionMapper.xml index 7e11dfa..efd56ac 100644 --- a/src/main/resources/mapper/AnsweringQuestionMapper.xml +++ b/src/main/resources/mapper/AnsweringQuestionMapper.xml @@ -41,7 +41,7 @@ and t.ask_id = #{memberId} - order by t.create_date + order by t.create_date desc diff --git a/src/main/resources/mapper/ClassDictMapper.xml b/src/main/resources/mapper/ClassDictMapper.xml index 7cc0d76..7d84003 100644 --- a/src/main/resources/mapper/ClassDictMapper.xml +++ b/src/main/resources/mapper/ClassDictMapper.xml @@ -30,7 +30,8 @@ t2.course_name, t.start_date, t.end_date, - t4.cnt + t4.cnt, + t.class_type FROM class_dict t LEFT JOIN course_dict t2 ON t.course_id = t2.id @@ -76,7 +77,7 @@ AND t3.company_id = #{companyId} AND t2.id NOT IN ( SELECT - t3.id + t3.member_id FROM class_member_mapping t3 WHERE @@ -84,4 +85,16 @@ AND t3.class_id = #{classId}) + + diff --git a/src/main/resources/mapper/CourseDictMapper.xml b/src/main/resources/mapper/CourseDictMapper.xml index 77a179b..f4f8fbf 100644 --- a/src/main/resources/mapper/CourseDictMapper.xml +++ b/src/main/resources/mapper/CourseDictMapper.xml @@ -115,4 +115,7 @@ AND t.company_id = #{companyId} + + + diff --git a/src/main/resources/mapper/SignInRecordMapper.xml b/src/main/resources/mapper/SignInRecordMapper.xml index 44d82ef..59b954b 100644 --- a/src/main/resources/mapper/SignInRecordMapper.xml +++ b/src/main/resources/mapper/SignInRecordMapper.xml @@ -23,16 +23,17 @@