Commit e58aafd0 by 涂亚平

2.2.1上线了。。。。

1 parent da8e4a00
...@@ -95,7 +95,7 @@ public class AdministerController { ...@@ -95,7 +95,7 @@ public class AdministerController {
@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));
} }
...@@ -198,7 +198,7 @@ public class AdministerController { ...@@ -198,7 +198,7 @@ public class AdministerController {
@PostMapping("exportZip") @PostMapping("exportZip")
@ApiOperation("下载压缩包 id 班级id") @ApiOperation("下载压缩包 id 班级id")
@CrossOrigin @CrossOrigin
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
administerService.export(classDetailDTO); administerService.export(classDetailDTO);
} }
......
...@@ -66,7 +66,7 @@ public class ClassDictController { ...@@ -66,7 +66,7 @@ public class ClassDictController {
@PostMapping("classDetail") @PostMapping("classDetail")
@ApiOperation("获取一个班级详情 id") @ApiOperation("获取一个班级详情 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO classDetail(@RequestBody ClassDictDO classDictDO){ public ResponseVO classDetail(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.classDetail(classDictDO)); return ResponseData.generateCreatedResponse(0,classDictService.classDetail(classDictDO));
} }
......
...@@ -50,7 +50,7 @@ public class ClassNoticeController { ...@@ -50,7 +50,7 @@ public class ClassNoticeController {
} }
@PostMapping("queryClassNotices") @PostMapping("queryClassNotices")
@ApiOperation("查看某个课程的通知提醒 classId 课程id status 状态(待发送/已发送)") @ApiOperation("查看某个课程的通知提醒 classId 课程id noticeType 状态(待发送/已发送)")
public ResponseVO queryClassNotices(@RequestBody ClassNoticeDO classNoticeDO){ public ResponseVO queryClassNotices(@RequestBody ClassNoticeDO classNoticeDO){
return ResponseData.generateCreatedResponse(0,classNoticeService.queryClassNotices(classNoticeDO)); return ResponseData.generateCreatedResponse(0,classNoticeService.queryClassNotices(classNoticeDO));
} }
......
...@@ -50,7 +50,7 @@ public class CourseDictController { ...@@ -50,7 +50,7 @@ public class CourseDictController {
@PostMapping("queryCourses") @PostMapping("queryCourses")
@ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId rankId courseType openStatus") @ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId rankId courseType openStatus")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){ public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO)); return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO));
} }
......
...@@ -67,7 +67,7 @@ public class CourseNotificationJob implements Job { ...@@ -67,7 +67,7 @@ public class CourseNotificationJob implements Job {
} }
ClassNoticeDO classNotice = new ClassNoticeDO(); ClassNoticeDO classNotice = new ClassNoticeDO();
classNotice.setId(classNoticeDO.getId()); classNotice.setId(classNoticeDO.getId());
classNotice.setStatus(CourseNotification.SENT); //classNotice.setStatus(CourseNotification.SENT);
classNoticeMapper.updateById(classNotice); classNoticeMapper.updateById(classNotice);
} }
} }
......
...@@ -41,9 +41,5 @@ public class ClassNoticeDO extends BaseModel { ...@@ -41,9 +41,5 @@ public class ClassNoticeDO extends BaseModel {
*/ */
private String noticeTime; private String noticeTime;
/**
* 发送状态
*/
private String status;
} }
...@@ -25,6 +25,7 @@ import com.subsidy.mapper.FieldDictMapper; ...@@ -25,6 +25,7 @@ import com.subsidy.mapper.FieldDictMapper;
import com.subsidy.mapper.MemberDepartmentMappingMapper; import com.subsidy.mapper.MemberDepartmentMappingMapper;
import com.subsidy.mapper.MemberMapper; import com.subsidy.mapper.MemberMapper;
import com.subsidy.mapper.OprAdmDictMapper; import com.subsidy.mapper.OprAdmDictMapper;
import com.subsidy.mapper.PaperDictMapper;
import com.subsidy.mapper.RoleAdministerMappingMapper; import com.subsidy.mapper.RoleAdministerMappingMapper;
import com.subsidy.mapper.SignInRecordMapper; import com.subsidy.mapper.SignInRecordMapper;
import com.subsidy.mapper.VodDictMapper; import com.subsidy.mapper.VodDictMapper;
...@@ -41,6 +42,7 @@ import com.subsidy.model.ExerciseDoneResultDO; ...@@ -41,6 +42,7 @@ import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.model.MemberDepartmentMappingDO; import com.subsidy.model.MemberDepartmentMappingDO;
import com.subsidy.model.OprAdmDictDO; import com.subsidy.model.OprAdmDictDO;
import com.subsidy.model.PaperDictDO;
import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.model.RoleAdministerMappingDO;
import com.subsidy.model.SignInRecordDO; import com.subsidy.model.SignInRecordDO;
import com.subsidy.model.VodDictDO; import com.subsidy.model.VodDictDO;
...@@ -187,6 +189,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -187,6 +189,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//@Autowired //@Autowired
//private MongoTemplate mongoTemplate; //private MongoTemplate mongoTemplate;
@Autowired
private PaperDictMapper paperDictMapper;
public LoginVO login(AdministerDO administerDO) { public LoginVO login(AdministerDO administerDO) {
LoginVO loginVO = new LoginVO(); LoginVO loginVO = new LoginVO();
...@@ -196,13 +201,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -196,13 +201,13 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
*/ */
//AdministerDO administerDO1 = (AdministerDO) redisUtil.get(RedisPrefixConstant.SUBSIDY_ADMINISTER_PREFIX + administerDO.getAccountName()); //AdministerDO administerDO1 = (AdministerDO) redisUtil.get(RedisPrefixConstant.SUBSIDY_ADMINISTER_PREFIX + administerDO.getAccountName());
//if (null == administerDO1) { //if (null == administerDO1) {
/** /**
* 查表,并将数据写入到redis * 查表,并将数据写入到redis
*/ */
AdministerDO administerDO1 = this.baseMapper.selectOne(new QueryWrapper<AdministerDO>() AdministerDO administerDO1 = this.baseMapper.selectOne(new QueryWrapper<AdministerDO>()
.lambda() .lambda()
.eq(AdministerDO::getAccountName, administerDO.getAccountName())); .eq(AdministerDO::getAccountName, administerDO.getAccountName()));
//redisUtil.set(RedisPrefixConstant.SUBSIDY_ADMINISTER_PREFIX + administerDO.getAccountName(), administerDO1); //redisUtil.set(RedisPrefixConstant.SUBSIDY_ADMINISTER_PREFIX + administerDO.getAccountName(), administerDO1);
//} //}
if (null == administerDO1) { if (null == administerDO1) {
...@@ -322,7 +327,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -322,7 +327,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) { public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) {
Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize());
IPage<OperatorsVO> operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), null,0); IPage<OperatorsVO> operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), null, 0);
List<OperatorsVO> operatorsVOS = operatorsVOIPage.getRecords(); List<OperatorsVO> operatorsVOS = operatorsVOIPage.getRecords();
for (OperatorsVO operatorsVO : operatorsVOS) { for (OperatorsVO operatorsVO : operatorsVOS) {
...@@ -421,7 +426,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -421,7 +426,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//视频 //视频
int i = 0; int i = 0;
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getMemberId(), vodDictDO.getId(),classDetailDTO.getId()); int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength( classDetailDTO.getId(),classMemberMappingDO.getMemberId(), vodDictDO.getId());
if (totalPlayLength >= vodDictDO.getVodLength()) { if (totalPlayLength >= vodDictDO.getVodLength()) {
i++; i++;
} }
...@@ -472,7 +477,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -472,7 +477,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
int playLength = 0; int playLength = 0;
//该成员完成了几个视频 //该成员完成了几个视频
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailVO.getId(), vodDictDO.getId(),classDetailDTO.getId()); int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(),classDetailVO.getId(), vodDictDO.getId());
if (totalPlayLength >= vodDictDO.getVodLength()) { if (totalPlayLength >= vodDictDO.getVodLength()) {
i++; i++;
} }
...@@ -512,9 +517,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -512,9 +517,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//签到次数 //签到次数
//long set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classDetailVO.getId() + ":classId:" + classDetailDTO.getId() + "*").stream().count(); //long set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classDetailVO.getId() + ":classId:" + classDetailDTO.getId() + "*").stream().count();
Integer set = signInRecordMapper.selectCount(new QueryWrapper<SignInRecordDO>() Integer set = signInRecordMapper.selectCount(new QueryWrapper<SignInRecordDO>()
.lambda() .lambda()
.eq(SignInRecordDO::getClassId,classDetailDTO.getId()) .eq(SignInRecordDO::getClassId, classDetailDTO.getId())
.eq(SignInRecordDO::getMemberId,classDetailVO.getId())); .eq(SignInRecordDO::getMemberId, classDetailVO.getId()));
classDetailVO.setSignCounts(set); classDetailVO.setSignCounts(set);
...@@ -543,7 +548,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -543,7 +548,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
int playLength = 0; int playLength = 0;
//该成员完成了几个视频 //该成员完成了几个视频
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailVO.getId(), vodDictDO.getId(),classDetailDTO.getId()); int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(),classDetailVO.getId(), vodDictDO.getId());
if (totalPlayLength >= vodDictDO.getVodLength()) { if (totalPlayLength >= vodDictDO.getVodLength()) {
i++; i++;
} }
...@@ -592,8 +597,8 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -592,8 +597,8 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//long set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classDetailVO.getId() + ":classId:" + classDetailDTO.getId() + "*").stream().count(); //long set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classDetailVO.getId() + ":classId:" + classDetailDTO.getId() + "*").stream().count();
Integer set = signInRecordMapper.selectCount(new QueryWrapper<SignInRecordDO>() Integer set = signInRecordMapper.selectCount(new QueryWrapper<SignInRecordDO>()
.lambda() .lambda()
.eq(SignInRecordDO::getClassId,classDetailDTO.getId()) .eq(SignInRecordDO::getClassId, classDetailDTO.getId())
.eq(SignInRecordDO::getMemberId,classDetailVO.getId())); .eq(SignInRecordDO::getMemberId, classDetailVO.getId()));
classDetailVO.setSignCounts(set); classDetailVO.setSignCounts(set);
...@@ -624,7 +629,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -624,7 +629,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
int playLength = 0; int playLength = 0;
//该成员完成了几个视频 //该成员完成了几个视频
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classSignVO.getId(), vodDictDO.getId(),classDetailDTO.getId()); int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(),classSignVO.getId(), vodDictDO.getId());
if (totalPlayLength >= vodDictDO.getVodLength()) { if (totalPlayLength >= vodDictDO.getVodLength()) {
i++; i++;
} }
...@@ -645,9 +650,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -645,9 +650,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//Set<String> set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); //Set<String> set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*");
List<SignInRecordDO> signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper<SignInRecordDO>() List<SignInRecordDO> signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper<SignInRecordDO>()
.lambda() .lambda()
.eq(SignInRecordDO::getClassId,classDetailDTO.getId()) .eq(SignInRecordDO::getClassId, classDetailDTO.getId())
.eq(SignInRecordDO::getMemberId,classSignVO.getId()) .eq(SignInRecordDO::getMemberId, classSignVO.getId())
.orderByAsc(SignInRecordDO::getSignInDate)); .orderByAsc(SignInRecordDO::getSignInDate));
classSignVO.setSignCounts(signInRecordDOS.size()); classSignVO.setSignCounts(signInRecordDOS.size());
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
...@@ -655,7 +660,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -655,7 +660,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
for (SignInRecordDO signInRecordDO : signInRecordDOS) { for (SignInRecordDO signInRecordDO : signInRecordDOS) {
//String[] array = signInRecordDO.split(":"); //String[] array = signInRecordDO.split(":");
//时间戳转时间 //时间戳转时间
stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T"," ").split(" " )[0]).append(";"); stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T", " ").split(" ")[0]).append(";");
} }
if (StringUtils.isNotBlank(stringBuilder.toString())) { if (StringUtils.isNotBlank(stringBuilder.toString())) {
String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1); String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1);
...@@ -683,7 +688,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -683,7 +688,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
int playLength = 0; int playLength = 0;
//该成员完成了几个视频 //该成员完成了几个视频
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classSignVO.getId(), vodDictDO.getId(),classDetailDTO.getId()); int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(),classSignVO.getId(), vodDictDO.getId());
if (totalPlayLength >= vodDictDO.getVodLength()) { if (totalPlayLength >= vodDictDO.getVodLength()) {
i++; i++;
} }
...@@ -702,8 +707,8 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -702,8 +707,8 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//Set<String> set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); //Set<String> set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*");
List<SignInRecordDO> signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper<SignInRecordDO>() List<SignInRecordDO> signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper<SignInRecordDO>()
.lambda() .lambda()
.eq(SignInRecordDO::getClassId,classDetailDTO.getId()) .eq(SignInRecordDO::getClassId, classDetailDTO.getId())
.eq(SignInRecordDO::getMemberId,classSignVO.getId()) .eq(SignInRecordDO::getMemberId, classSignVO.getId())
.orderByAsc(SignInRecordDO::getSignInDate)); .orderByAsc(SignInRecordDO::getSignInDate));
classSignVO.setSignCounts(signInRecordDOS.size()); classSignVO.setSignCounts(signInRecordDOS.size());
...@@ -715,7 +720,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -715,7 +720,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
for (SignInRecordDO signInRecordDO : signInRecordDOS) { for (SignInRecordDO signInRecordDO : signInRecordDOS) {
//String[] array = signInRecordDO.split(":"); //String[] array = signInRecordDO.split(":");
//时间戳转时间 //时间戳转时间
stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T"," ").split(" ")[0]).append(";"); stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T", " ").split(" ")[0]).append(";");
} }
if (StringUtils.isNotBlank(stringBuilder.toString())) { if (StringUtils.isNotBlank(stringBuilder.toString())) {
String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1); String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1);
...@@ -743,7 +748,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -743,7 +748,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
for (ExerciseTestVO exerciseTestVO : classSignVOS) { for (ExerciseTestVO exerciseTestVO : classSignVOS) {
//学生测试完成情况 //学生测试完成情况
TestScoreInfoVO testScoreInfoVO = exerciseDoneResultMapper.testScoreInfo(classDetailDTO.getPaperId(), exerciseTestVO.getId(),classDetailDTO.getId()); TestScoreInfoVO testScoreInfoVO = exerciseDoneResultMapper.testScoreInfo(classDetailDTO.getPaperId(), exerciseTestVO.getId(), classDetailDTO.getId());
exerciseTestVO.setPaperId(exerciseTestVO.getPaperId()); exerciseTestVO.setPaperId(exerciseTestVO.getPaperId());
if (null != testScoreInfoVO) { if (null != testScoreInfoVO) {
exerciseTestVO.setScore(testScoreInfoVO.getScore()); exerciseTestVO.setScore(testScoreInfoVO.getScore());
...@@ -773,7 +778,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -773,7 +778,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) { for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) {
//学生测试完成情况 //学生测试完成情况
//查看课程卷子 //查看课程卷子
TestScoreInfoVO testScoreInfoVO = exerciseDoneResultMapper.testScoreInfo(classDetailDTO.getPaperId(), exerciseTestVO.getId(),classDetailDTO.getId()); TestScoreInfoVO testScoreInfoVO = exerciseDoneResultMapper.testScoreInfo(classDetailDTO.getPaperId(), exerciseTestVO.getId(), classDetailDTO.getId());
exerciseTestVO.setPaperId(exerciseTestVO.getPaperId()); exerciseTestVO.setPaperId(exerciseTestVO.getPaperId());
if (null != testScoreInfoVO) { if (null != testScoreInfoVO) {
exerciseTestVO.setScore(testScoreInfoVO.getScore()); exerciseTestVO.setScore(testScoreInfoVO.getScore());
...@@ -1228,22 +1233,24 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1228,22 +1233,24 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
* 测试成绩 * 测试成绩
*/ */
//查看某个课程下有几个试卷 //查看这个班级的课程下有几个试卷
List<ExerciseDoneResultDO> exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper<ExerciseDoneResultDO>()
//通过班级找课程
ClassDictDO classDictDO1 = classDictMapper.selectById(classDetailDTO.getId());
//通过课程id去找这个课程有几套卷子
List<PaperDictDO> paperDictDOS = paperDictMapper.selectList(new QueryWrapper<PaperDictDO>()
.lambda() .lambda()
.eq(ExerciseDoneResultDO::getClassId,classDetailDTO.getId())); .eq(PaperDictDO::getCourseId, classDictDO1.getCourseId()));
for (int i = 0 ; i < exerciseDoneResultDOS.size();i++){ for (int i = 0 ; i < paperDictDOS.size() ; i ++){
ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
classDetailDTO.setFlag(false); classDetailDTO.setFlag(false);
classDetailDTO.setPaperId(exerciseDoneResultDOS.get(i).getPaperId()); classDetailDTO.setPaperId(paperDictDOS.get(i).getId());
List<ExerciseTestVO> exerciseTestVOS = exportExerciseTest(classDetailDTO); List<ExerciseTestVO> exerciseTestVOS = exportExerciseTest(classDetailDTO);
testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2); testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
compressFileToZipStream(zipOutputStream, baos2, "test"+i+".xlsx"); compressFileToZipStream(zipOutputStream, baos2, "test" + i + ".xlsx");
} }
/** /**
* 答疑记录 * 答疑记录
*/ */
...@@ -1317,7 +1324,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1317,7 +1324,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
try { try {
//日期格式 //日期格式
if (!StringUtils.isEmpty(s.getInductionDate())){ if (!StringUtils.isEmpty(s.getInductionDate())) {
String DATE_PATTERN = "yyyy-MM-dd"; String DATE_PATTERN = "yyyy-MM-dd";
SimpleDateFormat sdf = new SimpleDateFormat("E MMM dd HH:mm:ss z yyyy", Locale.US); SimpleDateFormat sdf = new SimpleDateFormat("E MMM dd HH:mm:ss z yyyy", Locale.US);
Date date = sdf.parse(s.getInductionDate()); Date date = sdf.parse(s.getInductionDate());
...@@ -1497,7 +1504,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1497,7 +1504,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
sheet.addMergedRegion(cellRangeAddress21); sheet.addMergedRegion(cellRangeAddress21);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 10); CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 11);
sheet.addMergedRegion(cellRangeAddress22); sheet.addMergedRegion(cellRangeAddress22);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框
...@@ -1513,7 +1520,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1513,7 +1520,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, 5, 10); CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 11);
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]);
......
...@@ -135,7 +135,7 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -135,7 +135,7 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
throw new HttpException(70001); throw new HttpException(70001);
} }
classNoticeDO.setClassId(classDictDO.getId()); classNoticeDO.setClassId(classDictDO.getId());
classNoticeDO.setStatus(CourseNotification.UNSENT); //classNoticeDO.setStatus(CourseNotification.UNSENT);
classNoticeMapper.insert(classNoticeDO); classNoticeMapper.insert(classNoticeDO);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("classId", classNoticeDO.getClassId()); params.put("classId", classNoticeDO.getClassId());
......
...@@ -87,10 +87,14 @@ public class ClassHourDictServiceImpl extends ServiceImpl<ClassHourDictMapper, C ...@@ -87,10 +87,14 @@ public class ClassHourDictServiceImpl extends ServiceImpl<ClassHourDictMapper, C
//ClassHourDictDO classHourDictDO1 = (ClassHourDictDO) redisUtil.get(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + getSettingVO.getCompanyId()); //ClassHourDictDO classHourDictDO1 = (ClassHourDictDO) redisUtil.get(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX + getSettingVO.getCompanyId());
//getSettingVO.setId(classHourDictDO1.getId()); //getSettingVO.setId(classHourDictDO1.getId());
//String[] nullParams = MyBeanUtils.getNullPropertyNames(getSettingVO);
//BeanUtils.copyProperties(getSettingVO, classHourDictDO1,nullParams); //BeanUtils.copyProperties(getSettingVO, classHourDictDO1,nullParams);
//redisUtil.set(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX+getSettingVO.getCompanyId(), classHourDictDO1); //redisUtil.set(RedisPrefixConstant.SUBSIDY_SETTINGS_PREFIX+getSettingVO.getCompanyId(), classHourDictDO1);
//this.baseMapper.updateById(classHourDictDO1); ClassHourDictDO classHourDictDO1 = this.baseMapper.selectOne(new QueryWrapper<ClassHourDictDO>()
.lambda()
.eq(ClassHourDictDO::getCompanyId,getSettingVO.getCompanyId()));
String[] nullParams = MyBeanUtils.getNullPropertyNames(getSettingVO);
BeanUtils.copyProperties(getSettingVO,classHourDictDO1,nullParams);
this.baseMapper.updateById(classHourDictDO1);
if (getSettingVO.getRotationImgDictDOS().size()>0){ if (getSettingVO.getRotationImgDictDOS().size()>0){
List<RotationImgDictDO> rotationImgDictDOS = getSettingVO.getRotationImgDictDOS(); List<RotationImgDictDO> rotationImgDictDOS = getSettingVO.getRotationImgDictDOS();
......
...@@ -22,6 +22,7 @@ import com.subsidy.vo.classdict.ClassAndCompanyInfoVO; ...@@ -22,6 +22,7 @@ import com.subsidy.vo.classdict.ClassAndCompanyInfoVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -50,19 +51,18 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class ...@@ -50,19 +51,18 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public String addNotice(ClassNoticeDO classNoticeDO) { public String addNotice(ClassNoticeDO classNoticeDO) {
if(DateFormatUtil.parse(classNoticeDO.getNoticeTime(),"yyyy-MM-dd HH").before(new Date())) { if (DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH").before(new Date())) {
throw new HttpException(70001); throw new HttpException(70001);
} }
classNoticeDO.setStatus(CourseNotification.UNSENT);
this.baseMapper.insert(classNoticeDO); this.baseMapper.insert(classNoticeDO);
ClassDictDO classDictDO = classDictMapper.selectById(classNoticeDO.getClassId()); ClassDictDO classDictDO = classDictMapper.selectById(classNoticeDO.getClassId());
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("classId", classNoticeDO.getClassId()); params.put("classId", classNoticeDO.getClassId());
params.put("id", classNoticeDO.getId()); params.put("id", classNoticeDO.getId());
String name = classDictDO.getClassName()+"-"+classNoticeDO.getNoticeType()+"-"+classNoticeDO.getNoticeTime(); String name = classDictDO.getClassName() + "-" + classNoticeDO.getNoticeType() + "-" + classNoticeDO.getNoticeTime();
quartzUtil.addSimpleJob(CourseNotificationJob.class,DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH:mm:ss") , params, name, "CourseNotificationJob"); quartzUtil.addSimpleJob(CourseNotificationJob.class, DateFormatUtil.parse(classNoticeDO.getNoticeTime(), "yyyy-MM-dd HH:mm:ss"), params, name, "CourseNotificationJob");
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
} }
...@@ -78,41 +78,41 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class ...@@ -78,41 +78,41 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class
this.baseMapper.deleteById(classNoticeDO.getId()); this.baseMapper.deleteById(classNoticeDO.getId());
ClassDictDO classDictDO = classDictMapper.selectById(noticeDO.getClassId()); ClassDictDO classDictDO = classDictMapper.selectById(noticeDO.getClassId());
String name = classDictDO.getClassName()+"-"+noticeDO.getNoticeType()+"-"+noticeDO.getNoticeTime(); String name = classDictDO.getClassName() + "-" + noticeDO.getNoticeType() + "-" + noticeDO.getNoticeTime();
quartzUtil.deleteJob(name, "CourseNotificationJob"); quartzUtil.deleteJob(name, "CourseNotificationJob");
return ConstantUtils.DELETE_SUCCESS; return ConstantUtils.DELETE_SUCCESS;
} }
public List<ClassNoticeDO> queryClassNotices(ClassNoticeDO classNoticeDO){ public List<ClassNoticeDO> queryClassNotices(ClassNoticeDO classNoticeDO) {
return this.baseMapper.selectList(new QueryWrapper<ClassNoticeDO>() return this.baseMapper.selectList(new QueryWrapper<ClassNoticeDO>()
.lambda() .lambda()
.eq(ClassNoticeDO::getStatus, classNoticeDO.getStatus()) .eq(ClassNoticeDO::getNoticeType, classNoticeDO.getNoticeType())
.eq(ClassNoticeDO::getClassId,classNoticeDO.getClassId())); .eq(ClassNoticeDO::getClassId, classNoticeDO.getClassId()));
} }
@Override @Override
public void sendNotification(SendNotificationDTO sendNotificationDTO) { public void sendNotification(SendNotificationDTO sendNotificationDTO) {
ClassAndCompanyInfoVO cmInfo = classDictMapper.getClassAndCompanyInfoVO(sendNotificationDTO.getClassId()); ClassAndCompanyInfoVO cmInfo = classDictMapper.getClassAndCompanyInfoVO(sendNotificationDTO.getClassId());
if(sendNotificationDTO.getSendType().equals(SmsCode.ALL.getType())) { if (sendNotificationDTO.getSendType().equals(SmsCode.ALL.getType())) {
String params = "{\"company\":\""+ cmInfo.getCompany() +"\", \"course\":\""+ cmInfo.getCourseName() +"\", \"startDate\": \""+ cmInfo.getStartDate()+"\", \"endDate\": \""+ cmInfo.getEndDate()+"\"}"; String params = "{\"company\":\"" + cmInfo.getCompany() + "\", \"course\":\"" + cmInfo.getCourseName() + "\", \"startDate\": \"" + cmInfo.getStartDate() + "\", \"endDate\": \"" + cmInfo.getEndDate() + "\"}";
List<MemberDO> list = memberMapper.getMemberList(sendNotificationDTO.getClassId()); List<MemberDO> list = memberMapper.getMemberList(sendNotificationDTO.getClassId());
if(list != null) { if (list != null) {
for (MemberDO memberDO : list) { for (MemberDO memberDO : list) {
SMSUtils.sendNoticeSMS(SmsCode.ALL.getCode(), memberDO.getTelephone(), params); SMSUtils.sendNoticeSMS(SmsCode.ALL.getCode(), memberDO.getTelephone(), params);
} }
} }
} else if(sendNotificationDTO.getSendType().equals(SmsCode.NOT_SIGNED_IN.getType())) { } else if (sendNotificationDTO.getSendType().equals(SmsCode.NOT_SIGNED_IN.getType())) {
String params = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}"; String params = "{ \"name\": \"" + cmInfo.getName() + "\", \"course\":\"" + cmInfo.getCourseName() + "\"}";
List<MemberDO> list = memberMapper.getMemberListBySignInRecord(sendNotificationDTO.getClassId()); List<MemberDO> list = memberMapper.getMemberListBySignInRecord(sendNotificationDTO.getClassId());
if(list != null) { if (list != null) {
for (MemberDO memberDO : list) { for (MemberDO memberDO : list) {
SMSUtils.sendNoticeSMS(SmsCode.NOT_SIGNED_IN.getCode(), memberDO.getTelephone(), params); SMSUtils.sendNoticeSMS(SmsCode.NOT_SIGNED_IN.getCode(), memberDO.getTelephone(), params);
} }
} }
} else if(sendNotificationDTO.getSendType().equals(SmsCode.UNFINISHED.getType())) { } else if (sendNotificationDTO.getSendType().equals(SmsCode.UNFINISHED.getType())) {
String params = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}"; String params = "{ \"name\": \"" + cmInfo.getName() + "\", \"course\":\"" + cmInfo.getCourseName() + "\"}";
List<MemberDO> list = memberMapper.getUnfinishedMemberList(sendNotificationDTO.getClassId()); List<MemberDO> list = memberMapper.getUnfinishedMemberList(sendNotificationDTO.getClassId());
if(list != null) { if (list != null) {
for (MemberDO memberDO : list) { for (MemberDO memberDO : list) {
SMSUtils.sendNoticeSMS(SmsCode.UNFINISHED.getCode(), memberDO.getTelephone(), params); SMSUtils.sendNoticeSMS(SmsCode.UNFINISHED.getCode(), memberDO.getTelephone(), params);
} }
......
...@@ -687,7 +687,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -687,7 +687,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) {
List<VodDictDO> vodDictDOS = classDictMapper.getClassVods(classMemberMappingDO.getClassId()); List<VodDictDO> vodDictDOS = classDictMapper.getClassVods(classMemberMappingDO.getClassId());
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
int playLength = vodPlayHistoryMapper.memberVodTotalLength(memberDO.getId(), vodDictDO.getId(), classMemberMappingDO.getClassId()); int playLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getClassId(),memberDO.getId(), vodDictDO.getId());
if (playLength < vodDictDO.getVodLength()) { if (playLength < vodDictDO.getVodLength()) {
break; break;
} }
......
...@@ -158,7 +158,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig ...@@ -158,7 +158,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
//视频 //视频
int i = 0; int i = 0;
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getMemberId(), vodDictDO.getId(),classMemberMappingDO.getClassId()); int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classMemberMappingDO.getClassId(),classMemberMappingDO.getMemberId(), vodDictDO.getId());
if (totalPlayLength >= vodDictDO.getVodLength()) { if (totalPlayLength >= vodDictDO.getVodLength()) {
i++; i++;
} }
......
...@@ -466,7 +466,7 @@ public class ExcelUtil { ...@@ -466,7 +466,7 @@ public class ExcelUtil {
sheet.addMergedRegion(cellRangeAddress21); sheet.addMergedRegion(cellRangeAddress21);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 10); CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 11);
sheet.addMergedRegion(cellRangeAddress22); sheet.addMergedRegion(cellRangeAddress22);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框
...@@ -482,7 +482,7 @@ public class ExcelUtil { ...@@ -482,7 +482,7 @@ public class ExcelUtil {
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, 5, 10); CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 11);
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]);
......
# 环境配置 # 环境配置
spring.profiles.active=dev spring.profiles.active=prod
# 端口号 # 端口号
spring.server.port=23457 spring.server.port=23459
#嵌入tomcat配置 #嵌入tomcat配置
#和CPU数 #和CPU数
spring.server.acceptorThreadCount=600 spring.server.acceptorThreadCount=600
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!