Commit edb7d68c authored by YangZhaoJun1's avatar YangZhaoJun1

完善

parent b36a2e83
package org.rcisoft.business.texaminfo.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.rcisoft.core.base.BaseMapper;
import org.rcisoft.business.texaminfo.entity.TExamInfo;
import org.apache.ibatis.annotations.ResultMap;
......@@ -29,5 +31,11 @@ public interface TExamInfoRepository extends BaseMapper<TExamInfo> {
@Select("<script>select * from t_exam_info where p_id = #{paperId} and del_flag = 0 and flag = 1 limit 1</script>")
@ResultMap(value = "BaseResultMap" )
TExamInfo selectExamInfoByPid(String paperId);
@Select("<script> select business_id from t_paper where chap_id = #{chapterId} and status = '0' </script>")
List<String> queryPidByChapterId( @Param("chapterId") String chapterId);
@Update("<script> update t_paper set status = '1' where business_id = #{pId} </script>")
void updateStatus( @Param("pId") String pId);
}
......@@ -32,9 +32,12 @@ public class TExamInfo extends IdEntity<TExamInfo> {
private Integer sorder;
private String ip;
public TExamInfo(String pId) {
public TExamInfo(String pId) {
this.pId = pId;
}
}
}
......@@ -131,14 +131,13 @@ public class TQuestionController extends PaginationController<TQuestion> {
@ApiImplicitParams({@ApiImplicitParam(name = "slId", value = "课程ID", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "chapId", value = "章节ID", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "pcompose" , value = "1全部 2本节" , required = true , dataType = "varchar"),
@ApiImplicitParam(name = "composeBeforeUpdate" , value = "修改之前的从属 1 全部 2 本节" , required = false , dataType = "varchar"),
@ApiImplicitParam(name = "composeBeforeUpdate" , value = "是否查询inUse 1是 2否" , required = false , dataType = "varchar"),
@ApiImplicitParam(name = "stateBeforeUpdate" , value = "修改之前的状态 1 随机 2 自主" , required = false , dataType = "varchar"),
@ApiImplicitParam(name = "qtype", value = "题型", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "qtitle", value = "题干关键字", required = false, dataType = "varchar")})
@GetMapping(value = "/queryTQuestions")
@PreAuthorize("hasRole('ROLE_1002')")
public Result queryTQuestion(TQuestion tQuestion) {
//tQuestion.setCreateBy(UserUtil.getUserInfoProp(getToken(),UserUtil.USER_ID));
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
......
......@@ -157,7 +157,7 @@ public class TQuestionServiceImpl implements TQuestionService {
List<TQuestionOptions> options = tQuestionOptionsRepository.queryTQuestionOptions(question.getBusinessId());
question.setOptions(options);
}
if(tQuestion.getStateBeforeUpdate().equals("2")&&(tQuestion.getPcompose().equals(tQuestion.getComposeBeforeUpdate()))){
if(tQuestion.getStateBeforeUpdate().equals("2")&&(tQuestion.getComposeBeforeUpdate().equals("1"))){
for(TQuestion chapterQuestion : chapterQuestions){
//判断是否已被添加
if(question.getBusinessId().equals(chapterQuestion.getBusinessId())){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment