修改bug

master
xiaoCJ 8 months ago
parent f87500d77d
commit f0e8ed5125

@ -71,8 +71,7 @@ public class CaseApi {
sysTopicAndCourse.setId(IdUtil.randomUUID());
sysTopicAndCourse.setTopicType("1");
sysTopicAndCourse.setTopicId(uuid);
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneName());
String oneId = sysOneCatalogs.getOneId();
String oneId = sysOneCatalogs1.getOneId();
sysTopicAndCourse.setOneId(oneId);
sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName());
if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) {
@ -98,7 +97,7 @@ public class CaseApi {
@AnonymousAccess
@ApiOperation("案例题页面查询")
@PostMapping("selectCaseList")
public PageInfo<SysCaseQuestion> selectCaseByConditions(@RequestParam Integer index,
public PageInfo<SysCaseQuestion> selectCaseList(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam(required = false) String keyword,
@RequestParam(required = false) String systemOwner,
@ -114,9 +113,21 @@ public class CaseApi {
@AnonymousAccess
@ApiOperation("案例题详细内容展示")
@PostMapping("selectCaseDetails")
public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String caseId) {
return caseQuestionMapper.selectByPrimaryKey(caseId);
public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String 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;
}

@ -1,7 +1,6 @@
package com.sztzjy.resource_center.controller.new_module.admin;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.reflect.TypeToken;
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 java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -231,8 +231,13 @@ public class AdminCaseController {
@RequestParam Integer size,
@RequestParam(required = false) String keyWord,
@ApiParam("精品案例不传,院校案例传'院校案例'") @RequestParam(required = false) String source,
@RequestParam(required = false) List<String> labelName) {
List<AdminCaseReturnDto> adminCaseReturnDtos = adminCaseMapper.selectByConditions(keyWord, source, labelName);
@RequestParam(required = false) String 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);
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.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -24,6 +25,8 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -74,8 +77,13 @@ public class StuCaseController {
@RequestParam(required = false) String keyWord,
@ApiParam("精品案例传管理员院校案例传学校ID") @RequestParam(required = false) String source,
@ApiParam("收藏案例页面传") @RequestParam(required = false) String userId,
@RequestParam(required = false) List<String> labelName) {
List<AdminCaseReturnDto> adminCaseReturnDtos = adminCaseMapper.selectByConditionsByStu(keyWord, source, userId, labelName);
@RequestParam(required = false) String 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);
return new ResultEntity<>(pageInfo);
}

@ -42,10 +42,10 @@ public interface AdminCaseMapper {
List<AdminCaseReturnDto> selectByConditionsByStu(@Param("keyWord") String keyWord,
@Param("source") String source,
@Param("userId") String userId,
@Param("labelName") List<String> labelName);
@Param("labelName") List<String> list);
List<AdminCaseReturnDto> selectByConditions(@Param("keyWord") String keyWord,
@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 * 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
on s.case_id = st.topic_id
<where>
@ -450,7 +452,7 @@
</if>
and s.unmount_status is false
</where>
order by s.create_time
order by s.create_time desc
</select>

Loading…
Cancel
Save