whb 8 months ago
commit 6139e22fb3

@ -4,6 +4,7 @@ import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.annotation.AnonymousAccess;
import com.sztzjy.resource_center.entity.*; import com.sztzjy.resource_center.entity.*;
import com.sztzjy.resource_center.entity.dto.TrainingDto;
import com.sztzjy.resource_center.mapper.SysCaseQuestionMapper; import com.sztzjy.resource_center.mapper.SysCaseQuestionMapper;
import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper; import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper;
import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; import com.sztzjy.resource_center.mapper.SysOneCatalogMapper;
@ -71,8 +72,7 @@ public class CaseApi {
sysTopicAndCourse.setId(IdUtil.randomUUID()); sysTopicAndCourse.setId(IdUtil.randomUUID());
sysTopicAndCourse.setTopicType("1"); sysTopicAndCourse.setTopicType("1");
sysTopicAndCourse.setTopicId(uuid); sysTopicAndCourse.setTopicId(uuid);
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneName()); String oneId = sysOneCatalogs1.getOneId();
String oneId = sysOneCatalogs.getOneId();
sysTopicAndCourse.setOneId(oneId); sysTopicAndCourse.setOneId(oneId);
sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName()); sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName());
if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) { if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) {
@ -98,11 +98,11 @@ public class CaseApi {
@AnonymousAccess @AnonymousAccess
@ApiOperation("案例题页面查询") @ApiOperation("案例题页面查询")
@PostMapping("selectCaseList") @PostMapping("selectCaseList")
public PageInfo<SysCaseQuestion> selectCaseByConditions(@RequestParam Integer index, public PageInfo<SysCaseQuestion> selectCaseList(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@RequestParam(required = false) String keyword, @RequestParam(required = false) String keyword,
@RequestParam(required = false) String systemOwner, @RequestParam(required = false) String systemOwner,
@RequestParam(required = false) String schoolId) { @RequestParam(required = false) String schoolId) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId(); String oneId = sysOneCatalogs.getOneId();
List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId); List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId);
@ -114,9 +114,21 @@ public class CaseApi {
@AnonymousAccess @AnonymousAccess
@ApiOperation("案例题详细内容展示") @ApiOperation("案例题详细内容展示")
@PostMapping("selectCaseDetails") @PostMapping("selectCaseDetails")
public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String caseId) { public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String caseId,
return caseQuestionMapper.selectByPrimaryKey(caseId); @RequestParam String oneId) {
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andOneIdEqualTo(oneId).andTopicIdEqualTo(caseId);
List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example);
if (sysTopicAndCourses != null && !sysTopicAndCourses.isEmpty()) {
SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0);
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId);
sysCaseQuestion.setTwoId(sysTopicAndCourse.getTwoId());
sysCaseQuestion.setTwoName(sysTopicAndCourse.getTwoName());
sysCaseQuestion.setThreeId(sysTopicAndCourse.getThreeId());
sysCaseQuestion.setThreeName(sysTopicAndCourse.getThreeName());
return sysCaseQuestion;
}
return null;
} }
@ -256,6 +268,7 @@ public class CaseApi {
//案例题步骤内容查看 caseStepId //案例题步骤内容查看 caseStepId
@PostMapping("selectCaseStepDetails") @PostMapping("selectCaseStepDetails")
@ApiOperation("案例题步骤内容查看") @ApiOperation("案例题步骤内容查看")
@AnonymousAccess
public SysCaseQuestionStepWithBLOBs selectCaseStepDetails(@ApiParam("案例题步骤ID") @RequestParam String caseStepId) { public SysCaseQuestionStepWithBLOBs selectCaseStepDetails(@ApiParam("案例题步骤ID") @RequestParam String caseStepId) {
return caseQuestionStepMapper.selectByPrimaryKey(caseStepId); return caseQuestionStepMapper.selectByPrimaryKey(caseStepId);
} }
@ -270,10 +283,17 @@ public class CaseApi {
//案例题步骤内容查看 caseStepId //案例题步骤内容查看 caseStepId
@PostMapping("selectCaseByChapterId") @PostMapping("selectCaseByChapterId")
@ApiOperation("根据三级ID查询案例题集合") @ApiOperation("根据三级ID查询案例题集合")
@AnonymousAccess
public List<SysCaseQuestion> selectCaseByChapterId(@RequestParam String threeId) { public List<SysCaseQuestion> selectCaseByChapterId(@RequestParam String threeId) {
SysCaseQuestionExample example = new SysCaseQuestionExample(); SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andThreeIdEqualTo(threeId); example.createCriteria().andThreeIdEqualTo(threeId);
List<SysCaseQuestion> list = caseQuestionMapper.selectByExample(example); List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example);
List<String> collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getTopicId).collect(Collectors.toList());
SysCaseQuestionExample example1 = new SysCaseQuestionExample();
example1.createCriteria().andCaseIdIn(collect).andSourceEqualTo("管理员");
List<SysCaseQuestion> list = caseQuestionMapper.selectByExampleWithBLOBs(example1);
return list; return list;
} }
@ -286,7 +306,8 @@ public class CaseApi {
*/ */
@PostMapping("selectCaseStepListBatchByIdListAndSort") @PostMapping("selectCaseStepListBatchByIdListAndSort")
@ApiOperation("查询案例题步骤并排序") @ApiOperation("查询案例题步骤并排序")
public List<SysCaseQuestionStepWithBLOBs> selectCaseByChapterId(@RequestParam List<String> caseIdList) { @AnonymousAccess
public List<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdListAndSort(@RequestBody List<String> caseIdList) {
SysCaseQuestionStepExample example = new SysCaseQuestionStepExample(); SysCaseQuestionStepExample example = new SysCaseQuestionStepExample();
example.createCriteria().andCaseIdIn(caseIdList); example.createCriteria().andCaseIdIn(caseIdList);
example.setOrderByClause("sort"); example.setOrderByClause("sort");
@ -303,7 +324,8 @@ public class CaseApi {
*/ */
@PostMapping("selectCaseByChapterIdList") @PostMapping("selectCaseByChapterIdList")
@ApiOperation("根据章节IdList查询案例题") @ApiOperation("根据章节IdList查询案例题")
public List<SysCaseQuestion> selectCaseByChapterIdList(@RequestParam List<String> chapterIdList) { @AnonymousAccess
public List<SysCaseQuestion> selectCaseByChapterIdList(@RequestBody List<String> chapterIdList) {
SysTopicAndCourseExample example = new SysTopicAndCourseExample(); SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andThreeIdIn(chapterIdList); example.createCriteria().andThreeIdIn(chapterIdList);
List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example); List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example);
@ -318,11 +340,46 @@ public class CaseApi {
//*考试模式--成绩报告案例题question0riginal所属章节contentOriginal为考核点数量,Sort为序号 //*考试模式--成绩报告案例题question0riginal所属章节contentOriginal为考核点数量,Sort为序号
@PostMapping("getGradeReportCase") @PostMapping("getGradeReportCase")
@ApiOperation("考试模式/成绩报告/案例题") @ApiOperation("考试模式/成绩报告/案例题")
public List<SysCaseQuestionStepWithBLOBs> getGradeReportCase(@RequestParam List<String> caseIdList, @AnonymousAccess
public List<SysCaseQuestionStepWithBLOBs> getGradeReportCase(@RequestBody List<String> caseIdList,
@RequestParam String schoolId, @RequestParam String schoolId,
@RequestParam String systemOwner) { @RequestParam String systemOwner) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId(); String oneId = sysOneCatalogs.getOneId();
return caseQuestionStepMapper.getGradeReportCase(caseIdList, schoolId, oneId); return caseQuestionStepMapper.getGradeReportCase(caseIdList, schoolId, oneId);
} }
//根据课程ID查询案例题
@PostMapping("selectCaseByCourseId")
@ApiOperation("根据课程ID查询案例题")
@AnonymousAccess //只查学校新增的
public List<SysCaseQuestion> selectCaseByCourseId(@RequestParam String courseId,
@RequestParam String systemOwner,
@RequestParam String schoolId) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId();
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andTwoIdEqualTo(courseId).andOneIdEqualTo(oneId);
List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example);
if (!sysTopicAndCourses.isEmpty()) {
List<String> collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getTopicId).collect(Collectors.toList());
SysCaseQuestionExample example1 = new SysCaseQuestionExample();
example1.createCriteria().andCaseIdIn(collect).andSourceEqualTo(schoolId);
List<SysCaseQuestion> list = caseQuestionMapper.selectByExampleWithBLOBs(example1);
return list;
}
return null;
}
//* 单独接口
//* 展示案例题详细信息
@AnonymousAccess
@ApiOperation("展示案例题详细信息")
@PostMapping("selectTrainingByIds")
public List<TrainingDto> selectTrainingByIds(@RequestBody List<String> caseStepIdList) {
List<TrainingDto> trainingDtos = caseQuestionStepMapper.selectTrainingByIds(caseStepIdList);
return trainingDtos;
}
} }

@ -169,7 +169,7 @@ public class CourseApi {
@AnonymousAccess @AnonymousAccess
@ApiOperation("根据课程IDList查询章节集合并排序") @ApiOperation("根据课程IDList查询章节集合并排序")
@PostMapping("selectChaptersByCourseIdsAndAsc") @PostMapping("selectChaptersByCourseIdsAndAsc")
public List<SysThreeCatalog> selectChaptersByCourseIdsAndAsc(@RequestParam List<String> courseIds) { public List<SysThreeCatalog> selectChaptersByCourseIdsAndAsc(@RequestBody List<String> courseIds) {
SysThreeCatalogExample example = new SysThreeCatalogExample(); SysThreeCatalogExample example = new SysThreeCatalogExample();
example.createCriteria().andTwoIdIn(courseIds); example.createCriteria().andTwoIdIn(courseIds);
example.setOrderByClause("sort"); example.setOrderByClause("sort");
@ -186,7 +186,7 @@ public class CourseApi {
@AnonymousAccess @AnonymousAccess
@ApiOperation("查询总章节数量") @ApiOperation("查询总章节数量")
@PostMapping("getTotalChapterCount") @PostMapping("getTotalChapterCount")
public Integer getTotalChapterCount(String systemOwner) { public Integer getTotalChapterCount(@RequestParam String systemOwner) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId(); String oneId = sysOneCatalogs.getOneId();
return threeCatalogMapper.countByOneId(oneId); return threeCatalogMapper.countByOneId(oneId);
@ -202,7 +202,7 @@ public class CourseApi {
@AnonymousAccess @AnonymousAccess
@ApiOperation("根据章节ID查询章节信息") @ApiOperation("根据章节ID查询章节信息")
@PostMapping("selectChapterByChapterId") @PostMapping("selectChapterByChapterId")
public SysThreeCatalog selectChapterByChapterId(String chapterId) { public SysThreeCatalog selectChapterByChapterId(@RequestParam String chapterId) {
return threeCatalogMapper.selectByPrimaryKey(chapterId); return threeCatalogMapper.selectByPrimaryKey(chapterId);
} }

@ -347,7 +347,7 @@ public class ObjectiveApi {
@AnonymousAccess @AnonymousAccess
@ApiOperation("根据客观题IDList批量查询客观题") @ApiOperation("根据客观题IDList批量查询客观题")
@PostMapping("selectBatchByIdList") @PostMapping("selectBatchByIdList")
private List<SysObjectiveQuestions> selectBatchByIdList(@RequestParam List<String> objectIdList) { private List<SysObjectiveQuestions> selectBatchByIdList(@RequestBody List<String> objectIdList) {
SysObjectiveQuestionsExample example = new SysObjectiveQuestionsExample(); SysObjectiveQuestionsExample example = new SysObjectiveQuestionsExample();
example.createCriteria().andObjectiveIdIn(objectIdList); example.createCriteria().andObjectiveIdIn(objectIdList);
List<SysObjectiveQuestions> sysObjectiveQuestions = sysObjectiveQuestionMapper.selectByExample(example); List<SysObjectiveQuestions> sysObjectiveQuestions = sysObjectiveQuestionMapper.selectByExample(example);
@ -571,18 +571,22 @@ public class ObjectiveApi {
@AnonymousAccess @AnonymousAccess
@ApiOperation("获取所选客观题数量及分数") @ApiOperation("获取所选客观题数量及分数")
@PostMapping("getChooseObjCountAndSorce") @PostMapping("getChooseObjCountAndSorce")
private Map<Integer, BigDecimal> getChooseObjCountAndSorce(@RequestParam List<String> objectIdList) { private Map<String, BigDecimal> getChooseObjCountAndSorce(@RequestBody List<String> objectIdList) {
return sysObjectiveQuestionMapper.getChooseObjCountAndSorce(objectIdList);
Map<String, BigDecimal> chooseObjCountAndSorce = sysObjectiveQuestionMapper.getChooseObjCountAndSorce(objectIdList);
return chooseObjCountAndSorce;
} }
// *根据客观题类型査询客观题 // *根据客观题类型査询客观题
@AnonymousAccess @AnonymousAccess
@ApiOperation("获取所选客观题数量及分数") @ApiOperation("根据客观题类型査询客观题")
@PostMapping("selectObjByType") @PostMapping("selectObjByType")
private List<SysObjectiveQuestions> selectObjByType(@RequestParam String type, private List<SysObjectiveQuestionsDto> selectObjByType(@RequestParam String type,
@RequestParam String schoolId, @RequestParam String schoolId,
@RequestParam String systemOwner) { @RequestParam String systemOwner) {
return sysObjectiveQuestionMapper.selectObjByType(type, schoolId); List<SysObjectiveQuestionsDto> sysObjectiveQuestionsDtos = sysObjectiveQuestionMapper.selectObjByType(type, schoolId);
return sysObjectiveQuestionsDtos;
} }
} }

@ -24,10 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.util.Arrays; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@RestController @RestController
@ -159,14 +156,19 @@ public class ResourceApi {
@AnonymousAccess @AnonymousAccess
@ApiOperation("获取资源类型数量") @ApiOperation("获取资源类型数量")
@PostMapping("getResourceTypeCount") @PostMapping("getResourceTypeCount")
public Map<String, Integer> getResourceTypeCount(@RequestParam String systemOwner, public Map<String, Long> getResourceTypeCount(@RequestParam String systemOwner,
@RequestParam String schoolId) { @RequestParam String schoolId) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
SysResourceAndCourseExample example = new SysResourceAndCourseExample(); SysResourceAndCourseExample example = new SysResourceAndCourseExample();
example.createCriteria().andOneIdEqualTo(sysOneCatalogs.getOneId()); example.createCriteria().andOneIdEqualTo(sysOneCatalogs.getOneId());
List<SysResourceAndCourse> sysResourceAndCourses = sysResourceAndCourseMapper.selectByExample(example); List<SysResourceAndCourse> sysResourceAndCourses = sysResourceAndCourseMapper.selectByExample(example);
List<String> ids = sysResourceAndCourses.stream().map(SysResourceAndCourse::getResourceId).collect(Collectors.toList()); List<String> ids = sysResourceAndCourses.stream().map(SysResourceAndCourse::getResourceId).collect(Collectors.toList());
return sysResourceMapper.getCountByType(ids, schoolId); List<Map<String, Object>> countByType = sysResourceMapper.getCountByType(ids, schoolId);
Map<String, Long> resultMap = new HashMap<>();
for (Map<String, Object> item : countByType) {
resultMap.put(item.get("resource_type").toString(), (Long) item.get("count"));
}
return resultMap;
} }
@ -303,5 +305,4 @@ public class ResourceApi {
@Param("学校ID") @RequestParam String schoolId) { @Param("学校ID") @RequestParam String schoolId) {
return sysResourceMapper.getMostPopularName(); return sysResourceMapper.getMostPopularName();
} }
} }

@ -1,7 +1,6 @@
package com.sztzjy.resource_center.controller.new_module.admin; package com.sztzjy.resource_center.controller.new_module.admin;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
import com.nimbusds.jose.shaded.gson.Gson; import com.nimbusds.jose.shaded.gson.Gson;
@ -29,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -231,8 +231,13 @@ public class AdminCaseController {
@RequestParam Integer size, @RequestParam Integer size,
@RequestParam(required = false) String keyWord, @RequestParam(required = false) String keyWord,
@ApiParam("精品案例不传,院校案例传'院校案例'") @RequestParam(required = false) String source, @ApiParam("精品案例不传,院校案例传'院校案例'") @RequestParam(required = false) String source,
@RequestParam(required = false) List<String> labelName) { @RequestParam(required = false) String labelName) {
List<AdminCaseReturnDto> adminCaseReturnDtos = adminCaseMapper.selectByConditions(keyWord, source, labelName); List<String> list = new ArrayList<>();
if (StringUtils.isNotBlank(labelName)) {
String[] split = labelName.split(",");
list = Arrays.asList(split);
}
List<AdminCaseReturnDto> adminCaseReturnDtos = adminCaseMapper.selectByConditions(keyWord, source, list);
PageInfo pageInfo = PageUtil.pageHelper(adminCaseReturnDtos, index, size); PageInfo pageInfo = PageUtil.pageHelper(adminCaseReturnDtos, index, size);
return new ResultEntity<>(pageInfo); return new ResultEntity<>(pageInfo);
} }

@ -10,6 +10,7 @@ import com.sztzjy.resource_center.entity.admin.*;
import com.sztzjy.resource_center.mapper.admin.AdminDataLabelMapper; import com.sztzjy.resource_center.mapper.admin.AdminDataLabelMapper;
import com.sztzjy.resource_center.mapper.admin.AdminDataMapper; import com.sztzjy.resource_center.mapper.admin.AdminDataMapper;
import com.sztzjy.resource_center.mapper.admin.AdminFileMapper; import com.sztzjy.resource_center.mapper.admin.AdminFileMapper;
import com.sztzjy.resource_center.util.PageUtil;
import com.sztzjy.resource_center.util.ResultEntity; import com.sztzjy.resource_center.util.ResultEntity;
import com.sztzjy.resource_center.util.file.IFileUtil; import com.sztzjy.resource_center.util.file.IFileUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -162,9 +163,8 @@ public class AdminDataController {
@RequestParam(required = false) String keyWord, @RequestParam(required = false) String keyWord,
@ApiParam("精品案例不传院校案例1") @RequestParam(required = false) String type, @ApiParam("精品案例不传院校案例1") @RequestParam(required = false) String type,
@RequestParam(required = false) String labelName) { @RequestParam(required = false) String labelName) {
PageHelper.startPage(index, size);
List<AdminDataReturnDto> adminDataReturnDtos = adminDataMapper.selectByConditions(keyWord, type, labelName); List<AdminDataReturnDto> adminDataReturnDtos = adminDataMapper.selectByConditions(keyWord, type, labelName);
PageInfo pageInfo = new PageInfo(adminDataReturnDtos); PageInfo pageInfo = PageUtil.pageHelper(adminDataReturnDtos, index, size);
return new ResultEntity<>(pageInfo); return new ResultEntity<>(pageInfo);
} }

@ -16,6 +16,7 @@ import com.sztzjy.resource_center.util.file.IFileUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -24,6 +25,8 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -74,8 +77,13 @@ public class StuCaseController {
@RequestParam(required = false) String keyWord, @RequestParam(required = false) String keyWord,
@ApiParam("精品案例传管理员院校案例传学校ID") @RequestParam(required = false) String source, @ApiParam("精品案例传管理员院校案例传学校ID") @RequestParam(required = false) String source,
@ApiParam("收藏案例页面传") @RequestParam(required = false) String userId, @ApiParam("收藏案例页面传") @RequestParam(required = false) String userId,
@RequestParam(required = false) List<String> labelName) { @RequestParam(required = false) String labelName) {
List<AdminCaseReturnDto> adminCaseReturnDtos = adminCaseMapper.selectByConditionsByStu(keyWord, source, userId, labelName); List<String> list = new ArrayList<>();
if (StringUtils.isNotBlank(labelName)) {
String[] split = labelName.split(",");
list = Arrays.asList(split);
}
List<AdminCaseReturnDto> adminCaseReturnDtos = adminCaseMapper.selectByConditionsByStu(keyWord, source, userId, list);
PageInfo pageInfo = PageUtil.pageHelper(adminCaseReturnDtos, index, size); PageInfo pageInfo = PageUtil.pageHelper(adminCaseReturnDtos, index, size);
return new ResultEntity<>(pageInfo); return new ResultEntity<>(pageInfo);
} }

@ -8,6 +8,7 @@ import com.sztzjy.resource_center.entity.admin.*;
import com.sztzjy.resource_center.mapper.admin.AdminCollectDataMapper; import com.sztzjy.resource_center.mapper.admin.AdminCollectDataMapper;
import com.sztzjy.resource_center.mapper.admin.AdminDataMapper; import com.sztzjy.resource_center.mapper.admin.AdminDataMapper;
import com.sztzjy.resource_center.mapper.admin.AdminFileMapper; import com.sztzjy.resource_center.mapper.admin.AdminFileMapper;
import com.sztzjy.resource_center.util.PageUtil;
import com.sztzjy.resource_center.util.ResultEntity; import com.sztzjy.resource_center.util.ResultEntity;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -80,9 +81,8 @@ public class StuDataController {
@ApiParam("为空展示所有数据院校数据传学校ID") @RequestParam(required = false) String source, @ApiParam("为空展示所有数据院校数据传学校ID") @RequestParam(required = false) String source,
@ApiParam("收藏案例页面传") @RequestParam(required = false) String userId, @ApiParam("收藏案例页面传") @RequestParam(required = false) String userId,
@RequestParam(required = false) String labelName) { @RequestParam(required = false) String labelName) {
PageHelper.startPage(index, size); List<AdminDataReturnDto> adminDataReturnDtos = adminDataMapper.selectByConditionsBySchoolId(keyWord, source, userId, labelName);
List<AdminDataReturnDto> adminDataReturnDtos = adminDataMapper.selectByConditionsBySchoolId(keyWord, source, userId, labelName); PageInfo pageInfo = PageUtil.pageHelper(adminDataReturnDtos, index, size);
PageInfo pageInfo = new PageInfo(adminDataReturnDtos);
return new ResultEntity<PageInfo<AdminDataReturnDto>>(pageInfo); return new ResultEntity<PageInfo<AdminDataReturnDto>>(pageInfo);
} }
} }

@ -0,0 +1,24 @@
package com.sztzjy.resource_center.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Author xcj
* @Date 2024/7/22
*/
@Data
public class TrainingDto {
@ApiModelProperty("案例名称")
private String name;
@ApiModelProperty("案例题ID")
private String caseId;
@ApiModelProperty("所属任务")
private String task;
@ApiModelProperty("步骤数量")
private int count;
@ApiModelProperty("案例分值")
private BigDecimal score;
}

@ -5,6 +5,7 @@ import com.sztzjy.resource_center.entity.SysCaseQuestionStepExample;
import com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs; import com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs;
import java.util.List; import java.util.List;
import com.sztzjy.resource_center.entity.dto.TrainingDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
@ -40,4 +41,6 @@ public interface SysCaseQuestionStepMapper {
List<SysCaseQuestionStepWithBLOBs> getGradeReportCase(@Param("list") List<String> caseIdList, List<SysCaseQuestionStepWithBLOBs> getGradeReportCase(@Param("list") List<String> caseIdList,
@Param("schoolId") String schoolId, @Param("schoolId") String schoolId,
@Param("oneId") String oneId); @Param("oneId") String oneId);
List<TrainingDto> selectTrainingByIds(@Param("list") List<String> caseStepIdList);
} }

@ -54,7 +54,7 @@ public interface SysObjectiveQuestionsMapper {
void batchDelete(@Param("list") List<String> ids); void batchDelete(@Param("list") List<String> ids);
Map<Integer, BigDecimal> getChooseObjCountAndSorce(@Param("list") List<String> objectIdList); Map<String, BigDecimal> getChooseObjCountAndSorce(@Param("list") List<String> objectIdList);
List<SysObjectiveQuestions> selectObjByType(@Param("type") String type,@Param("schoolId") String schoolId); List<SysObjectiveQuestionsDto> selectObjByType(@Param("type") String type,@Param("schoolId") String schoolId);
} }

@ -45,7 +45,7 @@ public interface SysResourceMapper {
@Param("threeId") String threeId, @Param("threeId") String threeId,
@Param("resourceName") String resourceName); @Param("resourceName") String resourceName);
Map<String, Integer> getCountByType(@Param("list") List<String> ids, @Param("schoolId") String schoolId); List<Map<String, Object>> getCountByType(@Param("list") List<String> ids, @Param("schoolId") String schoolId);
@Select("SELECT resource_name FROM `sys_resource` ORDER BY count desc") @Select("SELECT resource_name FROM `sys_resource` ORDER BY count desc")
String getMostPopularName(); String getMostPopularName();

@ -42,10 +42,10 @@ public interface AdminCaseMapper {
List<AdminCaseReturnDto> selectByConditionsByStu(@Param("keyWord") String keyWord, List<AdminCaseReturnDto> selectByConditionsByStu(@Param("keyWord") String keyWord,
@Param("source") String source, @Param("source") String source,
@Param("userId") String userId, @Param("userId") String userId,
@Param("labelName") List<String> labelName); @Param("labelName") List<String> list);
List<AdminCaseReturnDto> selectByConditions(@Param("keyWord") String keyWord, List<AdminCaseReturnDto> selectByConditions(@Param("keyWord") String keyWord,
@Param("source") String source, @Param("source") String source,
@Param("labelName") List<String> labelName); @Param("labelName") List<String> list);
} }

@ -435,7 +435,9 @@
<!--条件查询 无重复数据--> <!--条件查询 无重复数据-->
<select id="selectCaseByConditions" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectCaseByConditions" parameterType="java.lang.String" resultMap="BaseResultMap">
select * from sys_case_questions s select st.one_id,st.one_name,st.two_id,st.two_name,st.three_id,st.three_name,
s.case_id,s.title,s.content,s.resource_data,s.source,s.type,s.unmount_status,s.create_time,s.update_time
from sys_case_questions s
left join sys_topic_and_course st left join sys_topic_and_course st
on s.case_id = st.topic_id on s.case_id = st.topic_id
<where> <where>
@ -450,7 +452,7 @@
</if> </if>
and s.unmount_status is false and s.unmount_status is false
</where> </where>
order by s.create_time order by s.create_time desc
</select> </select>

@ -409,4 +409,28 @@
and s2.unmount_status is FALSE and s2.unmount_status is FALSE
GROUP BY s2.title, s3.three_name GROUP BY s2.title, s3.three_name
</select> </select>
<resultMap id="DtoBaseResultMap" type="com.sztzjy.resource_center.entity.dto.TrainingDto">
<result column="title" jdbcType="VARCHAR" property="name"/>
<result column="three_name" jdbcType="VARCHAR" property="task"/>
<result column="case_id" jdbcType="VARCHAR" property="caseId"/>
<result column="total_steps_count" jdbcType="INTEGER" property="count"/>
<result column="total_steps_score" jdbcType="DECIMAL" property="score"/>
<result column="total_steps_score" jdbcType="DECIMAL" property="score"/>
</resultMap>
<select id="selectTrainingByIds" resultMap="DtoBaseResultMap">
SELECT SUM(sqs.score) AS total_steps_score, sqs.case_id,COUNT(sqs.case_step_id) AS total_steps_count, sq.title, s3.three_name
FROM sys_case_question_steps sqs
JOIN sys_case_questions sq ON sqs.case_id = sq.case_id
JOIN sys_topic_and_course s3 ON sq.case_id = s3.topic_id
WHERE sqs.case_id IN
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
GROUP BY sq.title, s3.three_name,sqs.case_id;
</select>
</mapper> </mapper>

@ -477,8 +477,8 @@
</foreach> </foreach>
</delete> </delete>
<select id="selectByList" parameterType="java.util.List" resultType="java.util.Map"> <select id="getChooseObjCountAndSorce" parameterType="java.util.List" resultType="java.util.Map">
SELECT count(*),sum(score)FROM sys_objective_question SELECT count(*),sum(score)FROM sys_objective_questions
WHERE objective_id IN WHERE objective_id IN
<foreach collection="list" separator="," item="id" open="(" close=")"> <foreach collection="list" separator="," item="id" open="(" close=")">
#{id} #{id}
@ -487,7 +487,7 @@
</select> </select>
<select id="selectObjByType" parameterType="java.util.List" resultType="java.util.Map"> <select id="selectObjByType" parameterType="java.lang.String" resultMap="DtoMap">
SELECT s.objective_id, s.content, sc.two_name, three_name SELECT s.objective_id, s.content, sc.two_name, three_name
FROM sys_objective_questions s FROM sys_objective_questions s
LEFT JOIN sys_topic_and_course sc LEFT JOIN sys_topic_and_course sc
@ -496,5 +496,4 @@
and s.is_delete = FALSE and s.is_delete = FALSE
and s.type = #{type} and s.type = #{type}
</select> </select>
</mapper> </mapper>

@ -440,7 +440,7 @@
<foreach close=")" collection="list" index="index" item="item" open="(" separator=","> <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
#{item} #{item}
</foreach> </foreach>
AND source = #{schoolId} AND source in (#{schoolId},'管理员')
GROUP BY resource_type GROUP BY resource_type
</select> </select>

Loading…
Cancel
Save