| | |
| | | IMsgInfoService msgInfoService; |
| | | |
| | | /** |
| | | * 查询列表数据 |
| | | * 查询列表数据 |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @return |
| | |
| | | QExerciseGroup group = QExerciseGroup.exerciseGroup; |
| | | QSubject subject = QSubject.subject; |
| | | |
| | | // 搜索名 |
| | | // 搜索名 |
| | | keyword = StringUtils.isBlank(keyword) ? null : "%"+keyword+"%"; |
| | | |
| | | // 获取查询结果集合 |
| | | // 获取查询结果集合 |
| | | QueryResults<Tuple> results = this.getQueryFactory() |
| | | .select(qEva, group,subject) |
| | | .from(qEva, template, group,subject) |
| | |
| | | .orderBy(qEva.createTime.desc()) |
| | | .fetchResults(); |
| | | |
| | | // 封装参数 |
| | | // 封装参数 |
| | | List<Map<String,Object>> resultLst = |
| | | results.getResults() |
| | | .stream() |
| | |
| | | map.put("createTime", tuple.get(qEva).getCreateTime()); |
| | | map.put("groupId", tuple.get(group).getGroupId()); |
| | | map.put("exerCount", tuple.get(group).getAllCount()); |
| | | map.put("evaluateCount", this.getEvaluateCount(tuple.get(qEva).getEvaluateId()));//已评估人数 |
| | | map.put("evaluateCount", this.getEvaluateCount(tuple.get(qEva).getEvaluateId()));//已评估人数 |
| | | map.put("evaluateAllCount", this |
| | | .queryEvaluateAllCount(tuple.get(qEva).getEvalRangeType(), tuple.get(qEva).getEvalRangeId().split(",")));//应评估人数 |
| | | .queryEvaluateAllCount(tuple.get(qEva).getEvalRangeType(), tuple.get(qEva).getEvalRangeId().split(",")));//应评估人数 |
| | | return map; |
| | | }).collect(Collectors.toList()); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取范围选择 |
| | | * 获取范围选择 |
| | | * |
| | | * type: lesson:课程 class:班级 person:人员 |
| | | * type: lesson:课程 class:班级 person:人员 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | public ResultJson queryRangeList(String type,String searchName) { |
| | | |
| | | List<Tuple> tupleLst = null; |
| | | // 搜索名 |
| | | // 搜索名 |
| | | searchName = StringUtils.isBlank(searchName) ? null : "%"+searchName+"%"; |
| | | |
| | | if(ClientUtils.isAdmin()){// 管理员 |
| | | if(ClientUtils.isAdmin()){// 管理员 |
| | | |
| | | tupleLst = getAdminRangeList(type,searchName); |
| | | }else{// 老师 |
| | | }else{// 老师 |
| | | |
| | | tupleLst = getTeacherRangeList(type,searchName); |
| | | } |
| | | |
| | | // 统一处理返回数据 |
| | | // 统一处理返回数据 |
| | | List<Map<String,Object>> resultLst = tupleLst.stream() |
| | | .map(tuple -> { |
| | | Map<String,Object> map = new HashMap<String,Object>(2); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取管理员范围选择 |
| | | * 获取管理员范围选择 |
| | | * @param type |
| | | * @return |
| | | */ |
| | |
| | | QUser user = QUser.user; |
| | | List<Tuple> tupleLst = null; |
| | | |
| | | if(SchEvaluate.EVALUATE_RANGE_LESSON.equals(type)){//课程 |
| | | if(SchEvaluate.EVALUATE_RANGE_LESSON.equals(type)){//课程 |
| | | |
| | | tupleLst = this.getQueryFactory().select(subject.name.as("name"),subject.subjectId.as("id")).distinct() |
| | | .from(subject) |
| | |
| | | .orderBy(subject.createTime.desc()) |
| | | .fetch(); |
| | | |
| | | }else if(SchEvaluate.EVALUATE_RANGE_CLASS.equals(type)){//班级 |
| | | }else if(SchEvaluate.EVALUATE_RANGE_CLASS.equals(type)){//班级 |
| | | |
| | | tupleLst = this.getQueryFactory().select(cls.name.as("name"),cls.classId.as("id")).distinct() |
| | | .from(cls) |
| | |
| | | .build()) |
| | | .orderBy(cls.createTime.desc()) |
| | | .fetch(); |
| | | }else if(SchEvaluate.EVALUATE_RANGE_PERSON.equals(type)){//人员 |
| | | }else if(SchEvaluate.EVALUATE_RANGE_PERSON.equals(type)){//人员 |
| | | QStuStudent stu = QStuStudent.stuStudent; |
| | | |
| | | tupleLst = this.getQueryFactory().select(user.name.as("name"),user.userId.as("id")).distinct() |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取老师范围选择 |
| | | * 获取老师范围选择 |
| | | * @param type |
| | | * @return |
| | | */ |
| | |
| | | List<Tuple> tupleLst = null; |
| | | String teacherId = teacherService.getTeacherIdByUserId(ClientUtils.getUserId()); |
| | | |
| | | if(SchEvaluate.EVALUATE_RANGE_LESSON.equals(type)){//课程 |
| | | if(SchEvaluate.EVALUATE_RANGE_LESSON.equals(type)){//课程 |
| | | |
| | | tupleLst = this.getQueryFactory().select(subject.name.as("name"),subject.subjectId.as("id")).distinct() |
| | | .from(subject) |
| | |
| | | .orderBy(subject.createTime.desc()) |
| | | .fetch(); |
| | | |
| | | }else if(SchEvaluate.EVALUATE_RANGE_CLASS.equals(type)){//班级 |
| | | }else if(SchEvaluate.EVALUATE_RANGE_CLASS.equals(type)){//班级 |
| | | |
| | | tupleLst = this.getQueryFactory().select(cls.name.as("name"),cls.classId.as("id")).distinct() |
| | | .from(subject, re, cls) |
| | |
| | | .orderBy(subject.createTime.desc()) |
| | | .fetch(); |
| | | |
| | | }else if(SchEvaluate.EVALUATE_RANGE_PERSON.equals(type)){//人员 |
| | | }else if(SchEvaluate.EVALUATE_RANGE_PERSON.equals(type)){//人员 |
| | | QStuStudent stu = QStuStudent.stuStudent; |
| | | |
| | | tupleLst = this.getQueryFactory().select(stu.name.as("name"),stu.userId.as("id")).distinct() |
| | |
| | | } |
| | | |
| | | /** |
| | | * 后台新增评估 |
| | | * 后台新增评估 |
| | | * @param eva |
| | | * @return |
| | | */ |
| | |
| | | public ResultJson addOrUpdateEvaluate(SchEvaluate eva) { |
| | | String evaluateId = eva.getEvaluateId(); |
| | | String groupId = null; |
| | | if(StringUtils.isBlank(evaluateId)){// 新增 |
| | | //1、插入组 |
| | | if(StringUtils.isBlank(evaluateId)){// 新增 |
| | | //1、插入组 |
| | | ExerciseGroup obj = this.insertExerciseGroup(eva.getEvaluateName(), |
| | | ExerciseGroup.TYPE_EXERCISE_TEACH_EVALUATE); |
| | | |
| | | //2、插入评估模板 |
| | | //2、插入评估模板 |
| | | SchEvaluateTemplate objTemplate = new SchEvaluateTemplate(); |
| | | TraceUtils.setCreateTrace(objTemplate); |
| | | objTemplate.setEvaluateTemplateName(eva.getEvaluateName()); |
| | |
| | | objTemplate.setOrgName(ClientUtils.getOrgName()); |
| | | this.save(objTemplate); |
| | | |
| | | // 3、插入评估表 |
| | | // 3、插入评估表 |
| | | eva.setEvalTemplateId(objTemplate.getEvaluateTemplateId()); |
| | | eva.setEvalTemplateName(objTemplate.getEvaluateTemplateName()); |
| | | eva.setEvaluateCount(BigInteger.ZERO); |
| | |
| | | |
| | | evaluateId = eva.getEvaluateId(); |
| | | groupId = obj.getGroupId(); |
| | | }else{// 编辑 |
| | | }else{// 编辑 |
| | | SchEvaluate newEva = this.read(SchEvaluate.class, eva.getEvaluateId()); |
| | | |
| | | newEva.setEvaluateName(eva.getEvaluateName()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * :后台 插入评估模板时调用 |
| | | * :后台 插入评估模板时调用 |
| | | * |
| | | * @param name |
| | | * @param type |
| | |
| | | obj.setAllCount(BigInteger.ZERO); |
| | | this.save(obj); |
| | | |
| | | // 保存 |
| | | // 保存 |
| | | return obj; |
| | | } |
| | | |
| | | /** |
| | | * 查询基本信息 |
| | | * 查询基本信息 |
| | | */ |
| | | @Override |
| | | public ResultJson queryBaseInfo(String evaluateId) { |
| | |
| | | QSchEvaluateTemplate template = QSchEvaluateTemplate.schEvaluateTemplate; |
| | | QExerciseGroup group = QExerciseGroup.exerciseGroup; |
| | | |
| | | // 获取查询结果集合 |
| | | // 获取查询结果集合 |
| | | ExerciseGroup g = this.getQueryFactory() |
| | | .select(group) |
| | | .from(qEva, template, group) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * 删除 |
| | | */ |
| | | @Override |
| | | public ResultJson delete(String evaluateIds){ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 激活 |
| | | * 激活 |
| | | */ |
| | | @Override |
| | | public ResultJson doActive(String evaluateIds){ |
| | |
| | | return new ResultJson(true, "success"); |
| | | } |
| | | |
| | | //发布消息 |
| | | //发布消息 |
| | | private void doSendhMsg(String evaluateId){ |
| | | SchEvaluate evaluate = this.read(SchEvaluate.class,evaluateId); |
| | | |
| | |
| | | Map<String,String> attrs = CollectionUtils.newStringMap("evaluateId",evaluate.getEvaluateId(),"evaluateName",evaluate.getEvaluateName(), |
| | | "templateId",evaluate.getEvalTemplateId(),"evalRangeName",evaluate.getEvalRangeName(),"creator",evaluate.getCreator()); |
| | | |
| | | msgInfoService.doSendTextMsgToUsersLoop(lstUserIds, MsgInfo.TYPE_EVALUATE, "发布了问卷调查", attrs); |
| | | msgInfoService.doSendTextMsgToUsersLoop(lstUserIds, MsgInfo.TYPE_EVALUATE, "发布了问卷调查", attrs); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | *回退 |
| | | *回退 |
| | | */ |
| | | @Override |
| | | public ResultJson doWithdraw(String evaluateIds){ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 复制 |
| | | * 复制 |
| | | */ |
| | | @Override |
| | | public ResultJson doCopy(SchEvaluate eva){ |
| | |
| | | SchEvaluate schEva = evaRepository.getOne(eva.getEvaluateId()); |
| | | SchEvaluateTemplate oldTemplate = this.read(SchEvaluateTemplate.class, schEva.getEvalTemplateId()); |
| | | |
| | | // 1、生成习题组 |
| | | // 1、生成习题组 |
| | | String newGroupId = exerciseService.doCopyExerciseByEvaluate(oldTemplate.getGroupId()); |
| | | |
| | | // 2、生成模板 |
| | | // 2、生成模板 |
| | | SchEvaluateTemplate newTemplate = new SchEvaluateTemplate(); |
| | | |
| | | BeanUtils.copyProperties(newTemplate, oldTemplate); |
| | |
| | | TraceUtils.setCreateTrace(newTemplate); |
| | | this.save(newTemplate); |
| | | |
| | | // 3、生成评估表 |
| | | // 3、生成评估表 |
| | | SchEvaluate newEva = new SchEvaluate(); |
| | | BeanUtils.copyProperties(newEva, eva); |
| | | newEva.setEvaluateId(null); |
| | |
| | | return new ResultJson(true, "success", CollectionUtils.newObjectMap("evaluateId", newEva.getEvaluateId(), "groupId", newGroupId)); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("doCopy评估复制:复制练习BeanUtils.copyProperties()方法copy失败", e); |
| | | log.error("doCopy评估复制:复制练习BeanUtils.copyProperties()方法copy失败", e); |
| | | } |
| | | |
| | | return new ResultJson(false); |
| | | } |
| | | |
| | | /** |
| | | * 查看结果 问卷整体情况 |
| | | * 查看结果 问卷整体情况 |
| | | * @param evaluateId |
| | | * @param groupId |
| | | * @param evalRangeType |
| | |
| | | @Override |
| | | public ResultJson queryEvaluateDetail(String evaluateId,String groupId){ |
| | | |
| | | // 1、查询已提交问卷list |
| | | // 1、查询已提交问卷list |
| | | List<Map<String, Object>> answerUserLst = queryAnswerEvaLst(evaluateId); |
| | | |
| | | // 已经答题过的学员id |
| | | // 已经答题过的学员id |
| | | List<String> userAnswerList = new ArrayList<String>(answerUserLst.size()); |
| | | for(Map<String,Object> map:answerUserLst){ |
| | | userAnswerList.add(String.valueOf(map.get("userId"))); |
| | | } |
| | | |
| | | // 2、查询未提交答案list |
| | | // 2、查询未提交答案list |
| | | List<Map<String,Object>> notAnswerUserLst = this.queryNotAnswerEvaLst(evaluateId, userAnswerList); |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询已答题的学员list |
| | | * 查询已答题的学员list |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询未答题的学员list |
| | | * 查询未答题的学员list |
| | | * @param rangeType |
| | | * @param evalRangeIds |
| | | * @param userAnswerList |
| | |
| | | QSubject qSubject = QSubject.subject; |
| | | |
| | | Predicate predicate = null; |
| | | if(SchEvaluate.EVALUATE_RANGE_LESSON.equals(rangeType)){//课程 |
| | | if(SchEvaluate.EVALUATE_RANGE_LESSON.equals(rangeType)){//课程 |
| | | |
| | | predicate = stu.classId.in(getQueryFactory().select(re.classId).from(re,qSubject) |
| | | .where(qSubject.origSubjectId.in(evalRangeIds).and(re.subjectId.eq(qSubject.subjectId)) |
| | | .and(qSubject.deleteFlag.isFalse()).and(re.deleteFlag.eq(false)))); |
| | | }else if(SchEvaluate.EVALUATE_RANGE_CLASS.equals(rangeType)){//班级 |
| | | }else if(SchEvaluate.EVALUATE_RANGE_CLASS.equals(rangeType)){//班级 |
| | | |
| | | predicate = stu.classId.in(evalRangeIds); |
| | | }else if(SchEvaluate.EVALUATE_RANGE_PERSON.equals(rangeType)){//人员 |
| | | }else if(SchEvaluate.EVALUATE_RANGE_PERSON.equals(rangeType)){//人员 |
| | | |
| | | predicate = stu.userId.in(evalRangeIds); |
| | | } |
| | | |
| | | List<Map<String,Object>> notAnswerUserLst = this.getQueryFactory().select(stu.userId, stu.name).distinct() |
| | | .from(stu) |
| | | .where(stu.userId.notIn(userAnswerList)// 过滤掉已经答题过的学员 |
| | | .where(stu.userId.notIn(userAnswerList)// 过滤掉已经答题过的学员 |
| | | .and(stu.deleteFlag.eq(false)) |
| | | .and(predicate)) |
| | | .orderBy(stu.createTime.desc()) |
| | |
| | | } |
| | | |
| | | |
| | | /** ------前端 ---------------------------start------------------------------------------------------------------ */ |
| | | /** ------前端 ---------------------------start------------------------------------------------------------------ */ |
| | | |
| | | /** |
| | | * 提交答案 |
| | | * 提交答案 |
| | | * @param score |
| | | * @return |
| | | */ |
| | |
| | | List<TeachEvaScoreData> lstScore = scoreResult.getItems(); |
| | | String evaluateId = scoreResult.getEvaluateId(); |
| | | |
| | | // 1.操作ExerciseRecord做题记录 |
| | | // 1.操作ExerciseRecord做题记录 |
| | | ExerciseRecord record = this.doOperExerciseRecord(scoreResult); |
| | | |
| | | if(null == record){ |
| | | return new ResultJson(false,"您已经提交,不能重复提交"); |
| | | return new ResultJson(false,"您已经提交,不能重复提交"); |
| | | } |
| | | String exerciseRecordId = record.getRecordId(); |
| | | |
| | | if(!scoreResult.getItems().isEmpty()){ |
| | | // 2.记录练习答案 ExerciseItemAnswerU |
| | | // 2.记录练习答案 ExerciseItemAnswerU |
| | | this.doOperExerciseItemAnswerUBatch(lstScore, exerciseRecordId); |
| | | } |
| | | |
| | | // 3.插入评估记录关联表 |
| | | // 3.插入评估记录关联表 |
| | | this.doOperSchEvaRecordRe(exerciseRecordId, evaluateId); |
| | | |
| | | // 4.更新评估表的完成人数 |
| | | // 4.更新评估表的完成人数 |
| | | SchEvaluate eval = this.updateEvaluateCount(evaluateId); |
| | | |
| | | if(!scoreResult.getItems().isEmpty()){ |
| | | // 5.插入评估明细表 |
| | | // 5.插入评估明细表 |
| | | this.insertEvaluateDetailBatch(lstScore,evaluateId); |
| | | } |
| | | |
| | | return new ResultJson(true, "操作成功", |
| | | return new ResultJson(true, "操作成功", |
| | | CollectionUtils.newObjectMap("doNumber", eval.getEvaluateCount(), "recordId", exerciseRecordId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 操作本次做题记录 |
| | | * 操作本次做题记录 |
| | | * @return |
| | | */ |
| | | public ExerciseRecord doOperExerciseRecord(TeachEvaScoreResult scoreResult) { |
| | |
| | | |
| | | String doCount = String.valueOf(scoreResult.getItems().size()); |
| | | |
| | | // 2.查询总题目数 |
| | | // 2.查询总题目数 |
| | | ExerciseGroup group = this.findUnique("select g from ExerciseGroup g,SchEvaluate e,SchEvaluateTemplate t " |
| | | + "where g.groupId=t.groupId and e.evalTemplateId=t.evaluateTemplateId and e.evaluateId=?" |
| | | + " and g.deleteFlag is false and e.deleteFlag is false ", |
| | | CollectionUtils.newList(scoreResult.getEvaluateId()), ExerciseGroup.class); |
| | | BigInteger allCount = group.getAllCount(); |
| | | |
| | | // 3.查询做题记录obj |
| | | // 3.查询做题记录obj |
| | | BigDecimal completionRate = ExerciseUtils.parseStrToBigDecimal(doCount, String.valueOf(allCount)); |
| | | |
| | | ExerciseRecord record = new ExerciseRecord(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 批量增加或修改练习记录答案 |
| | | * 批量增加或修改练习记录答案 |
| | | * @return |
| | | */ |
| | | public Result doOperExerciseItemAnswerUBatch(List<TeachEvaScoreData> lstScore, String exerciseRecordId) { |
| | | String userId = ClientUtils.getUserId(); |
| | | |
| | | List<ExerciseItemAnswerU> lstNewAnswerU = new ArrayList<ExerciseItemAnswerU>(lstScore.size()); |
| | | // 组装答案记录 |
| | | // 组装答案记录 |
| | | ExerciseItemAnswerU answerU = null; |
| | | for(TeachEvaScoreData score:lstScore){ |
| | | if(StringUtils.isBlank(score.getAnswer())){ |
| | |
| | | lstNewAnswerU.add(answerU); |
| | | } |
| | | |
| | | // 批量保存 |
| | | // 批量保存 |
| | | this.saveOrUpdateAll(lstNewAnswerU); |
| | | |
| | | return new Result(true); |
| | | } |
| | | |
| | | /** |
| | | * 批量增加或修改评估明细记录 |
| | | * 批量增加或修改评估明细记录 |
| | | * @return |
| | | */ |
| | | public Result insertEvaluateDetailBatch(List<TeachEvaScoreData> lstScore,String evaluateId) { |
| | |
| | | lstDetail.add(record); |
| | | } |
| | | |
| | | // 批量保存 |
| | | // 批量保存 |
| | | this.saveOrUpdateAll(lstDetail); |
| | | |
| | | return new Result(true); |
| | | } |
| | | |
| | | /** |
| | | * 新增评估与记录关联表 |
| | | * 新增评估与记录关联表 |
| | | * @param groupId |
| | | * @return |
| | | */ |
| | |
| | | SchEvaRecordRe record = new SchEvaRecordRe(); |
| | | record.setEvaluateId(evaluateId); |
| | | record.setExerciseRecordId(recordId); |
| | | //记录答题所在班级 |
| | | //记录答题所在班级 |
| | | if(null != ClientUtils.getUserInfo()){ |
| | | record.setClassId(ClientUtils.getClassId()); |
| | | record.setOrgId(ClientUtils.getOrgId()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 更新评估表记录 |
| | | * 更新评估表记录 |
| | | * @return |
| | | */ |
| | | public SchEvaluate updateEvaluateCount(String evaluateId) { |
| | |
| | | record.setEvaluateCount(BigInteger.valueOf(this.getEvaluateCount(evaluateId))); |
| | | TraceUtils.setUpdateTrace(record); |
| | | |
| | | // 保存 |
| | | // 保存 |
| | | this.save(record); |
| | | |
| | | return record; |
| | | } |
| | | |
| | | /** |
| | | * 查询问卷统计 |
| | | * 查询问卷统计 |
| | | * @param groupId |
| | | * @param evaluateId |
| | | * @return |
| | |
| | | lstExerciseItemAnswerU.add(objExerciseItemAnswerU); |
| | | } |
| | | |
| | | // 查询答案 |
| | | // 查询答案 |
| | | objExerciseItem.setExerciseItemAnswerU(lstExerciseItemAnswerU); |
| | | } |
| | | } |
| | | objSchEvaluate.setEvaluateCount(BigInteger.valueOf(this.getEvaluateCount(evaluateId))); |
| | | // 查询应评估总人数 |
| | | // 查询应评估总人数 |
| | | objSchEvaluate.setEvaluateAllCount(BigInteger.valueOf(this |
| | | .queryEvaluateAllCount(objSchEvaluate.getEvalRangeType(),objSchEvaluate.getEvalRangeId().split(",")))); |
| | | |
| | | //拼装前端所需要的数据 |
| | | //拼装前端所需要的数据 |
| | | Map<String, Object> resultMap = |
| | | ExerciseUtils.packageExerciseDetail(items, objSchEvaluate); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询应评估人数 |
| | | * 查询应评估人数 |
| | | * @param rangeType |
| | | * @param evalRangeIds |
| | | * @return |
| | |
| | | QSubject qSubject = QSubject.subject; |
| | | |
| | | Predicate predicate = null; |
| | | if(SchEvaluate.EVALUATE_RANGE_LESSON.equals(rangeType)){//课程 |
| | | if(SchEvaluate.EVALUATE_RANGE_LESSON.equals(rangeType)){//课程 |
| | | |
| | | predicate = stu.classId.in(getQueryFactory().select(re.classId).from(re,qSubject) |
| | | .where(qSubject.origSubjectId.in(evalRangeIds).and(re.subjectId.eq(qSubject.subjectId)) |
| | | .and(qSubject.deleteFlag.isFalse()).and(re.deleteFlag.eq(false)))); |
| | | }else if(SchEvaluate.EVALUATE_RANGE_CLASS.equals(rangeType)){//班级 |
| | | }else if(SchEvaluate.EVALUATE_RANGE_CLASS.equals(rangeType)){//班级 |
| | | |
| | | predicate = stu.classId.in(evalRangeIds); |
| | | }else if(SchEvaluate.EVALUATE_RANGE_PERSON.equals(rangeType)){//人员 |
| | | }else if(SchEvaluate.EVALUATE_RANGE_PERSON.equals(rangeType)){//人员 |
| | | |
| | | return evalRangeIds.length; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取问卷答卷人数 |
| | | * 获取问卷答卷人数 |
| | | * |
| | | * @param schEvaluateId |
| | | * @param classId |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询学生评估list |
| | | * 查询学生评估list |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询学生评估count |
| | | * 查询学生评估count |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取评估题目 |
| | | * 获取评估题目 |
| | | * @param templateId |
| | | * @param status |
| | | * @param exerciseRecordId |
| | |
| | | + "where t.evaluateTemplateId=e.evalTemplateId and e.evaluateId=?", |
| | | CollectionUtils.newList(evaluateId),String.class); |
| | | |
| | | // 2.查找评估组下所有对应的练习 |
| | | // 2.查找评估组下所有对应的练习 |
| | | String hql_item = "select item" |
| | | + " from ExerciseItem item, ExerciseGroupItemRe re, ExerciseGroup g" |
| | | + " where item.exerciseId=re.exerciseItemId " |
| | |
| | | |
| | | List<ExerciseItem> lstItems = this.find(hql_item, CollectionUtils.newList(groupId), ExerciseItem.class); |
| | | if(lstItems.isEmpty()){ |
| | | return new ResultJson(false,"当前评估未添加题目"); |
| | | return new ResultJson(false,"当前评估未添加题目"); |
| | | } |
| | | //查询用户所填答案 |
| | | //查询用户所填答案 |
| | | List<ExerciseItemAnswerU> lstUserAnswer = null; |
| | | String exerciseRecordId = this.findUnique("select r.recordId from SchEvaRecordRe re, ExerciseRecord r " |
| | | + "where re.exerciseRecordId=r.recordId and re.evaluateId=? and r.deleteFlag is false and r.userId = ?", |
| | |
| | | String hql_options = "select o from ExerciseItemAnswerU o where o.exerciseRecordId = ? and o.deleteFlag is false"; |
| | | lstUserAnswer = this.find(hql_options, CollectionUtils.newList(exerciseRecordId), ExerciseItemAnswerU.class); |
| | | } |
| | | // 2.1.组装参数 用于查询问卷选项图片 |
| | | // 2.1.组装参数 用于查询问卷选项图片 |
| | | Map<String, Object> argsImgMap = new HashMap<String, Object>(); |
| | | String argImgs = ""; |
| | | Map<String, Object> argsMap = new HashMap<String, Object>(); |
| | |
| | | } |
| | | argsMap.put("exerciseIds", args); |
| | | argsImgMap.put("optionIds", argImgs.split(";")); |
| | | // 2-3-1查询题目是否关联图片 |
| | | // 2-3-1查询题目是否关联图片 |
| | | String hql_itemImgs = "from ExerciseObjectImg where exerciseObjectId in (:exerciseIds) and deleteFlag is false and objectType=1 order by exerciseObjectId,imgOrder "; |
| | | List<ExerciseObjectImg> lstItemImgs = this.findByComplexHql(hql_itemImgs, argsMap, ExerciseObjectImg.class); |
| | | // 2-3-2查询题目选项是否关联图片 |
| | | // 2-3-2查询题目选项是否关联图片 |
| | | String hql_optionImgs = "from ExerciseObjectImg where exerciseObjectId in (:optionIds) and deleteFlag is false and objectType=2"; |
| | | List<ExerciseObjectImg> lstOptionImgs = this.findByComplexHql(hql_optionImgs, argsImgMap, ExerciseObjectImg.class); |
| | | |
| | | // 重新组装练习选项 |
| | | // 重新组装练习选项 |
| | | ExerciseUtils.packageExerciseItem(lstItems, lstUserAnswer, lstOptionImgs); |
| | | |
| | | Map<String, List<ExerciseObjectImg>> imgItemMap = ExerciseUtils.packageExerciseItemImg(lstItemImgs); |
| | | |
| | | for(ExerciseItem item:lstItems){ |
| | | // 4.5题目中是否有图片 |
| | | // 4.5题目中是否有图片 |
| | | if(imgItemMap.get(item.getExerciseId()) != null){ |
| | | item.setImgs(imgItemMap.get(item.getExerciseId())); |
| | | } |