Commit c3ddb3a9 by 涂亚平

上线版本

1 parent feb94308
......@@ -24,6 +24,7 @@ import io.swagger.annotations.Api;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
......@@ -83,14 +84,14 @@ 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));
}
@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));
}
......@@ -98,9 +99,9 @@ public class AdministerController {
@PostMapping("exportClassDetail")
@ApiOperation("班级管理--班级成员--导出 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO){
List<ClassDetailVO> classDetailVOS = administerService.exportClassDetail(classDetailDTO);
ExcelUtil.writeExcel(classDetailVOS,ClassDetailVO.class);
public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
administerService.exportClassDetail(classDetailDTO);
}
@PostMapping("signDetail")
......@@ -113,9 +114,9 @@ public class AdministerController {
@PostMapping("exportSignDetail")
@ApiOperation("班级管理--注册签到 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportSignDetail(@RequestBody ClassDetailDTO classDetailDTO){
List<ClassSignVO> classSignVOS = administerService.exportSignDetail(classDetailDTO);
ExcelUtil.writeExcel(classSignVOS, ClassSignVO.class);
public void exportSignDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
administerService.exportSignDetail(classDetailDTO);
}
@PostMapping("exerciseTest")
......@@ -128,9 +129,9 @@ public class AdministerController {
@PostMapping("exportExerciseTest")
@ApiOperation("班级管理--测评成绩 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO){
List<ExerciseTestVO> exerciseTestVOS =administerService.exportExerciseTest(classDetailDTO);
ExcelUtil.writeExcel(exerciseTestVOS,ExerciseTestVO.class);
public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
administerService.exportExerciseTest(classDetailDTO);
}
@PostMapping("answerRecord")
......@@ -143,9 +144,9 @@ public class AdministerController {
@PostMapping("exportAnswerRecord")
@ApiOperation("班级管理--答疑 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportAnswerRecord(@RequestBody ClassDetailDTO classDetailDTO){
List<AnswerRecordVO> answerRecordVOS = administerService.exportAnswerRecord(classDetailDTO);
ExcelUtil.writeExcel(answerRecordVOS,AnswerRecordVO.class);
public void exportAnswerRecord(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
administerService.exportAnswerRecord(classDetailDTO);
}
@PostMapping("exportZip")
......
......@@ -61,7 +61,7 @@ public class MemberController {
@PostMapping("updateMember")
@ApiOperation("编辑成员 {id departmentId userName accountName telephone gender image idCard status}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateMember(@RequestBody AddMemberDTO addMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.updateMember(addMemberDTO));
}
......
......@@ -13,4 +13,6 @@ public class ClassDetailDTO {
private String userName;
Boolean flag;
}
......@@ -14,6 +14,6 @@ public class ClassSignInfoDTO {
private Integer pageNum;
private Integer id;
private Integer companyId;
}
......@@ -42,22 +42,22 @@ public interface AdministerService extends IService<AdministerDO> {
IPage classDetail(ClassDetailDTO classDetailDTO);
List<ClassDetailVO> exportClassDetail(ClassDetailDTO classDetailDTO);
List<ClassDetailVO> exportClassDetail(ClassDetailDTO classDetailDTO)throws Exception;
IPage signDetail(ClassDetailDTO classDetailDTO);
List<ClassSignVO> exportSignDetail(ClassDetailDTO classDetailDTO);
List<ClassSignVO> exportSignDetail(ClassDetailDTO classDetailDTO)throws Exception;
IPage exerciseTest(ClassDetailDTO classDetailDTO);
List<ExerciseTestVO> exportExerciseTest(ClassDetailDTO classDetailDTO);
List<ExerciseTestVO> exportExerciseTest(ClassDetailDTO classDetailDTO)throws Exception;
IPage answerRecord(ClassDetailDTO classDetailDTO);
List<AnswerRecordVO> exportAnswerRecord(ClassDetailDTO classDetailDTO);
List<AnswerRecordVO> exportAnswerRecord(ClassDetailDTO classDetailDTO)throws Exception;
void export(ClassDetailDTO classDetailDTO)throws Exception;
List<MemberDO> importMember(Long companyId, MultipartFile multipartFile);
String importMember(Long companyId, MultipartFile multipartFile);
}
......@@ -39,7 +39,7 @@ public interface MemberService extends IService<MemberDO> {
MemberStudyPageVO studyPage(MemberDO memberDO);
List<ContentVodVO> contentVod(ContentMemberDTO contentVodDTO);
ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO);
List<ContentFilesVO> contentFiles(ContentMemberDTO contentMemberDTO);
......
......@@ -2,6 +2,7 @@ package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.administer.VerifyCodeDTO;
......@@ -135,6 +136,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
public String updateMember(AddMemberDTO addMemberDTO) {
if (null!= addMemberDTO.getDepartmentIds()){
Integer count = this.baseMapper.selectCount(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getTelephone, addMemberDTO.getTelephone())
......@@ -144,7 +146,6 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
if (count > 0) {
throw new HttpException(20002);
}
Integer count1 = this.baseMapper.selectCount(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getAccountName, addMemberDTO.getAccountName())
......@@ -154,10 +155,13 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
if (count1 > 0) {
throw new HttpException(20002);
}
}
MemberDO memberDO = new MemberDO();
BeanUtils.copyProperties(addMemberDTO, memberDO);
this.baseMapper.updateById(memberDO);
if (null != addMemberDTO.getDepartmentIds()){
memberDepartmentMappingMapper.delete(new QueryWrapper<MemberDepartmentMappingDO>()
.lambda()
.eq(MemberDepartmentMappingDO::getMemberId, addMemberDTO.getId()));
......@@ -170,6 +174,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
memberDepartmentMappingDO.setDepartmentId(lg);
memberDepartmentMappingMapper.insert(memberDepartmentMappingDO);
}
}
return ConstantUtils.SET_SUCCESS;
}
......@@ -291,7 +296,9 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
return memberStudyPageVO;
}
public List<ContentVodVO> contentVod(ContentMemberDTO contentVodDTO) {
public ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO) {
ContentVodNewVO contentVodNewVO = new ContentVodNewVO();
List<ContentVodVO> contentVodVOS = new ArrayList<>();
List<CourseContentDO> courseContentDOS = courseContentMapper.selectList(new QueryWrapper<CourseContentDO>()
......@@ -345,7 +352,20 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
contentVodVOS.add(contentVodVO);
}
return contentVodVOS;
contentVodNewVO.setContentVodVOS(contentVodVOS);
List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>()
.lambda()
.eq(VodPlayHistoryDO::getClassId,contentVodDTO.getClassId())
.eq(VodPlayHistoryDO::getMemberId,contentVodDTO.getMemberId())
.orderByDesc(VodPlayHistoryDO::getCreateDate));
if (vodPlayHistoryDOS.size()>0){
VodPlayHistoryDO vodPlayHistoryDO = vodPlayHistoryDOS.get(0);
VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO.getVodId());
BeanUtils.copyProperties(vodDictDO,contentVodNewVO);
contentVodNewVO.setPlayRecord(vodPlayHistoryDO.getPlayRecord());
}
return contentVodNewVO;
}
public List<ContentFilesVO> contentFiles(ContentMemberDTO contentMemberDTO) {
......
......@@ -84,7 +84,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
Page pager = new Page(classSignInfoDTO.getPageNum(), classSignInfoDTO.getPageSize());
IPage<ClassSignInfoVO> classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(),classSignInfoDTO.getId());
IPage<ClassSignInfoVO> classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(),classSignInfoDTO.getCompanyId());
List<ClassSignInfoVO> classSignInfoVOS = classSignInfoVOIPage.getRecords();
for (ClassSignInfoVO classSignInfoVO : classSignInfoVOS){
......@@ -140,7 +140,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
passNum++;
}
}
classSignInfoVO.setPassRate(100* MathUtil.intDivFloorPercent(passNum,classMemberMappingDOS.size()));
classSignInfoVO.setPassRate(MathUtil.intDivFloorPercent(passNum,classMemberMappingDOS.size()));
//平均签到数 向上取整
......
......@@ -20,4 +20,8 @@ public class ExerciseTestVO {
@ExcelColumn(col = 3,value = "最高分")
private String result;
private String idCard;
private String telephone;
}
......@@ -4,7 +4,7 @@ import com.subsidy.util.excel.ExcelColumn;
import lombok.Data;
@Data
public class ClassDetailVO {
public class ClassDetailVO <T>{
private Long id;
......@@ -16,7 +16,7 @@ public class ClassDetailVO {
private String accountName;
@ExcelColumn(col = 3,value = "身份证号")
private String idCards;
private String idCard;
@ExcelColumn(col = 4,value = "联系方式")
private String telephone;
......
......@@ -13,6 +13,10 @@ public class ClassSignVO {
@ExcelColumn(col = 1,value = "成员名称")
private String userName;
private String idCard;
private String telephone;
/**
* 签到次数
*/
......
package com.subsidy.vo.member;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.subsidy.model.VodDictDO;
import lombok.Data;
import java.util.List;
@Data
public class ContentVodNewVO {
private Integer playRecord;
private Long id;
/**
* 目录id
*/
private Long contentId;
/**
* 视频名称
*/
private String vodName;
/**
* 视频时长
*/
private Integer vodLength;
/**
* 视频格式
*/
private String vodType;
/**
* 视频大小
*/
private String vodSize;
/**
* 视频地址
*/
private String vodUrl;
/**
* 视频编码
*/
private String vodCode;
/**
* 讲师名称
*/
private String teacherName;
/**
* 封面
*/
private String coverPage;
private List<ContentVodVO> contentVodVOS;
}
......@@ -21,4 +21,6 @@ public class StudyPageVO {
private Integer doneMember;
private String className;
}
# 环境配置
spring.profiles.active=prod
spring.profiles.active=dev
# 文件编码 UTF8
spring.mandatory-file-encoding=UTF-8
......
......@@ -28,3 +28,5 @@ meishu.code-message[80002]=uuid验证失败
meishu.code-message[90001]=该类目已存在
meishu.code-message[10001]=导入失败
......@@ -67,7 +67,8 @@
t2.id,
t2.user_name,
t2.account_name,
t2.telephone
t2.telephone,
t2.id_card
FROM
class_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
......@@ -85,7 +86,8 @@
t2.id,
t2.user_name,
t2.account_name,
t2.telephone
t2.telephone,
t2.id_card
FROM
class_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
......
......@@ -43,6 +43,7 @@
<if test="className != null and className !=''">
and t.class_name like concat('%',#{className} ,'%')
</if>
order by t.create_date desc
</select>
<select id="getClassVods" parameterType="long" resultType="com.subsidy.model.VodDictDO">
......
......@@ -29,7 +29,8 @@
t3.id,
t2.id as classId,
t3.course_name,
t2.end_date
t2.end_date,
t2.class_name
FROM
class_member_mapping t
LEFT JOIN class_dict t2 ON t.class_id = t2.id
......
......@@ -30,21 +30,26 @@
t2.teacher_name,
t2.vod_url,
t2.vod_name,
round( t.play_record *100/ t2.vod_length ,0) AS percent
t3.play_record,
round( t3.play_record * 100 / t2.vod_length, 0 ) AS percent
FROM
(
SELECT
t.vod_id,
t.play_record,
max( t.update_date )
t.member_id,
max( t.create_date ) AS playDate
FROM
vod_play_history t
WHERE
t.delete_date IS NULL
AND t.member_id = #{memberId}
GROUP BY
t.vod_id
t.vod_id,
t.member_id
) t
LEFT JOIN vod_play_history t3 ON t.playDate = t3.create_date
AND t.vod_id = t3.vod_id
AND t.member_id = t3.member_id
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t2.delete_date IS NULL
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!