Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
b72588b6ab
@ -23,7 +23,7 @@ public interface SysUserDAO extends MyBatisBaseDao<SysUser, Long, SysUserExample
|
|||||||
" nationcode, email, wx_id, \n" +
|
" nationcode, email, wx_id, \n" +
|
||||||
" wx_union_id, wm_open_id, `status`, \n" +
|
" wx_union_id, wm_open_id, `status`, \n" +
|
||||||
" roles, `offline`, create_time, \n" +
|
" roles, `offline`, create_time, \n" +
|
||||||
" update_user_id, update_time)\n"+
|
" update_user_id, update_time)\n" +
|
||||||
" values " +
|
" values " +
|
||||||
" <foreach collection=\"list\" item=\"entity\" separator=\",\"> " +
|
" <foreach collection=\"list\" item=\"entity\" separator=\",\"> " +
|
||||||
" (#{entity.account,jdbcType=VARCHAR}, #{entity.name,jdbcType=VARCHAR}, #{entity.nickname,jdbcType=VARCHAR}, \n" +
|
" (#{entity.account,jdbcType=VARCHAR}, #{entity.name,jdbcType=VARCHAR}, #{entity.nickname,jdbcType=VARCHAR}, \n" +
|
||||||
@ -44,4 +44,48 @@ public interface SysUserDAO extends MyBatisBaseDao<SysUser, Long, SysUserExample
|
|||||||
" GROUP BY DATE(create_time);" +
|
" GROUP BY DATE(create_time);" +
|
||||||
"</script>")
|
"</script>")
|
||||||
List<DailyLiveQuantityVO> statisticsDailyRegister(@Param("beginDate") LocalDate beginDate, @Param("endDate") LocalDate endDate);
|
List<DailyLiveQuantityVO> statisticsDailyRegister(@Param("beginDate") LocalDate beginDate, @Param("endDate") LocalDate endDate);
|
||||||
|
|
||||||
|
// @Results(value = {
|
||||||
|
// @Result(column = "id", property = "id"),
|
||||||
|
// @Result(column = "account", property = "account"),
|
||||||
|
// @Result(column = "name", property = "name"),
|
||||||
|
// @Result(column = "nickname", property = "nickname"),
|
||||||
|
// @Result(column = "avatar_path", property = "avatarPath"),
|
||||||
|
// @Result(column = "password", property = "password"),
|
||||||
|
// @Result(column = "mobile", property = "mobile"),
|
||||||
|
// @Result(column = "nationcode", property = "nationcode"),
|
||||||
|
// @Result(column = "email", property = "email"),
|
||||||
|
// @Result(column = "wx_id", property = "wxId"),
|
||||||
|
// @Result(column = "wx_union_id", property = "wxUnionId"),
|
||||||
|
// @Result(column = "wm_open_id", property = "wmOpenId"),
|
||||||
|
// @Result(column = "status", property = "status"),
|
||||||
|
// @Result(column = "roles", property = "roles"), //这行有问题
|
||||||
|
// @Result(column = "create_time", property = "createTime"),
|
||||||
|
// @Result(column = "company_id", property = "companyId"),
|
||||||
|
// @Result(column = "company.name", property = "companyName")
|
||||||
|
// })
|
||||||
|
// @Select("<script>" +
|
||||||
|
// "select\n" +
|
||||||
|
// " <if test=\"distinct\">\n" +
|
||||||
|
// " distinct\n" +
|
||||||
|
// " </if>\n" +
|
||||||
|
// " <include refid=\"Base_Column_List\" />\n" +
|
||||||
|
// " , company.name" +
|
||||||
|
// " from sys_user left join company on sys_user.company_id = company.id\n" +
|
||||||
|
// " <if test=\"_parameter != null\">\n" +
|
||||||
|
// " <include refid=\"Example_Where_Clause\" />\n" +
|
||||||
|
// " </if>\n" +
|
||||||
|
// " <if test=\"orderByClause != null\">\n" +
|
||||||
|
// " order by ${orderByClause}\n" +
|
||||||
|
// " </if>\n" +
|
||||||
|
// " <if test=\"limit != null\">\n" +
|
||||||
|
// " <if test=\"offset != null\">\n" +
|
||||||
|
// " limit ${offset}, ${limit}\n" +
|
||||||
|
// " </if>\n" +
|
||||||
|
// " <if test=\"offset == null\">\n" +
|
||||||
|
// " limit ${limit}\n" +
|
||||||
|
// " </if>\n" +
|
||||||
|
// " </if>" +
|
||||||
|
// "</script>")
|
||||||
|
// List<UserVO> selectUserWithCompanyName(SysUserExample example);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package club.joylink.rtss.exception;
|
package club.joylink.rtss.exception;
|
||||||
|
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class BaseException extends RuntimeException {
|
public class BaseException extends RuntimeException {
|
||||||
|
|
||||||
private IExceptionMessage exceptionMessage;
|
private IExceptionMessage exceptionMessage;
|
||||||
@ -29,6 +33,9 @@ public class BaseException extends RuntimeException {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getVoMessage() {
|
public String getVoMessage() {
|
||||||
|
if (!StringUtils.isEmpty(super.getMessage())) {
|
||||||
|
return super.getMessage();
|
||||||
|
}
|
||||||
return this.exceptionMessage.getMessage();
|
return this.exceptionMessage.getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,9 +50,10 @@ public enum BusinessExceptionAssertEnum implements BusinessExceptionAssert {
|
|||||||
LOGIN_INFO_ERROR(40003, "login info error"),
|
LOGIN_INFO_ERROR(40003, "login info error"),
|
||||||
LOGIN_EXPIRED(40004, "login expired"),
|
LOGIN_EXPIRED(40004, "login expired"),
|
||||||
NOT_LOGIN(40005, "not login"),
|
NOT_LOGIN(40005, "not login"),
|
||||||
|
WECHAT_CODE_EXPIRED(40029, "wechat code expired"),
|
||||||
INVALID_CLIENT(40031, "invalid client"),
|
INVALID_CLIENT(40031, "invalid client"),
|
||||||
INCORRECT_VERIFICATION_CODE(40051, "incorrect verification code"),
|
INCORRECT_VERIFICATION_CODE(40051, "incorrect verification code"),
|
||||||
THIRD_SERVICE_CALL_EXCEPTION(40071, "the third service call exception"),
|
THIRD_SERVICE_CALL_EXCEPTION(40071, "the third service call exception")
|
||||||
;
|
;
|
||||||
|
|
||||||
int code;
|
int code;
|
||||||
|
@ -71,6 +71,9 @@ public class LessonService implements ILessonService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private StudentRelLessonClassDAO studentRelLessonClassDAO;
|
private StudentRelLessonClassDAO studentRelLessonClassDAO;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IExamService iExamService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LessonTreeVO getLessonTree(Long id, UserVO userVO) {
|
public LessonTreeVO getLessonTree(Long id, UserVO userVO) {
|
||||||
LessonTreeVO lessonTreeVO = new LessonTreeVO();
|
LessonTreeVO lessonTreeVO = new LessonTreeVO();
|
||||||
@ -616,7 +619,7 @@ public class LessonService implements ILessonService {
|
|||||||
if (Objects.nonNull(existedDefaultLesson)) {
|
if (Objects.nonNull(existedDefaultLesson)) {
|
||||||
lesson.setId(existedDefaultLesson.getId());
|
lesson.setId(existedDefaultLesson.getId());
|
||||||
lessonDAO.updateByPrimaryKey(lesson);
|
lessonDAO.updateByPrimaryKey(lesson);
|
||||||
//存在默认课程删除旧版本、章节及关联实训数据
|
//存在默认课程删除旧版本、章节、考试及关联实训数据
|
||||||
LsLessonVersionExample versionExample = new LsLessonVersionExample();
|
LsLessonVersionExample versionExample = new LsLessonVersionExample();
|
||||||
versionExample.createCriteria().andLessonIdEqualTo(existedDefaultLesson.getId());
|
versionExample.createCriteria().andLessonIdEqualTo(existedDefaultLesson.getId());
|
||||||
lessonVersionDAO.deleteByExample(versionExample);
|
lessonVersionDAO.deleteByExample(versionExample);
|
||||||
@ -654,7 +657,7 @@ public class LessonService implements ILessonService {
|
|||||||
List<Training> examTrainings = new ArrayList<>(20);
|
List<Training> examTrainings = new ArrayList<>(20);
|
||||||
int orderNum = 1;
|
int orderNum = 1;
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
Map<String, Map<String, List<Training>>> trainings = iTrainingV1Service.findEntities(mapVO.getId())
|
Map<String, Map<String, List<Training>>> trainings = iTrainingV1Service.findEntities(mapVO.getId(), prdType)
|
||||||
.stream().collect(Collectors.groupingBy(Training::getType, Collectors.groupingBy(Training::getOperateType)));
|
.stream().collect(Collectors.groupingBy(Training::getType, Collectors.groupingBy(Training::getOperateType)));
|
||||||
for (BusinessConsts.Training.Type type : BusinessConsts.Training.Type.values()) {
|
for (BusinessConsts.Training.Type type : BusinessConsts.Training.Type.values()) {
|
||||||
Map<String, List<Training>> collect = trainings.get(type.name());
|
Map<String, List<Training>> collect = trainings.get(type.name());
|
||||||
|
@ -13,6 +13,7 @@ import club.joylink.rtss.vo.SmsResponse;
|
|||||||
import club.joylink.rtss.vo.UserQueryVO;
|
import club.joylink.rtss.vo.UserQueryVO;
|
||||||
import club.joylink.rtss.vo.UserVO;
|
import club.joylink.rtss.vo.UserVO;
|
||||||
import club.joylink.rtss.vo.VdCode;
|
import club.joylink.rtss.vo.VdCode;
|
||||||
|
import club.joylink.rtss.vo.client.CompanyVO;
|
||||||
import club.joylink.rtss.vo.client.PageVO;
|
import club.joylink.rtss.vo.client.PageVO;
|
||||||
import club.joylink.rtss.vo.client.UserConfigVO;
|
import club.joylink.rtss.vo.client.UserConfigVO;
|
||||||
import club.joylink.rtss.vo.client.map.MapVO;
|
import club.joylink.rtss.vo.client.map.MapVO;
|
||||||
@ -33,6 +34,7 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -83,6 +85,9 @@ public class SysUserService implements ISysUserService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CompanyDAO companyDAO;
|
private CompanyDAO companyDAO;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ICompanyService iCompanyService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserVO findUserByAccountAndPassword(String account, String password) {
|
public UserVO findUserByAccountAndPassword(String account, String password) {
|
||||||
SysUserExample example = new SysUserExample();
|
SysUserExample example = new SysUserExample();
|
||||||
@ -230,6 +235,13 @@ public class SysUserService implements ISysUserService {
|
|||||||
}
|
}
|
||||||
Page<SysUser> page = (Page<SysUser>) this.sysUserDAO.selectByExample(example);
|
Page<SysUser> page = (Page<SysUser>) this.sysUserDAO.selectByExample(example);
|
||||||
List<UserVO> userVOS = UserVO.convert2VO(page.getResult());
|
List<UserVO> userVOS = UserVO.convert2VO(page.getResult());
|
||||||
|
Map<Integer, CompanyVO> companyMap = iCompanyService.queryOrganizations().stream()
|
||||||
|
.collect(Collectors.toMap(CompanyVO::getId, Function.identity()));
|
||||||
|
userVOS.forEach(user -> {
|
||||||
|
if (user.getCompanyId() != null) {
|
||||||
|
user.setCompanyName(companyMap.get(user.getCompanyId()).getName());
|
||||||
|
}
|
||||||
|
});
|
||||||
return PageVO.convert(page, userVOS);
|
return PageVO.convert(page, userVOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,9 +51,6 @@ public class UserExamService implements IUserExamService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private LsLessonDAO lessonDAO;
|
private LsLessonDAO lessonDAO;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService iSysUserService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public UserExamVO generateExamInstance(long examId, UserVO userVO) {
|
public UserExamVO generateExamInstance(long examId, UserVO userVO) {
|
||||||
@ -73,7 +70,7 @@ public class UserExamService implements IUserExamService {
|
|||||||
// 判断是否在考试时间之内
|
// 判断是否在考试时间之内
|
||||||
if (examDef.getStartTime() != null) {
|
if (examDef.getStartTime() != null) {
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(now.isAfter(examDef.getStartTime())&&now.isBefore(examDef.getEndTime()));
|
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(now.isAfter(examDef.getStartTime()) && now.isBefore(examDef.getEndTime()));
|
||||||
}
|
}
|
||||||
// 保存用户考试信息
|
// 保存用户考试信息
|
||||||
UserExam userExam = new UserExam();
|
UserExam userExam = new UserExam();
|
||||||
@ -89,28 +86,30 @@ public class UserExamService implements IUserExamService {
|
|||||||
ruleExample.createCriteria().andExamIdEqualTo(examId);
|
ruleExample.createCriteria().andExamIdEqualTo(examId);
|
||||||
List<ExamDefinitionRules> rules = this.examDefinitionRulesDAO.selectByExample(ruleExample);
|
List<ExamDefinitionRules> rules = this.examDefinitionRulesDAO.selectByExample(ruleExample);
|
||||||
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionNotEmpty(rules);
|
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionNotEmpty(rules);
|
||||||
for (ExamDefinitionRules rule : rules) {
|
//确认课程存在
|
||||||
// 根据课程所属产品的编码和规则中实训类型查找实训
|
|
||||||
LsLesson lesson = this.lessonDAO.selectByPrimaryKey(examDef.getLessonId());
|
LsLesson lesson = this.lessonDAO.selectByPrimaryKey(examDef.getLessonId());
|
||||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(lesson);
|
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(lesson);
|
||||||
TrainingExample te = new TrainingExample();
|
//查询实训,生成试卷
|
||||||
TrainingExample.Criteria criteria = te.createCriteria()
|
Map<String, Map<String, List<Training>>> trainings = iTrainingService.findEntities(lesson.getMapId(), lesson.getPrdType())
|
||||||
.andMapIdEqualTo(lesson.getMapId())
|
.stream().collect(Collectors.groupingBy(Training::getType, Collectors.groupingBy(Training::getOperateType)));
|
||||||
.andPrdTypeEqualTo(lesson.getPrdType())
|
for (ExamDefinitionRules rule : rules) {
|
||||||
.andTypeEqualTo(rule.getTrainingType());
|
List<Training> collect;
|
||||||
if (StringUtils.hasText(rule.getOperateType())) {
|
if (StringUtils.hasText(rule.getOperateType())) {
|
||||||
criteria.andOperateTypeEqualTo(rule.getOperateType());
|
collect = trainings.get(rule.getTrainingType()).get(rule.getOperateType());
|
||||||
|
} else {
|
||||||
|
collect = new ArrayList<>();
|
||||||
|
for (List<Training> value : trainings.get(rule.getTrainingType()).values()) {
|
||||||
|
collect.addAll(value);
|
||||||
}
|
}
|
||||||
// 符合生成规则的实训
|
}
|
||||||
List<Training> trainings = this.trainingDAO.selectByExample(te);
|
BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(collect.size() > rule.getNum());
|
||||||
BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(trainings.size() > rule.getNum());
|
|
||||||
// 随机生成考试并保存
|
// 随机生成考试并保存
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
List<UserExamQuestionsVO> questionsVOs = new ArrayList<>();
|
List<UserExamQuestionsVO> questionsVOs = new ArrayList<>();
|
||||||
while (flag) {
|
while (flag) {
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
int i = random.nextInt(trainings.size());
|
int i = random.nextInt(collect.size());
|
||||||
Long trainId = trainings.get(i).getId();
|
Long trainId = collect.get(i).getId();
|
||||||
// 保存考试题目
|
// 保存考试题目
|
||||||
UserExamQuestions questions = new UserExamQuestions();
|
UserExamQuestions questions = new UserExamQuestions();
|
||||||
questions.setPoint(rule.getPoint());
|
questions.setPoint(rule.getPoint());
|
||||||
@ -121,10 +120,10 @@ public class UserExamService implements IUserExamService {
|
|||||||
this.userExamQuestionsMapper.insert(questions);
|
this.userExamQuestionsMapper.insert(questions);
|
||||||
// 返回考试题目
|
// 返回考试题目
|
||||||
UserExamQuestionsVO userExamQuestionsVO = new UserExamQuestionsVO(questions);
|
UserExamQuestionsVO userExamQuestionsVO = new UserExamQuestionsVO(questions);
|
||||||
userExamQuestionsVO.setTrainingName(trainings.get(i).getName());
|
userExamQuestionsVO.setTrainingName(collect.get(i).getName());
|
||||||
questionsVOs.add(userExamQuestionsVO);
|
questionsVOs.add(userExamQuestionsVO);
|
||||||
// 从集合中剔除已使用实训
|
// 从集合中剔除已使用实训
|
||||||
trainings.remove(i);
|
collect.remove(i);
|
||||||
if (questionsVOs.size() == rule.getNum()) {
|
if (questionsVOs.size() == rule.getNum()) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
package club.joylink.rtss.services;
|
package club.joylink.rtss.services;
|
||||||
|
|
||||||
|
import club.joylink.rtss.configuration.configProp.WeChatConfig;
|
||||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.rtss.services.cache.ICacheService;
|
import club.joylink.rtss.services.cache.ICacheService;
|
||||||
import club.joylink.rtss.configuration.configProp.WeChatConfig;
|
|
||||||
import club.joylink.rtss.vo.wx.WmUserSession;
|
import club.joylink.rtss.vo.wx.WmUserSession;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -46,7 +45,7 @@ public class WxApiService implements IWxApiService {
|
|||||||
WmUserSession wmUserSession = (WmUserSession) this.iCacheService.get(WmUserSession.getCacheKey(wmCode));
|
WmUserSession wmUserSession = (WmUserSession) this.iCacheService.get(WmUserSession.getCacheKey(wmCode));
|
||||||
if(Objects.isNull(wmUserSession)) {
|
if(Objects.isNull(wmUserSession)) {
|
||||||
wmUserSession = restTemplate.getForObject(weChatConfig.getCode2SessionUrl(wmCode), WmUserSession.class);
|
wmUserSession = restTemplate.getForObject(weChatConfig.getCode2SessionUrl(wmCode), WmUserSession.class);
|
||||||
BusinessExceptionAssertEnum.THIRD_SERVICE_CALL_EXCEPTION.assertHasText(wmUserSession.getOpenid(),
|
BusinessExceptionAssertEnum.WECHAT_CODE_EXPIRED.assertHasText(wmUserSession.getOpenid(),
|
||||||
String.format("小程序code为:‘%s’,微信返回的错误消息:errcode:'%s', errmsg:‘%s’", wmCode, wmUserSession.getErrcode(), wmUserSession.getErrmsg()));
|
String.format("小程序code为:‘%s’,微信返回的错误消息:errcode:'%s', errmsg:‘%s’", wmCode, wmUserSession.getErrcode(), wmUserSession.getErrmsg()));
|
||||||
iCacheService.putExpired(WmUserSession.getCacheKey(wmCode), wmUserSession, 5, TimeUnit.MINUTES);
|
iCacheService.putExpired(WmUserSession.getCacheKey(wmCode), wmUserSession, 5, TimeUnit.MINUTES);
|
||||||
}
|
}
|
||||||
|
@ -180,21 +180,21 @@ public class QuestionBankService implements IQuestionBankService {
|
|||||||
if (questionVO.isSelect() || questionVO.isJudge()) {
|
if (questionVO.isSelect() || questionVO.isJudge()) {
|
||||||
long answerCount = questionVO.getOptionList().stream().filter(QuestionOptionVO::getCorrect).count();
|
long answerCount = questionVO.getOptionList().stream().filter(QuestionOptionVO::getCorrect).count();
|
||||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(answerCount == 1,
|
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(answerCount == 1,
|
||||||
String.format("单选或判断题[%s]正确答案应当有且只有一个!", topic));
|
String.format("题序[%s]:单选或判断题[%s]正确答案应当有且只有一个!", questionVO.getId(),topic));
|
||||||
}
|
}
|
||||||
if (questionVO.isFill() || questionVO.isAnswer()) {
|
if (questionVO.isFill() || questionVO.isAnswer()) {
|
||||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(
|
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(
|
||||||
questionVO.getOptionList().stream().allMatch(QuestionOptionVO::getCorrect),
|
questionVO.getOptionList().stream().allMatch(QuestionOptionVO::getCorrect),
|
||||||
String.format("填空或问答题[%s]不能有错误选项!", topic));
|
String.format("题序[%s]:填空或问答题[%s]不能有错误选项!", questionVO.getId(),topic));
|
||||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(
|
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(
|
||||||
questionVO.getOptionList().stream().noneMatch(op -> Objects.isNull(op.getOrder())),
|
questionVO.getOptionList().stream().noneMatch(op -> Objects.isNull(op.getOrder())),
|
||||||
String.format("填空或问答题[%s]选项缺少序号!", topic));
|
String.format("题序[%s]:填空或问答题[%s]选项缺少序号!", questionVO.getId(),topic));
|
||||||
if (questionVO.getOptionList().stream().anyMatch(op -> Objects.isNull(op.getOrder()))) {
|
if (questionVO.getOptionList().stream().anyMatch(op -> Objects.isNull(op.getOrder()))) {
|
||||||
questionVO.getOptionList().sort(Comparator.comparing(QuestionOptionVO::getOrder));
|
questionVO.getOptionList().sort(Comparator.comparing(QuestionOptionVO::getOrder));
|
||||||
AtomicInteger i = new AtomicInteger(1);
|
AtomicInteger i = new AtomicInteger(1);
|
||||||
questionVO.getOptionList().forEach(o -> {
|
questionVO.getOptionList().forEach(o -> {
|
||||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertEquals(o.getOrder(), i.getAndIncrement(),
|
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertEquals(o.getOrder(), i.getAndIncrement(),
|
||||||
String.format("填空或问答题[%s]选项序号不对!", topic));
|
String.format("题序[%s]:填空或问答题[%s]选项序号不对!", questionVO.getId(), topic));
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -186,5 +186,5 @@ public interface ITrainingV1Service {
|
|||||||
* 根据地图id查询实训
|
* 根据地图id查询实训
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Training> findEntities(Long mapId);
|
List<Training> findEntities(Long mapId, String prdType);
|
||||||
}
|
}
|
||||||
|
@ -689,9 +689,9 @@ public class TrainingV1Service implements ITrainingV1Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Training> findEntities(Long mapId) {
|
public List<Training> findEntities(Long mapId, String prdType) {
|
||||||
TrainingExample example = new TrainingExample();
|
TrainingExample example = new TrainingExample();
|
||||||
example.createCriteria().andMapIdEqualTo(mapId);
|
example.createCriteria().andMapIdEqualTo(mapId).andPrdTypeEqualTo(prdType);
|
||||||
return trainingDAO.selectByExample(example);
|
return trainingDAO.selectByExample(example);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,12 @@ public class UserQueryVO extends PageQueryVO {
|
|||||||
@ApiModelProperty(value = "手机号")
|
@ApiModelProperty(value = "手机号")
|
||||||
private String mobile;
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "单位名称")
|
||||||
|
private String companyId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色
|
* 角色
|
||||||
*/
|
*/
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
package club.joylink.rtss.vo;
|
package club.joylink.rtss.vo;
|
||||||
|
|
||||||
|
import club.joylink.rtss.constants.BusinessConsts;
|
||||||
|
import club.joylink.rtss.entity.SysUser;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import club.joylink.rtss.constants.BusinessConsts;
|
|
||||||
import club.joylink.rtss.entity.SysUser;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -102,6 +102,8 @@ public class UserVO implements Serializable {
|
|||||||
|
|
||||||
private Integer companyId;
|
private Integer companyId;
|
||||||
|
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
public UserVO() {}
|
public UserVO() {}
|
||||||
|
|
||||||
public UserVO(SysUser sysUser) {
|
public UserVO(SysUser sysUser) {
|
||||||
|
Loading…
Reference in New Issue
Block a user