Commit be81e3f1 by 涂亚平

支付前备份

1 parent fc42d8d5
......@@ -73,11 +73,18 @@ public class MemberController {
}
@PostMapping("qingxuetangLogin")
@ApiOperation("轻学堂登录 手机号")
@ApiOperation("轻学堂登录 手机号mobile")
public ResponseVO qingxuetangLogin(@RequestBody QingxuetangLoginDTO qingxuetangLoginDTO){
return ResponseData.generateCreatedResponse(0,memberService.qingxuetangLogin(qingxuetangLoginDTO));
}
@PostMapping("kunchiLogin")
@ApiOperation("鲲驰登陆 authCorpName 手机号mobile nickname timestamp sign")
public ResponseVO kunchiLogin(@RequestBody QingxuetangLoginDTO qingxuetangLoginDTO){
return ResponseData.generateCreatedResponse(0,memberService.kunchiLogin(qingxuetangLoginDTO));
}
@PostMapping("updatePassword")
@ApiOperation("修改密码 {id password}")
@LoginRequired
......
......@@ -37,6 +37,8 @@ public interface MemberService extends IService<MemberDO> {
UserRoleVO qingxuetangLogin(QingxuetangLoginDTO qingxuetangLoginDTO);
UserRoleVO kunchiLogin(QingxuetangLoginDTO qingxuetangLoginDTO);
String updatePassword(MemberDO memberDO);
MemberStudyPageVO studyPage(MemberDO memberDO);
......
......@@ -63,6 +63,7 @@ import java.time.Duration;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
......@@ -469,6 +470,13 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
return null;
}
// 9a79cda9ef6f4a52a8
// 552a4147db2d4026bc4e9021acd614f8
public static void main(String[] args) {
String uuid = UUID.randomUUID().toString().replace("-","");
System.out.println(uuid);
}
public UserRoleVO qingxuetangLogin(QingxuetangLoginDTO qingxuetangLoginDTO) {
UserRoleVO userRoleVO = new UserRoleVO();
......@@ -539,15 +547,100 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
throw new HttpException(10013);
}
//是否登陆过 1:是 0:否
if (0 == memberDO.getFirstLogin()) {
// //是否登陆过 1:是 0:否
// if (0 == memberDO.getFirstLogin()) {
// OprMemDictDO oprMemDictDO = new OprMemDictDO();
// oprMemDictDO.setUserId(memberDO.getId());
// oprMemDictDO.setOprType("登录");
// oprMemDictDO.setResult(0);
// oprMemDictMapper.insert(oprMemDictDO);
// throw new HttpException(10015);
// }
BeanUtils.copyProperties(memberDO, userRoleVO);
//审计日志
OprMemDictDO oprMemDictDO = new OprMemDictDO();
oprMemDictDO.setUserId(memberDO.getId());
oprMemDictDO.setOprType("登录");
oprMemDictDO.setResult(1);
oprMemDictMapper.insert(oprMemDictDO);
userRoleVO.setCompanyId(companyDictDO.getId());
userRoleVO.setCompanyName(companyDictDO.getCompanyName());
userRoleVO.setLogo(companyDictDO.getLogo());
List<RotationImgDictDO> rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper<RotationImgDictDO>()
.lambda()
.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);
userRoleVO.setToken(token);
return userRoleVO;
}
public UserRoleVO kunchiLogin(QingxuetangLoginDTO qingxuetangLoginDTO){
UserRoleVO userRoleVO = new UserRoleVO();
// appId:9a79cda9ef6f4a52a8
// appSecret:552a4147db2d4026bc4e9021acd614f8
MemberDO memberDO = this.baseMapper.selectOne(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getTelephone, qingxuetangLoginDTO.getMobile()));
if (memberDO == null) {
throw new HttpException(10010);
}
/**
* 时间戳有没有过期
*/
if (qingxuetangLoginDTO.getTimestamp()-System.currentTimeMillis()>=5*60*1000 || System.currentTimeMillis()-qingxuetangLoginDTO.getTimestamp()>=5*60*1000){
OprMemDictDO oprMemDictDO = new OprMemDictDO();
oprMemDictDO.setUserId(memberDO.getId());
oprMemDictDO.setOprType("登录");
oprMemDictDO.setResult(0);
oprMemDictMapper.insert(oprMemDictDO);
throw new HttpException(10015);
throw new HttpException(14002);
}
//鉴权逻辑 对不对
String preAuthen = "appId=9a79cda9ef6f4a52a8"
+"&authCorpName="+ qingxuetangLoginDTO.getAuthCorpName()
+"&mobile="+qingxuetangLoginDTO.getMobile()
+"&nickname="+qingxuetangLoginDTO.getNickname()
+"&timestamp="+qingxuetangLoginDTO.getTimestamp()
+"&appSecret=552a4147db2d4026bc4e9021acd614f8" ;
String result = SecretUtils.getMD5String(preAuthen);
if (!qingxuetangLoginDTO.getSign().equals(result)){
OprMemDictDO oprMemDictDO = new OprMemDictDO();
oprMemDictDO.setUserId(memberDO.getId());
oprMemDictDO.setOprType("登录");
oprMemDictDO.setResult(0);
oprMemDictMapper.insert(oprMemDictDO);
throw new HttpException(14001);
}
CompanyDictDO companyDictDO = companyDictMapper.selectById(memberDO.getCompanyId());
if ("冻结".equals(memberDO.getStatus())) {
OprMemDictDO oprMemDictDO = new OprMemDictDO();
oprMemDictDO.setUserId(memberDO.getId());
oprMemDictDO.setOprType("登录");
oprMemDictDO.setResult(0);
oprMemDictMapper.insert(oprMemDictDO);
throw new HttpException(10013);
}
// //是否登陆过 1:是 0:否
// if (0 == memberDO.getFirstLogin()) {
// OprMemDictDO oprMemDictDO = new OprMemDictDO();
// oprMemDictDO.setUserId(memberDO.getId());
// oprMemDictDO.setOprType("登录");
// oprMemDictDO.setResult(0);
// oprMemDictMapper.insert(oprMemDictDO);
// throw new HttpException(10015);
// }
BeanUtils.copyProperties(memberDO, userRoleVO);
//审计日志
......
......@@ -67,6 +67,8 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
private RedisUtil redisUtil;
public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO) {
if (vodPlayHistoryDO.getPlayLength()>3){
MemberDO memberDO = memberMapper.selectById(vodPlayHistoryDO.getMemberId());
//查看系统设定的时长
ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne(new QueryWrapper<ClassHourDictDO>()
......@@ -87,11 +89,13 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
}
vodPlayHistoryDO.setPlayCount(1);
this.baseMapper.insert(vodPlayHistoryDO);
}
return ConstantUtils.ADD_SUCCESS;
}
public String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO) {
if (insertHistoryNewDTO.getPlayLength()>3){
//对比redis上的token
String token = redisUtil.get("mobile_"+insertHistoryNewDTO.getMemberId()).toString();
if (!insertHistoryNewDTO.getToken().equals(token)){
......@@ -121,6 +125,8 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
}
vodPlayHistoryDO.setPlayCount(1);
this.baseMapper.insert(vodPlayHistoryDO);
}
return ConstantUtils.ADD_SUCCESS;
}
......@@ -615,10 +621,14 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
public List<Long> testPlays(){
List<MemberDO> memberDOS = memberMapper.selectList(null);
List<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getClassId,168));
// List<MemberDO> memberDOS = memberMapper.selectList(null);
List<Long> result = new ArrayList<>();
for (MemberDO memberDO : memberDOS){
List<VodPlayStateVO> vodPlayStateVOS = vodDictMapper.testPlays(memberDO.getId());
for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS){
List<VodPlayStateVO> vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId());
for (int i = 0 ; i < vodPlayStateVOS.size() ; i ++){
for ( int k = i+1 ; k < vodPlayStateVOS.size() ; k ++){
VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(k);
......
......@@ -52,7 +52,7 @@ public class SMSUtils {
//必填:短信签名-可在短信控制台中找到
request.setSignName("有课互联");
//必填:短信模板-可在短信控制台中找到
request.setTemplateCode("SMS_229640297");
request.setTemplateCode("SMS_190945394");
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
request.setTemplateParam("{\"code\":\""+ code +"\"}");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!