diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index bad6784..adea2f3 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -5,10 +5,7 @@ import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.dto.administer.*; -import com.subsidy.model.AdministerDO; -import com.subsidy.model.ExerciseDoneHistoryDO; -import com.subsidy.model.ExerciseDoneResultDO; -import com.subsidy.model.MemberDO; +import com.subsidy.model.*; import com.subsidy.service.AdministerService; import com.subsidy.util.ConstantUtils; import io.swagger.annotations.Api; @@ -91,7 +88,7 @@ public class AdministerController { @PostMapping("classSummary") @ApiOperation("班级详情--数据概览 id 班级id ") - @LoginRequired +// @LoginRequired public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.classSummary(classDetailDTO)); } @@ -233,6 +230,12 @@ public class AdministerController { return ResponseData.generateCreatedResponse(0,administerService.imageCheckDetail(classDetailDTO)); } + @PostMapping("getMemberCheckDetail") + @ApiOperation("查看某个学生的验证详情 memberId 学员id classId") + @LoginRequired + public ResponseVO getMemberCheckDetail(@RequestBody ImageCheckRecordDO imageCheckRecordDO){ + return ResponseData.generateCreatedResponse(0,administerService.getMemberCheckDetail(imageCheckRecordDO)); + } @PostMapping("exportZip") @ApiOperation("下载压缩包 id 班级id") @@ -257,9 +260,17 @@ public class AdministerController { } @PostMapping("manageMember") - @ApiOperation("用户管理 {pageSize pageNum userName:名字 【废弃】}") + @ApiOperation("用户管理 {pageSize pageNum userName:名字 }") @LoginRequired public ResponseVO manageMember(@RequestBody ManageMemberDTO manageMemberDTO){ return ResponseData.generateCreatedResponse(0,administerService.manageMember(manageMemberDTO)); } + + @PostMapping("exportManageMember") + @ApiOperation("导出认证信息 {pageSize pageNum userName:名字 } ") + @LoginRequired + public void exportManageMember(@RequestBody ManageMemberDTO manageMemberDTO){ + administerService.exportManageMember(manageMemberDTO); + } + } diff --git a/src/main/java/com/subsidy/controller/AnsweringQuestionController.java b/src/main/java/com/subsidy/controller/AnsweringQuestionController.java index 65b8ca9..25bb63e 100644 --- a/src/main/java/com/subsidy/controller/AnsweringQuestionController.java +++ b/src/main/java/com/subsidy/controller/AnsweringQuestionController.java @@ -10,6 +10,7 @@ import com.subsidy.service.AnsweringQuestionService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CachePut; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -41,6 +42,7 @@ public class AnsweringQuestionController { @PostMapping("addQuestion") @ApiOperation("新增答疑 {classId askId title}") @LoginRequired + @CachePut(value = "ResultData" ,key = "'classId_'+#answeringQuestionDO.getClassId()") public ResponseVO addQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ return ResponseData.generateCreatedResponse(0,answeringQuestionService.addQuestion(answeringQuestionDO)); } @@ -48,6 +50,7 @@ public class AnsweringQuestionController { @PostMapping("deleteQuestion") @ApiOperation(" 删除答疑 {id}") @LoginRequired + @CachePut(value = "ResultData" ,key = "'classId_'+#answeringQuestionDO.getClassId()") public ResponseVO deleteQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ return ResponseData.generateCreatedResponse(0,answeringQuestionService.deleteQuestion(answeringQuestionDO)); } @@ -55,6 +58,7 @@ public class AnsweringQuestionController { @PostMapping("updateQuestion") @ApiOperation("编辑答疑 {id answerId answer}") @LoginRequired + @CachePut(value = "ResultData" ,key = "'classId_'+#answeringQuestionDO.getClassId()") public ResponseVO updateQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ return ResponseData.generateCreatedResponse(0, answeringQuestionService.updateQuestion(answeringQuestionDO)); } diff --git a/src/main/java/com/subsidy/controller/CategoryController.java b/src/main/java/com/subsidy/controller/CategoryController.java index 87ee8b9..58dac9e 100644 --- a/src/main/java/com/subsidy/controller/CategoryController.java +++ b/src/main/java/com/subsidy/controller/CategoryController.java @@ -8,6 +8,7 @@ import com.subsidy.dto.category.GetCategoriesDTO; import com.subsidy.model.CategoryDO; import com.subsidy.service.CategoryService; import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.catagory.GetCategoriesVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -25,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController; * @since 2021-10-11 */ @RestController -@Api(tags = "类目") +@Api(tags = "行业领域") @RequestMapping("/category") public class CategoryController { @@ -33,37 +34,37 @@ public class CategoryController { private CategoryService categoryService; @PostMapping("getCategories") - @ApiOperation("查询类目 name 类目名称 companyId pageSize pageNum") + @ApiOperation("查询行业领域 name 类目名称 companyId pageSize pageNum") @LoginRequired public ResponseVO getCategories(@RequestBody GetCategoriesDTO getCategoriesDTO){ return ResponseData.generateCreatedResponse(0,categoryService.getCategories(getCategoriesDTO)); } @PostMapping("getAll") - @ApiOperation("查询所有类目 companyId") + @ApiOperation("查询所有类目【是否还有用?】 companyId") public ResponseVO getAll(@RequestBody GetCategoriesDTO getCategoriesDTO){ return ResponseData.generateCreatedResponse(0,categoryService.getAll(getCategoriesDTO)); } @PostMapping("addCategory") - @ApiOperation("新增类目 name companyId") + @ApiOperation("新增行业领域 name companyId categoryDOS[name 行业领域名称]") @LoginRequired - public ResponseVO addCategory(@RequestBody CategoryDO categoryDO){ - return ResponseData.generateCreatedResponse(0,categoryService.addCategory(categoryDO)); + public ResponseVO addCategory(@RequestBody GetCategoriesVO getCategoriesVO){ + return ResponseData.generateCreatedResponse(0,categoryService.addCategory(getCategoriesVO)); } @PostMapping("deleteCategory") - @ApiOperation("删除类目 id") + @ApiOperation("删除一级行业领域 id") @LoginRequired public ResponseVO deleteCategory(@RequestBody CategoryDO categoryDO){ return ResponseData.generateCreatedResponse(0,categoryService.deleteCategory(categoryDO)); } @PostMapping("updateCategory") - @ApiOperation("修改类目 id name companyId") + @ApiOperation("修改行业领域 id name companyId categoryDOS[name 行业领域名称]") @LoginRequired - public ResponseVO updateCategory(@RequestBody CategoryDO categoryDO){ - return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(categoryDO)); + public ResponseVO updateCategory(@RequestBody GetCategoriesVO getCategoriesVO){ + return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(getCategoriesVO)); } } diff --git a/src/main/java/com/subsidy/controller/ClassDictController.java b/src/main/java/com/subsidy/controller/ClassDictController.java index 7cc6d6f..f3cd871 100644 --- a/src/main/java/com/subsidy/controller/ClassDictController.java +++ b/src/main/java/com/subsidy/controller/ClassDictController.java @@ -16,6 +16,7 @@ import com.subsidy.util.ConstantUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CachePut; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -59,7 +60,10 @@ public class ClassDictController { } @PostMapping("updateClass") - @ApiOperation("修改班级 id companyId className classTypeId startDate endDate") + @ApiOperation("修改班级 id className classTypeId startDate endDate isOrder 是否按顺序播放 isFastPlay 是否允许快进 " + + "testRule:测试规则 limitHour 学习上限时长 imageClassCheck:首次进入班级时人脸验证 imageTestCheck:测试前人脸识别验证" + + "activityDetection:活跃度检测开启/关闭 activityDetectionMethod:活跃度检测方式 firstDragAllowed:首次播放允许拖曳" + + "firstSpeedAllowed:首次播放允许倍速 playSnap 课程抓拍 ") @LoginRequired public ResponseVO updateClass(@RequestBody ClassDictDO classDictDO){ return ResponseData.generateCreatedResponse(0,classDictService.updateClass(classDictDO)); diff --git a/src/main/java/com/subsidy/controller/CompanyDictController.java b/src/main/java/com/subsidy/controller/CompanyDictController.java index d38a194..91dff13 100644 --- a/src/main/java/com/subsidy/controller/CompanyDictController.java +++ b/src/main/java/com/subsidy/controller/CompanyDictController.java @@ -57,12 +57,28 @@ public class CompanyDictController { } @PostMapping("updateCompany") - @ApiOperation("修改企业 id superviseName 第三方监管名称 accountName:账号 logo companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员") + @ApiOperation("修改企业 id superviseName 第三方监管名称 accountName:账号 logo companyName:企业名称 address 企业所在地 shortName 简称 " + + "banner:标语 field[]:领域 role 1:超级管理员 2:普通成员 ") @LoginRequired public ResponseVO updateAdminister(@RequestBody AddCompanyDTO addCompanyDTO){ return ResponseData.generateCreatedResponse(0,companyDictService.updateAdminister(addCompanyDTO)); } + @PostMapping("updateCompanySettings") + @ApiOperation("修改企业设置 id timeLimit:上课时间不晚于23:30,不早于6:30" + + "ipAddressRecord: 签到时记录IP地址 deviceNoRecord: 设备类型") + @LoginRequired + public ResponseVO updateCompanySettings(@RequestBody CompanyDictDO companyDictDO){ + return ResponseData.generateCreatedResponse(0,companyDictService.updateCompanySettings(companyDictDO)); + } + + @PostMapping("getCompanyInfo") + @ApiOperation("获取公司配置信息 id ") + @LoginRequired + public ResponseVO getCompanyInfo(@RequestBody CompanyDictDO companyDictDO){ + return ResponseData.generateCreatedResponse(0,companyDictService.getCompanyInfo(companyDictDO)); + } + @PostMapping("getAllCompany") @ApiOperation("获取全部企业 {companyName}") @LoginRequired diff --git a/src/main/java/com/subsidy/controller/ExerciseDictController.java b/src/main/java/com/subsidy/controller/ExerciseDictController.java index 350e37c..2c29814 100644 --- a/src/main/java/com/subsidy/controller/ExerciseDictController.java +++ b/src/main/java/com/subsidy/controller/ExerciseDictController.java @@ -15,6 +15,7 @@ import com.subsidy.util.ConstantUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CachePut; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -61,6 +62,7 @@ public class ExerciseDictController { @ApiOperation("提交答案 {paperId 卷子id memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ] length:做题时长} ") @LoginRequired @TimeRequired + @CachePut(value = "ResultData" ,key = "'classId_'+#submitDTO.getClassId()") public ResponseVO submit(@RequestBody SubmitDTO submitDTO){ return ResponseData.generateCreatedResponse(0,exerciseDictService.submit(submitDTO)); } diff --git a/src/main/java/com/subsidy/controller/ImageCheckRecordController.java b/src/main/java/com/subsidy/controller/ImageCheckRecordController.java index 0d16246..954f047 100644 --- a/src/main/java/com/subsidy/controller/ImageCheckRecordController.java +++ b/src/main/java/com/subsidy/controller/ImageCheckRecordController.java @@ -4,6 +4,8 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.common.interceptor.TimeRequired; +import com.subsidy.dto.image.CheckResultDTO; import com.subsidy.dto.image.ImageCheckDTO; import com.subsidy.model.ImageCheckRecordDO; import com.subsidy.service.ImageCheckRecordService; @@ -41,11 +43,37 @@ public class ImageCheckRecordController { } @PostMapping("imageCheck") - @ApiOperation("人身核验 id 用户id nonce ") + @ApiOperation("课程/测评人身核验(权威库:身份证) PC端 id 用户id classId 班级id ") + @TimeRequired public ResponseVO imageCheck(@RequestBody ImageCheckDTO imageCheckDTO) throws Exception { return ResponseData.generateCreatedResponse(0, imageCheckRecordService.imageCheck(imageCheckDTO)); } + @PostMapping("h5ImageCheck") + @ApiOperation("课程/测评人脸核验(权威库:身份证) 微信浮层H5 id 用户id classId 班级id") + @TimeRequired + public ResponseVO h5CheckResult(@RequestBody ImageCheckDTO imageCheckDTO)throws Exception{ + return ResponseData.generateCreatedResponse(0,imageCheckRecordService.h5CheckResult(imageCheckDTO)); + } + + @PostMapping("loginCheck") + @ApiOperation("签到页做人脸核验 (权威库:身份证) PC端 id 用户id") + @TimeRequired + public ResponseVO loginCheck(@RequestBody ImageCheckDTO imageCheckDTO)throws Exception{ + return ResponseData.generateCreatedResponse(0,imageCheckRecordService.loginCheck(imageCheckDTO)); + } + @PostMapping("h5LoginCheck") + @ApiOperation("签到页做人脸核验 (权威库:身份证) PC端 id 用户id") + @TimeRequired + public ResponseVO h5LoginCheck(@RequestBody ImageCheckDTO imageCheckDTO)throws Exception{ + return ResponseData.generateCreatedResponse(0,imageCheckRecordService.h5LoginCheck(imageCheckDTO)); + } + + @PostMapping("checkResult") + @ApiOperation("人脸验证结果 存图片 id 订单号 ") + public ResponseVO checkResult(@RequestBody CheckResultDTO checkResultDTO)throws Exception{ + return ResponseData.generateCreatedResponse(0,imageCheckRecordService.checkResult(checkResultDTO)); + } } diff --git a/src/main/java/com/subsidy/controller/MemberController.java b/src/main/java/com/subsidy/controller/MemberController.java index d693828..8106814 100644 --- a/src/main/java/com/subsidy/controller/MemberController.java +++ b/src/main/java/com/subsidy/controller/MemberController.java @@ -110,7 +110,7 @@ public class MemberController { @PostMapping("myCourses") @ApiOperation("手机端:我的学习--课程 memberId 学员id status 状态 0:全部 1:进行中 2:待开始 3:已完成 ") -// @LoginRequired + @LoginRequired @TimeRequired public ResponseVO myCourses(@RequestBody MyCoursesDTO myCoursesDTO){ return ResponseData.generateCreatedResponse(0,memberService.myCourses(myCoursesDTO)); @@ -118,7 +118,7 @@ public class MemberController { @PostMapping("contentVod") @ApiOperation("手机端:目录+视频 classId 班级id courseId 课程 memberId 学员id") -// @LoginRequired + @LoginRequired @TimeRequired public ResponseVO contentVod(@RequestBody ContentMemberDTO contentVodDTO){ return ResponseData.generateCreatedResponse(0,memberService.contentVod(contentVodDTO)); diff --git a/src/main/java/com/subsidy/controller/SignInRecordController.java b/src/main/java/com/subsidy/controller/SignInRecordController.java index 935e96d..1e0418a 100644 --- a/src/main/java/com/subsidy/controller/SignInRecordController.java +++ b/src/main/java/com/subsidy/controller/SignInRecordController.java @@ -13,6 +13,7 @@ import com.subsidy.util.ConstantUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CachePut; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -35,16 +36,17 @@ public class SignInRecordController { private SignInRecordService signInRecordService; @PostMapping("getMemberSignInfo") - @ApiOperation("获取某个成员的签到记录 id 成员id pageSize pageNum") + @ApiOperation("获取某个成员的签到记录 id 成员id classId 班级id pageSize pageNum") @LoginRequired public ResponseVO getMemberSignInfo(@RequestBody GetMemberSignInfoDTO getMemberSignInfoDTO) { return ResponseData.generateCreatedResponse(0, signInRecordService.getMemberSignInfo(getMemberSignInfoDTO)); } @PostMapping("signIn") - @ApiOperation("签到 memberId") - @LoginRequired + @ApiOperation("签到 memberId deviceNo:设备号") +// @LoginRequired @TimeRequired + @CachePut(value = "ResultData" ,key = "'classId_'+#signInRecordDO.getClassId()") public ResponseVO signIn(@RequestBody SignInRecordDO signInRecordDO) { return ResponseData.generateCreatedResponse(0, signInRecordService.signIn(signInRecordDO)); } @@ -58,7 +60,7 @@ public class SignInRecordController { @PostMapping("signInStatus") @ApiOperation("判断学生当天有没有打卡 {memberId 学生id}") - @LoginRequired +// @LoginRequired @TimeRequired public ResponseVO signInStatus(@RequestBody SignInRecordDO signInRecordDO) { return ResponseData.generateCreatedResponse(0, signInRecordService.signInStatus(signInRecordDO)); diff --git a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java index 7a241bd..8aaf441 100644 --- a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java +++ b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java @@ -80,7 +80,6 @@ public class VodPlayHistoryController { vodPlayHistoryService.playLengthFix(remainSecondsDTO); } - @PostMapping("testPlays") @ApiOperation("解决有交叉时间的数据") public ResponseVO testPlays(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){ diff --git a/src/main/java/com/subsidy/dto/image/CheckResultDTO.java b/src/main/java/com/subsidy/dto/image/CheckResultDTO.java new file mode 100644 index 0000000..4cd04ac --- /dev/null +++ b/src/main/java/com/subsidy/dto/image/CheckResultDTO.java @@ -0,0 +1,10 @@ +package com.subsidy.dto.image; + +import lombok.Data; + +@Data +public class CheckResultDTO { + + private String id; + +} diff --git a/src/main/java/com/subsidy/dto/image/ImageCheckDTO.java b/src/main/java/com/subsidy/dto/image/ImageCheckDTO.java index 9dd4717..7356ad9 100644 --- a/src/main/java/com/subsidy/dto/image/ImageCheckDTO.java +++ b/src/main/java/com/subsidy/dto/image/ImageCheckDTO.java @@ -7,12 +7,6 @@ public class ImageCheckDTO { private Long id; - private String imageBase64; - private Long classId; - private Long paperId; - - private String nonce ; - } diff --git a/src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java b/src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java index 571466a..b546be7 100644 --- a/src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java +++ b/src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java @@ -9,6 +9,8 @@ public class GetMemberSignInfoDTO { private Integer pageNum; + private Long classId; + private Long id; } diff --git a/src/main/java/com/subsidy/mapper/CategoryMapper.java b/src/main/java/com/subsidy/mapper/CategoryMapper.java index 5ec704a..fa939e9 100644 --- a/src/main/java/com/subsidy/mapper/CategoryMapper.java +++ b/src/main/java/com/subsidy/mapper/CategoryMapper.java @@ -1,7 +1,9 @@ package com.subsidy.mapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.CategoryDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.catagory.GetCategoriesVO; import org.springframework.stereotype.Repository; import java.util.List; @@ -19,8 +21,15 @@ public interface CategoryMapper extends BaseMapper { /** - * 查看某个课程下的所有类目 + * 查看某个课程下的所有行业领域 */ List queryCourseCategory(Long courseId); + + /** + * 查看行业领域 + * 公司id为空的话就查平台的,否则传公司的行业领域 + */ + IPage getCategories(IPage page,Long companyId,String name); + } diff --git a/src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java b/src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java index 8c29f55..40e8f5a 100644 --- a/src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java +++ b/src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java @@ -2,8 +2,11 @@ package com.subsidy.mapper; import com.subsidy.model.ImageCheckRecordDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.image.GetMemberCheckDetailVO; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 实名验证记录表 Mapper 接口 @@ -12,7 +15,13 @@ import org.springframework.stereotype.Repository; * @author DengMin * @since 2022-07-14 */ - @Repository +@Repository public interface ImageCheckRecordMapper extends BaseMapper { + + /** + * 获取某个人某个课程的验证记录 + */ + List getMemberCheckDetail(Long memberId, Long classId); + } diff --git a/src/main/java/com/subsidy/mapper/VodDictMapper.java b/src/main/java/com/subsidy/mapper/VodDictMapper.java index 3391cc8..6a91578 100644 --- a/src/main/java/com/subsidy/mapper/VodDictMapper.java +++ b/src/main/java/com/subsidy/mapper/VodDictMapper.java @@ -44,5 +44,5 @@ public interface VodDictMapper extends BaseMapper { /** * 重复数据查找 */ - List testPlays(Long memberId); + List testPlays(Long memberId,Long classId); } diff --git a/src/main/java/com/subsidy/model/CategoryDO.java b/src/main/java/com/subsidy/model/CategoryDO.java index c82ebcb..1b520b8 100644 --- a/src/main/java/com/subsidy/model/CategoryDO.java +++ b/src/main/java/com/subsidy/model/CategoryDO.java @@ -26,6 +26,11 @@ public class CategoryDO extends BaseModel { private Long id; /** + * 父id + */ + private Long parentId; + + /** * 企业id */ private Long companyId; diff --git a/src/main/java/com/subsidy/model/ClassDictDO.java b/src/main/java/com/subsidy/model/ClassDictDO.java index 20c4ef8..52c4aef 100644 --- a/src/main/java/com/subsidy/model/ClassDictDO.java +++ b/src/main/java/com/subsidy/model/ClassDictDO.java @@ -68,10 +68,10 @@ public class ClassDictDO extends BaseModel { */ private Integer isFastPlay; - ///** - // * 班级状态 - // */ - //private String openStatus; + /** + * 班级状态 + */ + private String openStatus; /** * 测试规则 @@ -118,6 +118,4 @@ public class ClassDictDO extends BaseModel { */ private Integer playSnap; - - } diff --git a/src/main/java/com/subsidy/model/CompanyDictDO.java b/src/main/java/com/subsidy/model/CompanyDictDO.java index cf5d8be..3ce3917 100644 --- a/src/main/java/com/subsidy/model/CompanyDictDO.java +++ b/src/main/java/com/subsidy/model/CompanyDictDO.java @@ -60,4 +60,20 @@ public class CompanyDictDO extends BaseModel { */ private String superviseName; + /** + * 上课时间不晚于23:30,不早于6:30 + */ + private Integer timeLimit; + + /** + * 签到时记录IP地址 + */ + private Integer ipAddressRecord; + + /** + * 签到时记录设备型号 + */ + private Integer deviceNoRecord; + + } diff --git a/src/main/java/com/subsidy/model/ImageCheckRecordDO.java b/src/main/java/com/subsidy/model/ImageCheckRecordDO.java index 71147a2..617a728 100644 --- a/src/main/java/com/subsidy/model/ImageCheckRecordDO.java +++ b/src/main/java/com/subsidy/model/ImageCheckRecordDO.java @@ -26,7 +26,7 @@ public class ImageCheckRecordDO extends BaseModel { private Long id; /** - * 班级id + * 班级 */ private Long classId; @@ -36,12 +36,39 @@ public class ImageCheckRecordDO extends BaseModel { private Long memberId; /** - * 请求id + * 活体检测得分 */ - private String requestId; + private String liveRate; /** - * 图片地址 + * 人脸检测得分 */ - private String imageUrl; + private String similarity; + + /** + * 刷脸时间 + */ + private String occurredTime; + + /** + * 图片 + */ + private String photo; + + /** + * 流水号 + */ + private String bizSeqNo; + + /** + * 检测类型 检测类型 1,权威库 0照片比对 + */ + private Integer checkType; + + /** + * 检测地点 1,签到页 0 班级内 + */ + private Integer checkPlace; + + } diff --git a/src/main/java/com/subsidy/model/SignInRecordDO.java b/src/main/java/com/subsidy/model/SignInRecordDO.java index 90312ac..fa1c41e 100644 --- a/src/main/java/com/subsidy/model/SignInRecordDO.java +++ b/src/main/java/com/subsidy/model/SignInRecordDO.java @@ -46,5 +46,15 @@ public class SignInRecordDO extends BaseModel { @ExcelColumnUtil(value = "sign_in_date", col = 4) private LocalDateTime signInDate; + /** + * 地址 + */ + private String ipAddress; + + /** + * 设备号 + */ + private String deviceNo; + } diff --git a/src/main/java/com/subsidy/service/AdministerService.java b/src/main/java/com/subsidy/service/AdministerService.java index beb7745..8dae927 100644 --- a/src/main/java/com/subsidy/service/AdministerService.java +++ b/src/main/java/com/subsidy/service/AdministerService.java @@ -6,8 +6,10 @@ import com.subsidy.dto.administer.*; import com.subsidy.model.AdministerDO; import com.subsidy.model.ExerciseDoneHistoryDO; import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.model.ImageCheckRecordDO; import com.subsidy.vo.administer.*; import com.subsidy.vo.classdict.ClassDetailVO; +import com.subsidy.vo.image.GetMemberCheckDetailVO; import com.subsidy.vo.member.ClassSignVO; import com.subsidy.vo.sign.AnswerRecordVO; import org.springframework.web.multipart.MultipartFile; @@ -74,6 +76,8 @@ public interface AdministerService extends IService { IPage imageCheckDetail(ClassDetailDTO classDetailDTO); + List getMemberCheckDetail(ImageCheckRecordDO imageCheckRecordDO); + void export(ClassDetailDTO classDetailDTO)throws Exception; IPage memberStudy(MemberStudyLogDTO memberStudyLogDTO); @@ -83,4 +87,6 @@ public interface AdministerService extends IService { String importMember(Long companyId, MultipartFile multipartFile)throws Exception; IPage manageMember(ManageMemberDTO manageMemberDTO); + + void exportManageMember(ManageMemberDTO manageMemberDTO); } diff --git a/src/main/java/com/subsidy/service/CategoryService.java b/src/main/java/com/subsidy/service/CategoryService.java index 8647c82..406f7e9 100644 --- a/src/main/java/com/subsidy/service/CategoryService.java +++ b/src/main/java/com/subsidy/service/CategoryService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.dto.category.GetCategoriesDTO; import com.subsidy.model.CategoryDO; import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.catagory.GetCategoriesVO; import java.util.List; @@ -17,13 +18,13 @@ import java.util.List; */ public interface CategoryService extends IService { - IPage getCategories(GetCategoriesDTO getCategoriesDTO); + IPage getCategories(GetCategoriesDTO getCategoriesDTO); List getAll(GetCategoriesDTO getCategoriesDTO); - String addCategory(CategoryDO categoryDO); + String addCategory(GetCategoriesVO getCategoriesVO); String deleteCategory(CategoryDO categoryDO); - String updateCategory(CategoryDO categoryDO); + String updateCategory(GetCategoriesVO getCategoriesVO); } diff --git a/src/main/java/com/subsidy/service/CompanyDictService.java b/src/main/java/com/subsidy/service/CompanyDictService.java index 44d817a..c1d2c58 100644 --- a/src/main/java/com/subsidy/service/CompanyDictService.java +++ b/src/main/java/com/subsidy/service/CompanyDictService.java @@ -33,6 +33,10 @@ public interface CompanyDictService extends IService { String updateAdminister(AddCompanyDTO addCompanyDTO); + String updateCompanySettings(CompanyDictDO companyDictDO); + + CompanyDictDO getCompanyInfo(CompanyDictDO companyDictDO); + 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 index 7448cb7..29de678 100644 --- a/src/main/java/com/subsidy/service/ImageCheckRecordService.java +++ b/src/main/java/com/subsidy/service/ImageCheckRecordService.java @@ -1,8 +1,10 @@ package com.subsidy.service; +import com.subsidy.dto.image.CheckResultDTO; import com.subsidy.dto.image.ImageCheckDTO; import com.subsidy.model.ImageCheckRecordDO; import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.token.SendIdCardInfoVO; import java.util.List; @@ -18,6 +20,14 @@ public interface ImageCheckRecordService extends IService { List getImageCheckHistory(ImageCheckRecordDO imageCheckRecordDO); - String imageCheck(ImageCheckDTO imageCheckDTO)throws Exception; + SendIdCardInfoVO imageCheck(ImageCheckDTO imageCheckDTO)throws Exception; + + SendIdCardInfoVO h5CheckResult(ImageCheckDTO imageCheckDTO) throws Exception; + + SendIdCardInfoVO loginCheck(ImageCheckDTO imageCheckDTO)throws Exception; + + SendIdCardInfoVO h5LoginCheck(ImageCheckDTO imageCheckDTO)throws Exception; + + ImageCheckRecordDO checkResult(CheckResultDTO checkResultDTO)throws Exception; } diff --git a/src/main/java/com/subsidy/service/VodPlayHistoryService.java b/src/main/java/com/subsidy/service/VodPlayHistoryService.java index 230428c..02cef99 100644 --- a/src/main/java/com/subsidy/service/VodPlayHistoryService.java +++ b/src/main/java/com/subsidy/service/VodPlayHistoryService.java @@ -8,6 +8,7 @@ import com.subsidy.model.VodPlayHistoryDO; import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.vo.vod.VodPlayStateVO; +import java.util.HashSet; import java.util.List; /** @@ -32,5 +33,5 @@ public interface VodPlayHistoryService extends IService { void playLengthFix(RemainSecondsDTO remainSecondsDTO); - List testPlays(VodPlayHistoryDO vodPlayHistoryDO); + HashSet testPlays(VodPlayHistoryDO vodPlayHistoryDO); } diff --git a/src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java b/src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java index 96f8497..5b5ab6d 100644 --- a/src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java @@ -37,10 +37,12 @@ public class ActivityDetectionServiceImpl extends ServiceImpl getCheckHistory(GetCheckHistoryDTO getCheckHistoryDTO){ diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index 3dd0bb7..db5fb0d 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -46,6 +46,8 @@ import com.subsidy.model.PaperDictDO; import com.subsidy.model.RoleAdministerMappingDO; import com.subsidy.model.SignInRecordDO; import com.subsidy.model.VodDictDO; +import com.subsidy.mapper.*; +import com.subsidy.model.*; import com.subsidy.service.AdministerService; import com.subsidy.util.ConstantUtils; import com.subsidy.util.ExcelFormatUtils; @@ -57,6 +59,7 @@ import com.subsidy.vo.administer.*; import com.subsidy.vo.classdict.ClassDetailVO; import com.subsidy.vo.done.GetMaxScoreVO; import com.subsidy.vo.done.TestScoreInfoVO; +import com.subsidy.vo.image.GetMemberCheckDetailVO; import com.subsidy.vo.member.ClassSignVO; import com.subsidy.vo.sign.AnswerRecordVO; import com.subsidy.vo.vod.ClassMemberPlayLengthVO; @@ -114,6 +117,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; + /** *

* 管理平台用户 服务实现类 @@ -176,6 +180,9 @@ public class AdministerServiceImpl extends ServiceImpl classSignVOIPage = this.baseMapper.classSign(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); List classSignVOS = classSignVOIPage.getRecords(); - //课程由多少个视频 - List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); - for (ClassSignVO classSignVO : classSignVOS) { - //该学生完成了多少个 - int i = 0; - int playLength = 0; - //该成员完成了几个视频 - for (VodDictDO vodDictDO : vodDictDOS) { - int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classSignVO.getId(), vodDictDO.getId()); - if (totalPlayLength >= vodDictDO.getVodLength()) { - i++; - } - playLength += totalPlayLength; - } - //课程进度 - classSignVO.setClassProcess(i + "/" + vodDictDOS.size()); - - //完成率 - String percent = MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(i), new BigDecimal(vodDictDOS.size())); - classSignVO.setPercent(percent); - - //培训时长 - classSignVO.setTrainingLength(playLength); - classSignVO.setTrainingLengthStr(MathUtil.secToTime(playLength)); - - //签到 - //Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); + //签到次数 List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() .lambda() .eq(SignInRecordDO::getClassId, classDetailDTO.getId()) @@ -651,7 +632,6 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { - i++; - } - playLength += totalPlayLength; - } - classSignVO.setClassProcess(i + "/" + vodDictDOS.size()); - - //完成率 - String percent = MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(i), new BigDecimal(vodDictDOS.size())); - classSignVO.setPercent(percent); - - //培训时长 小时 - classSignVO.setTrainingLengthStr(MathUtil.secToTime(playLength)); - - //培训时长 分钟 - classSignVO.setTrainingLengthMinute(Math.floorDiv(playLength, 60) + ""); - //签到 //Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + classSignVO.getId() + ":classId:" + classDetailDTO.getId() + "*"); List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() @@ -711,10 +673,8 @@ public class AdministerServiceImpl extends ServiceImpl imageCheckDetail(ClassDetailDTO classDetailDTO){ + public IPage imageCheckDetail(ClassDetailDTO classDetailDTO) { Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); - return this.baseMapper.imageCheckDetail(pager,classDetailDTO.getId(),classDetailDTO.getUserName()); + return this.baseMapper.imageCheckDetail(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + } + + public List getMemberCheckDetail(ImageCheckRecordDO imageCheckRecordDO) { + List memberCheckDetail = imageCheckRecordMapper.getMemberCheckDetail(imageCheckRecordDO.getMemberId(), imageCheckRecordDO.getClassId()); + + for (GetMemberCheckDetailVO gcdv : memberCheckDetail) { + if (gcdv.getSimilarity() > 60.0) { + gcdv.setResult("通过"); + } else { + gcdv.setResult("不通过"); + } + } + return memberCheckDetail; } public void writeVodExcel(List classDailyInfoVOS, HashMap hashMap, List title, HashMap vodHashmap) { @@ -1399,6 +1378,31 @@ public class AdministerServiceImpl extends ServiceImpl manageMemberVOS = iPage.getRecords(); + + for (ManageMemberVO manageMemberVO : manageMemberVOS) { + + if (manageMemberVO.getFirstLogin() == 1) { + manageMemberVO.setSmsCheck("已完成"); + } else { + manageMemberVO.setSmsCheck("尚未完成"); + } + + if (!StringUtils.isEmpty(manageMemberVO.getCheckImage())) { + manageMemberVO.setImageCheckStatus("已完成"); + } else { + manageMemberVO.setImageCheckStatus("尚未完成"); + } + } + ExcelUtil.writeExcel(manageMemberVOS, ManageMemberVO.class); + } + + public String userName(String originName, int i, Long companyId) { i++; List memberDOS = memberMapper.selectList(new QueryWrapper() @@ -1746,7 +1750,7 @@ public class AdministerServiceImpl extends ServiceImpl implements CategoryService { - public IPage getCategories(GetCategoriesDTO getCategoriesDTO) { + public IPage getCategories(GetCategoriesDTO getCategoriesDTO) { Page pager = new Page(getCategoriesDTO.getPageNum(), getCategoriesDTO.getPageSize()); - if (null == getCategoriesDTO.getCompanyId()) { - return this.baseMapper.selectPage(pager, new QueryWrapper() - .lambda() - .like(CategoryDO::getName, getCategoriesDTO.getName()) - .isNull(CategoryDO::getCompanyId)); - } else { - return this.baseMapper.selectPage(pager, new QueryWrapper() - .lambda() - .like(CategoryDO::getName, getCategoriesDTO.getName()) - .eq(CategoryDO::getCompanyId, getCategoriesDTO.getCompanyId())); + IPage categoryDOIPage = this.baseMapper.getCategories(pager,getCategoriesDTO.getCompanyId(),getCategoriesDTO.getName()); + + //二级行业领域 + List getCategoriesVOS = categoryDOIPage.getRecords(); + for (GetCategoriesVO gcv : getCategoriesVOS){ + //找二级 + List categoryDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(CategoryDO::getParentId,gcv.getId())); + gcv.setCategoryDOS(categoryDOS); } + return categoryDOIPage; } @@ -56,48 +59,79 @@ public class CategoryServiceImpl extends ServiceImpl } } - public String addCategory(CategoryDO categoryDO) { + public String addCategory(GetCategoriesVO getCategoriesVO) { int count; - if (null == categoryDO.getCompanyId()) { + if (null == getCategoriesVO.getCompanyId()) { count = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .like(CategoryDO::getName, categoryDO.getName()) + .like(CategoryDO::getName, getCategoriesVO.getName()) .isNull(CategoryDO::getCompanyId)); } else { count = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .like(CategoryDO::getName, categoryDO.getName()) - .eq(CategoryDO::getCompanyId, categoryDO.getCompanyId())); + .like(CategoryDO::getName, getCategoriesVO.getName()) + .eq(CategoryDO::getCompanyId, getCategoriesVO.getCompanyId())); } if (count > 0) { throw new HttpException(90001); } + + //一级目录 + CategoryDO categoryDO = new CategoryDO(); + BeanUtils.copyProperties(getCategoriesVO,categoryDO); this.baseMapper.insert(categoryDO); + //二级目录 + List categoryDOS = getCategoriesVO.getCategoryDOS(); + for (CategoryDO cd : categoryDOS){ + cd.setCompanyId(getCategoriesVO.getCompanyId()); + cd.setParentId(categoryDO.getId()); + this.baseMapper.insert(cd); + } return ConstantUtils.ADD_SUCCESS; } public String deleteCategory(CategoryDO categoryDO) { this.baseMapper.deleteById(categoryDO.getId()); + this.baseMapper.delete(new QueryWrapper() + .lambda() + .eq(CategoryDO::getParentId,categoryDO.getId())); return ConstantUtils.DELETE_SUCCESS; } - public String updateCategory(CategoryDO categoryDO) { + public String updateCategory(GetCategoriesVO getCategoriesVO) { int count = this.baseMapper.selectCount(new QueryWrapper() .lambda() - .eq(CategoryDO::getName, categoryDO.getName()) - .eq(CategoryDO::getCompanyId, categoryDO.getCompanyId()) - .ne(CategoryDO::getId, categoryDO.getId())); + .eq(CategoryDO::getName, getCategoriesVO.getName()) + .eq(CategoryDO::getCompanyId, getCategoriesVO.getCompanyId()) + .ne(CategoryDO::getId, getCategoriesVO.getId())); if (count > 0) { throw new HttpException(90001); } + CategoryDO categoryDO = new CategoryDO(); + BeanUtils.copyProperties(getCategoriesVO,categoryDO); this.baseMapper.updateById(categoryDO); + CategoryDO categoryDO1 = this.baseMapper.selectById(categoryDO.getId()); + + if (getCategoriesVO.getCategoryDOS().size()>0){ + + this.baseMapper.delete(new QueryWrapper() + .lambda() + .eq(CategoryDO::getParentId,getCategoriesVO.getId())); + + List categoryDOS = getCategoriesVO.getCategoryDOS(); + for (CategoryDO cd: categoryDOS){ + cd.setParentId(getCategoriesVO.getId()); + cd.setCompanyId(categoryDO1.getCompanyId()); + this.baseMapper.insert(cd); + } + } return ConstantUtils.SET_SUCCESS; } diff --git a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java index a280e56..f78bc04 100644 --- a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java @@ -279,13 +279,22 @@ public class CompanyDictServiceImpl extends ServiceImpl getAllCompany(CompanyDictDO companyDictDO) { return this.baseMapper.getAllCompany(companyDictDO); } public IPage getCompanyMembers(GetCompanyMembersDTO getCompanyMembersDTO) { Page pager = new Page(getCompanyMembersDTO.getPageNum(), getCompanyMembersDTO.getPageSize()); - return this.baseMapper.getCompanyMembers(pager,getCompanyMembersDTO.getCompanyId(),getCompanyMembersDTO.getUserName()); + return this.baseMapper.getCompanyMembers(pager, getCompanyMembersDTO.getCompanyId(), getCompanyMembersDTO.getUserName()); } @Override @@ -343,18 +352,18 @@ public class CompanyDictServiceImpl extends ServiceImpl() - .lambda() - .eq(MemberDO::getCompanyId,getCompanyMembersDTO.getCompanyId())); + .lambda() + .eq(MemberDO::getCompanyId, getCompanyMembersDTO.getCompanyId())); memberSummaryVO.setTotal(total); //短信验证 Integer smsCnt = memberMapper.selectCount(new QueryWrapper() - .lambda() - .eq(MemberDO::getCompanyId,getCompanyMembersDTO.getCompanyId()) - .isNull(MemberDO::getFirstLogin)); + .lambda() + .eq(MemberDO::getCompanyId, getCompanyMembersDTO.getCompanyId()) + .isNull(MemberDO::getFirstLogin)); memberSummaryVO.setSmsCnt(smsCnt); - memberSummaryVO.setImgCnt(total-smsCnt); + memberSummaryVO.setImgCnt(total - smsCnt); return memberSummaryVO; } diff --git a/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java index 05651c3..eb7749e 100644 --- a/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java @@ -1,35 +1,37 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.generator.config.TemplateConfig; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.hash.Hashing; import com.subsidy.common.configure.RestTemplateConfig; import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.image.CheckResultDTO; import com.subsidy.dto.image.ImageCheckDTO; +import com.subsidy.mapper.AccessTokenMapper; +import com.subsidy.mapper.ImageCheckRecordMapper; import com.subsidy.mapper.MemberMapper; +import com.subsidy.model.AccessTokenDO; import com.subsidy.model.ImageCheckRecordDO; -import com.subsidy.mapper.ImageCheckRecordMapper; import com.subsidy.model.MemberDO; import com.subsidy.service.ImageCheckRecordService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; import com.subsidy.util.DateFormatUtil; -import com.subsidy.util.ImageCheckUtil; +import com.subsidy.vo.image.CheckImageResultVO; import com.subsidy.vo.token.*; -import com.subsidy.vo.wechat.AccessTokenVO; -import com.tencentcloudapi.faceid.v20180301.models.GetFaceIdResultResponse; -import com.tencentcloudapi.faceid.v20180301.models.ImageRecognitionResponse; import org.apache.commons.codec.Charsets; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.*; import org.springframework.stereotype.Service; +import sun.misc.BASE64Decoder; +//import org.apache.commons.codec.binary.Base64; +import java.io.*; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** *

@@ -48,85 +50,190 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl getImageCheckHistory(ImageCheckRecordDO imageCheckRecordDO) { return this.baseMapper.selectList(new QueryWrapper() .lambda() - .eq(ImageCheckRecordDO::getClassId, imageCheckRecordDO.getClassId()) .eq(ImageCheckRecordDO::getMemberId, imageCheckRecordDO.getMemberId()) .orderByDesc(ImageCheckRecordDO::getCreateDate)); } - public String imageCheck(ImageCheckDTO imageCheckDTO) throws Exception { + public SendIdCardInfoVO imageCheck(ImageCheckDTO imageCheckDTO) throws Exception { + return PCCheckIdCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 0); + } + + public SendIdCardInfoVO h5CheckResult(ImageCheckDTO imageCheckDTO) throws Exception { + return H5IdCheckCard(imageCheckDTO.getId(),imageCheckDTO.getClassId(),0); + } + public SendIdCardInfoVO loginCheck(ImageCheckDTO imageCheckDTO) throws Exception { + return PCCheckIdCard(imageCheckDTO.getId(), null, 1); + } + + public SendIdCardInfoVO h5LoginCheck(ImageCheckDTO imageCheckDTO) throws Exception { + return H5IdCheckCard(imageCheckDTO.getId(),imageCheckDTO.getClassId(),1); + } + + /** + * 当天验证次数超过 + */ + public void getDailyCheckCnt(Long memberId){ + int count = imageCheckRecordMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ImageCheckRecordDO::getMemberId,memberId) + .ge(ImageCheckRecordDO::getCreateDate,LocalDateTime.now())); + if (count>3){ + throw new HttpException(18001); + } + } + + /** + * H5端调取权威库(身份证)验证 权威库 + * 1,签到页 0 班级内 + */ + public SendIdCardInfoVO H5IdCheckCard(Long id, Long classId, Integer checkPlace) { + getDailyCheckCnt(id); //获取这个学生的基本信息 - MemberDO memberDO = memberMapper.selectById(imageCheckDTO.getId()); + MemberDO memberDO = memberMapper.selectById(id); if (StringUtils.isEmpty(memberDO.getIdCard())) { throw new HttpException(10025); } - //获取token - IdCardAccessTokenVO idCardAccessTokenVO = this.accessToken(); + // 生成订单 + ImageCheckRecordDO imageCheckRecordDO = new ImageCheckRecordDO(); + imageCheckRecordDO.setMemberId(id); + imageCheckRecordDO.setClassId(classId); + imageCheckRecordDO.setCheckType(1); + imageCheckRecordDO.setCheckPlace(checkPlace); + imageCheckRecordMapper.insert(imageCheckRecordDO); //获取signTicket - IdCardTicketsVO idCardTicketsVO = this.signTickets(idCardAccessTokenVO.getAccess_token()); + IdCardTicketsVO idCardTicketsVO = this.signTickets(getLatestAccessToken()); + //生成签名 + List signList1 = Arrays.asList(WBAPPID, NONCE, memberDO.getId() + "", "1.0.0"); + String sign = sign(signList1, idCardTicketsVO.getValue()); + + //合作方后台上送身份信息 + SendIdCardInfoVO sendIdCardInfoVO = this.h5SendIdCardInfo(imageCheckRecordDO.getId() + "", memberDO, sign); + if (!"0".equals(sendIdCardInfoVO.getCode())) { + imageCheckRecordMapper.deleteById(imageCheckRecordDO.getId()); + throw new HttpException(10026); + } + + //获取 NONCE ticket + IdCardTicketsVO nonceTicket = this.nonceTicket(getLatestAccessToken(), memberDO.getId() + ""); + + //签名2 + List signList2 = Arrays.asList(WBAPPID, NONCE, imageCheckRecordDO.getId() + "", sendIdCardInfoVO.getResult().getH5faceId(), memberDO.getId() + "", "1.0.0"); + String sign2 = sign(signList2, nonceTicket.getValue()); + + sendIdCardInfoVO.getResult().setWbAppId(WBAPPID); + sendIdCardInfoVO.getResult().setNonce(NONCE); + sendIdCardInfoVO.getResult().setUserId(memberDO.getId()); + sendIdCardInfoVO.getResult().setSign(sign2); + + return sendIdCardInfoVO; + } + + /** + * PC端调取权威库(身份证)验证 权威库 + * 1,签到页 0 班级内 + */ + public SendIdCardInfoVO PCCheckIdCard(Long id, Long classId, Integer checkPlace) { - List signList1 = new ArrayList<>(); - signList1.add(WBAPPID); - signList1.add("001"); - signList1.add(memberDO.getUserName()); - signList1.add(memberDO.getIdCard()); - signList1.add(memberDO.getId() + ""); - signList1.add("1.0.0"); + getDailyCheckCnt(id); + //获取这个学生的基本信息 + MemberDO memberDO = memberMapper.selectById(id); + if (StringUtils.isEmpty(memberDO.getIdCard())) { + throw new HttpException(10025); + } + + //生成订单 + ImageCheckRecordDO imageCheckRecordDO = new ImageCheckRecordDO(); + imageCheckRecordDO.setMemberId(memberDO.getId()); + imageCheckRecordDO.setClassId(classId); + imageCheckRecordDO.setCheckType(1); + imageCheckRecordDO.setCheckPlace(checkPlace); + imageCheckRecordMapper.insert(imageCheckRecordDO); + + //获取signTicket + IdCardTicketsVO idCardTicketsVO = this.signTickets(getLatestAccessToken()); //生成签名 + List signList1 = Arrays.asList(WBAPPID, imageCheckRecordDO.getId() + "", memberDO.getUserName(), memberDO.getIdCard(), memberDO.getId() + "", "1.0.0"); String sign = sign(signList1, idCardTicketsVO.getValue()); - System.out.println(sign); //合作方后台上送身份信息 - SendIdCardInfoVO sendIdCardInfoVO = this.sendIdCardInfo("001", memberDO, sign); + SendIdCardInfoVO sendIdCardInfoVO = this.sendIdCardInfo(imageCheckRecordDO.getId() + "", memberDO, sign); + if (!"0".equals(sendIdCardInfoVO.getCode())) { + imageCheckRecordMapper.deleteById(imageCheckRecordDO.getId()); + throw new HttpException(10026); + } //获取 NONCE ticket - IdCardTicketsVO nonceTicket = this.nonceTicket(idCardAccessTokenVO.getAccess_token(), memberDO.getId() + ""); + IdCardTicketsVO nonceTicket = this.nonceTicket(getLatestAccessToken(), memberDO.getId() + ""); //签名2 - List signList2 = new ArrayList<>(); - signList2.add(WBAPPID); - signList2.add(memberDO.getId() + ""); - signList2.add(imageCheckDTO.getNonce()); - signList2.add("1.0.0"); - signList2.add(sendIdCardInfoVO.getResult().getH5faceId()); - signList2.add(sendIdCardInfoVO.getResult().getOrderNo()); + List signList2 = Arrays.asList(WBAPPID, memberDO.getId() + "", NONCE, "1.0.0", sendIdCardInfoVO.getResult().getFaceId(), sendIdCardInfoVO.getResult().getOrderNo()); String sign2 = sign(signList2, nonceTicket.getValue()); - //启动人脸验证 - this.startCheck(imageCheckDTO.getNonce(), sendIdCardInfoVO.getResult(), memberDO.getId() + "", sign2); + sendIdCardInfoVO.getResult().setWbAppId(WBAPPID); + sendIdCardInfoVO.getResult().setNonce(NONCE); + sendIdCardInfoVO.getResult().setUserId(memberDO.getId()); + sendIdCardInfoVO.getResult().setSign(sign2); + return sendIdCardInfoVO; + } + + public ImageCheckRecordDO checkResult(CheckResultDTO checkResultDTO) throws Exception { + + CheckImageResultVO checkImageResultVO = new CheckImageResultVO(); + //获取signTicket + IdCardTicketsVO idCardTicketsVO = this.signTickets(getLatestAccessToken()); //签名3 List signList3 = new ArrayList<>(); signList3.add(WBAPPID); - signList3.add("001"); + signList3.add(checkResultDTO.getId()); signList3.add("1.0.0"); - signList3.add(imageCheckDTO.getNonce()); + signList3.add(NONCE); - String sign3 = sign(signList3,idCardTicketsVO.getValue()); - System.out.println(sign3); + String sign3 = sign(signList3, idCardTicketsVO.getValue()); //人身核验结果 - ResultVO resultVO = this.checkResult("001", imageCheckDTO.getNonce(), sign3); + ResultVO resultVO = this.checkResult(checkResultDTO.getId(), sign3); + + //存数据库 + ImageCheckRecordDO imageCheckRecordDO = imageCheckRecordMapper.selectById(checkResultDTO.getId()); + BeanUtils.copyProperties(resultVO, imageCheckRecordDO); + imageCheckRecordMapper.updateById(imageCheckRecordDO); + BeanUtils.copyProperties(imageCheckRecordDO, checkImageResultVO); - if (Double.valueOf(resultVO.getSimilarity()) > 80.0) { - return ConstantUtils.SUCCESS_VERIFY; + //如果是签到页的认证,则把图片写到member表里 + MemberDO memberDO = memberMapper.selectById(imageCheckRecordDO.getMemberId()); + memberDO.setImage(checkImageResultVO.getPhoto()); + memberDO.setCheckTime(DateFormatUtil.format(new Date(),DateFormatUtil.FMT_sdf14_L)); + memberMapper.updateById(memberDO); + + if ((Double.valueOf(imageCheckRecordDO.getSimilarity()) > 60)) { + checkImageResultVO.setResult(true); } else { - return ConstantUtils.FAIL_VERIFY; + checkImageResultVO.setResult(false); } + return imageCheckRecordDO; } /** @@ -138,9 +245,6 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl response = restTemplateConfig.restTemplate() .exchange(url, HttpMethod.GET, null, IdCardAccessTokenVO.class); - - System.out.println(response.getBody().toString()); - return response.getBody(); } @@ -148,13 +252,9 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl response = restTemplateConfig.restTemplate() .exchange(url, HttpMethod.GET, null, IdCardSignTicketVO.class); - - System.out.println(response.getBody().getTickets()); - return response.getBody().getTickets().get(0); } @@ -177,7 +277,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl responseEntity = restTemplateConfig.restTemplate() + .exchange(url, HttpMethod.POST, new HttpEntity<>(input, headers), SendIdCardInfoVO.class); + return responseEntity.getBody(); + } + /** + * PC端 合作方后台上送身份信息 POST请求 + */ + public SendIdCardInfoVO h5SendIdCardInfo(String orderNo, MemberDO memberDO, String sign) { + String url = "https://kyc.qcloud.com/api/server/getAdvFaceId?orderNo=" + orderNo; + + String input = "{\n" + + " \"appId\":\"" + WBAPPID + "\",\n" + + " \"orderNo\":\"" + orderNo + "\",\n" + + " \"name\":\"" + memberDO.getUserName() + "\"," + + " \"idNo\":\"" + memberDO.getIdCard() + "\"," + + " \"userId\":\"" + memberDO.getId() + "\"," + + " \"version\":\"1.0.0\"," + + " \"sign\":\"" + sign + "\"," + + " \"nonce\":\"" + NONCE + "\"" + + "}"; HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); ResponseEntity responseEntity = restTemplateConfig.restTemplate() .exchange(url, HttpMethod.POST, new HttpEntity<>(input, headers), SendIdCardInfoVO.class); - return responseEntity.getBody(); } @@ -216,49 +337,44 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl responseEntity = restTemplateConfig.restTemplate() .exchange(url, HttpMethod.POST, new HttpEntity<>(input.getBytes(), headers), CheckResultVO.class); + return responseEntity.getBody().getResult(); + } - - return responseEntity.getBody().getResultVO(); + //获取最新的accessToken + public String getLatestAccessToken() { + AccessTokenDO accessTokenDO = accessTokenMapper.selectOne(new QueryWrapper() + .lambda() + .lt(AccessTokenDO::getCreateDate, LocalDateTime.now().minusMinutes(19L))); + + //数据库没有的话 + if (null == accessTokenDO) { + accessTokenMapper.delete(null); + //获取token + IdCardAccessTokenVO idCardAccessTokenVO = this.accessToken(); + accessTokenDO = new AccessTokenDO(); + accessTokenDO.setAccessToken(idCardAccessTokenVO.getAccess_token()); + accessTokenMapper.insert(accessTokenDO); + } + return accessTokenDO.getAccessToken(); } diff --git a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java index c3e2445..cdab567 100644 --- a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -21,6 +21,7 @@ import com.subsidy.model.VodDictDO; import com.subsidy.service.SignInRecordService; import com.subsidy.util.ConstantUtils; import com.subsidy.util.DateFormatUtil; +import com.subsidy.util.IpAddressUtil; import com.subsidy.vo.member.GetMemberSignInfoVO; import com.subsidy.vo.sign.DataViewVO; import com.subsidy.vo.sign.SignInStatusVO; @@ -73,6 +74,7 @@ public class SignInRecordServiceImpl extends ServiceImpl() .lambda() .eq(SignInRecordDO::getMemberId, getMemberSignInfoDTO.getId()) + .eq(SignInRecordDO::getClassId,getMemberSignInfoDTO.getClassId()) .orderByDesc(SignInRecordDO::getCreateDate)); } @@ -99,12 +101,12 @@ public class SignInRecordServiceImpl extends ServiceImpl @@ -81,7 +78,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl3){ + if (playLength > 3) { this.baseMapper.insert(vodPlayHistoryDO); } throw new HttpException(13001); @@ -119,7 +116,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl3){ + if (playLength > 3) { this.baseMapper.insert(vodPlayHistoryDO); } throw new HttpException(13001); @@ -631,89 +628,94 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl testPlays(VodPlayHistoryDO vodPlayHistoryDO) { + public HashSet testPlays(VodPlayHistoryDO vodPlayHistoryDO) { - String classIds = "261"; + 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"; -// String classIds = "122,150"; List classIdArr = Arrays.asList(classIds.split(",")); - List result = new ArrayList<>(); + HashSet result = new HashSet<>(); for (String classId : classIdArr) { List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() .lambda() .eq(ClassMemberMappingDO::getClassId, classId)); for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { - List 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); - VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); - if (vodPlayStateVO.getStartDate().after(vodPlayStateVO1.getStartDate()) && vodPlayStateVO.getStartDate().before(vodPlayStateVO1.getEndDate())) { - System.out.println("111111111"+vodPlayStateVO); - //这一条数据有问题 - //查看这个人 这个课程 当天的全部数据 按照createDate升序排序 -// List vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), vodPlayStateVO.getMemberId(), vodPlayStateVO.getEndDate()); - //从第一条开始看,顺延减去第二条的playlength得到第二条的create_date 以此类推 -// for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) { -// VodPlayHistoryDO vph1 = vodPlayHistoryDOS.get(l); -// VodPlayHistoryDO vph2 = vodPlayHistoryDOS.get(l + 1); -// LocalDateTime dateTmp = vph1.getCreateDate().minusSeconds(-vph2.getPlayLength() - getRandom1_2()); -// vph2.setCreateDate(dateTmp); -// this.baseMapper.updateById(vph2); - result.add(vodPlayStateVO.getId()); -// } + List vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId)); + for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) { + VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 + VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 + if (vodPlayStateVO1.getEndDate().getTime() - 3000 > vodPlayStateVO.getStartDate().getTime() && vodPlayStateVO.getPlayLength() >= 3) { + //这一条数据有问题 + System.out.println("111111111111111111111" + vodPlayStateVO); + //查看这个人 这个课程 当天的全部数据 按照createDate升序排序 + List vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), classMemberMappingDO.getMemberId(), vodPlayStateVO.getStartDate()); +// //从第一条开始看,顺延减去第二条的playlength得到第二条的create_date 以此类推 + for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) { + VodPlayHistoryDO vph1 = vodPlayHistoryDOS.get(l); //第一条 + if (l==0){ + vph1.setPlayDate(vph1.getCreateDate()); } + VodPlayHistoryDO vph2 = vodPlayHistoryDOS.get(l + 1); //第二条 + LocalDateTime dateTmp = vph1.getPlayDate().plusSeconds(vph2.getPlayLength()+getRandom1_2()); + vph2.setPlayDate(dateTmp); + this.baseMapper.updateById(vph2); } + result.add(vodPlayStateVO.getId()); +// break; } } } - return result; } + 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; + //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; - /** - * 3次签到 23400---28800 - */ - public Integer _3times () { - return new Random().nextInt(28800 - 23400 + 1) + 23400; - } + /** + * 3次签到 23400---28800 + */ + public Integer _3times() { + return new Random().nextInt(28800 - 23400 + 1) + 23400; + } - /** - * 4次签到 23400---28800 - */ - public Integer _4times () { - return new Random().nextInt(6 * 60 * 60 - 48 * 6 * 60 + 1) + 48 * 6 * 60; - } + /** + * 4次签到 23400---28800 + */ + public Integer _4times() { + return new Random().nextInt(6 * 60 * 60 - 48 * 6 * 60 + 1) + 48 * 6 * 60; + } - /** - * 5次签到 23400---28800 - */ - public Integer _5times () { - return new Random().nextInt(6 * 60 * 60 - 4 * 60 * 60 + 1) + 4 * 60 * 60; - } + /** + * 5次签到 23400---28800 + */ + public Integer _5times() { + return new Random().nextInt(6 * 60 * 60 - 4 * 60 * 60 + 1) + 4 * 60 * 60; + } - /** - * 6次签到 23400---28800 - */ - public Integer _6times () { - return new Random().nextInt(6 * 60 * 60 - 32 * 6 * 60 + 1) + 32 * 60 * 6; - } + /** + * 6次签到 23400---28800 + */ + public Integer _6times() { + return new Random().nextInt(6 * 60 * 60 - 32 * 6 * 60 + 1) + 32 * 60 * 6; + } + + /** + * 7次签到 23400---28800 + */ + public Integer _7times() { + return new Random().nextInt(6 * 60 * 60 - 25 * 6 * 60 + 1) + 25 * 6 * 60; + } - /** - * 7次签到 23400---28800 - */ - public Integer _7times () { - return new Random().nextInt(6 * 60 * 60 - 25 * 6 * 60 + 1) + 25 * 6 * 60; + public static void main(String[] args) { + while (true) { + System.out.println(getRandom1_2()); } - public static void main (String[]args){ - while (true) { - System.out.println(getRandom()); - } +// System.out.println(LocalDateTime.now()); +// System.out.println(LocalDateTime.now().minusMinutes(3)); + // int m = 0; // // int signInrecord = 4; @@ -777,22 +779,21 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl 11 || i < 5) { - // System.out.println("error"); - // } - //} - } - - public static Integer getRandom () { - return (int) (Math.random() * 3 / 2 + 5); - } - - public static Integer getRandom1_2 () { - return (int) (Math.random() * 3 / 2 + 1); - } + //while (true) { + // int i = getRandom(); + // System.out.println(i + "============"); + // if (i > 11 || i < 5) { + // System.out.println("error"); + // } + //} + } + public static Integer getRandom() { + return (int) (Math.random() * 3 / 2 + 5); + } + public static Integer getRandom1_2() { + return (int) (Math.random() * 3 / 2 + 1); } + +} diff --git a/src/main/java/com/subsidy/util/ExcelFormatUtils.java b/src/main/java/com/subsidy/util/ExcelFormatUtils.java index aa4eee3..13272f0 100644 --- a/src/main/java/com/subsidy/util/ExcelFormatUtils.java +++ b/src/main/java/com/subsidy/util/ExcelFormatUtils.java @@ -8,7 +8,7 @@ public class ExcelFormatUtils { public static final List memberList = Arrays.asList("序号", "成员名称","身份证号码", "性别", "账号", "联系方式", "签到次数", "课程进度", "学习时长(小时)","学习时长(分钟)", "答疑数", "测试成绩", "总评价"); - public static final List signList = Arrays.asList("序号", "成员名称", "身份证号码", "联系方式", "学习时长(小时)","学习时长(分钟)", "课程进度", "完成率", "签到次数", "签到日期"); + public static final List signList = Arrays.asList("序号", "成员名称", "身份证号", "联系方式", "签到次数", "签到时间","最近签到ip地址","最近签到设备型号"); public static final List scoreList = Arrays.asList("序号", "成员名称", "身份证号码", "联系方式", "测试成绩", "测试次数", "总评价"); diff --git a/src/main/java/com/subsidy/util/IpAddressUtil.java b/src/main/java/com/subsidy/util/IpAddressUtil.java index dfd1e0f..4e8026c 100644 --- a/src/main/java/com/subsidy/util/IpAddressUtil.java +++ b/src/main/java/com/subsidy/util/IpAddressUtil.java @@ -6,6 +6,9 @@ import java.net.UnknownHostException; public class IpAddressUtil { + /** + * 返回客户端ip + */ public static String getIpAddress(HttpServletRequest request) { String ipAddress = request.getHeader("x-forwarded-for"); if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { diff --git a/src/main/java/com/subsidy/util/excel/ExcelUtil.java b/src/main/java/com/subsidy/util/excel/ExcelUtil.java index 86d6ad2..a085eb2 100644 --- a/src/main/java/com/subsidy/util/excel/ExcelUtil.java +++ b/src/main/java/com/subsidy/util/excel/ExcelUtil.java @@ -313,51 +313,78 @@ public class ExcelUtil { return dataList; } - public static void writeExcel(List memberIds, HashMap> hashMap, List dates) { + /** + * 导出excel文件 + * @param list + * @param cls + * @param + */ + public static void writeExcel(List list, Class cls) { ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletResponse response = servletRequestAttributes.getResponse(); + Field[] fields = cls.getDeclaredFields(); + List fieldList = Arrays.stream(fields).filter(field -> { + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + if(annotation != null) { + field.setAccessible(true); + return true; + } + return false; + }).sorted(Comparator.comparing(field -> { + int col = 0; + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + if(annotation != null) { + col = annotation.col(); + } + return col; + })).collect(Collectors.toList()); Workbook wb = new XSSFWorkbook(); Sheet sheet = wb.createSheet(); AtomicInteger ai = new AtomicInteger(); - - Row row = sheet.createRow(ai.getAndIncrement()); - AtomicInteger at = new AtomicInteger(); - dates.forEach(field -> { - Cell cell = row.createCell(at.getAndIncrement()); - CellStyle cellStyle = wb.createCellStyle(); - cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); - Font font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - cellStyle.setFont(font); - cell.setCellStyle(cellStyle); - cell.setCellValue(field); - }); - - if (hashMap != null) { - memberIds.forEach(data -> { - Row r = sheet.createRow(ai.getAndIncrement()); - AtomicInteger a = new AtomicInteger(); - Cell cell = r.createCell(at.getAndIncrement()); + { + Row row = sheet.createRow(ai.getAndIncrement()); + AtomicInteger at = new AtomicInteger(); + fieldList.forEach(field -> { + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + String columnName = ""; + if (annotation != null) { + columnName = annotation.value(); + } + Cell cell = row.createCell(at.getAndIncrement()); CellStyle cellStyle = wb.createCellStyle(); cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + Font font = wb.createFont(); + font.setBoldweight(Font.BOLDWEIGHT_BOLD); + cellStyle.setFont(font); cell.setCellStyle(cellStyle); - HashMap hashMap1 = hashMap.get(data); - dates.forEach(field -> { - System.out.println(data + "========"); - System.out.println(field); - Cell cell1 = r.createCell(a.getAndIncrement()); - if (null != hashMap1) { - cell1.setCellValue(null == hashMap1.get(field) ? 0 : hashMap1.get(field)); - } else { - cell1.setCellValue(0); - } - }); + cell.setCellValue(columnName); }); - } - String fileName = String.valueOf(new Date().getTime()); - buildExcelDocument(fileName + "." + EXCEL2007, wb, response); + if (list != null) { + list.forEach(data -> { + Row r = sheet.createRow(ai.getAndIncrement()); + AtomicInteger a = new AtomicInteger(); + fieldList.forEach(field -> { + try { + Class type = field.getType(); + Object value = field.get(data); + Cell cell = r.createCell(a.getAndIncrement()); + if (value != null) { + cell.setCellValue(value.toString()); + } + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + }); + for (int i = 0; i < list.size(); i++) { + sheet.autoSizeColumn(i); + } + } + String fileName = String.valueOf(new Date().getTime()); + buildExcelDocument(fileName + "." + EXCEL2007, wb, response); + } } public static void writeMemberExcel(String companyName, String studyDate, String courseName, String title, List list, List headerList) throws Exception { @@ -697,7 +724,7 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress21); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 9); + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 7); sheet.addMergedRegion(cellRangeAddress22); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 @@ -713,7 +740,7 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress31); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 9); + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 7); sheet.addMergedRegion(cellRangeAddress32); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 thirdRow.createCell(0).setCellValue(thirdHead[0]); @@ -765,28 +792,19 @@ public class ExcelUtil { newCell = dataRow.createCell(4); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classSignVO.getTrainingLengthStr()); + newCell.setCellValue(classSignVO.getSignCounts()); newCell = dataRow.createCell(5); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classSignVO.getTrainingLengthMinute()); + newCell.setCellValue(classSignVO.getSignInDateList()); newCell = dataRow.createCell(6); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classSignVO.getClassProcess()); + newCell.setCellValue(classSignVO.getIpAddress()); newCell = dataRow.createCell(7); newCell.setCellStyle(cellStyle); - newCell.setCellValue(classSignVO.getPercent()); - - newCell = dataRow.createCell(8); - newCell.setCellStyle(cellStyle); - newCell.setCellValue(classSignVO.getSignCounts()); - - newCell = dataRow.createCell(9); - newCell.setCellStyle(cellStyle); - newCell.setCellValue(classSignVO.getSignInDateList()); - + newCell.setCellValue(classSignVO.getDeviceNo()); rowIndex++; seq++; diff --git a/src/main/java/com/subsidy/vo/administer/ImageCheckDetailVO.java b/src/main/java/com/subsidy/vo/administer/ImageCheckDetailVO.java index 1f8e658..27f4021 100644 --- a/src/main/java/com/subsidy/vo/administer/ImageCheckDetailVO.java +++ b/src/main/java/com/subsidy/vo/administer/ImageCheckDetailVO.java @@ -4,4 +4,19 @@ import lombok.Data; @Data public class ImageCheckDetailVO { + + private Long id; + + private String userName; + + private String accountName; + + private String telephone; + + private String idCard; + + private String cnt; + + private String recentDate; + } diff --git a/src/main/java/com/subsidy/vo/administer/ManageMemberVO.java b/src/main/java/com/subsidy/vo/administer/ManageMemberVO.java index f34a728..8638d9b 100644 --- a/src/main/java/com/subsidy/vo/administer/ManageMemberVO.java +++ b/src/main/java/com/subsidy/vo/administer/ManageMemberVO.java @@ -1,5 +1,6 @@ package com.subsidy.vo.administer; +import com.subsidy.util.excel.ExcelColumn; import lombok.Data; @Data @@ -7,14 +8,28 @@ public class ManageMemberVO { private Long id; + @ExcelColumn(col = 1,value = "用户名称") private String userName; + @ExcelColumn(col = 2,value = "手机号") private String telephone; + @ExcelColumn(col = 3,value = "身份证号") private String idCard; + @ExcelColumn(col = 4,value = "所属企业") private String companyName; private String accountName; + private String checkImage; + + private String checkTime; + + private Integer firstLogin; + + private String smsCheck; + + private String imageCheckStatus; + } diff --git a/src/main/java/com/subsidy/vo/catagory/GetCategoriesVO.java b/src/main/java/com/subsidy/vo/catagory/GetCategoriesVO.java new file mode 100644 index 0000000..8b7c8fc --- /dev/null +++ b/src/main/java/com/subsidy/vo/catagory/GetCategoriesVO.java @@ -0,0 +1,13 @@ +package com.subsidy.vo.catagory; + +import com.subsidy.model.CategoryDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetCategoriesVO extends CategoryDO { + + private List categoryDOS; + +} diff --git a/src/main/java/com/subsidy/vo/image/CheckImageResultVO.java b/src/main/java/com/subsidy/vo/image/CheckImageResultVO.java new file mode 100644 index 0000000..d78a5ad --- /dev/null +++ b/src/main/java/com/subsidy/vo/image/CheckImageResultVO.java @@ -0,0 +1,11 @@ +package com.subsidy.vo.image; + +import com.subsidy.model.ImageCheckRecordDO; +import lombok.Data; + +@Data +public class CheckImageResultVO extends ImageCheckRecordDO { + + private Boolean result; + +} diff --git a/src/main/java/com/subsidy/vo/image/GetMemberCheckDetailVO.java b/src/main/java/com/subsidy/vo/image/GetMemberCheckDetailVO.java new file mode 100644 index 0000000..47c1fb7 --- /dev/null +++ b/src/main/java/com/subsidy/vo/image/GetMemberCheckDetailVO.java @@ -0,0 +1,18 @@ +package com.subsidy.vo.image; + +import lombok.Data; + +@Data +public class GetMemberCheckDetailVO { + + private Long id; + + private String occurredTime; + + private String photo; + + private Double similarity; + + private String result; + +} diff --git a/src/main/java/com/subsidy/vo/member/ClassSignVO.java b/src/main/java/com/subsidy/vo/member/ClassSignVO.java index 4e7228b..e95942e 100644 --- a/src/main/java/com/subsidy/vo/member/ClassSignVO.java +++ b/src/main/java/com/subsidy/vo/member/ClassSignVO.java @@ -27,25 +27,14 @@ public class ClassSignVO { private String signInDateList; /** - * 培训时长 + * ip地址 */ - private Integer trainingLength; - - @ExcelColumn(col = 4,value = "培训时长(小时)") - private String trainingLengthStr; - - @ExcelColumn(col = 5,value = "培训时长(分钟)") - private String trainingLengthMinute; - - @ExcelColumn(col = 6,value = "课程进度") - private String classProcess; + private String ipAddress; /** - * 完成率 + * 最近设型号 */ - @ExcelColumn(col = 7,value = "完成率") - private String percent; - + private String deviceNo; diff --git a/src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java b/src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java index 42b51a0..ec736e1 100644 --- a/src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java +++ b/src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java @@ -4,4 +4,14 @@ import lombok.Data; @Data public class GetMemberSignInfoVO { + + private Long id; + + private String ipAddress; + + private String deviceNo; + + private String signInDate; + + } diff --git a/src/main/java/com/subsidy/vo/token/CheckResultVO.java b/src/main/java/com/subsidy/vo/token/CheckResultVO.java index f3cd70c..d4dd6e5 100644 --- a/src/main/java/com/subsidy/vo/token/CheckResultVO.java +++ b/src/main/java/com/subsidy/vo/token/CheckResultVO.java @@ -11,7 +11,7 @@ public class CheckResultVO { private String bizSeqNo; - private ResultVO resultVO; + private ResultVO result; private String transactionTime; diff --git a/src/main/java/com/subsidy/vo/token/SendResultVO.java b/src/main/java/com/subsidy/vo/token/SendResultVO.java index ccda248..f75a4af 100644 --- a/src/main/java/com/subsidy/vo/token/SendResultVO.java +++ b/src/main/java/com/subsidy/vo/token/SendResultVO.java @@ -17,4 +17,14 @@ public class SendResultVO { private Boolean success; + private String wbAppId; + + private String nonce; + + private Long userId; + + private String sign; + + private String faceId; + } diff --git a/src/main/resources/code.properties b/src/main/resources/code.properties index 164d67f..65379cb 100644 --- a/src/main/resources/code.properties +++ b/src/main/resources/code.properties @@ -18,6 +18,7 @@ meishu.code-message[10022]=密码输入错误,您还可以输入2次密码 meishu.code-message[10023]=密码输入错误,您还可以输入3次密码 meishu.code-message[10024]=密码输入错误,您还可以输入4次密码 meishu.code-message[10025]=身份证识别错误 +meishu.code-message[10026]=姓名或身份证号格式不正确 meishu.code-message[20001]=该课程已存在 @@ -65,7 +66,9 @@ meishu.code-message[16001]=该条件已存在 meishu.code-message[17001]=系统不支持00:00:00~06:00:00学习 -meishu.code-message[18000]=视频不存在 -meishu.code-message[18001]=删除失败,目录下没有该视频 + + +meishu.code-message[18001]=已超过当日验证次数上线 + diff --git a/src/main/resources/mapper/CategoryMapper.xml b/src/main/resources/mapper/CategoryMapper.xml index 1c21f9a..84b0eac 100644 --- a/src/main/resources/mapper/CategoryMapper.xml +++ b/src/main/resources/mapper/CategoryMapper.xml @@ -30,4 +30,23 @@ AND t2.delete_date IS NULL and t.course_id = #{courseId} + + diff --git a/src/main/resources/mapper/ImageCheckRecordMapper.xml b/src/main/resources/mapper/ImageCheckRecordMapper.xml index 9ce170f..77185e7 100644 --- a/src/main/resources/mapper/ImageCheckRecordMapper.xml +++ b/src/main/resources/mapper/ImageCheckRecordMapper.xml @@ -9,8 +9,6 @@ - - @@ -21,4 +19,18 @@ id, class_id, paper_id, request_id + + diff --git a/src/main/resources/mapper/MemberMapper.xml b/src/main/resources/mapper/MemberMapper.xml index 82ee958..ae0a93d 100644 --- a/src/main/resources/mapper/MemberMapper.xml +++ b/src/main/resources/mapper/MemberMapper.xml @@ -270,7 +270,10 @@ t.telephone, t.id_card, t.account_name, - t2.company_name + t2.company_name, + t.check_image, + t.check_time, + t.first_login FROM member t LEFT JOIN company_dict t2 ON t.company_id = t2.id @@ -325,6 +328,6 @@ - update member set check_image = nulll where id = #{id} + update member set check_image = null,check_time = null where id = #{id} diff --git a/src/main/resources/mapper/VodDictMapper.xml b/src/main/resources/mapper/VodDictMapper.xml index 5123a41..43d59a0 100644 --- a/src/main/resources/mapper/VodDictMapper.xml +++ b/src/main/resources/mapper/VodDictMapper.xml @@ -105,7 +105,10 @@ create_date FROM vod_play_history t - where t.member_id = #{memberId} + where + t.delete_date is null + and t.member_id = #{memberId} + and t.class_id =#{classId} ORDER BY t.member_id, start_date diff --git a/src/main/resources/mybatis-plus.properties b/src/main/resources/mybatis-plus.properties index b25caa2..a2493eb 100644 --- a/src/main/resources/mybatis-plus.properties +++ b/src/main/resources/mybatis-plus.properties @@ -1,6 +1,6 @@ # 此处为本项目src所在路径(代码生成器输出路径) outputDir=/src/main/java -author=DengMin +author=Tuyp # 父的包名 setParent=com.subsidy # mapper.xml文件生成路径