Commit 59dc36cf by 涂亚平

oss

1 parent 589d1251
......@@ -110,7 +110,7 @@ public class CompanyDictController {
@PostMapping(value = "getCompanyDataOverview")
@ApiOperation("数据统计")
@LoginRequired
// @LoginRequired
public ResponseVO getCompanyDataOverview() {
return ResponseData.generateCreatedResponse(0, companyDictService.getCompanyDataOverview());
}
......
......@@ -8,6 +8,8 @@ import com.subsidy.dto.vod.ChangeOrdersDTO;
import com.subsidy.model.CourseContentDO;
import com.subsidy.service.CourseContentService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.excel.ExcelUtil;
import com.subsidy.vo.course.ExportClassContentVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -16,14 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 课程目录表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-11
*/
import java.util.List;
@RestController
@Api(tags = "课程目录表")
@RequestMapping("/courseContent")
......@@ -59,4 +55,13 @@ public class CourseContentController {
public ResponseVO updateContent(@RequestBody CourseContentDO courseContentDO){
return ResponseData.generateCreatedResponse(0,courseContentService.updateContent(courseContentDO));
}
@PostMapping("exportClassContent")
@ApiOperation("导出课程章节内容+视频 courseId 课程id")
// @LoginRequired
public void exportClassContent(@RequestBody CourseContentDO courseContentDO){
List<ExportClassContentVO> exportClassContentVOS = courseContentService.exportClassContent(courseContentDO);
ExcelUtil.writeExcel(exportClassContentVOS, ExportClassContentVO.class);
}
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.dto.content.GetContendVodsDTO;
import com.subsidy.dto.vod.ChangeOrdersDTO;
import com.subsidy.model.CourseContentDO;
import com.subsidy.vo.course.ExportClassContentVO;
import com.subsidy.vo.vod.GetContendVodsVO;
import java.util.List;
......@@ -25,4 +26,6 @@ public interface CourseContentService extends IService<CourseContentDO> {
String addContent(CourseContentDO courseContentDO);
String updateContent(CourseContentDO courseContentDO);
List<ExportClassContentVO> exportClassContent(CourseContentDO courseContentDO);
}
......@@ -1353,6 +1353,8 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//不带声调
format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
List<ImportMemberDTO> failMembers = new ArrayList<>();
ExcelUtil.readExcelWithoutTitle(null, ImportMemberDTO.class, multipartFile).forEach(s -> {
MemberDO memberDO = memberMapper.selectOne(new QueryWrapper<MemberDO>()
......@@ -1360,7 +1362,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
.eq(MemberDO::getTelephone, s.getTelephone()));
if (null != memberDO) {
//memberDOS.add(memberDO);
ImportMemberDTO importMemberDTO = new ImportMemberDTO();
BeanUtils.copyProperties(memberDO,importMemberDTO);
failMembers.add(importMemberDTO);
} else {
MemberDO memberDO1 = new MemberDO();
memberDO1.setUserName(s.getUserName());
......
......@@ -243,6 +243,12 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
classTypeDictDO.setClassType("企业内训");
classTypeDictDO.setCompanyId(companyDictDO.getId());
classTypeDictMapper.insert(classTypeDictDO);
classTypeDictDO.setClassType("社会化、学徒制");
classTypeDictMapper.insert(classTypeDictDO);
classTypeDictDO.setClassType("补贴培训");
classTypeDictMapper.insert(classTypeDictDO);
return ConstantUtils.ADD_SUCCESS;
}
......
......@@ -3,11 +3,22 @@ package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.administer.SelfExportVO;
import com.subsidy.mapper.CourseContentMapper;
import com.subsidy.mapper.CourseDictMapper;
import com.subsidy.mapper.VodDictMapper;
import com.subsidy.model.CourseContentDO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.service.CourseContentService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.MathUtil;
import com.subsidy.util.excel.ExcelUtil;
import com.subsidy.vo.course.ExportClassContentVO;
import com.subsidy.vo.vod.GetContendVodsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -21,6 +32,12 @@ import java.util.List;
@Service
public class CourseContentServiceImpl extends ServiceImpl<CourseContentMapper, CourseContentDO> implements CourseContentService {
@Autowired
private VodDictMapper vodDictMapper;
@Autowired
private CourseDictMapper courseDictMapper;
@Override
public List<CourseContentDO> getContents(CourseContentDO courseContentDO) {
return this.baseMapper.selectList(new QueryWrapper<CourseContentDO>()
......@@ -31,20 +48,20 @@ public class CourseContentServiceImpl extends ServiceImpl<CourseContentMapper, C
}
@Override
public String deleteContent(CourseContentDO courseContentDO){
public String deleteContent(CourseContentDO courseContentDO) {
this.baseMapper.deleteById(courseContentDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
@Override
public String addContent(CourseContentDO courseContentDO){
public String addContent(CourseContentDO courseContentDO) {
Integer orderNoTmp = this.baseMapper.selectMaxOrderNo(courseContentDO.getCourseId());
int orderNo = 1 ;
int orderNo = 1;
if (null!=orderNoTmp){
orderNo = orderNoTmp+1;
if (null != orderNoTmp) {
orderNo = orderNoTmp + 1;
}
courseContentDO.setOrderNo(orderNo);
this.baseMapper.insert(courseContentDO);
......@@ -52,19 +69,59 @@ public class CourseContentServiceImpl extends ServiceImpl<CourseContentMapper, C
}
@Override
public String updateContent(CourseContentDO courseContentDO){
public String updateContent(CourseContentDO courseContentDO) {
int count = this.baseMapper.selectCount(new QueryWrapper<CourseContentDO>()
.lambda()
.eq(CourseContentDO::getCourseId,courseContentDO.getCourseId())
.eq(CourseContentDO::getContent,courseContentDO.getContent())
.ne(CourseContentDO::getId,courseContentDO.getId()));
.eq(CourseContentDO::getCourseId, courseContentDO.getCourseId())
.eq(CourseContentDO::getContent, courseContentDO.getContent())
.ne(CourseContentDO::getId, courseContentDO.getId()));
if (count>0){
if (count > 0) {
throw new HttpException(40001);
}
this.baseMapper.updateById(courseContentDO);
return ConstantUtils.SET_SUCCESS;
}
public List<ExportClassContentVO> exportClassContent(CourseContentDO courseContentDO) {
List<ExportClassContentVO> exportClassContentVOS = new ArrayList<ExportClassContentVO>();
CourseDictDO courseDictDO = courseDictMapper.selectById(courseContentDO.getCourseId());
List<CourseContentDO> courseContentDOS = this.baseMapper.selectList(new QueryWrapper<CourseContentDO>()
.lambda()
.eq(CourseContentDO::getCourseId, courseContentDO.getCourseId())
.orderByAsc(CourseContentDO::getOrderNo)
.orderByAsc(CourseContentDO::getCreateDate));
int totalLength = 0;
for (CourseContentDO ccd : courseContentDOS) {
List<GetContendVodsVO> contendVods = vodDictMapper.getContendVods(null, ccd.getId());
for (GetContendVodsVO cvv : contendVods) {
ExportClassContentVO exportClassContentVO = new ExportClassContentVO();
exportClassContentVO.setCourseName(courseDictDO.getCourseName());
exportClassContentVO.setContent(ccd.getContent());
exportClassContentVO.setVodAliasName(cvv.getVodAliasName());
exportClassContentVO.setVodLength(MathUtil.vodLength(cvv.getVodLength()));
totalLength += cvv.getVodLength();
exportClassContentVOS.add(exportClassContentVO);
}
}
//总时长(时分秒)
String totalLengthTmp = MathUtil.secToTime(totalLength);
//总时长(分钟)
String totalMinute = MathUtil.ceilSecond(totalLength);
exportClassContentVOS.stream().forEach(x -> {
x.setTotalLength(totalLengthTmp);
x.setTotalMinute(totalMinute);
});
return exportClassContentVOS;
}
}
......@@ -161,7 +161,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime());
//查看这个人该时间段的学习记录
List<ChapterList3> chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(0).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
List<ChapterList3> chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
if (chapterList3s.size() > 0) {
loginList.setChapterList(chapterList3s);
loginLists.add(loginList);
......
......@@ -201,7 +201,7 @@ public class ShehuihuaServiceImpl implements ShehuihuaService {
loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime());
//查看这个人该时间段的学习记录
List<ChapterList3> chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(0).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
List<ChapterList3> chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
if (chapterList3s.size() > 0) {
loginList.setChapterList(chapterList3s);
loginLists.add(loginList);
......
package com.subsidy.vo.course;
import com.subsidy.util.excel.ExcelColumn;
import lombok.Data;
@Data
public class ExportClassContentVO {
@ExcelColumn(col = 1,value = "课程名")
private String courseName;
@ExcelColumn(col = 2,value = "总时长(时分秒)")
private String totalLength;
@ExcelColumn(col = 3,value = "总时长(分钟)")
private String totalMinute;
@ExcelColumn(col = 4,value = "章节")
private String content;
@ExcelColumn(col = 5,value = "视频名称")
private String vodAliasName;
@ExcelColumn(col = 6,value = "视频长度")
private String vodLength;
}
# 环境配置
spring.profiles.active=dev
spring.profiles.active=prod
#和CPU数
spring.server.acceptorThreadCount=600
spring.server.minSpareThreads=100
......
......@@ -256,7 +256,7 @@
FROM
vod_play_history t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
</select>
......
......@@ -70,7 +70,7 @@
FROM
opr_adm_dict
WHERE
create_date &lt; (NOW() - INTERVAL 1 DAY)
create_date &lt; (NOW() - INTERVAL 2 DAY)
</select>
</mapper>
......@@ -52,7 +52,7 @@
FROM
opr_mem_dict
WHERE
create_date &lt; (NOW() - INTERVAL 1 DAY)
create_date &lt; (NOW() - INTERVAL 2 DAY)
</select>
<select id="getLatestLoginInfo" parameterType="long" resultType="com.subsidy.model.OprMemDictDO">
......
......@@ -95,7 +95,7 @@
FROM
class_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
and t1.class_code is not NULL
<if test="classType != null and classType != ''">
......@@ -123,7 +123,7 @@
FROM
vod_play_history t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
GROUP BY
t1.class_id,
......@@ -144,7 +144,7 @@
FROM
opr_mem_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND opr_type = "登出"
AND result = 1
......@@ -158,7 +158,7 @@
FROM
opr_mem_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND opr_type = "登录"
AND result = 1
......@@ -179,7 +179,7 @@
FROM
activity_detection t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND t1.member_id = #{memberId}
AND t1.class_id = #{classId}
......@@ -193,7 +193,7 @@
image_check_record t1
WHERE
class_id =#{classId}
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.paper_id IS NOT NULL
and t1.result =1
AND t1.member_id=#{memberId}
......@@ -211,7 +211,7 @@
FROM
opr_mem_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND t1.user_id = #{memberId}
AND opr_type = "登出"
......@@ -225,7 +225,7 @@
FROM
opr_mem_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND t1.user_id = #{memberId}
AND opr_type = "登录"
......@@ -243,7 +243,7 @@
AND t.result = 1
AND t.delete_date IS NULL
AND opr_type = "登录"
AND DATE_FORMAT( DATE_ADD( create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
AND DATE_FORMAT( DATE_ADD( create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
NOW(),
'%Y-%m-%d'
)
......@@ -259,7 +259,7 @@
AND t.result = 1
AND t.delete_date IS NULL
AND opr_type = "登出"
AND DATE_FORMAT( DATE_ADD( create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
AND DATE_FORMAT( DATE_ADD( create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
NOW(),
'%Y-%m-%d'
)
......@@ -290,7 +290,7 @@
exercise_done_result t1
WHERE
t1.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
NOW(),
'%Y-%m-%d'
)
......@@ -307,7 +307,7 @@
LEFT JOIN member t2 ON t1.member_id = t2.id
WHERE
t1.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
And class_id = #{classId}
</select>
......@@ -341,7 +341,7 @@
exercise_done_result t1
WHERE
t1.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND class_id = #{classId}
AND member_id = #{memberId}
</select>
......@@ -372,7 +372,7 @@
LEFT JOIN class_dict t2 ON t1.class_id = t2.id
LEFT JOIN member t3 ON t1.ask_id = t3.id
WHERE
DATE_FORMAT( DATE_ADD( t1.update_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
DATE_FORMAT( DATE_ADD( t1.update_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
......@@ -386,7 +386,7 @@
left join class_dict t2 on t.class_id = t2.id
WHERE
t.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
AND DATE_FORMAT( DATE_ADD( t.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
NOW(),
'%Y-%m-%d'
)
......@@ -412,7 +412,7 @@
class_id = #{classId}
AND t1.delete_date IS NULL
and t2.delete_date is null
AND DATE_FORMAT( DATE_ADD( t1.update_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
AND DATE_FORMAT( DATE_ADD( t1.update_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
NOW(),
'%Y-%m-%d'
)
......@@ -431,7 +431,7 @@
LEFT JOIN member t2 ON t1.member_id = t2.id
WHERE
class_id = #{classId}
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.paper_id IS NOT NULL
AND t1.result = 1
</select>
......@@ -451,7 +451,7 @@
WHERE
t1.delete_date is null
and class_id = #{classId}
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.paper_id IS NULL
AND t1.result = 1
and t1.member_id
......@@ -474,7 +474,7 @@
LEFT JOIN member t2 ON t1.member_id = t2.id
WHERE
t1.delete_date is null
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 2 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
and class_id = #{classId}
AND t1.paper_id IS not NULL
AND t1.result = 1
......
......@@ -55,7 +55,7 @@
delete_date IS NULL
AND date(sign_in_date) = date_sub(
curdate(),
INTERVAL 1 DAY)
INTERVAL 2 DAY)
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!