Commit d09a6680 by 阳浪

问题排序

parent e76cebb1
......@@ -40,6 +40,10 @@ public interface ResearchQuestionClient {
@PostMapping("/researchQuestion/update")
int batchUpdate(@RequestBody ModifyQuestionModel modifyQuestionModel);
@PostMapping("/researchQuestion/updateNo")
int updateNo(@RequestBody QuestionJumpVo vo);
/**
* 分页查询 一个调研下面的问题
*
......
......@@ -20,6 +20,9 @@ public class QuestionJumpVo {
@ApiModelProperty(value = "根据指定跳题策略时的题号")
private Integer jumpNo;
@ApiModelProperty(value = "题号,不能为空")
private Integer no;
@ApiModelProperty(value = "跳题策略类型 1表示根据选项跳题,2表示指定跳题")
private Integer type;
......
......@@ -91,6 +91,11 @@ public class TrResearchQuestionController {
return researchQuestionService.batchUpdate(model);
}
@PostMapping("/updateNo")
public int updateNo(@RequestBody QuestionJumpVo vo) {
return researchQuestionService.updateNo(vo);
}
/**
* 分页查询 一个调研下面的问题
*
......
......@@ -55,6 +55,8 @@ public interface TrResearchQuestionMapper extends BaseMapper<TrResearchQuestion>
int updateNo(@Param("id") Long id, @Param("jumpNo") Integer jumpNo);
int updateQNoById(@Param("id") Long id, @Param("no") Integer no);
/**
* 选择跳题时的问题列表
*
......
......@@ -138,6 +138,10 @@
update tr_research_question_option set jump_num = -1 where id = #{id}
</update>
<update id="updateQNoById">
update tr_research_question set no = #{no} where id = #{id}
</update>
<!-- 选择跳题时的问题列表 -->
<select id="listAllForJump" resultMap="BaseResultMap">
......
......@@ -39,6 +39,9 @@ public interface ITrResearchQuestionService extends IService<TrResearchQuestion>
*/
int batchUpdate(ModifyQuestionModel modifyQuestionModel) throws Exception;
int updateNo(QuestionJumpVo vo);
/**
* 分页查询调研问题
*
......
......@@ -121,6 +121,14 @@ public class TrResearchQuestionServiceImpl extends ServiceImpl<TrResearchQuestio
}
@Override
public int updateNo(QuestionJumpVo vo){
if(vo.getQuestionId()!=null){
return researchQuestionMapper.updateQNoById(vo.getQuestionId(),vo.getNo());
}
return 0;
}
@Override
public int batchUpdate(ModifyQuestionModel modifyQuestionModel) throws Exception {
int result = 0;
boolean hasOptions = false;
......@@ -790,6 +798,7 @@ public class TrResearchQuestionServiceImpl extends ServiceImpl<TrResearchQuestio
question.setUpdateById(context.getAccountId());
question.setUpdateByName(context.getAccountName());
question.setUpdateTime(date);
question.setNo(vo.getNo());
num = researchQuestionMapper.updateById(question);
} catch (Exception e) {
e.printStackTrace();
......
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