diff --git a/src/main/java/com/subsidy/common/configure/ActivityDetectionConfig.java b/src/main/java/com/subsidy/common/configure/ActivityDetectionConfig.java new file mode 100644 index 0000000..3aca11a --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/ActivityDetectionConfig.java @@ -0,0 +1,18 @@ +package com.subsidy.common.configure; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@Configuration +@ConfigurationProperties(prefix = "activity") +public class ActivityDetectionConfig { + + private Long captchaAppId; + + private String appSecretKey; + + private Long businessId; + +} diff --git a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java index 1e9b22a..2610834 100644 --- a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java +++ b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java @@ -111,8 +111,6 @@ public class AuthenticationInterceptor implements HandlerInterceptor { } throw new HttpException(1010); } - - return true; } diff --git a/src/main/java/com/subsidy/controller/ActivityDetectionController.java b/src/main/java/com/subsidy/controller/ActivityDetectionController.java new file mode 100644 index 0000000..7528136 --- /dev/null +++ b/src/main/java/com/subsidy/controller/ActivityDetectionController.java @@ -0,0 +1,45 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +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; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +import javax.servlet.http.HttpServletRequest; + +/** + *

+ * 活跃度检测表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-07-13 + */ +@RestController +@Api(tags = "活跃度检测表") +@RequestMapping("/activityDetection") +public class ActivityDetectionController { + + @Autowired + private ActivityDetectionService activityDetectionService; + + @PostMapping("verify") + @ApiOperation("验证滑块 ticket randStr memberId classId") + public ResponseVO verify(@RequestBody VerifyDTO verifyDTO, HttpServletRequest request){ + return ResponseData.generateCreatedResponse(0,activityDetectionService.verify(verifyDTO,request)); + } + + + + +} diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index b5cabb5..2f1f19a 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -42,11 +42,11 @@ public class AdministerController { @Autowired private AdministerService administerService; - @GetMapping("getIp") - public String getIp()throws Exception{ - InetAddress addr = InetAddress.getLocalHost(); - return addr.getHostAddress(); - } +// @GetMapping("getIp") +// public String getIp()throws Exception{ +// InetAddress addr = InetAddress.getLocalHost(); +// return addr.getHostAddress(); +// } @PostMapping("/login") @ApiOperation("登录接口 accountName password") @@ -212,6 +212,20 @@ public class AdministerController { return ResponseData.generateCreatedResponse(0,administerService.memberStudy(memberStudyLogDTO)); } + @PostMapping("memberDetectionRecord") + @ApiOperation("获取某个班级活跃度检测记录 id userName pageSize pageNum ") + @LoginRequired + public ResponseVO memberDetectionRecord(@RequestBody ClassDetailDTO classDetailDTO ){ + return ResponseData.generateCreatedResponse(0,administerService.memberDetectionRecord(classDetailDTO)); + } + + @PostMapping("exportMemberDetectionRecord") + @ApiOperation("获取某个班级活跃度检测记录 id userName ") + @LoginRequired + public void exportMemberDetectionRecord(@RequestBody ClassDetailDTO classDetailDTO ){ + administerService.exportMemberDetectionRecord(classDetailDTO); + } + @PostMapping("exportZip") @ApiOperation("下载压缩包 id 班级id") @CrossOrigin diff --git a/src/main/java/com/subsidy/controller/CompanyDictController.java b/src/main/java/com/subsidy/controller/CompanyDictController.java index c039bca..edace0a 100644 --- a/src/main/java/com/subsidy/controller/CompanyDictController.java +++ b/src/main/java/com/subsidy/controller/CompanyDictController.java @@ -6,7 +6,9 @@ import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.company.AddCompanyDTO; +import com.subsidy.dto.company.GetCompanyMembersDTO; import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.MemberDO; import com.subsidy.service.CompanyDictService; import com.subsidy.util.ConstantUtils; import io.swagger.annotations.Api; @@ -63,8 +65,16 @@ public class CompanyDictController { @PostMapping("getAllCompany") @ApiOperation("获取全部企业 {companyName}") + @LoginRequired public ResponseVO getAllCompany(@RequestBody CompanyDictDO companyDictDO){ return ResponseData.generateCreatedResponse(0,companyDictService.getAllCompany(companyDictDO)); } + @PostMapping("getCompanyMembers") + @ApiOperation("获取公司里的成员 pageNum pageSize companyId 公司id userName 成员名称") + @LoginRequired + public ResponseVO getCompanyMembers(@RequestBody GetCompanyMembersDTO getCompanyMembersDTO){ + return ResponseData.generateCreatedResponse(0,companyDictService.getCompanyMembers(getCompanyMembersDTO)); + } + } diff --git a/src/main/java/com/subsidy/controller/ImageCheckRecordController.java b/src/main/java/com/subsidy/controller/ImageCheckRecordController.java new file mode 100644 index 0000000..40686bc --- /dev/null +++ b/src/main/java/com/subsidy/controller/ImageCheckRecordController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 实名验证记录表 前端控制器 + *

+ * + * @author DengMin + * @since 2022-07-14 + */ +@RestController +@Api(tags = "实名验证记录表") +@RequestMapping("/image-check-record-do") +public class ImageCheckRecordController { + +} diff --git a/src/main/java/com/subsidy/controller/MemberController.java b/src/main/java/com/subsidy/controller/MemberController.java index 54fe8eb..848cb43 100644 --- a/src/main/java/com/subsidy/controller/MemberController.java +++ b/src/main/java/com/subsidy/controller/MemberController.java @@ -87,6 +87,13 @@ public class MemberController { return ResponseData.generateCreatedResponse(0,memberService.kunchiLogin(qingxuetangLoginDTO)); } + @PostMapping("checkStatus") + @ApiOperation("实名制验证状态 memberId") + @TimeRequired + public ResponseVO checkStatus(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.checkStatus(memberDO)); + } + @PostMapping("updatePassword") @ApiOperation("修改密码 {id password}") @LoginRequired @@ -95,10 +102,17 @@ public class MemberController { return ResponseData.generateCreatedResponse(0,memberService.updatePassword(memberDO)); } - @PostMapping("studyPage") - @ApiOperation("[废弃]手机端:学习主页 id 学员id") - public ResponseVO studyPage(@RequestBody MemberDO memberDO){ - return ResponseData.generateCreatedResponse(0,memberService.studyPage(memberDO)); + @PostMapping("updateCheckImage") + @ApiOperation("上传采集照片 id checkImage") + @TimeRequired + public ResponseVO updateCheckImage(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.updateCheckImage(memberDO)); + } + + @PostMapping("removeCheckImage") + @ApiOperation("清除采集照片 id ") + public ResponseVO removeCheckImage(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.removeCheckImage(memberDO)); } @PostMapping("myCourses") diff --git a/src/main/java/com/subsidy/dto/company/GetCompanyMembersDTO.java b/src/main/java/com/subsidy/dto/company/GetCompanyMembersDTO.java new file mode 100644 index 0000000..2c469c3 --- /dev/null +++ b/src/main/java/com/subsidy/dto/company/GetCompanyMembersDTO.java @@ -0,0 +1,16 @@ +package com.subsidy.dto.company; + +import lombok.Data; + +@Data +public class GetCompanyMembersDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long companyId; + + private String userName; + +} diff --git a/src/main/java/com/subsidy/dto/detection/VerifyDTO.java b/src/main/java/com/subsidy/dto/detection/VerifyDTO.java new file mode 100644 index 0000000..b2e963c --- /dev/null +++ b/src/main/java/com/subsidy/dto/detection/VerifyDTO.java @@ -0,0 +1,18 @@ +package com.subsidy.dto.detection; + +import lombok.Data; + +@Data +public class VerifyDTO { + + private String ticket; + + private String userIp; + + private String randStr; + + private Long memberId; + + private Long classId; + +} diff --git a/src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java b/src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java new file mode 100644 index 0000000..caf5e1b --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ActivityDetectionDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 活跃度检测表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-07-13 + */ + @Repository +public interface ActivityDetectionMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/AdministerMapper.java b/src/main/java/com/subsidy/mapper/AdministerMapper.java index dacc50f..5ea5099 100644 --- a/src/main/java/com/subsidy/mapper/AdministerMapper.java +++ b/src/main/java/com/subsidy/mapper/AdministerMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.AdministerDO; import com.subsidy.vo.administer.ExerciseTestVO; +import com.subsidy.vo.administer.MemberDetectionRecordVO; import com.subsidy.vo.administer.PermissionsVO; import com.subsidy.vo.classdict.ClassDetailVO; import com.subsidy.vo.member.ClassSignVO; @@ -45,5 +46,10 @@ public interface AdministerMapper extends BaseMapper { */ IPage answerRecord(IPage iPage, Long classId, String userName); + /** + * 活跃度检测 + */ + IPage classActivityDetection(IPage iPage, Long classId, String userName); + } diff --git a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java index 5ecde24..6792b3e 100644 --- a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java +++ b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java @@ -3,8 +3,10 @@ package com.subsidy.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.MemberDO; import com.subsidy.vo.administer.OperatorsVO; import com.subsidy.vo.company.GetAllCompanyVO; +import com.subsidy.vo.company.GetCompanyMembersVO; import org.springframework.stereotype.Repository; import java.util.List; @@ -22,13 +24,20 @@ public interface CompanyDictMapper extends BaseMapper { /** * 企业管理--查找所有主账号 、运营者 + * * @return */ - IPage operators(IPage page, String companyName,Long fieldId,Long id,Integer role,String superviseName); + IPage operators(IPage page, String companyName, Long fieldId, Long id, Integer role, String superviseName); /** * 查找所有的公司名称 */ List getAllCompany(CompanyDictDO companyDictDO); + /** + * 查看某个公司的学生 + */ + IPage getCompanyMembers(IPage page, Long companyId, String userName); + + } diff --git a/src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java b/src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java new file mode 100644 index 0000000..8c29f55 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ImageCheckRecordDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 实名验证记录表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2022-07-14 + */ + @Repository +public interface ImageCheckRecordMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/MemberMapper.java b/src/main/java/com/subsidy/mapper/MemberMapper.java index f46e2a0..2a7a8e2 100644 --- a/src/main/java/com/subsidy/mapper/MemberMapper.java +++ b/src/main/java/com/subsidy/mapper/MemberMapper.java @@ -70,4 +70,11 @@ public interface MemberMapper extends BaseMapper { List getMemberListBySignInRecord(Long classId); List getUnfinishedMemberList(Long classId); + + /** + * 清除采集照片 + */ + void removeCheckImage(Long id); + + } diff --git a/src/main/java/com/subsidy/model/ActivityDetectionDO.java b/src/main/java/com/subsidy/model/ActivityDetectionDO.java new file mode 100644 index 0000000..73e9319 --- /dev/null +++ b/src/main/java/com/subsidy/model/ActivityDetectionDO.java @@ -0,0 +1,48 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 活跃度检测表 + *

+ * + * @author DengMin + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("activity_detection") +public class ActivityDetectionDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 班级id + */ + private Long classId; + + /** + * 人员id + */ + private Long memberId; + + /** + * 成功/失败 + */ + private Integer status; + + /** + * RequestId + */ + private String requestId; + +} diff --git a/src/main/java/com/subsidy/model/ImageCheckRecordDO.java b/src/main/java/com/subsidy/model/ImageCheckRecordDO.java new file mode 100644 index 0000000..33d915f --- /dev/null +++ b/src/main/java/com/subsidy/model/ImageCheckRecordDO.java @@ -0,0 +1,38 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 实名验证记录表 + *

+ * + * @author DengMin + * @since 2022-07-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("image_check_record") +public class ImageCheckRecordDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + private Long id; + + /** + * 班级id + */ + private Long classId; + + /** + * 试卷id + */ + private Long paperId; + + private String requestId; + + +} diff --git a/src/main/java/com/subsidy/model/MemberDO.java b/src/main/java/com/subsidy/model/MemberDO.java index b7cf9e2..8f60de6 100644 --- a/src/main/java/com/subsidy/model/MemberDO.java +++ b/src/main/java/com/subsidy/model/MemberDO.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import lombok.Data; import lombok.EqualsAndHashCode; +import java.time.LocalDateTime; import java.util.Date; /** @@ -85,6 +86,16 @@ public class MemberDO extends BaseModel { private String image; /** + * 人脸核验--照片 + */ + private String checkImage; + + /** + * 采集时间 + */ + private LocalDateTime checkTime; + + /** * 身份证号 */ private String idCard; diff --git a/src/main/java/com/subsidy/service/ActivityDetectionService.java b/src/main/java/com/subsidy/service/ActivityDetectionService.java new file mode 100644 index 0000000..e5a0484 --- /dev/null +++ b/src/main/java/com/subsidy/service/ActivityDetectionService.java @@ -0,0 +1,21 @@ +package com.subsidy.service; + +import com.subsidy.dto.detection.VerifyDTO; +import com.subsidy.model.ActivityDetectionDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import javax.servlet.http.HttpServletRequest; + +/** + *

+ * 活跃度检测表 服务类 + *

+ * + * @author DengMin + * @since 2022-07-13 + */ +public interface ActivityDetectionService extends IService { + + String verify(VerifyDTO verifyDTO, HttpServletRequest request); + +} diff --git a/src/main/java/com/subsidy/service/AdministerService.java b/src/main/java/com/subsidy/service/AdministerService.java index b678fff..3acd2ed 100644 --- a/src/main/java/com/subsidy/service/AdministerService.java +++ b/src/main/java/com/subsidy/service/AdministerService.java @@ -68,6 +68,10 @@ public interface AdministerService extends IService { void exportClassVodDailyInfo(ClassVodDailyInfoDTO classVodDailyInfoDTO); + IPage memberDetectionRecord(ClassDetailDTO classDetailDTO); + + void exportMemberDetectionRecord(ClassDetailDTO classDetailDTO); + void export(ClassDetailDTO classDetailDTO)throws Exception; IPage memberStudy(MemberStudyLogDTO memberStudyLogDTO); diff --git a/src/main/java/com/subsidy/service/CompanyDictService.java b/src/main/java/com/subsidy/service/CompanyDictService.java index d17f9e2..29b31d1 100644 --- a/src/main/java/com/subsidy/service/CompanyDictService.java +++ b/src/main/java/com/subsidy/service/CompanyDictService.java @@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.company.AddCompanyDTO; +import com.subsidy.dto.company.GetCompanyMembersDTO; import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.MemberDO; import com.subsidy.vo.administer.OperatorsVO; import com.subsidy.vo.company.GetAllCompanyVO; +import com.subsidy.vo.company.GetCompanyMembersVO; import java.util.List; @@ -30,4 +33,6 @@ public interface CompanyDictService extends IService { List getAllCompany(CompanyDictDO companyDictDO); + IPage getCompanyMembers(GetCompanyMembersDTO getCompanyMembersDTO); + } diff --git a/src/main/java/com/subsidy/service/ImageCheckRecordService.java b/src/main/java/com/subsidy/service/ImageCheckRecordService.java new file mode 100644 index 0000000..de11672 --- /dev/null +++ b/src/main/java/com/subsidy/service/ImageCheckRecordService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.ImageCheckRecordDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 实名验证记录表 服务类 + *

+ * + * @author DengMin + * @since 2022-07-14 + */ +public interface ImageCheckRecordService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/MemberService.java b/src/main/java/com/subsidy/service/MemberService.java index f79d37b..df1526c 100644 --- a/src/main/java/com/subsidy/service/MemberService.java +++ b/src/main/java/com/subsidy/service/MemberService.java @@ -39,9 +39,13 @@ public interface MemberService extends IService { UserRoleVO kunchiLogin(QingxuetangLoginDTO qingxuetangLoginDTO); + CheckStatusVO checkStatus(MemberDO memberDO); + String updatePassword(MemberDO memberDO); - MemberStudyPageVO studyPage(MemberDO memberDO); + String updateCheckImage(MemberDO memberDO); + + String removeCheckImage(MemberDO memberDO); List myCourses(MyCoursesDTO myCoursesDTO); diff --git a/src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java b/src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java new file mode 100644 index 0000000..4bf94ad --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java @@ -0,0 +1,98 @@ +package com.subsidy.service.impl; + +import com.subsidy.common.configure.ActivityDetectionConfig; +import com.subsidy.common.configure.VODConfig; +import com.subsidy.common.configure.WechatConfig; +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.tencentcloudapi.captcha.v20190722.CaptchaClient; +import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultRequest; +import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultResponse; +import com.tencentcloudapi.common.Credential; +import com.tencentcloudapi.common.exception.TencentCloudSDKException; +import com.tencentcloudapi.common.profile.ClientProfile; +import com.tencentcloudapi.common.profile.HttpProfile; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; + +/** + *

+ * 活跃度检测表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-07-13 + */ +@Service +public class ActivityDetectionServiceImpl extends ServiceImpl implements ActivityDetectionService { + + @Autowired + private ActivityDetectionConfig activityDetectionConfig; + + @Autowired + private VODConfig vodConfig; + + public String verify(VerifyDTO verifyDTO, HttpServletRequest request){ + + try{ + // 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey,此处还需注意密钥对的保密 + // 密钥可前往https://console.cloud.tencent.com/cam/capi网站进行获取 + Credential cred = new Credential(vodConfig.getSecretId(),vodConfig.getSecretKey()); + // 实例化一个http选项,可选的,没有特殊需求可以跳过 + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("captcha.tencentcloudapi.com"); + // 实例化一个client选项,可选的,没有特殊需求可以跳过 + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + // 实例化要请求产品的client对象,clientProfile是可选的 + CaptchaClient client = new CaptchaClient(cred, "", clientProfile); + // 实例化一个请求对象,每个接口都会对应一个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(); + } + req.setUserIp(ip); + req.setRandstr(verifyDTO.getRandStr()); + req.setCaptchaAppId(activityDetectionConfig.getCaptchaAppId()); + req.setAppSecretKey(activityDetectionConfig.getAppSecretKey()); + req.setBusinessId(activityDetectionConfig.getBusinessId()); + // 返回的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()); + activityDetectionDO.setRequestId(resp.getRequestId()); + if (resp.getCaptchaCode()==1){ + activityDetectionDO.setStatus(1); + this.baseMapper.insert(activityDetectionDO); + return ConstantUtils.SUCCESS_VERIFY; + }else { + activityDetectionDO.setStatus(0); + this.baseMapper.insert(activityDetectionDO); + return ConstantUtils.FAIL_VERIFY; + } + } catch (TencentCloudSDKException e) { + System.out.println(e.toString()); + } + return null; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index b0d4dfe..297d536 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -54,19 +54,7 @@ import com.subsidy.util.JwtUtil; import com.subsidy.util.Localstorage; import com.subsidy.util.MathUtil; import com.subsidy.util.excel.ExcelUtil; -import com.subsidy.vo.administer.AdministerPermissionVO; -import com.subsidy.vo.administer.ClassDailyInfoVO; -import com.subsidy.vo.administer.ClassSummaryVO; -import com.subsidy.vo.administer.ClassVodDailyInfoItemVO; -import com.subsidy.vo.administer.ClassVodInfoVO; -import com.subsidy.vo.administer.ExerciseTestVO; -import com.subsidy.vo.administer.GetMemberPapersVO; -import com.subsidy.vo.administer.GetPaperDetailVO; -import com.subsidy.vo.administer.LoginVO; -import com.subsidy.vo.administer.ManageMemberVO; -import com.subsidy.vo.administer.MemberStudyLogVO; -import com.subsidy.vo.administer.OperatorsVO; -import com.subsidy.vo.administer.PermissionsVO; +import com.subsidy.vo.administer.*; import com.subsidy.vo.classdict.ClassDetailVO; import com.subsidy.vo.done.GetMaxScoreVO; import com.subsidy.vo.done.TestScoreInfoVO; @@ -324,8 +312,8 @@ public class AdministerServiceImpl extends ServiceImpl() - .lambda() - .eq(RoleAdministerMappingDO::getAdministerId,administerDO.getId())); + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId, administerDO.getId())); administerPermissionVO.setRole(roleAdministerMappingDO.getRoleId()); return administerPermissionVO; } @@ -333,7 +321,7 @@ public class AdministerServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); - IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), null, 1,null); + IPage operatorsVOIPage = companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), null, 1, null); List operatorsVOS = operatorsVOIPage.getRecords(); for (OperatorsVO operatorsVO : operatorsVOS) { @@ -432,7 +420,7 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } @@ -483,7 +471,7 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } @@ -554,7 +542,7 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } @@ -593,7 +581,7 @@ public class AdministerServiceImpl extends ServiceImpl() @@ -638,7 +626,7 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } @@ -697,7 +685,7 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; } @@ -713,7 +701,7 @@ public class AdministerServiceImpl extends ServiceImpl set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); @@ -1035,6 +1023,18 @@ public class AdministerServiceImpl extends ServiceImpl memberDetectionRecord(ClassDetailDTO classDetailDTO) { + Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); + return this.baseMapper.classActivityDetection(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + } + + public void exportMemberDetectionRecord(ClassDetailDTO classDetailDTO) { + Page pager = new Page(1, -1L); + IPage iPage = baseMapper.classActivityDetection(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List memberDetectionRecordVOS = iPage.getRecords(); + //TODO + + } public void writeVodExcel(List classDailyInfoVOS, HashMap hashMap, List title, HashMap vodHashmap) { @@ -1081,7 +1081,7 @@ public class AdministerServiceImpl extends ServiceImpl() .lambda() - .eq(RoleAdministerMappingDO::getAdministerId,operatorsDTO.getId()) - .eq(RoleAdministerMappingDO::getRoleId,1)); + .eq(RoleAdministerMappingDO::getAdministerId, operatorsDTO.getId()) + .eq(RoleAdministerMappingDO::getRoleId, 1)); - if (count > 0){ + if (count > 0) { administerDO.setCompanyId(null); } - IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(),administerDO.getCompanyId(),2,operatorsDTO.getSuperviseName()); + IPage page = this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getFieldId(), administerDO.getCompanyId(), 2, operatorsDTO.getSuperviseName()); List operatorsVOS = page.getRecords(); for (OperatorsVO operatorsVO : operatorsVOS) { //查看公司所在行业 @@ -181,27 +170,27 @@ public class CompanyDictServiceImpl extends ServiceImpl jobDictDOS = jobDictMapper.selectList(new QueryWrapper() - .lambda() - .isNull(JobDictDO::getCompanyId)); - for (JobDictDO jobDictDO : jobDictDOS){ + .lambda() + .isNull(JobDictDO::getCompanyId)); + for (JobDictDO jobDictDO : jobDictDOS) { jobDictDO.setCompanyId(companyDictDO.getId()); jobDictMapper.insert(jobDictDO); } //初始化运营者的职级 List rankDictDOS = rankDictMapper.selectList(new QueryWrapper() - .lambda() - .isNull(RankDictDO::getCompanyId)); - for (RankDictDO rankDictDO : rankDictDOS){ + .lambda() + .isNull(RankDictDO::getCompanyId)); + for (RankDictDO rankDictDO : rankDictDOS) { rankDictDO.setCompanyId(companyDictDO.getId()); rankDictMapper.insert(rankDictDO); } //初始化轮播图 List rotationImgDictDOS = rotationImgDictMapper.selectList(new QueryWrapper() - .lambda() - .isNull(RotationImgDictDO::getCompanyId)); - for (RotationImgDictDO rotationImgDictDO : rotationImgDictDOS){ + .lambda() + .isNull(RotationImgDictDO::getCompanyId)); + for (RotationImgDictDO rotationImgDictDO : rotationImgDictDOS) { rotationImgDictDO.setCompanyId(companyDictDO.getId()); rotationImgDictMapper.insert(rotationImgDictDO); } @@ -247,8 +236,8 @@ public class CompanyDictServiceImpl extends ServiceImpl getCompanyMembers(GetCompanyMembersDTO getCompanyMembersDTO) { + Page pager = new Page(getCompanyMembersDTO.getPageNum(), getCompanyMembersDTO.getPageSize()); + return this.baseMapper.getCompanyMembers(pager,getCompanyMembersDTO.getCompanyId(),getCompanyMembersDTO.getUserName()); + } + + } diff --git a/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java new file mode 100644 index 0000000..881c8e2 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.ImageCheckRecordDO; +import com.subsidy.mapper.ImageCheckRecordMapper; +import com.subsidy.service.ImageCheckRecordService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 实名验证记录表 服务实现类 + *

+ * + * @author DengMin + * @since 2022-07-14 + */ +@Service +public class ImageCheckRecordServiceImpl extends ServiceImpl implements ImageCheckRecordService { + +} diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java index 26344c8..4c41957 100644 --- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -680,49 +680,42 @@ public class MemberServiceImpl extends ServiceImpl imple return userRoleVO; } - public String updatePassword(MemberDO memberDO) { - this.baseMapper.updateById(memberDO); - //MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId()); - //redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX + memberDO1.getCompanyId() + ":" + memberDO.getAccountName(), memberDO); - return ConstantUtils.SET_SUCCESS; - } + public CheckStatusVO checkStatus(MemberDO memberDO) { - public MemberStudyPageVO studyPage(MemberDO memberDO) { - - MemberStudyPageVO memberStudyPageVO = new MemberStudyPageVO(); + CheckStatusVO checkStatusVO = new CheckStatusVO(); + MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId()); - List studyPageVOS = this.baseMapper.studyPage(memberDO); + if (StringUtils.isEmpty(memberDO1.getCheckImage())) { + checkStatusVO.setImageStatus(false); + } else { + checkStatusVO.setImageStatus(true); + } - final ExecutorService newCachedThreadPool = Executors.newCachedThreadPool(); - for (StudyPageVO studyPageVO : studyPageVOS) { - //查看课程下有几节课 - List vodDictDOS = courseContentMapper.getCourseVods(studyPageVO.getId()); - studyPageVO.setTotalVods(vodDictDOS.size()); - newCachedThreadPool.submit(() -> studyPageTask1(studyPageVO, vodDictDOS, memberDO.getId())); + if (memberDO1.getFirstLogin() == 1) { + checkStatusVO.setSMSStatus(true); + } else { + checkStatusVO.setSMSStatus(false); } - newCachedThreadPool.shutdown(); - memberStudyPageVO.setStudyPageVOS(studyPageVOS); - return memberStudyPageVO; + return checkStatusVO; } - public Future studyPageTask1(StudyPageVO studyPageVO, List vodDictDOS, Long memberId) { - - int i = 0; + public String updatePassword(MemberDO memberDO) { + this.baseMapper.updateById(memberDO); + //MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId()); + //redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX + memberDO1.getCompanyId() + ":" + memberDO.getAccountName(), memberDO); + return ConstantUtils.SET_SUCCESS; + } - //该成员完成了几个视频 - for (VodDictDO vodDictDO : vodDictDOS) { - int completeVodOrNot = vodPlayHistoryMapper.completeVodOrNot(memberId, vodDictDO.getId(), studyPageVO.getClassId()); - i += completeVodOrNot; - } - studyPageVO.setDoneVods(i); - ////该班级课程下有多少人 - //Integer count = classMemberMappingMapper.selectCount(new QueryWrapper() - // .lambda() - // .eq(ClassMemberMappingDO::getClassId, studyPageVO.getClassId())); - //studyPageVO.setTotalMember(count); + public String updateCheckImage(MemberDO memberDO) { + memberDO.setCheckTime(LocalDateTime.now()); + this.baseMapper.updateById(memberDO); + return ConstantUtils.SET_SUCCESS; + } - return new AsyncResult<>(studyPageVO); + public String removeCheckImage(MemberDO memberDO) { + this.baseMapper.removeCheckImage(memberDO.getId()); + return ConstantUtils.DELETE_SUCCESS; } public List myCourses(MyCoursesDTO myCoursesDTO) { diff --git a/src/main/java/com/subsidy/vo/administer/MemberDetectionRecordVO.java b/src/main/java/com/subsidy/vo/administer/MemberDetectionRecordVO.java new file mode 100644 index 0000000..2462926 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/MemberDetectionRecordVO.java @@ -0,0 +1,27 @@ +package com.subsidy.vo.administer; + +import com.subsidy.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class MemberDetectionRecordVO { + + + private Long id; + + @ExcelColumn(col = 1,value = "成员名称") + private String userName; + + @ExcelColumn(col = 2,value = "账号") + private String accountName; + + @ExcelColumn(col = 3,value = "身份证号") + private String idCard; + + @ExcelColumn(col = 4,value = "身份证号") + private String telephone; + + @ExcelColumn(col = 5,value = "检测次数") + private Integer cnt; + +} diff --git a/src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java b/src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java new file mode 100644 index 0000000..8ab3ea2 --- /dev/null +++ b/src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java @@ -0,0 +1,22 @@ +package com.subsidy.vo.company; + +import lombok.Data; + +@Data +public class GetCompanyMembersVO { + + private Long id; + + private String userName; + + private String idCard; + + private String companyName; + + private Integer firstLogin; + + private String checkImage; + + private String checkTime; + +} diff --git a/src/main/java/com/subsidy/vo/member/CheckStatusVO.java b/src/main/java/com/subsidy/vo/member/CheckStatusVO.java new file mode 100644 index 0000000..5c56033 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/CheckStatusVO.java @@ -0,0 +1,12 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class CheckStatusVO { + + private Boolean SMSStatus; + + private Boolean imageStatus; + +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 624bc84..f8eae84 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ # 环境配置 -spring.profiles.active=prod +spring.profiles.active=dev #和CPU数 spring.server.acceptorThreadCount=600 spring.server.minSpareThreads=100 @@ -69,3 +69,9 @@ wechat: #pro appId: wx5e1ecb9c9bd33451 appSecret: 4f5e1abb6fb4f68f5273820b6295ec6b + + +#活体检测配置 +activity.captchaAppId: 2013197365 +activity.appSecretKey: 04ABoF0ZVuMje8NP84DE5Sg** +activity.businessId: 1 \ No newline at end of file diff --git a/src/main/resources/mapper/ActivityDetectionMapper.xml b/src/main/resources/mapper/ActivityDetectionMapper.xml new file mode 100644 index 0000000..9fc0b42 --- /dev/null +++ b/src/main/resources/mapper/ActivityDetectionMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, class_id, member_id, status + + + diff --git a/src/main/resources/mapper/AdministerMapper.xml b/src/main/resources/mapper/AdministerMapper.xml index e98eda5..5a42698 100644 --- a/src/main/resources/mapper/AdministerMapper.xml +++ b/src/main/resources/mapper/AdministerMapper.xml @@ -120,4 +120,28 @@ + + diff --git a/src/main/resources/mapper/CompanyDictMapper.xml b/src/main/resources/mapper/CompanyDictMapper.xml index c345db5..a9ad5f9 100644 --- a/src/main/resources/mapper/CompanyDictMapper.xml +++ b/src/main/resources/mapper/CompanyDictMapper.xml @@ -75,4 +75,24 @@ + + diff --git a/src/main/resources/mapper/ExerciseDoneResultMapper.xml b/src/main/resources/mapper/ExerciseDoneResultMapper.xml index 839563d..081c5a0 100644 --- a/src/main/resources/mapper/ExerciseDoneResultMapper.xml +++ b/src/main/resources/mapper/ExerciseDoneResultMapper.xml @@ -119,23 +119,47 @@ + + + update member set check_image = nulll where id = #{id} +