Commit 421d9309 by 涂亚平

人脸识别版本备个份

1 parent 6b16f6de
...@@ -43,14 +43,14 @@ public class ImageCheckRecordController { ...@@ -43,14 +43,14 @@ public class ImageCheckRecordController {
} }
@PostMapping("imageCheck") @PostMapping("imageCheck")
@ApiOperation("课程/测评人身核验(权威库:身份证) PC端 id 用户id classId 班级id ") @ApiOperation("课程/测评人身核验(权威库:身份证) PC端 id 用户id classId 班级id classPlace 1:视频的时候检测 2:测评的时候检测 paperId")
@TimeRequired @TimeRequired
public ResponseVO imageCheck(@RequestBody ImageCheckDTO imageCheckDTO) throws Exception { public ResponseVO imageCheck(@RequestBody ImageCheckDTO imageCheckDTO) throws Exception {
return ResponseData.generateCreatedResponse(0, imageCheckRecordService.imageCheck(imageCheckDTO)); return ResponseData.generateCreatedResponse(0, imageCheckRecordService.imageCheck(imageCheckDTO));
} }
@PostMapping("h5ImageCheck") @PostMapping("h5ImageCheck")
@ApiOperation("课程/测评人脸核验(权威库:身份证) 微信浮层H5 id 用户id classId 班级id") @ApiOperation("课程/测评人脸核验(权威库:身份证) 微信浮层H5 id 用户id classId 班级id classPlace 1:视频的时候检测 2:测评的时候检测 paperId")
@TimeRequired @TimeRequired
public ResponseVO h5CheckResult(@RequestBody ImageCheckDTO imageCheckDTO)throws Exception{ public ResponseVO h5CheckResult(@RequestBody ImageCheckDTO imageCheckDTO)throws Exception{
return ResponseData.generateCreatedResponse(0,imageCheckRecordService.h5CheckResult(imageCheckDTO)); return ResponseData.generateCreatedResponse(0,imageCheckRecordService.h5CheckResult(imageCheckDTO));
...@@ -64,7 +64,7 @@ public class ImageCheckRecordController { ...@@ -64,7 +64,7 @@ public class ImageCheckRecordController {
} }
@PostMapping("h5LoginCheck") @PostMapping("h5LoginCheck")
@ApiOperation("签到页做人脸核验 (权威库:身份证) PC端 id 用户id") @ApiOperation("签到页做人脸核验 (权威库:身份证) id 用户id")
@TimeRequired @TimeRequired
public ResponseVO h5LoginCheck(@RequestBody ImageCheckDTO imageCheckDTO)throws Exception{ public ResponseVO h5LoginCheck(@RequestBody ImageCheckDTO imageCheckDTO)throws Exception{
return ResponseData.generateCreatedResponse(0,imageCheckRecordService.h5LoginCheck(imageCheckDTO)); return ResponseData.generateCreatedResponse(0,imageCheckRecordService.h5LoginCheck(imageCheckDTO));
......
...@@ -15,4 +15,14 @@ public class ImageCheckDTO { ...@@ -15,4 +15,14 @@ public class ImageCheckDTO {
*/ */
private Long classId; private Long classId;
/**
* 试卷id
*/
private Long paperId;
/**
* 1:视频的时候检测 2:测评的时候检测
*/
private Integer classPlace;
} }
...@@ -5,10 +5,7 @@ import com.subsidy.dto.classDict.GetSpareMembersDTO; ...@@ -5,10 +5,7 @@ import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassDictDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.model.VodDictDO; import com.subsidy.model.VodDictDO;
import com.subsidy.vo.classdict.ClassAndCompanyInfoVO; import com.subsidy.vo.classdict.*;
import com.subsidy.vo.classdict.ClassSettingsVO;
import com.subsidy.vo.classdict.GetAllClassesVO;
import com.subsidy.vo.classdict.GetClassBaseInfoVO;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -59,4 +56,9 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> { ...@@ -59,4 +56,9 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> {
Integer getClassCount(); Integer getClassCount();
List<ClassSettingsVO> getClassSettings(@Param("userId") Long userId); List<ClassSettingsVO> getClassSettings(@Param("userId") Long userId);
/**
* 通过班级id查看公司配置
*/
SystemSettings getCompanySettings(Long classId);
} }
...@@ -24,4 +24,9 @@ public interface ImageCheckRecordMapper extends BaseMapper<ImageCheckRecordDO> { ...@@ -24,4 +24,9 @@ public interface ImageCheckRecordMapper extends BaseMapper<ImageCheckRecordDO> {
*/ */
List<GetMemberCheckDetailVO> getMemberCheckDetail(Long memberId, Long classId); List<GetMemberCheckDetailVO> getMemberCheckDetail(Long memberId, Long classId);
/**
* 查看某个人某个课程当天做了几次人脸识别
*/
int checkDailyCount(Long memberId,Long classId,Integer checkPlace,Long paperId);
} }
...@@ -7,6 +7,7 @@ import com.subsidy.model.DepartmentDictDO; ...@@ -7,6 +7,7 @@ import com.subsidy.model.DepartmentDictDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.vo.administer.ManageMemberVO; import com.subsidy.vo.administer.ManageMemberVO;
import com.subsidy.vo.administer.UserRoleVO; import com.subsidy.vo.administer.UserRoleVO;
import com.subsidy.vo.classdict.SystemSettings;
import com.subsidy.vo.member.GetAllVO; import com.subsidy.vo.member.GetAllVO;
import com.subsidy.vo.member.MyCoursesVO; import com.subsidy.vo.member.MyCoursesVO;
import com.subsidy.vo.member.StudyPageVO; import com.subsidy.vo.member.StudyPageVO;
...@@ -76,5 +77,10 @@ public interface MemberMapper extends BaseMapper<MemberDO> { ...@@ -76,5 +77,10 @@ public interface MemberMapper extends BaseMapper<MemberDO> {
*/ */
void removeCheckImage(Long id); void removeCheckImage(Long id);
/**
* 通过人员id查询公司配置
*/
SystemSettings companySettings(Long memberId);
} }
...@@ -23,4 +23,6 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> { ...@@ -23,4 +23,6 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> {
List<OprMemDictDO> getRecordByDate(); List<OprMemDictDO> getRecordByDate();
OprMemDictDO getLatestLoginInfo(Long userId);
} }
...@@ -31,6 +31,11 @@ public class ImageCheckRecordDO extends BaseModel { ...@@ -31,6 +31,11 @@ public class ImageCheckRecordDO extends BaseModel {
private Long classId; private Long classId;
/** /**
* 试卷id
*/
private Long paperId;
/**
* 成员id * 成员id
*/ */
private Long memberId; private Long memberId;
...@@ -70,5 +75,15 @@ public class ImageCheckRecordDO extends BaseModel { ...@@ -70,5 +75,15 @@ public class ImageCheckRecordDO extends BaseModel {
*/ */
private Integer checkPlace; private Integer checkPlace;
/**
* 1:视频的时候检测 2:测评的时候检测
*/
private Integer classPlace;
/**
* 1 核对通过 0 核对不通过
*/
private Integer result;
} }
...@@ -38,8 +38,8 @@ public class OprMemDictDO extends BaseModel { ...@@ -38,8 +38,8 @@ public class OprMemDictDO extends BaseModel {
private Integer result; private Integer result;
/** /**
* 登录ip * 登录ip ==弃用字段
*/ */
private String ipAddress; // private String ipAddress;
} }
...@@ -40,6 +40,7 @@ import com.subsidy.util.websocket.WebSocketUtil; ...@@ -40,6 +40,7 @@ import com.subsidy.util.websocket.WebSocketUtil;
import com.subsidy.vo.classdict.ClassSettingsVO; import com.subsidy.vo.classdict.ClassSettingsVO;
import com.subsidy.vo.classdict.GetAllClassesVO; import com.subsidy.vo.classdict.GetAllClassesVO;
import com.subsidy.vo.classdict.GetClassBaseInfoVO; import com.subsidy.vo.classdict.GetClassBaseInfoVO;
import com.subsidy.vo.classdict.SystemSettings;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -163,6 +164,9 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -163,6 +164,9 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
public String updateClass(ClassDictDO classDictDO) { public String updateClass(ClassDictDO classDictDO) {
this.baseMapper.updateById(classDictDO); this.baseMapper.updateById(classDictDO);
//班级所在公司
SystemSettings systemSettings = this.baseMapper.getCompanySettings(classDictDO.getId());
List<ClassMemberMappingDO> list = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>() List<ClassMemberMappingDO> list = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>()
.lambda() .lambda()
.eq(ClassMemberMappingDO::getClassId, classDictDO.getId())); .eq(ClassMemberMappingDO::getClassId, classDictDO.getId()));
...@@ -171,8 +175,10 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict ...@@ -171,8 +175,10 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
WebSocketSession webSocketSession = WebSocketUtil.webSocketMap.get(classMemberMappingDO.getMemberId()); WebSocketSession webSocketSession = WebSocketUtil.webSocketMap.get(classMemberMappingDO.getMemberId());
if(null != webSocketSession && webSocketSession.isOpen()) { if(null != webSocketSession && webSocketSession.isOpen()) {
try { try {
//班级的配置
List<ClassSettingsVO> classSettings = this.baseMapper.getClassSettings(classMemberMappingDO.getMemberId()); List<ClassSettingsVO> classSettings = this.baseMapper.getClassSettings(classMemberMappingDO.getMemberId());
String data = JSONObject.toJSONString(ResponseData.generateCreatedResponse(0, classSettings), SerializerFeature.WriteMapNullValue); systemSettings.setClassSettingsVOS(classSettings);
String data = JSONObject.toJSONString(ResponseData.generateCreatedResponse(0, systemSettings), SerializerFeature.WriteMapNullValue);
webSocketSession.sendMessage(new TextMessage(data)); webSocketSession.sendMessage(new TextMessage(data));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -39,6 +39,7 @@ import com.subsidy.util.VodUtil; ...@@ -39,6 +39,7 @@ import com.subsidy.util.VodUtil;
import com.subsidy.util.websocket.WebSocketUtil; import com.subsidy.util.websocket.WebSocketUtil;
import com.subsidy.vo.administer.OperatorsVO; import com.subsidy.vo.administer.OperatorsVO;
import com.subsidy.vo.classdict.ClassSettingsVO; import com.subsidy.vo.classdict.ClassSettingsVO;
import com.subsidy.vo.classdict.SystemSettings;
import com.subsidy.vo.company.CDNStatDetailsVO; import com.subsidy.vo.company.CDNStatDetailsVO;
import com.subsidy.vo.company.DataOverviewVO; import com.subsidy.vo.company.DataOverviewVO;
import com.subsidy.vo.company.GetAllCompanyVO; import com.subsidy.vo.company.GetAllCompanyVO;
...@@ -293,6 +294,10 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -293,6 +294,10 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
public String updateCompanySettings(CompanyDictDO companyDictDO) { public String updateCompanySettings(CompanyDictDO companyDictDO) {
this.baseMapper.updateById(companyDictDO); this.baseMapper.updateById(companyDictDO);
CompanyDictDO companyDictDO1 = this.baseMapper.selectById(companyDictDO.getId());
SystemSettings systemSettings = new SystemSettings();
BeanUtils.copyProperties(companyDictDO1,systemSettings);
List<ClassMemberMappingDO> list = classMemberMappingMapper.getCLassMemberByCompanyId(companyDictDO.getId()); List<ClassMemberMappingDO> list = classMemberMappingMapper.getCLassMemberByCompanyId(companyDictDO.getId());
if(CollectionUtils.isNotEmpty(list)) { if(CollectionUtils.isNotEmpty(list)) {
for (ClassMemberMappingDO classMemberMappingDO : list) { for (ClassMemberMappingDO classMemberMappingDO : list) {
...@@ -300,7 +305,8 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -300,7 +305,8 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
if(null != webSocketSession && webSocketSession.isOpen()) { if(null != webSocketSession && webSocketSession.isOpen()) {
try { try {
List<ClassSettingsVO> classSettings = classDictMapper.getClassSettings(classMemberMappingDO.getMemberId()); List<ClassSettingsVO> classSettings = classDictMapper.getClassSettings(classMemberMappingDO.getMemberId());
String data = JSONObject.toJSONString(ResponseData.generateCreatedResponse(0, classSettings), SerializerFeature.WriteMapNullValue); systemSettings.setClassSettingsVOS(classSettings);
String data = JSONObject.toJSONString(ResponseData.generateCreatedResponse(0, systemSettings), SerializerFeature.WriteMapNullValue);
webSocketSession.sendMessage(new TextMessage(data)); webSocketSession.sendMessage(new TextMessage(data));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -14,9 +14,7 @@ import com.subsidy.model.AccessTokenDO; ...@@ -14,9 +14,7 @@ import com.subsidy.model.AccessTokenDO;
import com.subsidy.model.ImageCheckRecordDO; import com.subsidy.model.ImageCheckRecordDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.service.ImageCheckRecordService; import com.subsidy.service.ImageCheckRecordService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.DateFormatUtil; import com.subsidy.util.DateFormatUtil;
import com.subsidy.vo.image.CheckImageResultVO;
import com.subsidy.vo.token.*; import com.subsidy.vo.token.*;
import org.apache.commons.codec.Charsets; import org.apache.commons.codec.Charsets;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -24,15 +22,11 @@ import org.springframework.beans.BeanUtils; ...@@ -24,15 +22,11 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import sun.misc.BASE64Decoder;
import sun.security.krb5.internal.crypto.Nonce;
//import org.apache.commons.codec.binary.Base64;
import java.io.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern; //import org.apache.commons.codec.binary.Base64;
/** /**
* <p> * <p>
...@@ -72,19 +66,19 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -72,19 +66,19 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
} }
public SendIdCardInfoVO imageCheck(ImageCheckDTO imageCheckDTO) throws Exception { public SendIdCardInfoVO imageCheck(ImageCheckDTO imageCheckDTO) throws Exception {
return PCCheckIdCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 0); return PCCheckIdCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 0,imageCheckDTO.getClassPlace(),imageCheckDTO.getPaperId());
} }
public SendIdCardInfoVO h5CheckResult(ImageCheckDTO imageCheckDTO) throws Exception { public SendIdCardInfoVO h5CheckResult(ImageCheckDTO imageCheckDTO) throws Exception {
return H5IdCheckCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 0); return H5IdCheckCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 0,imageCheckDTO.getClassPlace(),imageCheckDTO.getPaperId());
} }
public SendIdCardInfoVO loginCheck(ImageCheckDTO imageCheckDTO) throws Exception { public SendIdCardInfoVO loginCheck(ImageCheckDTO imageCheckDTO) throws Exception {
return PCCheckIdCard(imageCheckDTO.getId(), null, 1); return PCCheckIdCard(imageCheckDTO.getId(), null, 1,null,null);
} }
public SendIdCardInfoVO h5LoginCheck(ImageCheckDTO imageCheckDTO) throws Exception { public SendIdCardInfoVO h5LoginCheck(ImageCheckDTO imageCheckDTO) throws Exception {
return H5IdCheckCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 1); return H5IdCheckCard(imageCheckDTO.getId(), null, 1,null,null);
} }
/** /**
...@@ -104,7 +98,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -104,7 +98,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
* H5端调取权威库(身份证)验证 权威库 * H5端调取权威库(身份证)验证 权威库
* 1,签到页 0 班级内 * 1,签到页 0 班级内
*/ */
public SendIdCardInfoVO H5IdCheckCard(Long id, Long classId, Integer checkPlace) { public SendIdCardInfoVO H5IdCheckCard(Long id, Long classId, Integer checkPlace,Integer classPlace,Long paperId) {
getDailyCheckCnt(id); getDailyCheckCnt(id);
//获取这个学生的基本信息 //获取这个学生的基本信息
MemberDO memberDO = memberMapper.selectById(id); MemberDO memberDO = memberMapper.selectById(id);
...@@ -119,6 +113,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -119,6 +113,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
imageCheckRecordDO.setClassId(classId); imageCheckRecordDO.setClassId(classId);
imageCheckRecordDO.setCheckType(1); imageCheckRecordDO.setCheckType(1);
imageCheckRecordDO.setCheckPlace(checkPlace); imageCheckRecordDO.setCheckPlace(checkPlace);
imageCheckRecordDO.setPaperId(paperId);
imageCheckRecordDO.setClassPlace(classPlace);
imageCheckRecordMapper.insert(imageCheckRecordDO); imageCheckRecordMapper.insert(imageCheckRecordDO);
//获取signTicket //获取signTicket
...@@ -169,7 +165,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -169,7 +165,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
* PC端调取权威库(身份证)验证 权威库 * PC端调取权威库(身份证)验证 权威库
* 1,签到页 0 班级内 * 1,签到页 0 班级内
*/ */
public SendIdCardInfoVO PCCheckIdCard(Long id, Long classId, Integer checkPlace) { public SendIdCardInfoVO PCCheckIdCard(Long id, Long classId, Integer checkPlace,Integer classPlace,Long paperId) {
getDailyCheckCnt(id); getDailyCheckCnt(id);
//获取这个学生的基本信息 //获取这个学生的基本信息
...@@ -184,6 +180,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -184,6 +180,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
imageCheckRecordDO.setClassId(classId); imageCheckRecordDO.setClassId(classId);
imageCheckRecordDO.setCheckType(1); imageCheckRecordDO.setCheckType(1);
imageCheckRecordDO.setCheckPlace(checkPlace); imageCheckRecordDO.setCheckPlace(checkPlace);
imageCheckRecordDO.setPaperId(paperId);
imageCheckRecordDO.setClassPlace(classPlace);
imageCheckRecordMapper.insert(imageCheckRecordDO); imageCheckRecordMapper.insert(imageCheckRecordDO);
//获取signTicket //获取signTicket
...@@ -210,8 +208,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -210,8 +208,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//获取 NONCE ticket //获取 NONCE ticket
IdCardTicketsVO nonceTicket = this.nonceTicket(getLatestAccessToken(), memberDO.getId() + ""); IdCardTicketsVO nonceTicket = this.nonceTicket(getLatestAccessToken(), memberDO.getId() + "");
//签名2 //签名2 faceId ===>H5FaceId
List<String> signList2 = new ArrayList(Arrays.asList(WBAPPID, memberDO.getId() + "", NONCE, "1.0.0", sendIdCardInfoVO.getResult().getFaceId(), sendIdCardInfoVO.getResult().getOrderNo())); List<String> signList2 = new ArrayList(Arrays.asList(WBAPPID, memberDO.getId() + "", NONCE, "1.0.0", sendIdCardInfoVO.getResult().getH5faceId(), sendIdCardInfoVO.getResult().getOrderNo()));
String sign2 = sign(signList2, nonceTicket.getValue()); String sign2 = sign(signList2, nonceTicket.getValue());
sendIdCardInfoVO.getResult().setWbAppId(WBAPPID); sendIdCardInfoVO.getResult().setWbAppId(WBAPPID);
...@@ -223,7 +221,6 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -223,7 +221,6 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
public ImageCheckRecordDO checkResult(CheckResultDTO checkResultDTO) throws Exception { public ImageCheckRecordDO checkResult(CheckResultDTO checkResultDTO) throws Exception {
CheckImageResultVO checkImageResultVO = new CheckImageResultVO();
//获取signTicket //获取signTicket
IdCardTicketsVO idCardTicketsVO = this.signTickets(getLatestAccessToken()); IdCardTicketsVO idCardTicketsVO = this.signTickets(getLatestAccessToken());
...@@ -242,21 +239,26 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -242,21 +239,26 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//存数据库 //存数据库
ImageCheckRecordDO imageCheckRecordDO = imageCheckRecordMapper.selectById(checkResultDTO.getId()); ImageCheckRecordDO imageCheckRecordDO = imageCheckRecordMapper.selectById(checkResultDTO.getId());
BeanUtils.copyProperties(resultVO, imageCheckRecordDO); BeanUtils.copyProperties(resultVO, imageCheckRecordDO);
imageCheckRecordMapper.updateById(imageCheckRecordDO);
BeanUtils.copyProperties(imageCheckRecordDO, checkImageResultVO); try {
if ((Double.valueOf(imageCheckRecordDO.getSimilarity()) > 60)) {
imageCheckRecordDO.setResult(1);
//如果是签到页的认证,则把图片写到member表里
if (imageCheckRecordDO.getCheckPlace()==1){
MemberDO memberDO = memberMapper.selectById(imageCheckRecordDO.getMemberId());
memberDO.setCheckImage(imageCheckRecordDO.getPhoto());
memberDO.setCheckTime(DateFormatUtil.format(new Date(), DateFormatUtil.FMT_sdf14_L));
memberMapper.updateById(memberDO);
}
} else {
imageCheckRecordDO.setResult(0);
}
}catch (Exception e){
imageCheckRecordDO.setResult(0);
}
//如果是签到页的认证,则把图片写到member表里 imageCheckRecordMapper.updateById(imageCheckRecordDO);
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 {
checkImageResultVO.setResult(false);
}
return imageCheckRecordDO; return imageCheckRecordDO;
} }
......
...@@ -9,42 +9,8 @@ import com.subsidy.common.configure.QXueYouConfig; ...@@ -9,42 +9,8 @@ import com.subsidy.common.configure.QXueYouConfig;
import com.subsidy.common.exception.HttpException; import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.administer.VerifyCodeDTO; import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.member.*; import com.subsidy.dto.member.*;
import com.subsidy.mapper.ClassDictMapper; import com.subsidy.mapper.*;
import com.subsidy.mapper.ClassHourDictMapper; import com.subsidy.model.*;
import com.subsidy.mapper.ClassMemberMappingMapper;
import com.subsidy.mapper.CompanyDictMapper;
import com.subsidy.mapper.CourseContentMapper;
import com.subsidy.mapper.CourseFieldMappingMapper;
import com.subsidy.mapper.DepartmentDictMapper;
import com.subsidy.mapper.ExerciseDoneResultMapper;
import com.subsidy.mapper.FileDictMapper;
import com.subsidy.mapper.JobDictMapper;
import com.subsidy.mapper.JobMemberMappingMapper;
import com.subsidy.mapper.MemberDepartmentMappingMapper;
import com.subsidy.mapper.MemberMapper;
import com.subsidy.mapper.OprMemDictMapper;
import com.subsidy.mapper.PaperDictMapper;
import com.subsidy.mapper.RotationImgDictMapper;
import com.subsidy.mapper.SmsVerifyCodeMapper;
import com.subsidy.mapper.VodDictMapper;
import com.subsidy.mapper.VodPlayHistoryMapper;
import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassHourDictDO;
import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.CompanyDictDO;
import com.subsidy.model.CourseContentDO;
import com.subsidy.model.DepartmentDictDO;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.FieldDictDO;
import com.subsidy.model.FileDictDO;
import com.subsidy.model.JobDictDO;
import com.subsidy.model.JobMemberMappingDO;
import com.subsidy.model.MemberDO;
import com.subsidy.model.MemberDepartmentMappingDO;
import com.subsidy.model.OprMemDictDO;
import com.subsidy.model.RotationImgDictDO;
import com.subsidy.model.SmsVerifyCodeDO;
import com.subsidy.model.VodDictDO;
import com.subsidy.service.MemberService; import com.subsidy.service.MemberService;
import com.subsidy.util.*; import com.subsidy.util.*;
//import com.subsidy.util.RedisUtil; //import com.subsidy.util.RedisUtil;
...@@ -135,7 +101,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -135,7 +101,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
private RotationImgDictMapper rotationImgDictMapper; private RotationImgDictMapper rotationImgDictMapper;
@Autowired @Autowired
private VodDictMapper vodDictMapper; private ImageCheckRecordMapper imageCheckRecordMapper;
@Autowired @Autowired
private SmsVerifyCodeMapper smsVerifyCodeMapper; private SmsVerifyCodeMapper smsVerifyCodeMapper;
...@@ -719,6 +685,21 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -719,6 +685,21 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
for (MyCoursesVO myCoursesVO : myCoursesVOS) { for (MyCoursesVO myCoursesVO : myCoursesVOS) {
List<FieldDictDO> fieldDictDOS = courseFieldMappingMapper.courseFields(myCoursesVO.getCourseId()); List<FieldDictDO> fieldDictDOS = courseFieldMappingMapper.courseFields(myCoursesVO.getCourseId());
myCoursesVO.setFieldDictDOS(fieldDictDOS); myCoursesVO.setFieldDictDOS(fieldDictDOS);
int count = imageCheckRecordMapper.selectCount(new QueryWrapper<ImageCheckRecordDO>()
.lambda()
.eq(ImageCheckRecordDO::getMemberId, myCoursesDTO.getMemberId())
.eq(ImageCheckRecordDO::getClassId, myCoursesVO.getClassId())
.eq(ImageCheckRecordDO::getCheckPlace, 1)
.eq(ImageCheckRecordDO::getResult, 1));
int checkCnt = imageCheckRecordMapper.checkDailyCount(myCoursesDTO.getMemberId(), myCoursesVO.getClassId(), 1,null);
myCoursesVO.setCheckCnt(checkCnt);
if (count > 0) {
myCoursesVO.setResult(1);
} else {
myCoursesVO.setResult(0);
}
} }
return myCoursesVOS; return myCoursesVOS;
} }
...@@ -855,6 +836,23 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -855,6 +836,23 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
} else { } else {
queryPapersVO.setResult("待完成"); queryPapersVO.setResult("待完成");
} }
int count = imageCheckRecordMapper.selectCount(new QueryWrapper<ImageCheckRecordDO>()
.lambda()
.eq(ImageCheckRecordDO::getMemberId, contentMemberDTO.getMemberId())
.eq(ImageCheckRecordDO::getClassId, contentMemberDTO.getClassId())
.eq(ImageCheckRecordDO::getPaperId,queryPapersVO.getId())
.eq(ImageCheckRecordDO::getClassPlace, 2)
.eq(ImageCheckRecordDO::getResult, 1));
int checkCnt = imageCheckRecordMapper.checkDailyCount(contentMemberDTO.getMemberId(), contentMemberDTO.getClassId(), 2,queryPapersVO.getId());
queryPapersVO.setCheckCnt(checkCnt);
if (count > 0) {
queryPapersVO.setCheckResult(1);
} else {
queryPapersVO.setCheckResult(0);
}
//截止时间 //截止时间
queryPapersVO.setEndDate(classDictDO.getEndDate()); queryPapersVO.setEndDate(classDictDO.getEndDate());
} }
......
package com.subsidy.vo.classdict;
import lombok.Data;
import java.util.List;
@Data
public class SystemSettings {
/**
* 上课时间不晚于23:30,不早于6:30
*/
private Integer timeLimit;
/**
* 签到时记录IP地址
*/
private Integer ipAddressRecord;
/**
* 签到时记录设备型号
*/
private Integer deviceNoRecord;
/**
* 班级配置
*/
private List<ClassSettingsVO> classSettingsVOS;
}
package com.subsidy.vo.image;
import com.subsidy.model.ImageCheckRecordDO;
import lombok.Data;
@Data
public class CheckImageResultVO extends ImageCheckRecordDO {
private Boolean result;
}
...@@ -32,5 +32,9 @@ public class MyCoursesVO { ...@@ -32,5 +32,9 @@ public class MyCoursesVO {
private Integer isFastPlay; private Integer isFastPlay;
private Integer result;
private Integer checkCnt;
private List<FieldDictDO> fieldDictDOS; private List<FieldDictDO> fieldDictDOS;
} }
...@@ -21,4 +21,8 @@ public class QueryPapersVO { ...@@ -21,4 +21,8 @@ public class QueryPapersVO {
private String endDate; private String endDate;
private Integer checkCnt;
private Integer checkResult;
} }
...@@ -197,4 +197,19 @@ ...@@ -197,4 +197,19 @@
AND t2.delete_date IS NULL AND t2.delete_date IS NULL
AND t3.delete_date IS NULL AND t3.delete_date IS NULL
</select> </select>
<select id="getCompanySettings" parameterType="long" resultType="com.subsidy.vo.classdict.SystemSettings">
SELECT
t2.time_limit,
t2.ip_address_record,
t2.device_no_record
FROM
class_dict t
LEFT JOIN company_dict t2 ON t.company_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.id = #{classId}
</select>
</mapper> </mapper>
...@@ -33,4 +33,26 @@ ...@@ -33,4 +33,26 @@
AND t.member_id = #{memberId} AND t.member_id = #{memberId}
</select> </select>
<select id="checkDailyCount" resultType="int">
SELECT
count(1)
FROM
image_check_record t
WHERE
t.delete_date IS NULL
<if test="memberId != null and memberId != ''">
AND t.member_id = #{memberId}
</if>
<if test="classId != null and classId != ''">
AND t.class_id = #{classId}
</if>
AND DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(t.create_date, '%Y-%m-%d')
<if test="checkPlace != null and checkPlace != ''">
and class_place = #{checkPlace}
</if>
<if test="paperId != null and paperId != ''">
and paper_id = #{paperId}
</if>
</select>
</mapper> </mapper>
...@@ -330,4 +330,18 @@ ...@@ -330,4 +330,18 @@
<update id="removeCheckImage" parameterType="long"> <update id="removeCheckImage" parameterType="long">
update member set check_image = null,check_time = null where id = #{id} update member set check_image = null,check_time = null where id = #{id}
</update> </update>
<select id="companySettings" parameterType="long" resultType="com.subsidy.vo.classdict.SystemSettings">
SELECT
t2.time_limit,
t2.ip_address_record,
t2.device_no_record
FROM
member t
LEFT JOIN company_dict t2 ON t.company_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.id = #{memberId}
</select>
</mapper> </mapper>
...@@ -54,4 +54,18 @@ ...@@ -54,4 +54,18 @@
WHERE WHERE
create_date &lt; (NOW() - INTERVAL 10 DAY) create_date &lt; (NOW() - INTERVAL 10 DAY)
</select> </select>
<select id="getLatestLoginInfo" parameterType="long" resultType="com.subsidy.model.OprMemDictDO">
SELECT
t.ip_address,
t.opr_type,
t.result,
t.user_id,
max(t.create_date) as create_date
FROM
opr_mem_dict t
WHERE
t.delete_date IS NULL
AND t.user_id = #{userId}
</select>
</mapper> </mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!