diff --git a/src/main/java/com/subsidy/controller/MemberController.java b/src/main/java/com/subsidy/controller/MemberController.java
index 68b86bc..e62f0cb 100644
--- a/src/main/java/com/subsidy/controller/MemberController.java
+++ b/src/main/java/com/subsidy/controller/MemberController.java
@@ -91,6 +91,14 @@ public class MemberController {
return ResponseData.generateCreatedResponse(0,memberService.kunchiLogin(qingxuetangLoginDTO,request));
}
+ @PostMapping("kexinkuLogin")
+ @ApiOperation("可信库登录 idCard 身份证号 timestamp 时间戳 sign")
+ @TimeRequired
+ public ResponseVO kexinkuLogin(@RequestBody KexinkuLoginDTO kexinkuLoginDTO ){
+ return ResponseData.generateCreatedResponse(0,memberService.kexinkuLogin(kexinkuLoginDTO));
+ }
+
+
@PostMapping("checkStatus")
@ApiOperation("实名制验证状态 id")
@TimeRequired
diff --git a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java
index ee3d999..d714374 100644
--- a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java
+++ b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java
@@ -16,6 +16,8 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
/**
*
* 视频播放历史记录表 前端控制器
@@ -96,4 +98,13 @@ public class VodPlayHistoryController {
vodPlayHistoryService.warning();
}
+ @PostMapping("criticalData")
+ @ApiOperation("找出临界那条数据 classId")
+ public List criticalData(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
+ return vodPlayHistoryService.criticalData(vodPlayHistoryDO);
+ }
+
+
+
+
}
diff --git a/src/main/java/com/subsidy/dto/member/KexinkuLoginDTO.java b/src/main/java/com/subsidy/dto/member/KexinkuLoginDTO.java
new file mode 100644
index 0000000..028f408
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/member/KexinkuLoginDTO.java
@@ -0,0 +1,20 @@
+package com.subsidy.dto.member;
+
+import lombok.Data;
+
+@Data
+public class KexinkuLoginDTO {
+
+ private String appId;
+
+ private String authCorpId;
+
+ private String openId;
+
+ private String idCard;
+
+ private Long timestamp;
+
+ private String sign;
+
+}
diff --git a/src/main/java/com/subsidy/jobs/WarningJob.java b/src/main/java/com/subsidy/jobs/WarningJob.java
index 509a742..a15d019 100644
--- a/src/main/java/com/subsidy/jobs/WarningJob.java
+++ b/src/main/java/com/subsidy/jobs/WarningJob.java
@@ -69,7 +69,7 @@ public class WarningJob {
// }
//
// if (result.size()>0){
-// List telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"});
+// List telephones = Arrays.asList(new String[]{"15201936167", "18201963812"});
// for (String telephone : telephones){
// smsUtils.sendWarning("SMS_460945631", telephone, result.toString());
// }
diff --git a/src/main/java/com/subsidy/mapper/OprMemDictMapper.java b/src/main/java/com/subsidy/mapper/OprMemDictMapper.java
index 11d849d..b50448c 100644
--- a/src/main/java/com/subsidy/mapper/OprMemDictMapper.java
+++ b/src/main/java/com/subsidy/mapper/OprMemDictMapper.java
@@ -1,6 +1,7 @@
package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.subsidy.model.OprAdmDictDO;
import com.subsidy.model.OprMemDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.opr.GetHistoryVO;
@@ -56,5 +57,13 @@ public interface OprMemDictMapper extends BaseMapper {
*/
void insertOrUpdate(Long userId, String oprType, Integer result, String ipAddress, Date createDate);
+ /**
+ * 查看某为成员最近登录情况 五天超过次数
+ */
+ List getLoginInfo(Long userId);
+ /**
+ * 清除今天登录失败的记录
+ */
+ void clearTodayLoginData(Long userId);
}
diff --git a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
index 205627c..b01f66b 100644
--- a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
+++ b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
@@ -2,6 +2,7 @@ package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.subsidy.model.VodDictDO;
import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.vo.administer.MemberStudyLogVO;
import com.subsidy.vo.member.ContentVodNewVO;
@@ -126,4 +127,9 @@ public interface VodPlayHistoryMapper extends BaseMapper {
*/
List dailyClassMembers();
+ /**
+ * 找出这个课程学习的人
+ */
+ List vodMembers(Long classId);
+
}
diff --git a/src/main/java/com/subsidy/service/MemberService.java b/src/main/java/com/subsidy/service/MemberService.java
index 1d634dd..af73fbf 100644
--- a/src/main/java/com/subsidy/service/MemberService.java
+++ b/src/main/java/com/subsidy/service/MemberService.java
@@ -43,6 +43,8 @@ public interface MemberService extends IService {
UserRoleVO kunchiLogin(QingxuetangLoginDTO qingxuetangLoginDTO, HttpServletRequest request);
+ UserRoleVO kexinkuLogin(KexinkuLoginDTO kexinkuLoginDTO);
+
CheckStatusVO checkStatus(MemberDO memberDO);
String updatePassword(MemberDO memberDO);
diff --git a/src/main/java/com/subsidy/service/VodPlayHistoryService.java b/src/main/java/com/subsidy/service/VodPlayHistoryService.java
index 8fb19d4..b16e683 100644
--- a/src/main/java/com/subsidy/service/VodPlayHistoryService.java
+++ b/src/main/java/com/subsidy/service/VodPlayHistoryService.java
@@ -40,4 +40,6 @@ public interface VodPlayHistoryService extends IService {
void warning();
+ List criticalData(VodPlayHistoryDO vodPlayHistoryDO);
+
}
diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
index 479cb5d..d41bd34 100644
--- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
@@ -243,11 +243,7 @@ public class AdministerServiceImpl extends ServiceImpl= 60 ? "合格" : "不合格");
rowIndex++;
diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
index e6afec1..f229d5a 100644
--- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
@@ -93,8 +93,8 @@ public class MemberServiceImpl extends ServiceImpl imple
@Autowired
private CompanyDictMapper companyDictMapper;
-// @Autowired
-// private OprMemDictMapper oprMemDictMapper;
+ @Autowired
+ private OprMemDictMapper oprMemDictMapper;
@Autowired
private JobDictMapper jobDictMapper;
@@ -121,9 +121,6 @@ public class MemberServiceImpl extends ServiceImpl imple
private QXueYouConfig qXueYouConfig;
@Autowired
- private LiveDictMapper liveDictMapper;
-
- @Autowired
private ActivityDetectionMapper activityDetectionMapper;
@Autowired
@@ -190,7 +187,7 @@ public class MemberServiceImpl extends ServiceImpl imple
MemberDO memberDO = new MemberDO();
BeanUtils.copyProperties(addMemberDTO, memberDO);
- memberDO.setPassword("123456");
+ memberDO.setPassword("Ykhl123456");
memberDO.setStatus("启用");
memberDO.setFirstLogin(0);
//公司赋值
@@ -359,25 +356,41 @@ public class MemberServiceImpl extends ServiceImpl imple
String token = JwtUtil.generateToken(memberDO.getId(), ConstantUtils.MOBILE_TERMINATE);
Localstorage.setUser(memberDO);
userRoleVO.setToken(token);
+
+ //清空登录失败的数据
+ oprMemDictMapper.clearTodayLoginData(memberDO.getId());
+
return userRoleVO;
}
public MemberVO passwordLogin(PasswordLoginDTO passwordLoginDTO, HttpServletRequest request) {
- MemberDO memberDO = null;
+ MemberDO memberDO = this.baseMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(MemberDO::getCompanyId, passwordLoginDTO.getCompanyId())
+ .eq(MemberDO::getAccountName, passwordLoginDTO.getAccountName()));
if (null == memberDO) {
- /**
- * 从数据库里查
- */
- memberDO = this.baseMapper.selectOne(new QueryWrapper()
- .lambda()
- .eq(MemberDO::getCompanyId, passwordLoginDTO.getCompanyId())
- .eq(MemberDO::getAccountName, passwordLoginDTO.getAccountName()));
- if (memberDO == null) {
- throw new HttpException(10017);
+ throw new HttpException(10017);
+ }
+
+
+ /**
+ * 最近5次都输入失败,5分钟后再验证
+ */
+ List oprMemDictDOS = oprMemDictMapper.getLoginInfo(memberDO.getId());
+
+ boolean flag = false;
+ for (int i = 0; i < oprMemDictDOS.size(); i++) {
+ if (oprMemDictDOS.get(i).getResult() == 1) {
+ flag = true;
+ break;
}
}
+ if (!flag && oprMemDictDOS.size() >= 4) {
+ throw new HttpException(10016);
+ }
+
CompanyDictDO companyDictDO = companyDictMapper.selectById(memberDO.getCompanyId());
if (memberDO.getPassword().equals(passwordLoginDTO.getPassword()) && 1 == memberDO.getFirstLogin() && !"冻结".equals(memberDO.getStatus())) {
MemberVO memberVO = new MemberVO();
@@ -385,15 +398,6 @@ public class MemberServiceImpl extends ServiceImpl imple
memberVO.setCompanyId(companyDictDO.getId());
memberVO.setCompanyName(companyDictDO.getCompanyName());
memberVO.setQxyStatus(companyDictDO.getQxyStatus());
-// OprMemDictDO oprMemDictDO = oprMemDictMapper.getLatestLoginInfo(memberDO.getId());
-// if (null == oprMemDictDO || !(oprMemDictDO.getResult() == 1 && "登录".equals(oprMemDictDO.getOprType()))) {
-// oprMemDictDO = new OprMemDictDO();
-// oprMemDictDO.setUserId(memberDO.getId());
-// oprMemDictDO.setOprType("登录");
-// oprMemDictDO.setResult(1);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// oprMemDictMapper.insert(oprMemDictDO);
-// }
memberVO.setCompanyId(companyDictDO.getId());
memberVO.setSuperviseName(companyDictDO.getSuperviseName());
memberVO.setCompanyName(companyDictDO.getCompanyName());
@@ -418,33 +422,63 @@ public class MemberServiceImpl extends ServiceImpl imple
memberTokensMapper.insert(memberTokensDO);
}
+ //清空登录失败的数据
+ oprMemDictMapper.clearTodayLoginData(memberDO.getId());
+
Localstorage.setUser(memberDO);
memberVO.setToken(token);
return memberVO;
} else {
- if (!memberDO.getPassword().equals(passwordLoginDTO.getPassword())) {
-// OprMemDictDO oprMemDictDO = new OprMemDictDO();
-// oprMemDictDO.setUserId(memberDO.getId());
-// oprMemDictDO.setOprType("登录");
-// oprMemDictDO.setResult(0);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// oprMemDictMapper.insert(oprMemDictDO);
- throw new HttpException(10016);
- }
if (0 == memberDO.getFirstLogin()) {
-// OprMemDictDO oprMemDictDO = new OprMemDictDO();
-// oprMemDictDO.setUserId(memberDO.getId());
-// oprMemDictDO.setOprType("登录");
-// oprMemDictDO.setResult(0);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// oprMemDictMapper.insert(oprMemDictDO);
+ OprMemDictDO oprMemDictDO = new OprMemDictDO();
+ oprMemDictDO.setUserId(memberDO.getId());
+ oprMemDictDO.setOprType("登录");
+ oprMemDictDO.setResult(0);
+ oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
+ oprMemDictMapper.insert(oprMemDictDO);
throw new HttpException(10015);
}
if ("冻结".equals(memberDO.getStatus())) {
+ OprMemDictDO oprMemDictDO = new OprMemDictDO();
+ oprMemDictDO.setUserId(memberDO.getId());
+ oprMemDictDO.setOprType("登录");
+ oprMemDictDO.setResult(0);
+ oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
+ oprMemDictMapper.insert(oprMemDictDO);
throw new HttpException(10014);
}
+
+ if (!memberDO.getPassword().equals(passwordLoginDTO.getPassword())) {
+ OprMemDictDO oprMemDictDO = new OprMemDictDO();
+ oprMemDictDO.setUserId(memberDO.getId());
+ oprMemDictDO.setOprType("登录");
+ oprMemDictDO.setResult(0);
+ oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
+ oprMemDictMapper.insert(oprMemDictDO);
+
+ int i = 0;
+
+ for (OprMemDictDO oad : oprMemDictDOS) {
+ if (oad.getResult() == 1) {
+ break;
+ }
+ i++;
+ }
+
+ if (i == 0) {
+ throw new HttpException(10024);
+ } else if (i == 1) {
+ throw new HttpException(10023);
+ } else if (i == 2) {
+ throw new HttpException(10022);
+ } else if (i == 3) {
+ throw new HttpException(10021);
+ } else {
+ throw new HttpException(10016);
+ }
+ }
}
return null;
}
@@ -470,12 +504,6 @@ public class MemberServiceImpl extends ServiceImpl imple
* 时间戳有没有过期
*/
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);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// oprMemDictMapper.insert(oprMemDictDO);
throw new HttpException(14002);
}
@@ -501,40 +529,17 @@ public class MemberServiceImpl extends ServiceImpl imple
String result = SecretUtils.getMD5String(preAuthen);
if (!qingxuetangLoginDTO.getSign().equals(result)) {
-// OprMemDictDO oprMemDictDO = new OprMemDictDO();
-// oprMemDictDO.setUserId(memberDO.getId());
-// oprMemDictDO.setOprType("登录");
-// oprMemDictDO.setResult(0);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// 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);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// oprMemDictMapper.insert(oprMemDictDO);
throw new HttpException(10013);
}
-
BeanUtils.copyProperties(memberDO, userRoleVO);
- //审计日志
-// OprMemDictDO oprMemDictDO = oprMemDictMapper.getLatestLoginInfo(memberDO.getId());
-// if (null == oprMemDictDO || !(oprMemDictDO.getResult() == 1 && "登录".equals(oprMemDictDO.getOprType()))) {
-// oprMemDictDO = new OprMemDictDO();
-// oprMemDictDO.setUserId(memberDO.getId());
-// oprMemDictDO.setOprType("登录");
-// oprMemDictDO.setResult(1);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// oprMemDictMapper.insert(oprMemDictDO);
-// }
userRoleVO.setCompanyId(companyDictDO.getId());
userRoleVO.setSuperviseName(companyDictDO.getSuperviseName());
userRoleVO.setCompanyName(companyDictDO.getCompanyName());
@@ -567,12 +572,6 @@ public class MemberServiceImpl extends ServiceImpl imple
* 时间戳有没有过期
*/
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);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// oprMemDictMapper.insert(oprMemDictDO);
throw new HttpException(14002);
}
@@ -586,39 +585,17 @@ public class MemberServiceImpl extends ServiceImpl imple
String result = SecretUtils.getMD5String(preAuthen);
if (!qingxuetangLoginDTO.getSign().equals(result)) {
-// OprMemDictDO oprMemDictDO = new OprMemDictDO();
-// oprMemDictDO.setUserId(memberDO.getId());
-// oprMemDictDO.setOprType("登录");
-// oprMemDictDO.setResult(0);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// 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);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// oprMemDictMapper.insert(oprMemDictDO);
throw new HttpException(10013);
}
BeanUtils.copyProperties(memberDO, userRoleVO);
- //审计日志
-// OprMemDictDO oprMemDictDO = oprMemDictMapper.getLatestLoginInfo(memberDO.getId());
-// if (null == oprMemDictDO || !(oprMemDictDO.getResult() == 1 && "登录".equals(oprMemDictDO.getOprType()))) {
-// oprMemDictDO = new OprMemDictDO();
-// oprMemDictDO.setUserId(memberDO.getId());
-// oprMemDictDO.setOprType("登录");
-// oprMemDictDO.setResult(1);
-// oprMemDictDO.setIpAddress(IpAddressUtil.getIpAddress(request));
-// oprMemDictMapper.insert(oprMemDictDO);
-// }
userRoleVO.setCompanyId(companyDictDO.getId());
userRoleVO.setSuperviseName(companyDictDO.getSuperviseName());
userRoleVO.setCompanyName(companyDictDO.getCompanyName());
@@ -633,6 +610,61 @@ public class MemberServiceImpl extends ServiceImpl imple
return userRoleVO;
}
+ public UserRoleVO kexinkuLogin(KexinkuLoginDTO kexinkuLoginDTO) {
+
+ UserRoleVO userRoleVO = new UserRoleVO();
+
+// appId:9a79cda9ef6f4a5ha1
+// appSecret:552a4147db2d4026bc4e9021acd61ka1
+ MemberDO memberDO = this.baseMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(MemberDO::getIdCard, kexinkuLoginDTO.getIdCard()));
+
+ if (memberDO == null) {
+ throw new HttpException(10010);
+ }
+
+ /**
+ * 时间戳有没有过期
+ */
+ if (kexinkuLoginDTO.getTimestamp() - System.currentTimeMillis() >= 5 * 60 * 1000 || System.currentTimeMillis() - kexinkuLoginDTO.getTimestamp() >= 5 * 60 * 1000) {
+ throw new HttpException(14002);
+ }
+
+ //鉴权逻辑 对不对
+ String preAuthen = "appId=9a79cda9ef6f4a5ha1"
+ + "&idCard=" + kexinkuLoginDTO.getIdCard()
+ + "×tamp=" + kexinkuLoginDTO.getTimestamp()
+ + "&appSecret=552a4147db2d4026bc4e9021acd61ka1";
+
+ String result = SecretUtils.getMD5String(preAuthen);
+ if (!kexinkuLoginDTO.getSign().equals(result)) {
+ throw new HttpException(14001);
+ }
+
+ CompanyDictDO companyDictDO = companyDictMapper.selectById(memberDO.getCompanyId());
+
+ if ("冻结".equals(memberDO.getStatus())) {
+ throw new HttpException(10013);
+ }
+
+ BeanUtils.copyProperties(memberDO, userRoleVO);
+
+ userRoleVO.setCompanyId(companyDictDO.getId());
+ userRoleVO.setSuperviseName(companyDictDO.getSuperviseName());
+ userRoleVO.setCompanyName(companyDictDO.getCompanyName());
+ userRoleVO.setLogo(companyDictDO.getLogo());
+ userRoleVO.setQxyStatus(companyDictDO.getQxyStatus());
+ List rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(RotationImgDictDO::getCompanyId, companyDictDO.getId()));
+ userRoleVO.setRotationImgDictDOS(rotationImgDictDOS);
+ String token = JwtUtil.generateToken(memberDO.getId(), ConstantUtils.MOBILE_TERMINATE);
+ userRoleVO.setToken(token);
+ return userRoleVO;
+
+ }
+
public CheckStatusVO checkStatus(MemberDO memberDO) {
CheckStatusVO checkStatusVO = new CheckStatusVO();
@@ -648,10 +680,10 @@ public class MemberServiceImpl extends ServiceImpl imple
.lambda()
.eq(ImageCheckRecordDO::getMemberId, memberDO.getId()));
- if (count >0){
+ if (count > 0) {
checkStatusVO.setIdCardStatus(true);
checkStatusVO.setImageStatus(true);
- }else {
+ } else {
checkStatusVO.setImageStatus(false);
checkStatusVO.setIdCardStatus(false);
}
@@ -1139,6 +1171,4 @@ public class MemberServiceImpl extends ServiceImpl imple
// }
-
-
}
diff --git a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
index 96a1e00..b441b71 100644
--- a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
@@ -12,6 +12,7 @@ import com.subsidy.model.*;
import com.subsidy.service.RenSheJuService;
import com.subsidy.util.OSSUtils;
import com.subsidy.util.RenSheJuConstant;
+import com.subsidy.util.SMSUtils;
import com.subsidy.vo.renshe.*;
import net.sf.json.JSONObject;
import okhttp3.*;
@@ -42,6 +43,8 @@ public class RenSheJuServiceImpl implements RenSheJuService {
@Autowired
private ImageCheckRecordMapper imageCheckRecordMapper;
+ @Autowired
+ private SMSUtils smsUtils;
public RensheResponseVO classBaseInfo() throws IOException {
@@ -71,10 +74,10 @@ public class RenSheJuServiceImpl implements RenSheJuService {
Set classIds = new HashSet<>();
- vodClassIds.stream().forEach(x->classIds.add(x));
- examClassIds.stream().forEach(x->classIds.add(x));
- answerClassIds.stream().forEach(x->classIds.add(x));
- imageClassIds.stream().forEach(x->classIds.add(x));
+ vodClassIds.stream().forEach(x -> classIds.add(x));
+ examClassIds.stream().forEach(x -> classIds.add(x));
+ answerClassIds.stream().forEach(x -> classIds.add(x));
+ imageClassIds.stream().forEach(x -> classIds.add(x));
try {
if (classIds.size() > 0) {
@@ -138,6 +141,11 @@ public class RenSheJuServiceImpl implements RenSheJuService {
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
+
+ List telephones = Arrays.asList(new String[]{"15201936167", "18201963812"});
+ for (String telephone : telephones) {
+ smsUtils.sendWarning("SMS_460945631", telephone, RenSheJuConstant.POST_2);
+ }
}
return null;
}
@@ -151,82 +159,80 @@ public class RenSheJuServiceImpl implements RenSheJuService {
ClassHourBehaviorDTO classHourBehaviorDTO = new ClassHourBehaviorDTO();
classHourBehaviorDTO.setPrivateKey(getSecret());
-
List classHourBasics = new ArrayList<>();
- try {
- //产生视频学习数据的班级
- List vodClassIds = renSheJuMapper.vodClassIds("0");
- List result = new ArrayList<>();
+// 产生视频学习数据的班级
+ List vodClassIds = renSheJuMapper.vodClassIds("0");
+
+ List result = new ArrayList<>();
+// List vodClassIds = new ArrayList<>();
+//
+// vodClassIds.add(451L);
- for (Long classId : vodClassIds){
+ try {
+ for (Long classId : vodClassIds) {
//产生数据的班级
List dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo(classId);
result.addAll(dailyStudyInfoVOS);
}
-
- for (DailyStudyInfoVO dailyStudyInfoVO : result) {
- ClassHourBasic classHourBasic = new ClassHourBasic();
- BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic);
- classHourBasic.setDownCode(dailyStudyInfoVO.getDownCode());
-
- //上线时间列表
- //找到当天每次上线下线时间
- //上线时间
- List loginRecords = renSheJuMapper.loginRecords(dailyStudyInfoVO.getMemberId());
- //下线时间
- List loginOutRecords = renSheJuMapper.loginOutRecords(dailyStudyInfoVO.getMemberId());
-
- List loginLists = new ArrayList<>();
- for (int i = 0; i < loginRecords.size(); i++) {
- LoginList loginList = new LoginList();
- loginList.setIp(loginRecords.get(i).getIpAddress());
- loginList.setStartTime(Timestamp.valueOf(loginRecords.get(i).getCreateDate()).getTime());
- loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime());
-
- //查看这个人该时间段的学习记录
- List chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
- if (chapterList3s.size() > 0) {
- loginList.setChapterList(chapterList3s);
- loginLists.add(loginList);
- }
+ for (DailyStudyInfoVO dailyStudyInfoVO : result) {
+ ClassHourBasic classHourBasic = new ClassHourBasic();
+ BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic);
+ classHourBasic.setDownCode(dailyStudyInfoVO.getDownCode());
+
+ //找到当天每次上线下线时间
+ //上线时间
+ List loginRecords = renSheJuMapper.loginRecords(dailyStudyInfoVO.getMemberId());
+ //下线时间
+ List loginOutRecords = renSheJuMapper.loginOutRecords(dailyStudyInfoVO.getMemberId());
+
+ List loginLists = new ArrayList<>();
+ for (int i = 0; i < loginRecords.size(); i++) {
+ LoginList loginList = new LoginList();
+ loginList.setIp(loginRecords.get(i).getIpAddress());
+ loginList.setStartTime(Timestamp.valueOf(loginRecords.get(i).getCreateDate()).getTime());
+ loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime());
+
+ //查看这个人该时间段的学习记录
+ List chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
+ if (chapterList3s.size() > 0) {
+ loginList.setChapterList(chapterList3s);
+ loginLists.add(loginList);
}
- classHourBasic.setLoginList(loginLists);
-
- //活跃度列表
- List activityLists = new ArrayList<>();
- List activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getDownCode(), dailyStudyInfoVO.getMemberId());
- for (DailyActivitiesVO dailyActivitiesVO : activityDetectionDOS) {
-
- ActivityList activityList = new ActivityList();
- if (null == dailyActivitiesVO.getAccess() || 0 == dailyActivitiesVO.getAccess()) {
- activityList.setAccess(1);
- activityList.setErrorInfo(2);
- } else {
- activityList.setAccess(0);
- }
+ }
+ classHourBasic.setLoginList(loginLists);
- if (0 == dailyActivitiesVO.getCheckType()) {
- activityList.setActivityDetection(2);
- } else if (1 == dailyActivitiesVO.getCheckType()) {
- activityList.setActivityDetection(1);
- }
+ //活跃度列表
+ List activityLists = new ArrayList<>();
+ List activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getDownCode(), dailyStudyInfoVO.getMemberId());
+ for (DailyActivitiesVO dailyActivitiesVO : activityDetectionDOS) {
- activityList.setActivityTime(dailyActivitiesVO.getActivityTime());
- activityLists.add(activityList);
+ ActivityList activityList = new ActivityList();
+ if (null == dailyActivitiesVO.getAccess() || 0 == dailyActivitiesVO.getAccess()) {
+ activityList.setAccess(1);
+ activityList.setErrorInfo(2);
+ } else {
+ activityList.setAccess(0);
}
- classHourBasic.setActivityList(activityLists);
- classHourBasics.add(classHourBasic);
- }
+ if (0 == dailyActivitiesVO.getCheckType()) {
+ activityList.setActivityDetection(2);
+ } else if (1 == dailyActivitiesVO.getCheckType()) {
+ activityList.setActivityDetection(1);
+ }
+ activityList.setActivityTime(dailyActivitiesVO.getActivityTime());
+ activityLists.add(activityList);
+ }
+ classHourBasic.setActivityList(activityLists);
+ classHourBasics.add(classHourBasic);
+ }
classHourBehaviorDTO.setClassHourBasic(classHourBasics);
System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO));
- if (classHourBasics.size()>0){
+ if (classHourBasics.size() > 0) {
RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString());
-
Request request = new Request.Builder()
.url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior")
.method("POST", body)
@@ -246,13 +252,12 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
renshejuHistoryMapper.insert(renshejuHistoryDO);
return rensheResponseVO;
- }else {
+ } else {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.NO_DATA);
renshejuHistoryMapper.insert(renshejuHistoryDO);
- return null;
}
// return null;
} catch (Exception e) {
@@ -262,6 +267,11 @@ public class RenSheJuServiceImpl implements RenSheJuService {
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
+
+ List telephones = Arrays.asList(new String[]{"15201936167", "18201963812"});
+// for (String telephone : telephones) {
+// smsUtils.sendWarning("SMS_460945631", telephone, RenSheJuConstant.POST_3);
+// }
}
return null;
}
@@ -397,6 +407,10 @@ public class RenSheJuServiceImpl implements RenSheJuService {
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
+ List telephones = Arrays.asList(new String[]{"15201936167", "18201963812"});
+ for (String telephone : telephones) {
+ smsUtils.sendWarning("SMS_460945631", telephone, RenSheJuConstant.POST_4);
+ }
}
return null;
}
@@ -485,6 +499,10 @@ public class RenSheJuServiceImpl implements RenSheJuService {
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
+ List telephones = Arrays.asList(new String[]{"15201936167", "18201963812"});
+ for (String telephone : telephones) {
+ smsUtils.sendWarning("SMS_460945631", telephone, RenSheJuConstant.POST_5);
+ }
}
return null;
}
@@ -497,10 +515,13 @@ public class RenSheJuServiceImpl implements RenSheJuService {
.build();
MediaType mediaType = MediaType.parse("application/json");
-
//找到昨天做过人脸识别的班级
List classIds = renSheJuMapper.checkClassIds("0");
+// List classIds = new ArrayList<>();
+//
+// classIds.add(451L);
+
for (Long classId : classIds) {
UploadImageDTO uploadImage = new UploadImageDTO();
@@ -571,7 +592,11 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_6);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString());
- renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
+ if (null != rensheResponseVO.getCtt()) {
+ renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
+ } else {
+ renshejuHistoryDO.setOutputParam(rensheResponseVO.getMsg());
+ }
renshejuHistoryMapper.insert(renshejuHistoryDO);
rensheResponseVOS.add(rensheResponseVO);
} else {
@@ -589,6 +614,10 @@ public class RenSheJuServiceImpl implements RenSheJuService {
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
+// List telephones = Arrays.asList(new String[]{"15201936167", "18201963812"});
+// for (String telephone : telephones) {
+// smsUtils.sendWarning("SMS_460945631", telephone, RenSheJuConstant.POST_6);
+// }
}
}
@@ -600,7 +629,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
- RequestBody body = RequestBody.create(mediaType,"{\"privateKey\":\""+getSecret()+"\"}");
+ RequestBody body = RequestBody.create(mediaType, "{\"privateKey\":\"" + getSecret() + "\"}");
Request request = new Request.Builder()
.url(renSheConfig.getUrl() + "/import/downstream/enterprise/getClassCodeByPrivateKey")
@@ -674,9 +703,9 @@ public class RenSheJuServiceImpl implements RenSheJuService {
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_8);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassCodeDTO).toString());
if (200 == response.code()) {
- if (null != rensheResponseVO.getCtt()){
+ if (null != rensheResponseVO.getCtt()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
- }else {
+ } else {
renshejuHistoryDO.setOutputParam(response.body().toString());
}
} else {
@@ -700,7 +729,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
- RequestBody body = RequestBody.create(mediaType,"{\"privateKey\":\""+getSecret()+"\"}");
+ RequestBody body = RequestBody.create(mediaType, "{\"privateKey\":\"" + getSecret() + "\"}");
Request request = new Request.Builder()
.url(renSheConfig.getUrl() + "/import/downstream/enterprise/getErrorClass")
.method("POST", body)
@@ -736,7 +765,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
- RequestBody body = RequestBody.create(mediaType,"{\"privateKey\":\""+getSecret()+"\"}");
+ RequestBody body = RequestBody.create(mediaType, "{\"privateKey\":\"" + getSecret() + "\"}");
Request request = new Request.Builder()
.url(renSheConfig.getUrl() + "/import/downstream/enterprise/clear")
diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
index e384d73..d134123 100644
--- a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
@@ -55,9 +55,19 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl()
+// .lambda()
+// .eq(ExerciseDoneResultDO::getClassId, vodPlayHistoryDO.getClassId())
+// .eq(ExerciseDoneResultDO::getMemberId, vodPlayHistoryDO.getMemberId())
+// .eq(ExerciseDoneResultDO::getResult, "合格"));
+
+// if (count == 0){
Date date = new Date();
if (vodPlayHistoryDO.getPlayLength() > 8 && vodPlayHistoryDO.getSuspendLength() <= 3000) {
//查看系统设定的时长
@@ -94,11 +104,21 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl()
+// .lambda()
+// .eq(ExerciseDoneResultDO::getClassId, insertHistoryNewDTO.getClassId())
+// .eq(ExerciseDoneResultDO::getMemberId, insertHistoryNewDTO.getMemberId())
+// .eq(ExerciseDoneResultDO::getResult, "合格"));
+//
+// if (count == 0){
Date date = new Date();
if (insertHistoryNewDTO.getPlayLength() > 8 && insertHistoryNewDTO.getSuspendLength() <= 3000) {
VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO();
@@ -136,6 +156,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl 0) {
- List telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"});
+ List telephones = Arrays.asList(new String[]{"15201936167", "18201963812"});
for (String telephone : telephones) {
smsUtils.sendWarning("SMS_460945631", telephone, result.toString());
}
}
}
+ public List criticalData(VodPlayHistoryDO vodPlayHistoryDO) {
+
+ List result = new ArrayList<>();
+
+ List vodMembers = vodPlayHistoryMapper.vodMembers(vodPlayHistoryDO.getClassId());
+
+ VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO.getVodId());
+
+ for (Long memberId : vodMembers){
+ List vodPlayHistoryDOS = this.baseMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(VodPlayHistoryDO::getClassId,vodPlayHistoryDO.getClassId())
+ .eq(VodPlayHistoryDO::getMemberId,memberId)
+ .eq(VodPlayHistoryDO::getVodId,vodPlayHistoryDO.getVodId())
+ .orderByAsc(VodPlayHistoryDO::getCreateDate));
+ int i = 0 ;
+
+ for (VodPlayHistoryDO vodPlayHistoryDO1 : vodPlayHistoryDOS){
+ i+=vodPlayHistoryDO1.getPlayLength();
+ if ( i >= vodDictDO.getVodLength()){
+ result.add(vodPlayHistoryDO1.getId());
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
//19为基数的话,3次签到6.5到8,4次签到4.8-6,
// 5次4-6,6次3.2-6,7次及以上2.5-6吧
//int randNumber =rand.nextInt(MAX - MIN + 1) + MIN;
@@ -738,13 +787,13 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl list = new ArrayList();
diff --git a/src/main/resources/mapper/AdministerMapper.xml b/src/main/resources/mapper/AdministerMapper.xml
index 5ee1d28..c08652e 100644
--- a/src/main/resources/mapper/AdministerMapper.xml
+++ b/src/main/resources/mapper/AdministerMapper.xml
@@ -62,7 +62,7 @@
and t2.user_name like concat('%',#{userName} ,'%')
- order by CONVERT(t2.user_name USING gbk) ASC
+ order by t2.account_name ASC
@@ -491,7 +490,6 @@
and class_id = #{classId}
AND t1.paper_id IS not NULL
AND t1.result = 1
- and t1.member_id
GROUP BY t1.class_id,t1.member_id
ORDER BY t1.create_date desc
diff --git a/src/main/resources/mapper/VodPlayHistoryMapper.xml b/src/main/resources/mapper/VodPlayHistoryMapper.xml
index b8de509..de00ac8 100644
--- a/src/main/resources/mapper/VodPlayHistoryMapper.xml
+++ b/src/main/resources/mapper/VodPlayHistoryMapper.xml
@@ -550,4 +550,14 @@
t.class_id
+
+ SELECT DISTINCT
+ t.member_id
+ FROM
+ vod_play_history t
+ WHERE
+ t.delete_date IS NULL
+ and t.class_id = #{classId}
+
+