Commit 85298f8d by 涂亚平

视频上传转码替换

1 parent 301a3dcd
...@@ -22,4 +22,6 @@ public class VODConfig { ...@@ -22,4 +22,6 @@ public class VODConfig {
private String api; private String api;
private String region; private String region;
private Integer classId;
} }
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.model.ClassHourDictDO;
import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.service.ClassHourDictService;
import com.subsidy.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
/**
* <p>
* 课时 前端控制器
* </p>
*
* @author DengMin
* @since 2021-11-26
*/
@RestController
@Api(tags = "课时")
@RequestMapping("/classHour")
public class ClassHourDictController {
@Autowired
private ClassHourDictService classHourDictService;
@PostMapping("getSetting")
@ApiOperation("查看当天设置的最大学习时长")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSetting(){
return ResponseData.generateCreatedResponse(0,classHourDictService.getSetting());
}
@PostMapping("updateSetting")
@ApiOperation("修改当天设置时长 id classHour status")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateSetting(@RequestBody ClassHourDictDO classHourDictDO){
return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(classHourDictDO));
}
@PostMapping("pollingGet")
@ApiOperation("轮询查询当前这个人当天有没有超过最长时长 memberId playLength")
public ResponseVO pollingGet(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
return ResponseData.generateCreatedResponse(0,classHourDictService.pollingGet(vodPlayHistoryDO));
}
}
...@@ -68,4 +68,5 @@ public class VodDictController { ...@@ -68,4 +68,5 @@ public class VodDictController {
} }
} }
package com.subsidy.mapper;
import com.subsidy.model.ClassHourDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 课时 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-11-26
*/
@Repository
public interface ClassHourDictMapper extends BaseMapper<ClassHourDictDO> {
}
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 课时
* </p>
*
* @author DengMin
* @since 2021-11-26
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("class_hour_dict")
public class ClassHourDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 课时
*/
private Integer classHour;
/**
* 有效/无效
*/
private Integer status;
}
package com.subsidy.service;
import com.subsidy.model.ClassHourDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.vo.hour.PollingGetVO;
/**
* <p>
* 课时 服务类
* </p>
*
* @author DengMin
* @since 2021-11-26
*/
public interface ClassHourDictService extends IService<ClassHourDictDO> {
ClassHourDictDO getSetting();
String updateSetting(ClassHourDictDO classHourDictDO);
PollingGetVO pollingGet(VodPlayHistoryDO vodPlayHistoryDO);
}
...@@ -45,6 +45,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -45,6 +45,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.lang.reflect.Member; import java.lang.reflect.Member;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
...@@ -254,7 +255,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -254,7 +255,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
} }
} }
} }
classSummaryVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods,classMemberMappingDOS.size())); classSummaryVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods, classMemberMappingDOS.size()));
//平均完成时长 学生观看课程视频的全部时长/总人数 //平均完成时长 学生观看课程视频的全部时长/总人数
int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size()); int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size());
...@@ -327,7 +328,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -327,7 +328,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
} }
} }
for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS){ for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) {
playLength += vodPlayHistoryDO.getPlayLength(); playLength += vodPlayHistoryDO.getPlayLength();
} }
...@@ -345,15 +346,15 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -345,15 +346,15 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
classDetailVO.setTotalExeCounts(exerciseDoneResultDO.getTotalCounts()); classDetailVO.setTotalExeCounts(exerciseDoneResultDO.getTotalCounts());
classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts()));
if (classDetailVO.getScore()>=60){ if (classDetailVO.getScore() >= 60) {
classDetailVO.setResult("合格"); classDetailVO.setResult("合格");
}else { } else {
classDetailVO.setResult("不合格"); classDetailVO.setResult("不合格");
} }
} }
classDetailVO.setClassProcess(i+"/"+vodDictDOS.size()); classDetailVO.setClassProcess(i + "/" + vodDictDOS.size());
//答疑 //答疑
Integer count = answeringQuestionMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>() Integer count = answeringQuestionMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>()
.lambda() .lambda()
...@@ -410,7 +411,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -410,7 +411,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
} }
for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS){ for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) {
playLength += vodPlayHistoryDO.getPlayLength(); playLength += vodPlayHistoryDO.getPlayLength();
} }
} }
...@@ -473,7 +474,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -473,7 +474,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//该学生完成了多少个 //该学生完成了多少个
int i = 0; int i = 0;
int playLength = 0 ; int playLength = 0;
//该成员完成了几个视频 //该成员完成了几个视频
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>()
...@@ -487,12 +488,12 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -487,12 +488,12 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
i++; i++;
} }
} }
for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS){ for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) {
playLength += vodPlayHistoryDO.getPlayLength(); playLength += vodPlayHistoryDO.getPlayLength();
} }
} }
classSignVO.setStudyVodCounts(i); classSignVO.setStudyVodCounts(i);
classSignVO.setClassProcess(i+"/"+vodDictDOS.size()); classSignVO.setClassProcess(i + "/" + vodDictDOS.size());
//完成率 //完成率
String percent = MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(i), new BigDecimal(vodDictDOS.size())); String percent = MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(i), new BigDecimal(vodDictDOS.size()));
...@@ -552,7 +553,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -552,7 +553,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
i++; i++;
} }
} }
for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS){ for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) {
playLength += vodPlayHistoryDO.getPlayLength(); playLength += vodPlayHistoryDO.getPlayLength();
} }
} }
...@@ -690,7 +691,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -690,7 +691,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
IPage iPage = this.baseMapper.answerRecord(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); IPage iPage = this.baseMapper.answerRecord(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
List<AnswerRecordVO> answerRecordVOS = iPage.getRecords(); List<AnswerRecordVO> answerRecordVOS = iPage.getRecords();
if (classDetailDTO.getFlag()){ if (classDetailDTO.getFlag()) {
ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
...@@ -710,7 +711,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -710,7 +711,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
response.reset(); response.reset();
response.setHeader("Access-Control-Allow-Origin", "*"); response.setHeader("Access-Control-Allow-Origin", "*");
response.setContentType("application/zip;charset=utf-8"); response.setContentType("application/zip;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + new String((zipname).getBytes("UTF-8"), "ISO8859-1")); response.setHeader("Content-Disposition", "attachment;filename=" + new String((zipname).getBytes(StandardCharsets.UTF_8), "ISO8859-1"));
ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
...@@ -794,22 +795,19 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -794,22 +795,19 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
memberDO1.setUserName(s.getUserName()); memberDO1.setUserName(s.getUserName());
memberDO1.setGender(s.getGender()); memberDO1.setGender(s.getGender());
try { try {
String accountName = PinyinHelper.toHanYuPinyinString(s.getUserName(),format,"",true); String accountName = PinyinHelper.toHanYuPinyinString(s.getUserName(), format, "", true);
//List<MemberDO> memberDOS1 = memberMapper.selectList(new QueryWrapper<MemberDO>() List<MemberDO> memberDOS = memberMapper.selectList(new QueryWrapper<MemberDO>()
//.lambda() .lambda()
//.like(MemberDO::getAccountName,accountName) .eq(MemberDO::getAccountName, accountName));
//.orderByDesc(MemberDO::getCreateDate)); if (memberDOS.size() > 0) {
//if (memberDOS1.size()>0){ String usernames = userName(accountName, 0);
// MemberDO mem = memberDOS1.get(0); memberDO1.setAccountName(usernames);
// Integer num = Integer.valueOf(mem.getAccountName().substring(mem.getAccountName().length()-4))+1; } else {
// memberDO1.setAccountName(accountName+num);
//}else {
memberDO1.setAccountName(accountName); memberDO1.setAccountName(accountName);
//} }
}catch (BadHanyuPinyinOutputFormatCombination ex) { } catch (BadHanyuPinyinOutputFormatCombination ex) {
} }
//memberDO1.setAccountName(s.getAccountName());
memberDO1.setTelephone(s.getTelephone()); memberDO1.setTelephone(s.getTelephone());
memberDO1.setIdCard(s.getIdCard()); memberDO1.setIdCard(s.getIdCard());
memberDO1.setStatus("启用"); memberDO1.setStatus("启用");
...@@ -834,6 +832,18 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -834,6 +832,18 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
} }
public String userName(String originName, int i) {
i++;
List<MemberDO> memberDOS = memberMapper.selectList(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getAccountName, originName + i));
if (memberDOS.size() > 0) {
return userName(originName, i);
} else {
return originName + i;
}
}
public static void membersListExcel(String companyName, String studyDate, String courseName, String title, List<String> headerList, List<ClassDetailVO> classDetailVOS, String datePattern, int colWidth, OutputStream out) { public static void membersListExcel(String companyName, String studyDate, String courseName, String title, List<String> headerList, List<ClassDetailVO> classDetailVOS, String datePattern, int colWidth, OutputStream out) {
...@@ -904,13 +914,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -904,13 +914,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
int[] secondWidth = new int[2]; int[] secondWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] secondHead = new String[2]; String[] secondHead = new String[2];
List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); List<String> secondList = Arrays.asList("培训实施单位:" + companyName, "培训时间:" + studyDate);
//第三行 //第三行
int[] thirdWidth = new int[2]; int[] thirdWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] thirdHead = new String[2]; String[] thirdHead = new String[2];
List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); List<String> thirdList = Arrays.asList("培训项目:" + courseName, "培训平台:有课互联系统");
ii = 0; ii = 0;
...@@ -1125,13 +1135,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1125,13 +1135,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
int[] secondWidth = new int[2]; int[] secondWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] secondHead = new String[2]; String[] secondHead = new String[2];
List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); List<String> secondList = Arrays.asList("培训实施单位:" + companyName, "培训时间:" + studyDate);
//第三行 //第三行
int[] thirdWidth = new int[2]; int[] thirdWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] thirdHead = new String[2]; String[] thirdHead = new String[2];
List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); List<String> thirdList = Arrays.asList("培训项目:" + courseName, "培训平台:有课互联系统");
ii = 0; ii = 0;
...@@ -1335,13 +1345,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1335,13 +1345,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
int[] secondWidth = new int[2]; int[] secondWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] secondHead = new String[2]; String[] secondHead = new String[2];
List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); List<String> secondList = Arrays.asList("培训实施单位:" + companyName, "培训时间:" + studyDate);
//第三行 //第三行
int[] thirdWidth = new int[2]; int[] thirdWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] thirdHead = new String[2]; String[] thirdHead = new String[2];
List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); List<String> thirdList = Arrays.asList("培训项目:" + courseName, "培训平台:有课互联系统");
ii = 0; ii = 0;
...@@ -1449,17 +1459,17 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1449,17 +1459,17 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//次数 //次数
newCell = dataRow.createCell(5); newCell = dataRow.createCell(5);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
if (exerciseTestVO.getScore()!=0){ if (exerciseTestVO.getScore() != 0) {
newCell.setCellValue(1); newCell.setCellValue(1);
}else { } else {
newCell.setCellValue(0); newCell.setCellValue(0);
} }
newCell = dataRow.createCell(6); newCell = dataRow.createCell(6);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
if (exerciseTestVO.getScore()>=60){ if (exerciseTestVO.getScore() >= 60) {
newCell.setCellValue("合格"); newCell.setCellValue("合格");
}else { } else {
newCell.setCellValue("不合格"); newCell.setCellValue("不合格");
} }
...@@ -1476,7 +1486,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1476,7 +1486,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
} }
} }
public static void askListExcel(String companyName, String studyDate, String courseName,String title, List<String> headerList, List<AnswerRecordVO> answerRecordVOS, String datePattern, int colWidth, OutputStream out) { public static void askListExcel(String companyName, String studyDate, String courseName, String title, List<String> headerList, List<AnswerRecordVO> answerRecordVOS, String datePattern, int colWidth, OutputStream out) {
// 声明一个工作薄 // 声明一个工作薄
SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存
workbook.setCompressTempFiles(true); workbook.setCompressTempFiles(true);
...@@ -1544,13 +1554,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1544,13 +1554,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
int[] secondWidth = new int[2]; int[] secondWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] secondHead = new String[2]; String[] secondHead = new String[2];
List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); List<String> secondList = Arrays.asList("培训实施单位:" + companyName, "培训时间:" + studyDate);
//第三行 //第三行
int[] thirdWidth = new int[2]; int[] thirdWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] thirdHead = new String[2]; String[] thirdHead = new String[2];
List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); List<String> thirdList = Arrays.asList("培训项目:" + courseName, "培训平台:有课互联系统");
ii = 0; ii = 0;
...@@ -1601,7 +1611,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1601,7 +1611,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
sheet.addMergedRegion(cellRangeAddress31); sheet.addMergedRegion(cellRangeAddress31);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 3,5); CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 3, 5);
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]);
......
...@@ -119,13 +119,13 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -119,13 +119,13 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
ClassDictDO classDictDO1 = this.baseMapper.selectById(classDictDO.getId()); ClassDictDO classDictDO1 = this.baseMapper.selectById(classDictDO.getId());
CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO1.getCourseId()); CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO1.getCourseId());
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO1.getCompanyId());
//查找这个班级里的学员的手机号 //查找这个班级里的学员的手机号
List<MemberDO> memberDOS = this.baseMapper.classMembers(classDictDO.getId()); List<MemberDO> memberDOS = this.baseMapper.classMembers(classDictDO.getId());
StringBuilder telephone = new StringBuilder(); StringBuilder telephone = new StringBuilder();
String param = "{\"company\":\""+companyDictDO.getCompanyName()+ "\",course\":\""+courseDictDO.getCourseName()+ "\",\"startDate\":\""+classDictDO1.getStartDate() +"\",\"endDate\":\""+classDictDO1.getEndDate() +"\"}"; String param = "{\"company\":\""+companyDictDO.getCompanyName()+ "\",\"course\":\""+courseDictDO.getCourseName()+ "\",\"startDate\":\""+classDictDO1.getStartDate() +"\",\"endDate\":\""+classDictDO1.getEndDate() +"\"}";
if (memberDOS.size()>0){ if (memberDOS.size()>0){
for (int i = 0 ;i< memberDOS.size();i++){ for (int i = 0 ;i< memberDOS.size();i++){
telephone.append(memberDOS.get(i).getTelephone()); telephone.append(memberDOS.get(i).getTelephone());
...@@ -133,7 +133,7 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -133,7 +133,7 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
telephone.append(","); telephone.append(",");
} }
} }
SMSUtils.sendNoticeSMS("SMS_228117919",telephone.toString(),param); SMSUtils.sendNoticeSMS("SMS_228137810",telephone.toString(),param);
} }
return ConstantUtils.SUCCESS_SEND_OUT; return ConstantUtils.SUCCESS_SEND_OUT;
} }
......
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.mapper.VodPlayHistoryMapper;
import com.subsidy.model.ClassHourDictDO;
import com.subsidy.mapper.ClassHourDictMapper;
import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.service.ClassHourDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.hour.PollingGetVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.List;
/**
* <p>
* 课时 服务实现类
* </p>
*
* @author DengMin
* @since 2021-11-26
*/
@Service
public class ClassHourDictServiceImpl extends ServiceImpl<ClassHourDictMapper, ClassHourDictDO> implements ClassHourDictService {
@Autowired
private ClassHourDictMapper classHourDictMapper;
@Autowired
private VodPlayHistoryMapper vodPlayHistoryMapper;
public ClassHourDictDO getSetting() {
ClassHourDictDO classHourDictDO = this.baseMapper.selectOne(null);
return classHourDictDO;
}
public String updateSetting(ClassHourDictDO classHourDictDO){
this.baseMapper.updateById(classHourDictDO);
return ConstantUtils.ADD_SUCCESS;
}
public PollingGetVO pollingGet(VodPlayHistoryDO vodPlayHistoryDO){
PollingGetVO pollingGetVO = new PollingGetVO();
//查看系统设定的时长
ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne(new QueryWrapper<ClassHourDictDO>()
.lambda()
.eq(ClassHourDictDO::getStatus,1));
if (null == classHourDictDO){
pollingGetVO.setBool(false);
return pollingGetVO;
}
//查看当天这个人看了多少时间
List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>()
.lambda()
.eq(VodPlayHistoryDO::getMemberId,vodPlayHistoryDO.getMemberId())
.eq(VodPlayHistoryDO::getCreateDate, LocalDate.now()));
int total = 0 ;
for (VodPlayHistoryDO vodPlayHistoryDO1 : vodPlayHistoryDOS){
total += vodPlayHistoryDO1.getPlayLength();
}
//是否超过时长 没超过 false 超过 true
if (total + vodPlayHistoryDO.getPlayLength() < classHourDictDO.getClassHour()*60*60){
pollingGetVO.setBool(false);
}else {
pollingGetVO.setBool(true);
}
return pollingGetVO;
}
}
...@@ -94,6 +94,15 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -94,6 +94,15 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
public String deleteMember(MemberDO memberDO) { public String deleteMember(MemberDO memberDO) {
this.baseMapper.deleteById(memberDO.getId()); this.baseMapper.deleteById(memberDO.getId());
classMemberMappingMapper.delete(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getMemberId,memberDO.getId()));
memberDepartmentMappingMapper.delete(new QueryWrapper<MemberDepartmentMappingDO>()
.lambda()
.eq(MemberDepartmentMappingDO::getMemberId,memberDO.getId()));
return ConstantUtils.DELETE_SUCCESS; return ConstantUtils.DELETE_SUCCESS;
} }
...@@ -109,8 +118,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -109,8 +118,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
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()));
.eq(MemberDO::getDepartmentId, addMemberDTO.getDepartmentId()));
if (count1 > 0) { if (count1 > 0) {
throw new HttpException(20002); throw new HttpException(20002);
...@@ -140,7 +148,6 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -140,7 +148,6 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
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())
.eq(MemberDO::getDepartmentId, addMemberDTO.getDepartmentId())
.ne(MemberDO::getId, addMemberDTO.getId())); .ne(MemberDO::getId, addMemberDTO.getId()));
if (count > 0) { if (count > 0) {
...@@ -149,7 +156,6 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -149,7 +156,6 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
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())
.eq(MemberDO::getDepartmentId, addMemberDTO.getDepartmentId())
.ne(MemberDO::getId, addMemberDTO.getId())); .ne(MemberDO::getId, addMemberDTO.getId()));
if (count1 > 0) { if (count1 > 0) {
...@@ -336,7 +342,12 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -336,7 +342,12 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
memberVodVO.setStatus(false); memberVodVO.setStatus(false);
if (vodPlayHistoryDOS.size() > 0) { if (vodPlayHistoryDOS.size() > 0) {
memberVodVO.setPercent(MathUtil.intDivCeil(100 * vodPlayHistoryDOS.get(0).getPlayRecord(), vodDictDO.getVodLength())); int length = MathUtil.intDivCeil(100 * vodPlayHistoryDOS.get(0).getPlayRecord(), vodDictDO.getVodLength());
if (length>=100){
memberVodVO.setPercent(100);
}else {
memberVodVO.setPercent(length);
}
if (memberVodVO.getPercent() >= 80) { if (memberVodVO.getPercent() >= 80) {
memberVodVO.setStatus(true); memberVodVO.setStatus(true);
} }
......
...@@ -3,6 +3,7 @@ package com.subsidy.service.impl; ...@@ -3,6 +3,7 @@ package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.common.configure.VODConfig; import com.subsidy.common.configure.VODConfig;
import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.content.GetContendVodsDTO; import com.subsidy.dto.content.GetContendVodsDTO;
import com.subsidy.model.VodDictDO; import com.subsidy.model.VodDictDO;
import com.subsidy.mapper.VodDictMapper; import com.subsidy.mapper.VodDictMapper;
...@@ -12,6 +13,12 @@ import com.subsidy.util.ConstantUtils; ...@@ -12,6 +13,12 @@ import com.subsidy.util.ConstantUtils;
import com.subsidy.util.Signature; import com.subsidy.util.Signature;
import com.subsidy.vo.vod.GetContendVodsVO; import com.subsidy.vo.vod.GetContendVodsVO;
import com.subsidy.vo.vod.SignatureVO; import com.subsidy.vo.vod.SignatureVO;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.vod.v20180717.VodClient;
import com.tencentcloudapi.vod.v20180717.models.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -43,7 +50,7 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im ...@@ -43,7 +50,7 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im
signature.setCurrentTime(System.currentTimeMillis()); signature.setCurrentTime(System.currentTimeMillis());
signature.setRandom(new Random().nextInt(Integer.MAX_VALUE)); signature.setRandom(new Random().nextInt(Integer.MAX_VALUE));
signature.setSignValidDuration(3600 * 24 * 2); signature.setSignValidDuration(3600 * 24 * 2);
signature.setClassId(vodConfig.getClassId());
String sign = ""; String sign = "";
try { try {
sign = signature.getUploadSignature(); sign = signature.getUploadSignature();
...@@ -61,12 +68,64 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im ...@@ -61,12 +68,64 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im
} }
public String deleteVod(VodDictDO vodDictDO) { public String deleteVod(VodDictDO vodDictDO) {
VodDictDO vodDictDO1 = this.baseMapper.selectById(vodDictDO.getId());
this.baseMapper.deleteById(vodDictDO.getId()); this.baseMapper.deleteById(vodDictDO.getId());
try{
//删除原视频
Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey());
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("vod.tencentcloudapi.com");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
VodClient client = new VodClient(cred, "", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
DeleteMediaRequest req = new DeleteMediaRequest();
req.setFileId(vodDictDO1.getVodCode());
// 返回的resp是一个DeleteMediaResponse的实例,与请求对象对应
client.DeleteMedia(req);
} catch (TencentCloudSDKException e) {
System.out.println(e.toString());
}
return ConstantUtils.DELETE_SUCCESS; return ConstantUtils.DELETE_SUCCESS;
} }
public String addVod(VodDictDO vodDictDO) { public String addVod(VodDictDO vodDictDO) {
this.baseMapper.insert(vodDictDO); this.baseMapper.insert(vodDictDO);
//上传后直接转码
Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey());
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("vod.tencentcloudapi.com");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
VodClient client = new VodClient(cred, "", clientProfile);
ProcessMediaRequest processMediaRequest = new ProcessMediaRequest();
MediaProcessTaskInput mediaProcessTaskInput1 = new MediaProcessTaskInput();
TranscodeTaskInput[] transcodeTaskInputs1 = new TranscodeTaskInput[1];
TranscodeTaskInput transcodeTaskInput1 = new TranscodeTaskInput();
transcodeTaskInput1.setDefinition(ConstantUtils.TEMPLATE_VOD);
transcodeTaskInputs1[0] = transcodeTaskInput1;
mediaProcessTaskInput1.setTranscodeTaskSet(transcodeTaskInputs1);
processMediaRequest.setMediaProcessTask(mediaProcessTaskInput1);
processMediaRequest.setFileId(vodDictDO.getVodCode());
ProcessMediaResponse processMediaResponse = null;
try {
processMediaResponse = client.ProcessMedia(processMediaRequest);
System.out.println(processMediaResponse);
} catch (Exception ex) {
throw new HttpException(50001);
}
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
} }
......
...@@ -44,7 +44,7 @@ public class ConstantUtils { ...@@ -44,7 +44,7 @@ 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 TECH_NAME = "有课互联学习平台";
public static final String PUBLISH_SUCCESS = "发布成功"; public static final String PUBLISH_SUCCESS = "发布成功";
......
...@@ -61,10 +61,7 @@ public class DateFormatUtil { ...@@ -61,10 +61,7 @@ public class DateFormatUtil {
* @return * @return
*/ */
public static boolean compare(Date d1, Date d2 ) { public static boolean compare(Date d1, Date d2 ) {
if(d1.after(d2)) { return !d1.after(d2);
return false;
}
return true;
} }
/** /**
......
...@@ -6,12 +6,12 @@ import java.util.List; ...@@ -6,12 +6,12 @@ import java.util.List;
public class ExcelFormatUtils { public class ExcelFormatUtils {
public static final List<String> memberList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "账号", "联系方式", "签到次数", "课程进度", "培训时长", "答疑数", "测试成绩", "总评价"}); public static final List<String> memberList = Arrays.asList("序号", "成员名称", "身份证号码", "账号", "联系方式", "签到次数", "课程进度", "培训时长", "答疑数", "测试成绩", "总评价");
public static final List<String> signList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "培训时长", "课程进度", "完成率", "签到次数", "签到日期"}); public static final List<String> signList = Arrays.asList("序号", "成员名称", "身份证号码", "手机号码", "培训时长", "课程进度", "完成率", "签到次数", "签到日期");
public static final List<String> scoreList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "测试最高成绩", "测试次数", "总评价"}); public static final List<String> scoreList = Arrays.asList("序号", "成员名称", "身份证号码", "手机号码", "测试最高成绩", "测试次数", "总评价");
public static final List<String> answersList = Arrays.asList(new String[]{"序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间"}); public static final List<String> answersList = Arrays.asList("序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间");
} }
...@@ -161,7 +161,7 @@ public class MathUtil { ...@@ -161,7 +161,7 @@ public class MathUtil {
public static String unitFormat(int i) { public static String unitFormat(int i) {
String retStr = null; String retStr = null;
if (i >= 0 && i < 10) { if (i >= 0 && i < 10) {
retStr = "0" + Integer.toString(i); retStr = "0" + i;
} else { } else {
retStr = "" + i; retStr = "" + i;
} }
......
...@@ -16,6 +16,7 @@ public class Signature { ...@@ -16,6 +16,7 @@ public class Signature {
private long currentTime; private long currentTime;
private int random; private int random;
private int signValidDuration; private int signValidDuration;
private int classId;
private static final String HMAC_ALGORITHM = "HmacSHA1"; private static final String HMAC_ALGORITHM = "HmacSHA1";
private static final String CONTENT_CHARSET = "UTF-8"; private static final String CONTENT_CHARSET = "UTF-8";
...@@ -36,6 +37,7 @@ public class Signature { ...@@ -36,6 +37,7 @@ public class Signature {
contextStr += "&currentTimeStamp=" + currentTime; contextStr += "&currentTimeStamp=" + currentTime;
contextStr += "&expireTime=" + endTime; contextStr += "&expireTime=" + endTime;
contextStr += "&random=" + random; contextStr += "&random=" + random;
contextStr += "&classId=" + classId;
try { try {
Mac mac = Mac.getInstance(HMAC_ALGORITHM); Mac mac = Mac.getInstance(HMAC_ALGORITHM);
...@@ -76,4 +78,6 @@ public class Signature { ...@@ -76,4 +78,6 @@ public class Signature {
public void setSignValidDuration(int signValidDuration) { public void setSignValidDuration(int signValidDuration) {
this.signValidDuration = signValidDuration; this.signValidDuration = signValidDuration;
} }
public void setClassId(int classId){this.classId = classId;}
} }
...@@ -13,6 +13,7 @@ import org.apache.poi.xssf.streaming.SXSSFWorkbook; ...@@ -13,6 +13,7 @@ import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
...@@ -217,7 +218,7 @@ public class ZipTestUtils { ...@@ -217,7 +218,7 @@ public class ZipTestUtils {
s.setBirthday(new Date()); s.setBirthday(new Date());
s.setHeight(i); s.setHeight(i);
s.setWeight(i); s.setWeight(i);
s.setSex(i / 2 == 0 ? false : true); s.setSex(i / 2 != 0);
list.add(s); list.add(s);
} }
//Map<String, String> headMap = new LinkedHashMap<String, String>(); //Map<String, String> headMap = new LinkedHashMap<String, String>();
...@@ -228,7 +229,7 @@ public class ZipTestUtils { ...@@ -228,7 +229,7 @@ public class ZipTestUtils {
//headMap.put("weight", "体重"); //headMap.put("weight", "体重");
//headMap.put("sex", "性别"); //headMap.put("sex", "性别");
List<String> memberList = Arrays.asList(new String[]{"成员名称","账号","联系方式","签到次数","课程进度","培训时长","评级测试","答疑"}); List<String> memberList = Arrays.asList("成员名称","账号","联系方式","签到次数","课程进度","培训时长","评级测试","答疑");
//导出zip //导出zip
...@@ -255,28 +256,28 @@ public class ZipTestUtils { ...@@ -255,28 +256,28 @@ public class ZipTestUtils {
String zipname = "test.zip"; String zipname = "test.zip";
response.reset(); response.reset();
response.setContentType("application/x-download"); response.setContentType("application/x-download");
response.setHeader("Content-Disposition", "attachment;filename=" + new String((zipname).getBytes(), "iso-8859-1")); response.setHeader("Content-Disposition", "attachment;filename=" + new String((zipname).getBytes(), StandardCharsets.ISO_8859_1));
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
/** /**
* 班级成员 * 班级成员
*/ */
List<String> memberList = Arrays.asList(new String[]{"成员名称","账号","联系方式","签到次数","课程进度","培训时长","评级测试","答疑"}); List<String> memberList = Arrays.asList("成员名称","账号","联系方式","签到次数","课程进度","培训时长","评级测试","答疑");
/** /**
* 注册签到 * 注册签到
*/ */
List<String> signList = Arrays.asList(new String[]{"成员名称","培训时长","课程进度","完成率"}); List<String> signList = Arrays.asList("成员名称","培训时长","课程进度","完成率");
/** /**
* 测试成绩 * 测试成绩
*/ */
List<String> scoreList = Arrays.asList(new String[]{"成员名称","测试结果","最高分"}); List<String> scoreList = Arrays.asList("成员名称","测试结果","最高分");
/** /**
* 答疑记录 * 答疑记录
*/ */
List<String> answerList = Arrays.asList(new String[]{"提问","答疑","提问时间","提问成员","答疑时间"}); List<String> answerList = Arrays.asList("提问","答疑","提问时间","提问成员","答疑时间");
//Map<String, String> headMap = new LinkedHashMap<String, String>(); //Map<String, String> headMap = new LinkedHashMap<String, String>();
//headMap.put("name", "成员名称"); //headMap.put("name", "成员名称");
......
...@@ -15,6 +15,7 @@ import org.apache.poi.xssf.streaming.SXSSFWorkbook; ...@@ -15,6 +15,7 @@ import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Iterator; import java.util.Iterator;
...@@ -203,7 +204,7 @@ public class ZipUtils { ...@@ -203,7 +204,7 @@ public class ZipUtils {
s.setBirthday(new Date()); s.setBirthday(new Date());
s.setHeight(i); s.setHeight(i);
s.setWeight(i); s.setWeight(i);
s.setSex(i / 2 == 0 ? false : true); s.setSex(i / 2 != 0);
ja.add(s); ja.add(s);
} }
Map<String, String> headMap = new LinkedHashMap<String, String>(); Map<String, String> headMap = new LinkedHashMap<String, String>();
...@@ -243,7 +244,7 @@ public class ZipUtils { ...@@ -243,7 +244,7 @@ public class ZipUtils {
String((zipname). String((zipname).
getBytes(), "iso-8859-1")); getBytes(), StandardCharsets.ISO_8859_1));
for (int i = 1; i < 6; i++) { for (int i = 1; i < 6; i++) {
String dir = i % 2 == 0 ? "dirA" : "dirB"; String dir = i % 2 == 0 ? "dirA" : "dirB";
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
......
...@@ -313,13 +313,13 @@ public class ExcelUtil { ...@@ -313,13 +313,13 @@ public class ExcelUtil {
int[] secondWidth = new int[2]; int[] secondWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] secondHead = new String[2]; String[] secondHead = new String[2];
List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); List<String> secondList = Arrays.asList("培训实施单位:" + companyName, "培训时间:" + studyDate);
//第三行 //第三行
int[] thirdWidth = new int[2]; int[] thirdWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] thirdHead = new String[2]; String[] thirdHead = new String[2];
List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); List<String> thirdList = Arrays.asList("培训项目:" + courseName, "培训平台:有课互联系统");
ii = 0; ii = 0;
...@@ -541,13 +541,13 @@ public class ExcelUtil { ...@@ -541,13 +541,13 @@ public class ExcelUtil {
int[] secondWidth = new int[2]; int[] secondWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] secondHead = new String[2]; String[] secondHead = new String[2];
List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); List<String> secondList = Arrays.asList("培训实施单位:" + companyName, "培训时间:" + studyDate);
//第三行 //第三行
int[] thirdWidth = new int[2]; int[] thirdWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] thirdHead = new String[2]; String[] thirdHead = new String[2];
List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); List<String> thirdList = Arrays.asList("培训项目:" + courseName, "培训平台:有课互联系统");
ii = 0; ii = 0;
...@@ -758,13 +758,13 @@ public class ExcelUtil { ...@@ -758,13 +758,13 @@ public class ExcelUtil {
int[] secondWidth = new int[2]; int[] secondWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] secondHead = new String[2]; String[] secondHead = new String[2];
List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); List<String> secondList = Arrays.asList("培训实施单位:" + companyName, "培训时间:" + studyDate);
//第三行 //第三行
int[] thirdWidth = new int[2]; int[] thirdWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] thirdHead = new String[2]; String[] thirdHead = new String[2];
List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); List<String> thirdList = Arrays.asList("培训项目:" + courseName, "培训平台:有课互联系统");
ii = 0; ii = 0;
...@@ -976,13 +976,13 @@ public class ExcelUtil { ...@@ -976,13 +976,13 @@ public class ExcelUtil {
int[] secondWidth = new int[2]; int[] secondWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] secondHead = new String[2]; String[] secondHead = new String[2];
List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); List<String> secondList = Arrays.asList("培训实施单位:" + companyName, "培训时间:" + studyDate);
//第三行 //第三行
int[] thirdWidth = new int[2]; int[] thirdWidth = new int[2];
// 产生表格标题行,以及设置列宽 // 产生表格标题行,以及设置列宽
String[] thirdHead = new String[2]; String[] thirdHead = new String[2];
List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); List<String> thirdList = Arrays.asList("培训项目:" + courseName, "培训平台:有课互联系统");
ii = 0; ii = 0;
......
package com.subsidy.vo.hour;
import lombok.Data;
@Data
public class PollingGetVO {
private Boolean bool;
}
...@@ -30,7 +30,7 @@ mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl ...@@ -30,7 +30,7 @@ mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
spring.servlet.multipart.max-file-size=2048KB spring.servlet.multipart.max-file-size=2048KB
spring.servlet.multipart.max-request-size=4098KB spring.servlet.multipart.max-request-size=4098KB
wechat.appId: wx7785293ff5e31f14 wechat.appId= wx7785293ff5e31f14
wechat.appSecret: 25d57cad61fc1b45b3afa46d4c35e8f6 wechat.appSecret= 25d57cad61fc1b45b3afa46d4c35e8f6
wechat.msgUrl: https://teachai.youkehulian.com/login wechat.msgUrl= https://teachai.youkehulian.com/login
wechat.templateId: Z1HNPLOrKiHEjfR1KMP-cC-uH3BWqDJIHv365Ev20yQ wechat.templateId= Z1HNPLOrKiHEjfR1KMP-cC-uH3BWqDJIHv365Ev20yQ
# 环境配置 # 环境配置
spring.profiles.active=prod spring.profiles.active=dev
# 文件编码 UTF8 # 文件编码 UTF8
spring.mandatory-file-encoding=UTF-8 spring.mandatory-file-encoding=UTF-8
...@@ -14,7 +14,7 @@ spring.resources.add-mappings=false ...@@ -14,7 +14,7 @@ spring.resources.add-mappings=false
mybatis-plus.global-config.banner=false mybatis-plus.global-config.banner=false
# mybatis-plus相关配置 # mybatis-plus相关配置
mybatis-plus.m/classSubjectTask/queryTaskDetailapper-locations=classpath:mapper/*.xml mybatis-plus.mapper-locations=classpath:mapper/*.xml
# 是否开启自动驼峰命名规则映射 # 是否开启自动驼峰命名规则映射
mybatis-plus.configuration.map-underscore-to-camel-case=true mybatis-plus.configuration.map-underscore-to-camel-case=true
# 如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段 # 如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段
...@@ -42,6 +42,7 @@ vod.secretId= AKIDOcePHvZ2C5VeYHQGSO5aqtlNxJQLqfz2 ...@@ -42,6 +42,7 @@ vod.secretId= AKIDOcePHvZ2C5VeYHQGSO5aqtlNxJQLqfz2
vod.secretKey= vjHYRmrfDbw0rWxA7oFcj7F8lDPKCm8E vod.secretKey= vjHYRmrfDbw0rWxA7oFcj7F8lDPKCm8E
vod.api= vod.tencentcloudapi.com vod.api= vod.tencentcloudapi.com
vod.region= ap-shanghai vod.region= ap-shanghai
vod.classId= 848920
# quartz # quartz
# 数据持久化方式 # 数据持久化方式
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.ClassHourDictMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.ClassHourDictDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="class_hour" property="classHour" />
<result column="status" property="status" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, class_hour, status
</sql>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!