Commit c3ddb3a9 by 涂亚平

上线版本

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