Commit 0cb59b9a by 涂亚平

备个份

1 parent 2c9d89b2
......@@ -4,8 +4,8 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.detection.GetCheckHistoryDTO;
import com.subsidy.dto.detection.VerifyDTO;
import com.subsidy.model.ActivityDetectionDO;
import com.subsidy.service.ActivityDetectionService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -43,11 +43,8 @@ public class ActivityDetectionController {
@PostMapping("getCheckHistory")
@ApiOperation("获取某个人某个课程的活跃度验证详情 memberId classId")
public ResponseVO getCheckHistory(@RequestBody ActivityDetectionDO activityDetectionDO){
return ResponseData.generateCreatedResponse(0,activityDetectionService.getCheckHistory(activityDetectionDO));
public ResponseVO getCheckHistory(@RequestBody GetCheckHistoryDTO getCheckHistoryDTO){
return ResponseData.generateCreatedResponse(0,activityDetectionService.getCheckHistory(getCheckHistoryDTO));
}
}
......@@ -77,4 +77,11 @@ public class CompanyDictController {
return ResponseData.generateCreatedResponse(0,companyDictService.getCompanyMembers(getCompanyMembersDTO));
}
@PostMapping("memberSummary")
@ApiOperation("学员认证详情 companyId")
@LoginRequired
public ResponseVO memberSummary(@RequestBody GetCompanyMembersDTO getCompanyMembersDTO){
return ResponseData.generateCreatedResponse(0,companyDictService.memberSummary(getCompanyMembersDTO));
}
}
package com.subsidy.dto.detection;
import lombok.Data;
@Data
public class GetCheckHistoryDTO {
private Integer pageSize;
private Integer pageNum;
private Long memberId;
private Long classId;
}
package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.ActivityDetectionDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.activity.GetCheckHistoryVO;
import org.springframework.stereotype.Repository;
/**
......@@ -15,4 +17,6 @@ import org.springframework.stereotype.Repository;
@Repository
public interface ActivityDetectionMapper extends BaseMapper<ActivityDetectionDO> {
IPage<GetCheckHistoryVO> getCheckHistory(IPage iPage,Long classId,Long memberId);
}
......@@ -78,6 +78,45 @@ public class ClassDictDO extends BaseModel {
*/
private Integer testRule;
/**
* 学习上限时长
*/
private Integer limitHour;
/**
* 首次进入班级时人脸验证
*/
private Integer imageClassCheck;
/**
* 测试前人脸识别验证
*/
private Integer imageTestCheck;
/**
* 活跃度检测开启/关闭
*/
private Integer activityDetection;
/**
* 活跃度检测方式
*/
private Integer activityDetectionMethod;
/**
* 首次播放允许拖曳
*/
private Integer firstDragAllowed;
/**
* 首次播放允许倍速
*/
private Integer firstSpeedAllowed;
/**
* 课时抓拍
*/
private Integer playSnap;
......
package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.detection.GetCheckHistoryDTO;
import com.subsidy.dto.detection.VerifyDTO;
import com.subsidy.model.ActivityDetectionDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.activity.GetCheckHistoryVO;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* <p>
......@@ -20,6 +21,6 @@ public interface ActivityDetectionService extends IService<ActivityDetectionDO>
String verify(VerifyDTO verifyDTO, HttpServletRequest request);
IPage<ActivityDetectionDO> getCheckHistory(ActivityDetectionDO activityDetectionDO);
IPage<GetCheckHistoryVO> getCheckHistory(GetCheckHistoryDTO getCheckHistoryDTO);
}
......@@ -10,6 +10,7 @@ import com.subsidy.model.MemberDO;
import com.subsidy.vo.administer.OperatorsVO;
import com.subsidy.vo.company.GetAllCompanyVO;
import com.subsidy.vo.company.GetCompanyMembersVO;
import com.subsidy.vo.company.MemberSummaryVO;
import java.util.List;
......@@ -35,4 +36,6 @@ public interface CompanyDictService extends IService<CompanyDictDO> {
IPage<GetCompanyMembersVO> getCompanyMembers(GetCompanyMembersDTO getCompanyMembersDTO);
MemberSummaryVO memberSummary(GetCompanyMembersDTO getCompanyMembersDTO);
}
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.common.configure.ActivityDetectionConfig;
import com.subsidy.common.configure.VODConfig;
import com.subsidy.common.configure.WechatConfig;
import com.subsidy.dto.detection.GetCheckHistoryDTO;
import com.subsidy.dto.detection.VerifyDTO;
import com.subsidy.model.ActivityDetectionDO;
import com.subsidy.mapper.ActivityDetectionMapper;
import com.subsidy.service.ActivityDetectionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.IpAddressUtil;
import com.subsidy.vo.activity.GetCheckHistoryVO;
import com.tencentcloudapi.captcha.v20190722.CaptchaClient;
import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultRequest;
import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultResponse;
......@@ -56,18 +59,7 @@ public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionM
// 实例化一个请求对象,每个接口都会对应一个request对象
DescribeCaptchaResultRequest req = new DescribeCaptchaResultRequest();
req.setCaptchaType(9L);
req.setTicket(verifyDTO.getTicket());
// String ip = request.getHeader("x-forwarded-for");
String ip = request.getHeader( " x-forwarded-for " );
if (ip == null || ip.length() == 0 || " unknown " .equalsIgnoreCase(ip)) {
ip = request.getHeader( " Proxy-Client-IP " );
}
if (ip == null || ip.length() == 0 || " unknown " .equalsIgnoreCase(ip)) {
ip = request.getHeader( " WL-Proxy-Client-IP " );
}
if (ip == null || ip.length() == 0 || " unknown " .equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
String ip = IpAddressUtil.getIpAddress(request);
req.setUserIp(ip);
req.setRandstr(verifyDTO.getRandStr());
req.setCaptchaAppId(activityDetectionConfig.getCaptchaAppId());
......@@ -76,7 +68,6 @@ public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionM
// 返回的resp是一个DescribeCaptchaResultResponse的实例,与请求对象对应
DescribeCaptchaResultResponse resp = client.DescribeCaptchaResult(req);
// 输出json格式的字符串回包
System.out.println(DescribeCaptchaResultResponse.toJsonString(resp));
ActivityDetectionDO activityDetectionDO = new ActivityDetectionDO();
activityDetectionDO.setClassId(verifyDTO.getClassId());
activityDetectionDO.setMemberId(verifyDTO.getMemberId());
......@@ -91,15 +82,14 @@ public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionM
return ConstantUtils.FAIL_VERIFY;
}
} catch (TencentCloudSDKException e) {
System.out.println(e.toString());
// System.out.println(e.toString());
}
return null;
}
public IPage<ActivityDetectionDO> getCheckHistory(ActivityDetectionDO activityDetectionDO){
return null;
public IPage<GetCheckHistoryVO> getCheckHistory(GetCheckHistoryDTO getCheckHistoryDTO){
Page pager = new Page(getCheckHistoryDTO.getPageNum(), getCheckHistoryDTO.getPageSize());
return this.baseMapper.getCheckHistory(pager,getCheckHistoryDTO.getClassId(),getCheckHistoryDTO.getMemberId());
}
}
......@@ -9,17 +9,7 @@ import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.dto.company.AddCompanyDTO;
import com.subsidy.dto.company.GetCompanyMembersDTO;
import com.subsidy.mapper.AdministerMapper;
import com.subsidy.mapper.ClassHourDictMapper;
import com.subsidy.mapper.ClassTypeDictMapper;
import com.subsidy.mapper.CompanyDictMapper;
import com.subsidy.mapper.CompanyFieldMappingMapper;
import com.subsidy.mapper.DepartmentDictMapper;
import com.subsidy.mapper.FieldDictMapper;
import com.subsidy.mapper.JobDictMapper;
import com.subsidy.mapper.RankDictMapper;
import com.subsidy.mapper.RoleAdministerMappingMapper;
import com.subsidy.mapper.RotationImgDictMapper;
import com.subsidy.mapper.*;
import com.subsidy.model.*;
import com.subsidy.service.CompanyDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -27,6 +17,7 @@ import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.administer.OperatorsVO;
import com.subsidy.vo.company.GetAllCompanyVO;
import com.subsidy.vo.company.GetCompanyMembersVO;
import com.subsidy.vo.company.MemberSummaryVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
......@@ -77,6 +68,9 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
@Autowired
private RotationImgDictMapper rotationImgDictMapper;
@Autowired
private MemberMapper memberMapper;
public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) {
Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize());
......@@ -258,5 +252,25 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
return this.baseMapper.getCompanyMembers(pager,getCompanyMembersDTO.getCompanyId(),getCompanyMembersDTO.getUserName());
}
public MemberSummaryVO memberSummary(GetCompanyMembersDTO getCompanyMembersDTO){
MemberSummaryVO memberSummaryVO = new MemberSummaryVO();
//总数
Integer total = memberMapper.selectCount(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getCompanyId,getCompanyMembersDTO.getCompanyId()));
memberSummaryVO.setTotal(total);
//短信验证
Integer smsCnt = memberMapper.selectCount(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getCompanyId,getCompanyMembersDTO.getCompanyId())
.isNull(MemberDO::getFirstLogin));
memberSummaryVO.setSmsCnt(smsCnt);
memberSummaryVO.setImgCnt(total-smsCnt);
return memberSummaryVO;
}
}
package com.subsidy.vo.activity;
import lombok.Data;
@Data
public class GetCheckHistoryVO {
private Long id;
private String createDate;
private Integer status;
}
package com.subsidy.vo.company;
import lombok.Data;
@Data
public class MemberSummaryVO {
private Integer total;
private Integer smsCnt;
private Integer imgCnt;
}
......@@ -21,4 +21,17 @@
id, class_id, member_id, status
</sql>
<select id="getCheckHistory" resultType="com.subsidy.vo.activity.GetCheckHistoryVO">
SELECT
t.id,
t.`status`,
t.create_date
FROM
activity_detection t
WHERE
t.delete_date IS NULL
AND t.class_id = #{classId}
AND t.member_id = #{memberId}
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!