Commit 301a3dcd by 涂亚平

账号名称根据拼音生成

1 parent 374745fa
Showing with 271 additions and 82 deletions
...@@ -55,6 +55,13 @@ ...@@ -55,6 +55,13 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>com.tencentcloudapi</groupId> <groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java</artifactId> <artifactId>tencentcloud-sdk-java</artifactId>
<version>3.1.64</version> <version>3.1.64</version>
......
...@@ -84,7 +84,7 @@ public class AdministerController { ...@@ -84,7 +84,7 @@ public class AdministerController {
@PostMapping("classSummary") @PostMapping("classSummary")
@ApiOperation("课程汇总 id 班级id ") @ApiOperation("课程汇总 id 班级id ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO){ public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.classSummary(classDetailDTO)); return ResponseData.generateCreatedResponse(0,administerService.classSummary(classDetailDTO));
} }
...@@ -98,7 +98,7 @@ public class AdministerController { ...@@ -98,7 +98,7 @@ public class AdministerController {
@PostMapping("exportClassDetail") @PostMapping("exportClassDetail")
@ApiOperation("班级管理--班级成员--导出 id 班级id userName") @ApiOperation("班级管理--班级成员--导出 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true); classDetailDTO.setFlag(true);
administerService.exportClassDetail(classDetailDTO); administerService.exportClassDetail(classDetailDTO);
......
...@@ -4,11 +4,13 @@ package com.subsidy.controller; ...@@ -4,11 +4,13 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO; import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.classDict.AddClassDTO;
import com.subsidy.dto.classDict.AddMemberToClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetAllClassesDTO; import com.subsidy.dto.classDict.GetAllClassesDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.service.ClassDictService; import com.subsidy.service.ClassDictService;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -51,10 +53,10 @@ public class ClassDictController { ...@@ -51,10 +53,10 @@ public class ClassDictController {
} }
@PostMapping("addClass") @PostMapping("addClass")
@ApiOperation("添加课程 ** companyId courseId className startDate endDate") @ApiOperation("添加课程 ** userId:登录人id companyId courseId className startDate endDate")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addClass(@RequestBody ClassDictDO classDictDO){ public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){
return ResponseData.generateCreatedResponse(0,classDictService.addClass(classDictDO)); return ResponseData.generateCreatedResponse(0,classDictService.addClass(addClassDTO));
} }
@PostMapping("updateClass") @PostMapping("updateClass")
...@@ -80,7 +82,7 @@ public class ClassDictController { ...@@ -80,7 +82,7 @@ public class ClassDictController {
@PostMapping("getSpareMembers") @PostMapping("getSpareMembers")
@ApiOperation("获取不在某班级的某企业里所有成员 ** companyId 企业id classId 班级id") @ApiOperation("获取不在某班级的某企业里所有成员 ** companyId 企业id classId 班级id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSpareMembers(@RequestBody GetSpareMembersDTO getSpareMembersDTO){ public ResponseVO getSpareMembers(@RequestBody GetSpareMembersDTO getSpareMembersDTO){
return ResponseData.generateCreatedResponse(0,classDictService.getSpareMembers(getSpareMembersDTO)); return ResponseData.generateCreatedResponse(0,classDictService.getSpareMembers(getSpareMembersDTO));
} }
...@@ -93,4 +95,11 @@ public class ClassDictController { ...@@ -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));
}
} }
package com.subsidy.dto.classDict;
import com.subsidy.model.ClassDictDO;
import lombok.Data;
@Data
public class AddClassDTO extends ClassDictDO {
private Long userId;
}
...@@ -38,5 +38,9 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> { ...@@ -38,5 +38,9 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> {
*/ */
List<MemberDO> getSpareMembers(GetSpareMembersDTO getSpareMembersDTO); List<MemberDO> getSpareMembers(GetSpareMembersDTO getSpareMembersDTO);
/**
* 查询班级里的学生信息
*/
List<MemberDO> classMembers(Long classId);
} }
...@@ -45,4 +45,5 @@ public interface CourseDictMapper extends BaseMapper<CourseDictDO> { ...@@ -45,4 +45,5 @@ public interface CourseDictMapper extends BaseMapper<CourseDictDO> {
*/ */
IPage<QueryCoursesVO> queryCompanyCourse(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId); IPage<QueryCoursesVO> queryCompanyCourse(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId);
} }
...@@ -39,6 +39,11 @@ public class ClassDictDO extends BaseModel { ...@@ -39,6 +39,11 @@ public class ClassDictDO extends BaseModel {
private String className; private String className;
/** /**
* 班级类型
*/
private String classType;
/**
* 课程id * 课程id
*/ */
private Long courseId; private Long courseId;
......
package com.subsidy.service; package com.subsidy.service;
import com.subsidy.dto.classDict.AddClassDTO;
import com.subsidy.dto.classDict.AddMemberToClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetAllClassesDTO; import com.subsidy.dto.classDict.GetAllClassesDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassDictDO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.vo.classdict.GetAllClassesVO; import com.subsidy.vo.classdict.GetAllClassesVO;
...@@ -25,7 +27,7 @@ public interface ClassDictService extends IService<ClassDictDO> { ...@@ -25,7 +27,7 @@ public interface ClassDictService extends IService<ClassDictDO> {
String deleteClasses(ClassDictDO classDictDO); String deleteClasses(ClassDictDO classDictDO);
String addClass(ClassDictDO classDictDO); String addClass(AddClassDTO addClassDTO);
String updateClass(ClassDictDO classDictDO); String updateClass(ClassDictDO classDictDO);
...@@ -37,4 +39,5 @@ public interface ClassDictService extends IService<ClassDictDO> { ...@@ -37,4 +39,5 @@ public interface ClassDictService extends IService<ClassDictDO> {
String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO); String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO);
String batchSms(ClassDictDO classDictDO);
} }
...@@ -24,4 +24,5 @@ public interface CourseDictService extends IService<CourseDictDO> { ...@@ -24,4 +24,5 @@ public interface CourseDictService extends IService<CourseDictDO> {
String updateCourses(CourseDictDO courseDictDO); String updateCourses(CourseDictDO courseDictDO);
IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO); IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO);
} }
package com.subsidy.service.impl; package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.dto.classDict.AddClassDTO;
import com.subsidy.dto.classDict.AddMemberToClassDTO; import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetAllClassesDTO; import com.subsidy.dto.classDict.GetAllClassesDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.mapper.AdministerMapper; import com.subsidy.mapper.*;
import com.subsidy.mapper.ClassMemberMappingMapper;
import com.subsidy.mapper.RoleAdministerMappingMapper;
import com.subsidy.model.*; import com.subsidy.model.*;
import com.subsidy.mapper.ClassDictMapper;
import com.subsidy.service.ClassDictService; import com.subsidy.service.ClassDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.SMSUtils;
import com.subsidy.vo.classdict.GetAllClassesVO; import com.subsidy.vo.classdict.GetAllClassesVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -35,6 +36,15 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -35,6 +36,15 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
@Autowired @Autowired
private ClassMemberMappingMapper classMemberMappingMapper; private ClassMemberMappingMapper classMemberMappingMapper;
@Autowired
private RoleAdministerMappingMapper roleAdministerMappingMapper;
@Autowired
private CourseDictMapper courseDictMapper;
@Autowired
private CompanyDictMapper companyDictMapper;
public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO) { public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO) {
return this.baseMapper.getAllClasses(classDictDO); return this.baseMapper.getAllClasses(classDictDO);
...@@ -50,7 +60,23 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -50,7 +60,23 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
return ConstantUtils.DELETE_SUCCESS; return ConstantUtils.DELETE_SUCCESS;
} }
public String addClass(ClassDictDO classDictDO) { public String addClass(AddClassDTO addClassDTO) {
//查看当前登录人的角色
int count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>()
.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); this.baseMapper.insert(classDictDO);
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
} }
...@@ -89,4 +115,27 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -89,4 +115,27 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
} }
public String batchSms(ClassDictDO classDictDO){
ClassDictDO classDictDO1 = this.baseMapper.selectById(classDictDO.getId());
CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO1.getCourseId());
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
//查找这个班级里的学员的手机号
List<MemberDO> 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;
}
} }
...@@ -8,15 +8,13 @@ import com.subsidy.dto.course.QueryCoursesDTO; ...@@ -8,15 +8,13 @@ import com.subsidy.dto.course.QueryCoursesDTO;
import com.subsidy.mapper.AdministerMapper; import com.subsidy.mapper.AdministerMapper;
import com.subsidy.mapper.CompanyDictMapper; import com.subsidy.mapper.CompanyDictMapper;
import com.subsidy.mapper.RoleAdministerMappingMapper; import com.subsidy.mapper.RoleAdministerMappingMapper;
import com.subsidy.model.AdministerDO; import com.subsidy.model.*;
import com.subsidy.model.CompanyDictDO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.mapper.CourseDictMapper; import com.subsidy.mapper.CourseDictMapper;
import com.subsidy.model.RoleAdministerMappingDO;
import com.subsidy.service.CompanyDictService; import com.subsidy.service.CompanyDictService;
import com.subsidy.service.CourseDictService; import com.subsidy.service.CourseDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.SMSUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -37,12 +35,6 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD ...@@ -37,12 +35,6 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
@Autowired @Autowired
private RoleAdministerMappingMapper roleAdministerMappingMapper; private RoleAdministerMappingMapper roleAdministerMappingMapper;
@Autowired
private AdministerMapper administerMapper;
@Autowired
private CompanyDictMapper companyDictMapper;
public String addCourse(CourseDictDO courseDictDO) { public String addCourse(CourseDictDO courseDictDO) {
int count = 0; int count = 0;
...@@ -147,4 +139,5 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD ...@@ -147,4 +139,5 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
} }
} }
...@@ -372,9 +372,11 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -372,9 +372,11 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
if (vodPlayHistoryDOS.size()>0){ if (vodPlayHistoryDOS.size()>0){
VodPlayHistoryDO vodPlayHistoryDO = vodPlayHistoryDOS.get(0); VodPlayHistoryDO vodPlayHistoryDO = vodPlayHistoryDOS.get(0);
VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO.getVodId()); VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO.getVodId());
if (null!=vodDictDO){
BeanUtils.copyProperties(vodDictDO,contentVodNewVO); BeanUtils.copyProperties(vodDictDO,contentVodNewVO);
contentVodNewVO.setPlayRecord(vodPlayHistoryDO.getPlayRecord()); contentVodNewVO.setPlayRecord(vodPlayHistoryDO.getPlayRecord());
} }
}
return contentVodNewVO; return contentVodNewVO;
} }
...@@ -435,12 +437,21 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -435,12 +437,21 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper<ExerciseDoneResultDO>() ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper<ExerciseDoneResultDO>()
.lambda() .lambda()
.eq(ExerciseDoneResultDO::getCourseId, courseDictDO.getId()) .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId())
.eq(ExerciseDoneResultDO::getMemberId, contentMemberDTO.getMemberId())); .eq(ExerciseDoneResultDO::getMemberId, contentMemberDTO.getMemberId()));
if (null != exerciseDoneResultDO) { if (null != exerciseDoneResultDO) {
getCourseTestVO.setRightCount(String.valueOf(exerciseDoneResultDO.getRightCounts())); getCourseTestVO.setRightCount(String.valueOf(exerciseDoneResultDO.getRightCounts()));
getCourseTestVO.setTotalCount(String.valueOf(exerciseDoneResultDO.getTotalCounts())); 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 { } else {
getCourseTestVO.setRightCount("-"); getCourseTestVO.setRightCount("-");
//该课程下有多少习题 //该课程下有多少习题
...@@ -448,6 +459,8 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -448,6 +459,8 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
.lambda() .lambda()
.eq(ExerciseDictDO::getCourseId, courseDictDO.getId())); .eq(ExerciseDictDO::getCourseId, courseDictDO.getId()));
getCourseTestVO.setTotalCount(String.valueOf(count)); getCourseTestVO.setTotalCount(String.valueOf(count));
getCourseTestVO.setPercent("-");
getCourseTestVO.setResult("不合格");
} }
return getCourseTestVO; return getCourseTestVO;
} }
...@@ -459,7 +472,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -459,7 +472,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId()); 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); getStudyInfoVO.setDiff(diff);
//已学课程 //已学课程
......
...@@ -66,10 +66,10 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -66,10 +66,10 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
this.baseMapper.delete(new QueryWrapper<SignInRecordDO>() this.baseMapper.delete(new QueryWrapper<SignInRecordDO>()
.lambda() .lambda()
.eq(SignInRecordDO::getMemberId,signInRecordDO.getMemberId()) .eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId())
.gt(SignInRecordDO::getSignInDate, LocalDate.now())); .gt(SignInRecordDO::getSignInDate, LocalDate.now()));
for (ClassDictDO classDictDO : classDictDOS){ for (ClassDictDO classDictDO : classDictDOS) {
SignInRecordDO signInRecordDO1 = new SignInRecordDO(); SignInRecordDO signInRecordDO1 = new SignInRecordDO();
signInRecordDO1.setClassId(classDictDO.getId()); signInRecordDO1.setClassId(classDictDO.getId());
signInRecordDO1.setMemberId(signInRecordDO.getMemberId()); signInRecordDO1.setMemberId(signInRecordDO.getMemberId());
...@@ -84,15 +84,15 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -84,15 +84,15 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
Page pager = new Page(classSignInfoDTO.getPageNum(), classSignInfoDTO.getPageSize()); Page pager = new Page(classSignInfoDTO.getPageNum(), classSignInfoDTO.getPageSize());
IPage<ClassSignInfoVO> classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(),classSignInfoDTO.getCompanyId()); IPage<ClassSignInfoVO> classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(), classSignInfoDTO.getCompanyId());
List<ClassSignInfoVO> classSignInfoVOS = classSignInfoVOIPage.getRecords(); List<ClassSignInfoVO> classSignInfoVOS = classSignInfoVOIPage.getRecords();
for (ClassSignInfoVO classSignInfoVO : classSignInfoVOS){ for (ClassSignInfoVO classSignInfoVO : classSignInfoVOS) {
//班级人数 //班级人数
List<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>() List<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>()
.lambda() .lambda()
.eq(ClassMemberMappingDO::getClassId,classSignInfoVO.getClassId())); .eq(ClassMemberMappingDO::getClassId, classSignInfoVO.getClassId()));
classSignInfoVO.setMemberCount(classMemberMappingDOS.size()); classSignInfoVO.setMemberCount(classMemberMappingDOS.size());
...@@ -103,29 +103,29 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -103,29 +103,29 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
int totalStudyVods = 0; int totalStudyVods = 0;
int totalStudyLength = 0 ; int totalStudyLength = 0;
//学生总共学习课时数 //学生总共学习课时数
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) {
List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>()
.lambda() .lambda()
.eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getId()) .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId())
.eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId())
.orderByDesc(VodPlayHistoryDO::getPlayRecord)); .orderByDesc(VodPlayHistoryDO::getPlayRecord));
for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS){ for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) {
totalStudyLength+=vodPlayHistoryDO.getPlayLength(); totalStudyLength += vodPlayHistoryDO.getPlayLength();
} }
if (vodPlayHistoryDOS.size() > 0) { if (vodPlayHistoryDOS.size() > 0) {
if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { if (vodPlayHistoryDOS.get(0).getPlayRecord() >= vodDictDO.getVodLength() * 0.8) {
totalStudyVods++; 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); classSignInfoVO.setAvgVodPlayLength(avg);
//测试通过率 //测试通过率
...@@ -136,19 +136,19 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -136,19 +136,19 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
int passNum = 0; int passNum = 0;
for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) { for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) {
if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts()*0.6){ if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts() * 0.6) {
passNum++; passNum++;
} }
} }
classSignInfoVO.setPassRate(MathUtil.intDivFloorPercent(passNum,classMemberMappingDOS.size())); classSignInfoVO.setPassRate(MathUtil.intDivFloorPercent(passNum, classMemberMappingDOS.size()));
//平均签到数 向上取整 //平均签到数 向上取整
//签到总次数 //签到总次数
Integer signCount = this.baseMapper.selectCount(new QueryWrapper<SignInRecordDO>() Integer signCount = this.baseMapper.selectCount(new QueryWrapper<SignInRecordDO>()
.lambda() .lambda()
.eq(SignInRecordDO::getClassId,classSignInfoVO.getClassId())); .eq(SignInRecordDO::getClassId, classSignInfoVO.getClassId()));
classSignInfoVO.setAvgSignCount(MathUtil.intDivCeil(signCount,classMemberMappingDOS.size())); classSignInfoVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classMemberMappingDOS.size()));
//答疑数 //答疑数
Integer count = answeringQuestionMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>() Integer count = answeringQuestionMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>()
...@@ -162,7 +162,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -162,7 +162,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
} }
public SignInStatusVO signInStatus(SignInRecordDO signInRecordDO){ public SignInStatusVO signInStatus(SignInRecordDO signInRecordDO) {
SignInStatusVO signInStatusVO = new SignInStatusVO(); SignInStatusVO signInStatusVO = new SignInStatusVO();
...@@ -172,15 +172,14 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -172,15 +172,14 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
List<ClassDictDO> classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); List<ClassDictDO> classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId());
for (ClassDictDO classDictDO : classDictDOS) {
for (ClassDictDO classDictDO : classDictDOS){
Integer count = this.baseMapper.selectCount(new QueryWrapper<SignInRecordDO>() Integer count = this.baseMapper.selectCount(new QueryWrapper<SignInRecordDO>()
.lambda() .lambda()
.eq(SignInRecordDO::getClassId,classDictDO.getId()) .eq(SignInRecordDO::getClassId, classDictDO.getId())
.eq(SignInRecordDO::getMemberId,signInRecordDO.getMemberId()) .eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId())
.gt(SignInRecordDO::getSignInDate,LocalDate.now())); .gt(SignInRecordDO::getSignInDate, LocalDate.now()));
if (count == 0 ){ if (count == 0) {
flag = false; flag = false;
} }
......
...@@ -44,6 +44,8 @@ public class ConstantUtils { ...@@ -44,6 +44,8 @@ public class ConstantUtils {
public static final String NOTICE_NAME = "有课进度通知"; public static final String NOTICE_NAME = "有课进度通知";
public static final String TECH_NAME = "有课互联科技";
public static final String PUBLISH_SUCCESS = "发布成功"; public static final String PUBLISH_SUCCESS = "发布成功";
public static final String LOGIN_OUT ="登出成功"; public static final String LOGIN_OUT ="登出成功";
......
package com.subsidy.util;
import java.util.Arrays;
import java.util.List;
public class ExcelFormatUtils {
public static final List<String> memberList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "账号", "联系方式", "签到次数", "课程进度", "培训时长", "答疑数", "测试成绩", "总评价"});
public static final List<String> signList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "培训时长", "课程进度", "完成率", "签到次数", "签到日期"});
public static final List<String> scoreList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "测试最高成绩", "测试次数", "总评价"});
public static final List<String> answersList = Arrays.asList(new String[]{"序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间"});
}
...@@ -89,12 +89,13 @@ public class MathUtil { ...@@ -89,12 +89,13 @@ public class MathUtil {
return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString() + "%"; return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString() + "%";
} }
} }
//百分比 不带%输出 //百分比 不带%输出
public static String getPercentAvgIndexWithPercent(BigDecimal counts, BigDecimal total) { public static String getPercentAvgIndexWithPercent(BigDecimal counts, BigDecimal total) {
if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) {
return "0"; return "0";
} else { } 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 { ...@@ -103,7 +104,7 @@ public class MathUtil {
if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) {
return "0"; return "0";
} else { } 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 { ...@@ -124,7 +125,7 @@ public class MathUtil {
return (int) Math.floor((double) a * 100 / b); return (int) Math.floor((double) a * 100 / b);
} }
public static Integer getRandomNum(Integer i){ public static Integer getRandomNum(Integer i) {
Random random = new Random(); Random random = new Random();
return random.nextInt(i); return random.nextInt(i);
} }
...@@ -134,4 +135,36 @@ public class MathUtil { ...@@ -134,4 +135,36 @@ public class MathUtil {
// System.out.println(getRandomNum(2)); // 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;
}
} }
...@@ -11,6 +11,11 @@ import com.aliyuncs.profile.DefaultProfile; ...@@ -11,6 +11,11 @@ import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile; import com.aliyuncs.profile.IClientProfile;
import com.subsidy.common.configure.AliyunSmsProperties; import com.subsidy.common.configure.AliyunSmsProperties;
import com.subsidy.common.exception.HttpException; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -110,7 +115,7 @@ public class SMSUtils { ...@@ -110,7 +115,7 @@ public class SMSUtils {
request.setSysAction("SendSms"); request.setSysAction("SendSms");
request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); request.putQueryParameter("RegionId",ConstantUtils.REGION_ID);
request.putQueryParameter("PhoneNumbers",telephone); request.putQueryParameter("PhoneNumbers",telephone);
request.putQueryParameter("SignName",ConstantUtils.NOTICE_NAME); request.putQueryParameter("SignName",ConstantUtils.TECH_NAME);
request.putQueryParameter("TemplateCode",templateId); request.putQueryParameter("TemplateCode",templateId);
// if (StringUtils.isEmpty(param)){ // if (StringUtils.isEmpty(param)){
// request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); // request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}");
...@@ -131,9 +136,22 @@ public class SMSUtils { ...@@ -131,9 +136,22 @@ public class SMSUtils {
} }
} }
public static void main(String[] args) { //public static void main(String[] args) {
String param = "{ \"company\":\""+"基金会"+ "\",\"time\":\""+"2020-01-02" +"\",\"address\":\""+"上海市" +"\"}"; // String param = "{ \"course\":\""+"语文课"+ "\",\"time\":\""+"2020-01-02" +"\",\"address\":\""+"上海市" +"\"}";
sendNoticeSMS("SMS_215336604","15201936167",param); // 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));
} }
} }
...@@ -267,7 +267,7 @@ public class ExcelUtil { ...@@ -267,7 +267,7 @@ public class ExcelUtil {
titleFont.setBoldweight((short) 700); titleFont.setBoldweight((short) 700);
titleStyle.setFont(titleFont); titleStyle.setFont(titleFont);
//第二行 //第二行/第三行样式
CellStyle secondStyle = workbook.createCellStyle(); CellStyle secondStyle = workbook.createCellStyle();
secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
...@@ -277,16 +277,6 @@ public class ExcelUtil { ...@@ -277,16 +277,6 @@ public class ExcelUtil {
Font secondFont = workbook.createFont(); Font secondFont = workbook.createFont();
secondStyle.setFont(secondFont); 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(); CellStyle headerStyle = workbook.createCellStyle();
setStyle(headerStyle); setStyle(headerStyle);
...@@ -384,10 +374,10 @@ public class ExcelUtil { ...@@ -384,10 +374,10 @@ public class ExcelUtil {
sheet.addMergedRegion(cellRangeAddress32); sheet.addMergedRegion(cellRangeAddress32);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框
thirdRow.createCell(0).setCellValue(thirdHead[0]); thirdRow.createCell(0).setCellValue(thirdHead[0]);
thirdRow.getCell(0).setCellStyle(thirdStyle); thirdRow.getCell(0).setCellStyle(secondStyle);
thirdRow.createCell(5).setCellValue(thirdHead[1]); thirdRow.createCell(5).setCellValue(thirdHead[1]);
thirdRow.getCell(5).setCellStyle(thirdStyle); thirdRow.getCell(5).setCellStyle(secondStyle);
//标题 3 //标题 3
SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1
...@@ -444,7 +434,7 @@ public class ExcelUtil { ...@@ -444,7 +434,7 @@ public class ExcelUtil {
newCell = dataRow.createCell(7); newCell = dataRow.createCell(7);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getTrainingLength()); newCell.setCellValue(classDetailVO.getTrainingLengthStr());
newCell = dataRow.createCell(8); newCell = dataRow.createCell(8);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
...@@ -660,7 +650,7 @@ public class ExcelUtil { ...@@ -660,7 +650,7 @@ public class ExcelUtil {
newCell = dataRow.createCell(4); newCell = dataRow.createCell(4);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
newCell.setCellValue(classSignVO.getTrainingLength()); newCell.setCellValue(classSignVO.getTrainingLengthStr());
newCell = dataRow.createCell(5); newCell = dataRow.createCell(5);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
......
...@@ -24,4 +24,5 @@ public class ExerciseTestVO { ...@@ -24,4 +24,5 @@ public class ExerciseTestVO {
private String telephone; private String telephone;
private Integer count;
} }
...@@ -4,7 +4,7 @@ import com.subsidy.util.excel.ExcelColumn; ...@@ -4,7 +4,7 @@ import com.subsidy.util.excel.ExcelColumn;
import lombok.Data; import lombok.Data;
@Data @Data
public class ClassDetailVO <T>{ public class ClassDetailVO{
private Long id; private Long id;
...@@ -40,9 +40,12 @@ public class ClassDetailVO <T>{ ...@@ -40,9 +40,12 @@ public class ClassDetailVO <T>{
@ExcelColumn(col = 6,value = "课程进度") @ExcelColumn(col = 6,value = "课程进度")
private String classProcess; private String classProcess;
@ExcelColumn(col = 7,value = "培训时长")
private Integer trainingLength; private Integer trainingLength;
@ExcelColumn(col = 7,value = "培训时长")
private String trainingLengthStr;
/** /**
* 作对个数 * 作对个数
*/ */
...@@ -66,7 +69,7 @@ public class ClassDetailVO <T>{ ...@@ -66,7 +69,7 @@ public class ClassDetailVO <T>{
private Integer askCounts; private Integer askCounts;
private String result;
......
...@@ -19,4 +19,6 @@ public class GetAllClassesVO { ...@@ -19,4 +19,6 @@ public class GetAllClassesVO {
private Integer cnt; private Integer cnt;
private String classType;
} }
...@@ -29,9 +29,11 @@ public class ClassSignVO { ...@@ -29,9 +29,11 @@ public class ClassSignVO {
/** /**
* 培训时长 * 培训时长
*/ */
@ExcelColumn(col = 4,value = "培训时长")
private Integer trainingLength; private Integer trainingLength;
@ExcelColumn(col = 4,value = "培训时长")
private String trainingLengthStr;
/** /**
* 已看视频 * 已看视频
*/ */
......
...@@ -15,4 +15,8 @@ public class GetCourseTestVO { ...@@ -15,4 +15,8 @@ public class GetCourseTestVO {
private String deadline; private String deadline;
private String result;
private String percent;
} }
...@@ -53,5 +53,8 @@ public class ClassSignInfoVO { ...@@ -53,5 +53,8 @@ public class ClassSignInfoVO {
*/ */
private Integer answerCount; private Integer answerCount;
private String classType;
} }
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<if test="memberId != null "> <if test="memberId != null ">
and t.ask_id = #{memberId} and t.ask_id = #{memberId}
</if> </if>
order by t.create_date order by t.create_date desc
</select> </select>
</mapper> </mapper>
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
t2.course_name, t2.course_name,
t.start_date, t.start_date,
t.end_date, t.end_date,
t4.cnt t4.cnt,
t.class_type
FROM FROM
class_dict t class_dict t
LEFT JOIN course_dict t2 ON t.course_id = t2.id LEFT JOIN course_dict t2 ON t.course_id = t2.id
...@@ -76,7 +77,7 @@ ...@@ -76,7 +77,7 @@
AND t3.company_id = #{companyId} AND t3.company_id = #{companyId}
AND t2.id NOT IN ( AND t2.id NOT IN (
SELECT SELECT
t3.id t3.member_id
FROM FROM
class_member_mapping t3 class_member_mapping t3
WHERE WHERE
...@@ -84,4 +85,16 @@ ...@@ -84,4 +85,16 @@
AND t3.class_id = #{classId}) AND t3.class_id = #{classId})
</select> </select>
<select id="classMembers" parameterType="long" resultType="com.subsidy.model.MemberDO">
SELECT
t2.*
FROM
class_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.class_id = #{classId}
</select>
</mapper> </mapper>
...@@ -115,4 +115,7 @@ ...@@ -115,4 +115,7 @@
AND t.company_id = #{companyId} AND t.company_id = #{companyId}
</if> </if>
</select> </select>
</mapper> </mapper>
...@@ -23,15 +23,16 @@ ...@@ -23,15 +23,16 @@
<select id="classSignInfo" resultType="com.subsidy.vo.sign.ClassSignInfoVO"> <select id="classSignInfo" resultType="com.subsidy.vo.sign.ClassSignInfoVO">
SELECT SELECT
t.id as classId, t.id AS classId,
t2.id as courseId, t2.id AS courseId,
t.class_name, t.class_name,
t2.course_name, t2.course_name,
t.start_date, t.start_date,
t.end_date t.end_date,
t.class_type
FROM FROM
company_dict t3 class_dict t
left join class_dict t on t3.id = t.company_id LEFT JOIN company_dict t3 ON t3.id = t.company_id
LEFT JOIN course_dict t2 ON t.course_id = t2.id LEFT JOIN course_dict t2 ON t.course_id = t2.id
WHERE WHERE
t.delete_date IS NULL t.delete_date IS NULL
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
t2.vod_url, t2.vod_url,
t2.vod_name, t2.vod_name,
t3.play_record, t3.play_record,
round( t3.play_record * 100 / t2.vod_length, 0 ) AS percent round( t3.play_record * 100 / t2.vod_length, 0 ) AS percent,
t.playDate
FROM FROM
( (
SELECT SELECT
...@@ -53,6 +54,7 @@ ...@@ -53,6 +54,7 @@
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE WHERE
t2.delete_date IS NULL t2.delete_date IS NULL
order by t.playDate desc
</select> </select>
</mapper> </mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!