Commit de277cb7 by 涂亚平

拉websocket前备个份

1 parent 52d13bc2
......@@ -41,9 +41,7 @@ public class WebSocketInterceptor implements HandshakeInterceptor {
HttpServletRequest httpServletRequest = ((ServletServerHttpRequest) request).getServletRequest();
Long userId = Long.parseLong(httpServletRequest.getParameter("userId"));
MemberDO memberDO = memberMapper.selectById(userId);
if(null != memberDO) {
return true;
}
return null != memberDO;
}
return false;
}
......
......@@ -88,7 +88,7 @@ public class MemberController {
}
@PostMapping("checkStatus")
@ApiOperation("实名制验证状态 memberId")
@ApiOperation("实名制验证状态 id")
@TimeRequired
public ResponseVO checkStatus(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.checkStatus(memberDO));
......
......@@ -25,6 +25,6 @@ public class QueryCoursesDTO {
private Long companyId;
private Integer openStatus;
private String openStatus;
}
......@@ -27,7 +27,7 @@ public interface CourseDictMapper extends BaseMapper<CourseDictDO> {
* courseName fieldId categoryId jobId courseRank courseType
* @return
*/
IPage<QueryCoursesVO > queryCourses(IPage page, String courseName, Long fieldId,Long categoryId,Long jobId,Long rankId, String courseType,Long companyId,Integer openStatus,Long businessId);
IPage<QueryCoursesVO > queryCourses(IPage page, String courseName, Long fieldId,Long categoryId,Long jobId,Long rankId, String courseType,Long companyId,String openStatus,Long businessId);
/**
* 通过课程id查询课程下的学生-----弃用
......
......@@ -52,7 +52,7 @@ public class CourseDictDO extends BaseModel {
/**
* 课程开放状态
*/
private Integer openStatus;
private String openStatus;
/**
* 备注
......
......@@ -605,9 +605,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
}
if (classDetailDTO.getFlag()) {
CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
// CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
ExcelUtil.writeMemberExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "授课记录汇总表", classDetailVOS, ExcelFormatUtils.memberList);
ExcelUtil.writeMemberExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "授课记录汇总表", classDetailVOS, ExcelFormatUtils.memberList);
}
return classDetailVOS;
}
......@@ -693,9 +693,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
if (classDetailDTO.getFlag()) {
ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
// CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
ExcelUtil.writeSignExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "注册签到表", classSignVOS, ExcelFormatUtils.signList);
ExcelUtil.writeSignExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "注册签到表", classSignVOS, ExcelFormatUtils.signList);
}
return classSignVOS;
......@@ -756,9 +756,8 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
if (classDetailDTO.getFlag()) {
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
ExcelUtil.writeTestExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", exerciseTestVOS, ExcelFormatUtils.scoreList);
ExcelUtil.writeTestExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "测试成绩表", exerciseTestVOS, ExcelFormatUtils.scoreList);
}
return exerciseTestVOS;
}
......@@ -784,9 +783,8 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
if (classDetailDTO.getFlag()) {
ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
ExcelUtil.writeAnswerExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "答疑记录表", answerRecordVOS, ExcelFormatUtils.answersList);
ExcelUtil.writeAnswerExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "答疑记录表", answerRecordVOS, ExcelFormatUtils.answersList);
}
return answerRecordVOS;
}
......@@ -1213,7 +1211,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
classDetailDTO.setFlag(false);
List<ClassDetailVO> classDetailVOS = exportClassDetail(classDetailDTO);
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
membersListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "授课记录汇总表", ExcelFormatUtils.memberList, classDetailVOS, null, 0, baos);
membersListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "授课记录汇总表", ExcelFormatUtils.memberList, classDetailVOS, null, 0, baos);
compressFileToZipStream(zipOutputStream, baos, "member.xlsx");
/**
......@@ -1222,7 +1220,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
ByteArrayOutputStream baos1 = new ByteArrayOutputStream();
classDetailDTO.setFlag(false);
List<ClassSignVO> classSignVOS = exportSignDetail(classDetailDTO);
signListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "注册签到", ExcelFormatUtils.signList, classSignVOS, null, 0, baos1);
signListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "注册签到", ExcelFormatUtils.signList, classSignVOS, null, 0, baos1);
compressFileToZipStream(zipOutputStream, baos1, "sign.xlsx");
......@@ -1244,7 +1242,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
classDetailDTO.setFlag(false);
classDetailDTO.setPaperId(paperDictDOS.get(i).getId());
List<ExerciseTestVO> exerciseTestVOS = exportExerciseTest(classDetailDTO);
testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
testListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
compressFileToZipStream(zipOutputStream, baos2, "test" + i + ".xlsx");
}
......@@ -1253,7 +1251,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
*/
ByteArrayOutputStream baos3 = new ByteArrayOutputStream();
List<AnswerRecordVO> answerRecordVOS = exportAnswerRecord(classDetailDTO);
askListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "答疑记录", ExcelFormatUtils.answersList, answerRecordVOS, null, 0, baos3);
askListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "答疑记录", ExcelFormatUtils.answersList, answerRecordVOS, null, 0, baos3);
compressFileToZipStream(zipOutputStream, baos3, "answer.xlsx");
zipOutputStream.flush();
......
......@@ -153,6 +153,7 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
public String updateClass(ClassDictDO classDictDO) {
this.baseMapper.updateById(classDictDO);
return ConstantUtils.SET_SUCCESS;
}
......
......@@ -100,7 +100,7 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
CourseDictDO courseDictDO = new CourseDictDO();
BeanUtils.copyProperties(addCourseDTO, courseDictDO);
courseDictDO.setOpenStatus(0);
courseDictDO.setOpenStatus("0");
this.baseMapper.insert(courseDictDO);
if (null != addCourseDTO.getCategoryDOS()) {
......
......@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import sun.misc.BASE64Decoder;
import sun.security.krb5.internal.crypto.Nonce;
//import org.apache.commons.codec.binary.Base64;
import java.io.*;
......@@ -123,7 +124,11 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//获取signTicket
IdCardTicketsVO idCardTicketsVO = this.signTickets(getLatestAccessToken());
//生成签名
List<String> signList1 = Arrays.asList(WBAPPID, NONCE, memberDO.getId() + "", "1.0.0");
List<String> signList1 =new ArrayList<>();
signList1.add(WBAPPID);
signList1.add(memberDO.getId()+"");
signList1.add("1.0.0");
signList1.add(NONCE);
String sign = sign(signList1, idCardTicketsVO.getValue());
//合作方后台上送身份信息
......@@ -143,7 +148,13 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
IdCardTicketsVO nonceTicket = this.nonceTicket(getLatestAccessToken(), memberDO.getId() + "");
//签名2
List<String> signList2 = Arrays.asList(WBAPPID, NONCE, imageCheckRecordDO.getId() + "", sendIdCardInfoVO.getResult().getH5faceId(), memberDO.getId() + "", "1.0.0");
List<String> signList2 = new ArrayList<>();
signList2.add(WBAPPID);
signList2.add(imageCheckRecordDO.getId()+"");
signList2.add(memberDO.getId()+"");
signList2.add("1.0.0");
signList2.add(sendIdCardInfoVO.getResult().getFaceId());
signList2.add(NONCE);
String sign2 = sign(signList2, nonceTicket.getValue());
sendIdCardInfoVO.getResult().setWbAppId(WBAPPID);
......@@ -179,7 +190,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
IdCardTicketsVO idCardTicketsVO = this.signTickets(getLatestAccessToken());
//生成签名
List<String> signList1 = Arrays.asList(WBAPPID, imageCheckRecordDO.getId() + "", memberDO.getUserName(), memberDO.getIdCard(), memberDO.getId() + "", "1.0.0");
List<String> signList1 = new ArrayList(Arrays.asList(WBAPPID, imageCheckRecordDO.getId() + "", memberDO.getUserName(), memberDO.getIdCard(), memberDO.getId() + "", "1.0.0"));
String sign = sign(signList1, idCardTicketsVO.getValue());
//合作方后台上送身份信息
......@@ -200,7 +211,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
IdCardTicketsVO nonceTicket = this.nonceTicket(getLatestAccessToken(), memberDO.getId() + "");
//签名2
List<String> signList2 = Arrays.asList(WBAPPID, memberDO.getId() + "", NONCE, "1.0.0", sendIdCardInfoVO.getResult().getFaceId(), sendIdCardInfoVO.getResult().getOrderNo());
List<String> signList2 = new ArrayList(Arrays.asList(WBAPPID, memberDO.getId() + "", NONCE, "1.0.0", sendIdCardInfoVO.getResult().getFaceId(), sendIdCardInfoVO.getResult().getOrderNo()));
String sign2 = sign(signList2, nonceTicket.getValue());
sendIdCardInfoVO.getResult().setWbAppId(WBAPPID);
......@@ -423,8 +434,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//获取最新的accessToken
public String getLatestAccessToken() {
AccessTokenDO accessTokenDO = accessTokenMapper.selectOne(new QueryWrapper<AccessTokenDO>()
.lambda()
.lt(AccessTokenDO::getCreateDate, LocalDateTime.now().minusMinutes(19L)));
.lambda() //21min //39min
.gt(AccessTokenDO::getCreateDate, LocalDateTime.now().minusMinutes(19L)));
//数据库没有的话
if (null == accessTokenDO) {
......@@ -438,5 +449,4 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
return accessTokenDO.getAccessToken();
}
}
......@@ -590,7 +590,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
.eq(RotationImgDictDO::getCompanyId, companyDictDO.getId()));
userRoleVO.setRotationImgDictDOS(rotationImgDictDOS);
String token = JwtUtil.generateToken(memberDO.getId(), ConstantUtils.MOBILE_TERMINATE);
redisUtil.set(ConstantUtils.MOBILE_TERMINATE + "_" + memberDO.getId(), token);
// redisUtil.set(ConstantUtils.MOBILE_TERMINATE + "_" + memberDO.getId(), token);
userRoleVO.setToken(token);
return userRoleVO;
}
......@@ -677,7 +677,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
.eq(RotationImgDictDO::getCompanyId, companyDictDO.getId()));
userRoleVO.setRotationImgDictDOS(rotationImgDictDOS);
String token = JwtUtil.generateToken(memberDO.getId(), ConstantUtils.MOBILE_TERMINATE);
redisUtil.set(ConstantUtils.MOBILE_TERMINATE + "_" + memberDO.getId(), token);
// redisUtil.set(ConstantUtils.MOBILE_TERMINATE + "_" + memberDO.getId(), token);
userRoleVO.setToken(token);
return userRoleVO;
}
......
......@@ -86,11 +86,11 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im
throw new HttpException(18000);
}
if(vodDictDO.getVodCode() != null) {
VodUtil.deleteMedia(vodConfig, vodDictDO.getVodCode());
if(vod.getVodCode() != null) {
VodUtil.deleteMedia(vodConfig, vod.getVodCode());
}
this.baseMapper.deleteById(vodDictDO.getId());
this.baseMapper.deleteById(vod.getId());
}
@Override
......
......@@ -632,7 +632,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
String classIds = "150,151,152,153,165,195,199,200,202,207,209,210,211,212,213,215,227,228,229,233,234,235,240,241,243,244,248,249,250,251,252,253,254,255,256,257,258,261,268,278,280,282,286,287,288,289,292,293,294,295,297,298,300,301,303,304,305,306";
List<String> classIdArr = Arrays.asList(classIds.split(","));
String[] classIdArr = classIds.split(",");
HashSet<Long> result = new HashSet<>();
for (String classId : classIdArr) {
......
......@@ -22,7 +22,7 @@ public class SecretUtils {
public static String getMD5String(String str) {
try {
// 生成一个MD5加密计算摘要
return DigestUtils.md5Hex(str.toString()).toUpperCase();
return DigestUtils.md5Hex(str).toUpperCase();
// MessageDigest md = MessageDigest.getInstance("MD5");
// 计算md5函数
// md.update(str.getBytes("utf-8"));
......
......@@ -103,7 +103,7 @@ public class WebSocketUtil implements WebSocketHandler {
}
webSocketMap.put(id, session);
/* 班级配置信息 */
/* 班级配置信息 */ //查人的班级
List<ClassSettingsVO> classSettings = classDictMapper.getClassSettings(id);
if(CollectionUtils.isNotEmpty(classSettings)) {
String data = JSONObject.toJSONString(ResponseData.generateCreatedResponse(0, classSettings), SerializerFeature.WriteMapNullValue);
......
......@@ -65,4 +65,6 @@ public class ClassSettingsVO {
private Integer ipAddressRecord;
private Integer deviceNoRecord;
private Integer timeLimit;
}
......@@ -68,7 +68,7 @@ spring.quartz.overwrite-existing-jobs=false
#spring.redis.port=6379
#spring.redis.password=r-uf6m4cpkjrgpzywjm3:Ykhl@208
wechat:
wechat=
#pro
appId: wx5e1ecb9c9bd33451
appSecret: 4f5e1abb6fb4f68f5273820b6295ec6b
appId= wx5e1ecb9c9bd33451
appSecret= 4f5e1abb6fb4f68f5273820b6295ec6b
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!