src/main/java/org/springblade/modules/exam/controller/ExamPaperController.java
@@ -521,6 +521,4 @@ } } } src/main/java/org/springblade/modules/exam/controller/ExamSubjectChoicesController.java
@@ -208,4 +208,27 @@ ExcelUtil.export(response, "题库导入数据模板", "题库导入数据表", list, ExamSubjectExcel.class); } /** * 获取下一题的题目,并判断上一题的答案,且返回上一题答题结果(app 模拟考试) * * @param examSubjectChoices 选择题信息对象 */ @GetMapping("/getSubjectResultInfoBySimulate") public R<ExamSubjectChoicesVO> getSubjectResultInfoBySimulate(ExamSubjectChoicesVO examSubjectChoices) { //查询下一题题目详情 ExamSubjectChoicesVO detail = examSubjectChoicesService.selectExamSubjectChoicesInfo(examSubjectChoices); //判断当前题目的答题结果 if (examSubjectChoices.getPreSubJectId()!=null) { if (null!=examSubjectChoices.getPreResult() && examSubjectChoices.getPreResult()!="" && !examSubjectChoices.getPreResult().equals("")) { detail.setResult(examSubjectChoicesService.getAnswerResultBySimulate(examSubjectChoices.getPreSubJectId(),examSubjectChoices.getPreResult(),examSubjectChoices.getSimulateExamId())); }else { //无 detail.setResult(3); } } //返回 return R.data(detail); } } src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.java
@@ -161,9 +161,10 @@ List<ExamScoreVO> getExamScoreList(@Param("examScore") ExamScoreVO examScoreVO); /** * 去除随机的题目 * @param radio * 取出随机的题目 * @param list * @param number 取出的数量 * @return */ List<ExamSubjectChoicesVO> queryRandomSubjectList(@Param("list") List<String> radio,@Param("number") Integer number); List<ExamSubjectChoicesVO> queryRandomSubjectList(@Param("list") List<String> list,@Param("number") Integer number); } src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml
@@ -535,7 +535,15 @@ </select> <select id="queryRandomSubjectList" resultType="org.springblade.modules.exam.vo.ExamSubjectChoicesVO"> select * from ( select id, category_id categoryId, subject_name subjectName, choices_type choicesType, score, analysis, tktype from ( select * from exam_subject_choices where id in <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> src/main/java/org/springblade/modules/exam/service/ExamPaperService.java
@@ -137,4 +137,12 @@ * @return */ List<ExamScoreVO> getExamScoreList(ExamScoreVO examScoreVO); /** * 根据id 取出题目信息(随机取) * @param list 题目id集合 * @param number 题目梳理 * @return */ List<ExamSubjectChoicesVO> queryRandomSubjectList(List<String> list, int number); } src/main/java/org/springblade/modules/exam/service/ExamSubjectChoicesService.java
@@ -68,4 +68,13 @@ * @return */ List<String> getExamSubjectChoicesList(); /** * 判断当前题目的答题结果 * @param preSubJectId 题目 id * @param preResult 提交的结果 * @param simulateExamId 模拟考试记录 id * @return */ Integer getAnswerResultBySimulate(Long preSubJectId, String preResult, Long simulateExamId); } src/main/java/org/springblade/modules/exam/service/impl/ExamPaperServiceImpl.java
@@ -366,4 +366,16 @@ public List<ExamScoreVO> getExamScoreList(ExamScoreVO examScoreVO) { return baseMapper.getExamScoreList(examScoreVO); } /** * 根据id 取出题目信息(随机取) * @param list 题目id集合 * @param number 题目梳理 * @return */ @Override public List<ExamSubjectChoicesVO> queryRandomSubjectList(List<String> list, int number) { return baseMapper.queryRandomSubjectList(list,number); } } src/main/java/org/springblade/modules/exam/service/impl/ExamSubjectChoicesServiceImpl.java
@@ -3,8 +3,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.AllArgsConstructor; import org.springblade.common.utils.arg; import org.springblade.modules.FTP.FtpUtil; import org.springblade.modules.exam.entity.ExamAnswerRecord; import org.springblade.modules.exam.entity.ExamSubjectChoices; @@ -15,6 +13,8 @@ import org.springblade.modules.exam.service.ExamSubjectChoicesService; import org.springblade.modules.exam.service.ExamSubjectOptionService; import org.springblade.modules.exam.vo.ExamSubjectChoicesVO; import org.springblade.modules.simulateexam.entity.SimulateExamAnswerRecord; import org.springblade.modules.simulateexam.service.SimulateExamAnswerRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -36,6 +36,9 @@ @Autowired private ExamAnswerRecordService examAnswerRecordService; @Autowired private SimulateExamAnswerRecordService simulateExamAnswerRecordService; @Override @@ -402,4 +405,90 @@ public List<String> getExamSubjectChoicesList() { return baseMapper.getExamSubjectChoicesList(); } /** * 判断当前题目的答题结果 * @param preSubJectId 题目 id * @param preResult 提交的结果 * @param simulateExamId 模拟考试记录 id * @return */ @Override public Integer getAnswerResultBySimulate(Long preSubJectId, String preResult, Long simulateExamId) { //查询题目信息 ExamSubjectChoices choices = this.getById(preSubJectId); //对比答案 if (choices.getChoicesType() == 2 || choices.getChoicesType() == 3){ //保存答题记录 boolean result = preResult.equals(choices.getAnswer()); int status = 0; //判断题逻辑 if (result){ status = 1; }else { status = 2; } //新增模拟考试答题记录 saveSimulateExamAns(choices,preSubJectId,preResult,simulateExamId,result); //返回 return status; }else if(choices.getChoicesType() == 0 || choices.getChoicesType() == 1){ //处理多选题的答案排序 String[] split = preResult.split(","); StringBuilder builder = new StringBuilder(); for (String s : split) { builder.append(s); } char[] arrayCh = builder.toString().toCharArray(); //利用数组帮助类自动排序 Arrays.sort(arrayCh); String sub0 = Arrays.toString(arrayCh); String sub = sub0.substring(1,sub0.length()-1).replaceAll(" ",""); //保存模拟考试答题记录 boolean result = sub.equals(choices.getAnswer()); int status = 0; //判断题逻辑 if (result){ status = 1; }else { status = 2; } //新增模拟考试答题记录 saveSimulateExamAns(choices,preSubJectId,preResult,simulateExamId,result); //返回 return status; } return 2; } /** * 新增模拟考试答题记录 * @param choices 题目信息 * @param preSubJectId 题目id * @param preResult 提交的答案 * @param simulateExamId 模拟考试id * @param result 答题的结果 */ private void saveSimulateExamAns(ExamSubjectChoices choices, Long preSubJectId, String preResult, Long simulateExamId, boolean result) { SimulateExamAnswerRecord simulateExamAnswerRecord = new SimulateExamAnswerRecord(); simulateExamAnswerRecord.setSimulateExamId(simulateExamId); simulateExamAnswerRecord.setAnswerOption(preResult); simulateExamAnswerRecord.setSubjectChoicesId(preSubJectId); simulateExamAnswerRecord.setAnswer(choices.getAnswer()); simulateExamAnswerRecord.setSubjectChoicesType(choices.getChoicesType()); simulateExamAnswerRecord.setAnswerTime(new Date()); int status = 0; //判断题逻辑 if (result){ status = 1; simulateExamAnswerRecord.setAnswerScore(choices.getScore()); }else { status = 2; simulateExamAnswerRecord.setAnswerScore(0); } simulateExamAnswerRecord.setAnswerResult(status); //新增 simulateExamAnswerRecordService.save(simulateExamAnswerRecord); } } src/main/java/org/springblade/modules/exam/vo/ExamSubjectChoicesVO.java
@@ -40,4 +40,9 @@ * 成绩id */ private Long scoreId; /** * 模拟考试记录id */ private Long simulateExamId; } src/main/java/org/springblade/modules/simulateexam/controller/SimulateExamRecordController.java
@@ -8,6 +8,7 @@ import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.modules.exam.vo.ExamPaperVO; import org.springblade.modules.simulateexam.entity.SimulateExamRecord; import org.springblade.modules.simulateexam.service.SimulateExamRecordService; import org.springblade.modules.simulateexam.vo.SimulateExamRecordVO; @@ -85,4 +86,45 @@ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(simulateExamRecordService.removeByIds(Func.toLongList(ids))); } /** * 首次点击开始考试,创建模拟考试 * @param simulateExamRecord 模拟考试记录对象信息 * @return */ @PostMapping("/beginExam") public R beginExam(@RequestBody SimulateExamRecord simulateExamRecord) { return R.data(simulateExamRecordService.insertSimulateExamRecord(simulateExamRecord)); } /** * 考试暂停后继续,1查询所有的答题信息,2查询所有的已答信息 3其他信息 * @param simulateExamRecord 必须包含 模拟考试id, type 1: 继续考试 2: 放弃之前的考试,重新生成题目考试 * @return */ @GetMapping("/getSimulateExamRefreshInfo") public R getSimulateExamRefreshInfo(SimulateExamRecordVO simulateExamRecord){ return R.data(simulateExamRecordService.getSimulateExamRefreshInfo(simulateExamRecord)); } /** * 答题途中暂停考试 * @param simulateExamRecord 模拟考试记录对象信息 * @return */ @PostMapping("/pauseExam") public R pauseExam(@RequestBody SimulateExamRecord simulateExamRecord) { return R.data(simulateExamRecordService.pauseExam(simulateExamRecord)); } /** * 模拟考试开始页面,查询是否有暂停中的模拟考试 * @param simulateExamRecord 模拟考试记录对象信息(必须包含 idCardNo) * @return */ @GetMapping("/getSimulateExamRecordInfo") public R getSimulateExamRecordInfo(SimulateExamRecord simulateExamRecord) { return R.data(simulateExamRecordService.getSimulateExamRecordInfo(simulateExamRecord)); } } src/main/java/org/springblade/modules/simulateexam/entity/SimulateExamRecord.java
@@ -59,4 +59,14 @@ * 身份证号码 */ private String idCardNo; /** * 题目ids (60道题目id集) */ private String subjectIds; /** * 答题时长,以毫秒为单位 */ private Long answerTime; } src/main/java/org/springblade/modules/simulateexam/mapper/SimulateExamRecordMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.Param; import org.springblade.modules.exam.vo.ExamSubjectChoicesVO; import org.springblade.modules.simulateexam.entity.SimulateExamRecord; import org.springblade.modules.simulateexam.vo.SimulateExamRecordVO; @@ -25,4 +26,11 @@ * @return */ List<SimulateExamRecordVO> selectSimulateExamRecordPage(IPage<SimulateExamRecordVO> page, @Param("simulateExamRecord") SimulateExamRecordVO simulateExamRecord); /** * 查询当前人员当前模拟考试的考试题目信息 * @param list 题目id 集合 * @return */ List<ExamSubjectChoicesVO> getSimulateExamRefreshList(@Param("list") List<String> list); } src/main/java/org/springblade/modules/simulateexam/mapper/SimulateExamRecordMapper.xml
@@ -11,4 +11,22 @@ </if> </select> <!--查询当前人员当前模拟考试的考试题目信息--> <select id="getSimulateExamRefreshList" resultType="org.springblade.modules.exam.vo.ExamSubjectChoicesVO"> select id, category_id categoryId, subject_name subjectName, choices_type choicesType, score, analysis, tktype from exam_subject_choices where id in <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> #{item} </foreach> </select> </mapper> src/main/java/org/springblade/modules/simulateexam/service/SimulateExamRecordService.java
@@ -23,4 +23,31 @@ */ IPage<SimulateExamRecordVO> selectSimulateExamRecordPage(IPage<SimulateExamRecordVO> page, SimulateExamRecordVO simulateExamRecordVO); /** * 首次点击开始考试,创建模拟考试 * @param simulateExamRecord 模拟考试记录对象信息 * @return */ Object insertSimulateExamRecord(SimulateExamRecord simulateExamRecord); /** * 暂停模拟考试 * @param simulateExamRecord * @return */ Object pauseExam(SimulateExamRecord simulateExamRecord); /** * 模拟考试开始页面,查询是否有暂停中的模拟考试 * @param simulateExamRecord 模拟考试记录对象信息 * @return */ Object getSimulateExamRecordInfo(SimulateExamRecord simulateExamRecord); /** * 考试暂停后继续,1查询所有的答题信息,2查询所有的已答信息 3其他信息 * @param simulateExamRecord 必须包含 模拟考试id, type 1: 继续考试 2: 放弃之前的考试,重新生成题目考试 * @return */ Object getSimulateExamRefreshInfo(SimulateExamRecordVO simulateExamRecord); } src/main/java/org/springblade/modules/simulateexam/service/impl/SimulateExamRecordServiceImpl.java
@@ -3,16 +3,32 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.redisson.misc.Hash; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Condition; import org.springblade.modules.exam.entity.ExamAnswerRecord; import org.springblade.modules.exam.entity.ExamScore; import org.springblade.modules.exam.entity.ExamSubjectChoices; import org.springblade.modules.exam.service.ExamPaperService; import org.springblade.modules.exam.service.ExamSubjectChoicesService; import org.springblade.modules.exam.vo.ExamSubjectChoicesVO; import org.springblade.modules.simulateexam.entity.SimulateExamAnswerRecord; import org.springblade.modules.simulateexam.entity.SimulateExamRecord; import org.springblade.modules.simulateexam.mapper.SimulateExamRecordMapper; import org.springblade.modules.simulateexam.service.SimulateExamAnswerRecordService; import org.springblade.modules.simulateexam.service.SimulateExamRecordService; import org.springblade.modules.simulateexam.vo.SimulateExamRecordVO; import org.springblade.modules.system.entity.User; import org.springblade.modules.system.service.IUserService; import org.springblade.modules.training.entity.TrainingRegistration; import org.springblade.modules.vip.entity.VipTopic; import org.springblade.modules.vip.service.VipTopicService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; import java.util.List; import java.lang.reflect.Array; import java.util.*; import java.util.stream.Collectors; /** * 模拟考试记录服务实现类 @@ -23,6 +39,20 @@ @Service public class SimulateExamRecordServiceImpl extends ServiceImpl<SimulateExamRecordMapper, SimulateExamRecord> implements SimulateExamRecordService { @Autowired private ExamSubjectChoicesService examSubjectChoicesService; @Autowired private VipTopicService vipTopicService; @Autowired private IUserService userService; @Autowired private ExamPaperService examPaperService; @Autowired private SimulateExamAnswerRecordService simulateExamAnswerRecordService; /** * 自定义分页查询模拟考试记录数据 @@ -34,4 +64,171 @@ public IPage<SimulateExamRecordVO> selectSimulateExamRecordPage(IPage<SimulateExamRecordVO> page, SimulateExamRecordVO simulateExamRecord) { return page.setRecords(baseMapper.selectSimulateExamRecordPage(page, simulateExamRecord)); } /** * 首次点击开始考试,创建模拟考试,并返回考试 * @param simulateExamRecord 模拟考试记录对象信息 * @return */ @Override public Object insertSimulateExamRecord(SimulateExamRecord simulateExamRecord) { //创建返回信息map Map<String, Object> map = new HashMap<>(); //使用身份证号码匹配人员信息(user_id) User user = new User(); user.setIsDeleted(0); user.setStatus(1); user.setCardid(simulateExamRecord.getIdCardNo()); List<User> list = userService.list(Condition.getQueryWrapper(user)); List<ExamSubjectChoicesVO> choicesVOList = new ArrayList<>(); if (list.size()>0){ User user1 = list.get(0); //查询当前人员的考试题库,已缴费id VipTopic vipTopic = new VipTopic(); vipTopic.setUserId(user1.getId()); VipTopic topic = vipTopicService.getOne(Condition.getQueryWrapper(vipTopic)); //从当前人员考试题库随机取60题存入 if (null!=topic){ List<String> list1 = Arrays.asList(topic.getTopicIds().split(",")); //获取随机的题目 List<String> radio = list1.subList(0, 49); List<String> checkbox = list1.subList(50, 69); List<String> judge = list1.subList(70, 109); List<String> sort = list1.subList(110, 119); //随机题目 List<ExamSubjectChoicesVO> radioRandomSubjectList = examPaperService.queryRandomSubjectList(radio,25); List<ExamSubjectChoicesVO> checkboxRandomSubjectList = examPaperService.queryRandomSubjectList(checkbox,10); List<ExamSubjectChoicesVO> judgeRandomSubjectList = examPaperService.queryRandomSubjectList(judge,20); List<ExamSubjectChoicesVO> sortRandomSubjectList = examPaperService.queryRandomSubjectList(sort,5); //合并集合数据 choicesVOList.addAll(radioRandomSubjectList); choicesVOList.addAll(checkboxRandomSubjectList); choicesVOList.addAll(judgeRandomSubjectList); choicesVOList.addAll(sortRandomSubjectList); //取出考试id List<Long> longList = choicesVOList.stream().map(ExamSubjectChoicesVO::getId).collect(Collectors.toList()); //装换为字符串 List<String> list2 = new ArrayList<>(); for (Long aLong : longList) { list2.add(aLong.toString()); } String collect = list2.stream().collect(Collectors.joining(",")); //设置题目信息 simulateExamRecord.setSubjectIds(collect); simulateExamRecord.setStartTime(new Date()); //考试剩余时长初始值为60分钟 simulateExamRecord.setAnswerTime(60*60*1000L); //考试中,开始计时 simulateExamRecord.setStatus(1); //新增模拟考试记录信息 boolean status = this.save(simulateExamRecord); if (status){ map.put("simulateExamRecord",simulateExamRecord); map.put("examSubjectInfo",choicesVOList); //返回信息 return map; } }else { throw new ServiceException("未查询到该人员缴费信息"); } }else { throw new ServiceException("未查询到该人员信息"); } //返回数据 return map; } /** * 暂停模拟考试 * @param simulateExamRecord * @return */ @Override public Object pauseExam(SimulateExamRecord simulateExamRecord) { simulateExamRecord.setStatus(2); //计算时长 return this.updateById(simulateExamRecord); } /** * 模拟考试开始页面,查询是否有暂停中的模拟考试 * @param simulateExamRecord 模拟考试记录对象信息(必须包含 idCardNo) * @return */ @Override public Object getSimulateExamRecordInfo(SimulateExamRecord simulateExamRecord) { simulateExamRecord.setStatus(2); return this.getOne(Condition.getQueryWrapper(simulateExamRecord)); } /** * 考试暂停后继续,1查询所有的答题信息,2查询所有的已答信息 3其他信息 * @param simulateExamRecord 必须包含 模拟考试id,id_card_no, type 1: 继续考试 2: 放弃之前的考试,重新生成题目考试 * @return */ @Override public Object getSimulateExamRefreshInfo(SimulateExamRecordVO simulateExamRecord) { if (null!=simulateExamRecord.getId()) { Map<String, Object> map = new HashMap<>(); //1. 继续考试 if (simulateExamRecord.getType().equals(1)){ //其他信息 SimulateExamRecord simulateExamRecord1 = this.getById(simulateExamRecord.getId()); List<String> list = Arrays.asList(simulateExamRecord1.getSubjectIds().split(",")); //修改信息,修改回考试中的状态 simulateExamRecord1.setStatus(2); this.updateById(simulateExamRecord1); //1.查询当前人员当前模拟考试的考试题目信息 List<ExamSubjectChoicesVO> examSubjectChoicesVOSList = baseMapper.getSimulateExamRefreshList(list); //2.查询当前人员已答的题目信息 SimulateExamAnswerRecord simulateExamAnswerRecord = new SimulateExamAnswerRecord(); simulateExamAnswerRecord.setSimulateExamId(simulateExamRecord.getId()); List<SimulateExamAnswerRecord> simulateExamAnswerRecordList = simulateExamAnswerRecordService.list(Condition.getQueryWrapper(simulateExamAnswerRecord)); //3.查询正在答题的信息 int count = simulateExamAnswerRecordList.size(); //查询下一题题目信息 ExamSubjectChoicesVO examSubjectChoicesVO = new ExamSubjectChoicesVO(); ExamSubjectChoices examSubjectChoices = new ExamSubjectChoices(); if (count>0) { examSubjectChoices.setId(examSubjectChoicesVOSList.get(count).getId()); examSubjectChoicesVO = examSubjectChoicesService.selectExamSubjectChoicesInfo(examSubjectChoices); } if (count==0) { examSubjectChoices.setId(examSubjectChoicesVOSList.get(0).getId()); examSubjectChoicesVO = examSubjectChoicesService.selectExamSubjectChoicesInfo(examSubjectChoices); } //5.数据封装 map.put("simulateExamRecord",simulateExamRecord1); map.put("examSubjectInfo",examSubjectChoicesVOSList); map.put("simulateExamAnswerRecordList",simulateExamAnswerRecordList); map.put("examSubjectChoicesVO",examSubjectChoicesVO); //6.返回数据 return map; } //2. 放弃之前的考试,重新获取题目返回 if (simulateExamRecord.getType().equals(2)){ SimulateExamRecord examRecord = this.getById(simulateExamRecord.getId()); //修改当前模拟考试状态为废弃 examRecord.setStatus(4); //修改信息 this.updateById(examRecord); //重新获取题目 SimulateExamRecord simulateExamRecord1 = new SimulateExamRecord(); simulateExamRecord1.setIdCardNo(examRecord.getIdCardNo()); //去获取题目 return insertSimulateExamRecord(simulateExamRecord1); } } return null; } } src/main/java/org/springblade/modules/simulateexam/vo/SimulateExamRecordVO.java
@@ -12,4 +12,9 @@ @Data public class SimulateExamRecordVO extends SimulateExamRecord { private static final long serialVersionUID = 1L; /** * 1: 继续考试 2: 放弃之前的考试,重新生成题目考试 */ private Integer type; } src/main/java/org/springblade/modules/vip/controller/UserVipController.java
@@ -103,4 +103,17 @@ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(userVipService.removeByIds(Func.toLongList(ids))); } /** * 查询用户信息 * @param userVip * @return */ @GetMapping("/getUserVipInfo") public R getUserVipInfo(UserVip userVip) { return R.data(userVipService.getUserVipInfo(userVip)); } } src/main/java/org/springblade/modules/vip/entity/UserVip.java
@@ -10,7 +10,7 @@ import java.util.Date; /** * 用户会员实体类 * 用户会员实体类(已缴费的) * * @author zhongrj * @since 2020-02-21 src/main/java/org/springblade/modules/vip/service/UserVipService.java
@@ -31,4 +31,11 @@ * @return */ boolean insertUserVipInfo(TrainingRegistration trainingRegistration); /** * 查询用户信息 * @param userVip * @return */ Object getUserVipInfo(UserVip userVip); } src/main/java/org/springblade/modules/vip/service/impl/UserVipServiceImpl.java
@@ -5,11 +5,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.modules.system.entity.User; import org.springblade.modules.system.service.IUserService; import org.springblade.modules.training.entity.TrainingRegistration; import org.springblade.modules.vip.entity.UserVip; import org.springblade.modules.vip.mapper.UserVipMapper; import org.springblade.modules.vip.service.UserVipService; import org.springblade.modules.vip.vo.UserVipVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; @@ -24,6 +26,8 @@ @Service public class UserVipServiceImpl extends ServiceImpl<UserVipMapper, UserVip> implements UserVipService { @Autowired private IUserService userService; /** * 自定义分页查询用户会员数据 @@ -69,4 +73,30 @@ //3.返回 return status; } /** * 查询用户信息(包含用户基本信息及是否缴费/会员) * @param userVip * @return */ @Override public Object getUserVipInfo(UserVip userVip) { // 根据身份证号查询用户信息 User user = new User(); user.setCardid(userVip.getIdCardNo()); user.setStatus(1); user.setIsDeleted(0); User user1 = userService.getOne(Condition.getQueryWrapper(user)); if (null!=user1){ userVip.setUserId(user1.getId()); UserVip vip = this.getOne(Condition.getQueryWrapper(userVip)); if (null!=vip){ UserVipVO vipVO = new UserVipVO(); vipVO.setIdCardNo(user1.getCardid()); vipVO.setSex(user1.getSex()); return vipVO; } } return null; } } src/main/java/org/springblade/modules/vip/vo/UserVipVO.java
@@ -12,4 +12,8 @@ @Data public class UserVipVO extends UserVip { private static final long serialVersionUID = 1L; private String realName; private Integer sex; } src/main/resources/application.yml
@@ -215,6 +215,7 @@ - /recordk/save - /recordk/details - /blade-user/detail - /userVip/detail #授权认证配置 auth: