理论试题管理代码调整

This commit is contained in:
tiger_zhou 2022-10-09 11:25:51 +08:00
parent 153fed2ef2
commit 4a450b40e7
8 changed files with 123 additions and 122 deletions

View File

@ -24,7 +24,6 @@ import java.util.List;
@RequestMapping(path = "/api/question/org") @RequestMapping(path = "/api/question/org")
public class PagerQuestionBankController { public class PagerQuestionBankController {
@Autowired @Autowired
private PagerQuestionService questionBankService; private PagerQuestionService questionBankService;
@ -33,7 +32,7 @@ public class PagerQuestionBankController {
*/ */
@GetMapping(path = "/paging") @GetMapping(path = "/paging")
public PageVO<PaperQuestionVO> pagingQueryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) { public PageVO<PaperQuestionVO> pagingQueryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) {
queryVO.setCompanyId(loginInfo.getTopOrgId()); queryVO.setOrgId(loginInfo.getTopOrgId());
return questionBankService.pagingQueryQuestions(queryVO,false); return questionBankService.pagingQueryQuestions(queryVO,false);
} }
@ -43,7 +42,7 @@ public class PagerQuestionBankController {
@GetMapping(path = "") @GetMapping(path = "")
public List<PaperQuestionVO> queryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) { public List<PaperQuestionVO> queryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) {
queryVO.setCompanyId(loginInfo.getTopOrgId()); queryVO.setOrgId(loginInfo.getTopOrgId());
return questionBankService.queryQuestions(queryVO,false); return questionBankService.queryQuestions(queryVO,false);
} }
@ -60,7 +59,7 @@ public class PagerQuestionBankController {
*/ */
@PostMapping(path = "") @PostMapping(path = "")
public void addQuestion(@Validated @RequestBody PaperQuestionVO questionVO, @RequestAttribute LoginUserInfoVO loginInfo) { public void addQuestion(@Validated @RequestBody PaperQuestionVO questionVO, @RequestAttribute LoginUserInfoVO loginInfo) {
questionVO.setCompanyId(loginInfo.getTopOrgId()); questionVO.setOrgId(loginInfo.getTopOrgId());
questionBankService.saveOrUpdate(questionVO, loginInfo.getAccountVO()); questionBankService.saveOrUpdate(questionVO, loginInfo.getAccountVO());
} }
@ -107,7 +106,7 @@ public class PagerQuestionBankController {
@PutMapping(path = "/{questionId}") @PutMapping(path = "/{questionId}")
public void updateQuestion(@PathVariable Long questionId, @RequestAttribute LoginUserInfoVO loginInfo, @RequestBody PaperQuestionVO questionVO, @RequestAttribute AccountVO user) { public void updateQuestion(@PathVariable Long questionId, @RequestAttribute LoginUserInfoVO loginInfo, @RequestBody PaperQuestionVO questionVO, @RequestAttribute AccountVO user) {
questionVO.setId(questionId); questionVO.setId(questionId);
questionVO.setCompanyId(loginInfo.getTopOrgId()); questionVO.setOrgId(loginInfo.getTopOrgId());
questionBankService.saveOrUpdate(questionVO, user); questionBankService.saveOrUpdate(questionVO, user);
} }

View File

@ -24,7 +24,7 @@ public interface PaperQuestionDAO {
// " and project_code = #{projectCode} "+ // " and project_code = #{projectCode} "+
// " </otherwise>" + // " </otherwise>" +
// "</choose>" + // "</choose>" +
" and company_id = #{companyId,jdbcType=BIGINT} " + " and org_id = #{companyId,jdbcType=BIGINT} " +
// "<if test=\"companyIdList != null and companyIdList.size > 0\">"+ // "<if test=\"companyIdList != null and companyIdList.size > 0\">"+
// "<foreach collection=\"companyIdList\" open=\" and company_id in (\" close=\")\" item=\"d\" separator=\",\">"+ // "<foreach collection=\"companyIdList\" open=\" and company_id in (\" close=\")\" item=\"d\" separator=\",\">"+
// " #{d} "+ // " #{d} "+

View File

@ -31,27 +31,25 @@ public class PaperQuestion implements Serializable {
*/ */
private LocalDateTime createTime; private LocalDateTime createTime;
/**
* 项目code
*/
private String projectCode;
/** /**
* 公司组织id * 公司组织id
*/ */
private Long companyId; private Long orgId;
/** /**
* 标签 * 标签
*/ */
private String raceLable; private String tags;
/**
* 答案,号隔开
*/
private String questionAnswer;
/** /**
* 是否删除0=1= * 是否删除0=1=
*/ */
private Integer isDel; private Integer isDel;
private String questionAnswer;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -184,7 +184,10 @@ public class PaperQuestionExample {
addCriterion("id not between", value1, value2, "id"); addCriterion("id not between", value1, value2, "id");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andQuestionLike(String value) {
addCriterion("`question` like", value, "question");
return (Criteria) this;
}
public Criteria andTypeIsNull() { public Criteria andTypeIsNull() {
addCriterion("`type` is null"); addCriterion("`type` is null");
return (Criteria) this; return (Criteria) this;
@ -225,10 +228,6 @@ public class PaperQuestionExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTopicLike(String value) {
addCriterion("`topic` like", value, "topic");
return (Criteria) this;
}
public Criteria andTypeLike(String value) { public Criteria andTypeLike(String value) {
addCriterion("`type` like", value, "type"); addCriterion("`type` like", value, "type");
return (Criteria) this; return (Criteria) this;
@ -379,203 +378,203 @@ public class PaperQuestionExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeIsNull() { public Criteria andOrgIdIsNull() {
addCriterion("project_code is null"); addCriterion("org_id is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeIsNotNull() { public Criteria andOrgIdIsNotNull() {
addCriterion("project_code is not null"); addCriterion("org_id is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeEqualTo(String value) { public Criteria andOrgIdEqualTo(Long value) {
addCriterion("project_code =", value, "projectCode"); addCriterion("org_id =", value, "orgId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeNotEqualTo(String value) { public Criteria andOrgIdNotEqualTo(Long value) {
addCriterion("project_code <>", value, "projectCode"); addCriterion("org_id <>", value, "orgId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeGreaterThan(String value) { public Criteria andOrgIdGreaterThan(Long value) {
addCriterion("project_code >", value, "projectCode"); addCriterion("org_id >", value, "orgId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeGreaterThanOrEqualTo(String value) { public Criteria andOrgIdGreaterThanOrEqualTo(Long value) {
addCriterion("project_code >=", value, "projectCode"); addCriterion("org_id >=", value, "orgId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeLessThan(String value) { public Criteria andOrgIdLessThan(Long value) {
addCriterion("project_code <", value, "projectCode"); addCriterion("org_id <", value, "orgId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeLessThanOrEqualTo(String value) { public Criteria andOrgIdLessThanOrEqualTo(Long value) {
addCriterion("project_code <=", value, "projectCode"); addCriterion("org_id <=", value, "orgId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeLike(String value) { public Criteria andOrgIdIn(List<Long> values) {
addCriterion("project_code like", value, "projectCode"); addCriterion("org_id in", values, "orgId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeNotLike(String value) { public Criteria andOrgIdNotIn(List<Long> values) {
addCriterion("project_code not like", value, "projectCode"); addCriterion("org_id not in", values, "orgId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeIn(List<String> values) { public Criteria andOrgIdBetween(Long value1, Long value2) {
addCriterion("project_code in", values, "projectCode"); addCriterion("org_id between", value1, value2, "orgId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeNotIn(List<String> values) { public Criteria andOrgIdNotBetween(Long value1, Long value2) {
addCriterion("project_code not in", values, "projectCode"); addCriterion("org_id not between", value1, value2, "orgId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeBetween(String value1, String value2) { public Criteria andTagsIsNull() {
addCriterion("project_code between", value1, value2, "projectCode"); addCriterion("tags is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProjectCodeNotBetween(String value1, String value2) { public Criteria andTagsIsNotNull() {
addCriterion("project_code not between", value1, value2, "projectCode"); addCriterion("tags is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdIsNull() { public Criteria andTagsEqualTo(String value) {
addCriterion("company_id is null"); addCriterion("tags =", value, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdIsNotNull() { public Criteria andTagsNotEqualTo(String value) {
addCriterion("company_id is not null"); addCriterion("tags <>", value, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdEqualTo(Long value) { public Criteria andTagsGreaterThan(String value) {
addCriterion("company_id =", value, "companyId"); addCriterion("tags >", value, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdNotEqualTo(Long value) { public Criteria andTagsGreaterThanOrEqualTo(String value) {
addCriterion("company_id <>", value, "companyId"); addCriterion("tags >=", value, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdGreaterThan(Long value) { public Criteria andTagsLessThan(String value) {
addCriterion("company_id >", value, "companyId"); addCriterion("tags <", value, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { public Criteria andTagsLessThanOrEqualTo(String value) {
addCriterion("company_id >=", value, "companyId"); addCriterion("tags <=", value, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdLessThan(Long value) { public Criteria andTagsLike(String value) {
addCriterion("company_id <", value, "companyId"); addCriterion("tags like", value, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdLessThanOrEqualTo(Long value) { public Criteria andTagsNotLike(String value) {
addCriterion("company_id <=", value, "companyId"); addCriterion("tags not like", value, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdIn(List<Long> values) { public Criteria andTagsIn(List<String> values) {
addCriterion("company_id in", values, "companyId"); addCriterion("tags in", values, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdNotIn(List<Long> values) { public Criteria andTagsNotIn(List<String> values) {
addCriterion("company_id not in", values, "companyId"); addCriterion("tags not in", values, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdBetween(Long value1, Long value2) { public Criteria andTagsBetween(String value1, String value2) {
addCriterion("company_id between", value1, value2, "companyId"); addCriterion("tags between", value1, value2, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCompanyIdNotBetween(Long value1, Long value2) { public Criteria andTagsNotBetween(String value1, String value2) {
addCriterion("company_id not between", value1, value2, "companyId"); addCriterion("tags not between", value1, value2, "tags");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableIsNull() { public Criteria andQuestionAnswerIsNull() {
addCriterion("race_lable is null"); addCriterion("question_answer is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableIsNotNull() { public Criteria andQuestionAnswerIsNotNull() {
addCriterion("race_lable is not null"); addCriterion("question_answer is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableEqualTo(String value) { public Criteria andQuestionAnswerEqualTo(String value) {
addCriterion("race_lable =", value, "raceLable"); addCriterion("question_answer =", value, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableNotEqualTo(String value) { public Criteria andQuestionAnswerNotEqualTo(String value) {
addCriterion("race_lable <>", value, "raceLable"); addCriterion("question_answer <>", value, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableGreaterThan(String value) { public Criteria andQuestionAnswerGreaterThan(String value) {
addCriterion("race_lable >", value, "raceLable"); addCriterion("question_answer >", value, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableGreaterThanOrEqualTo(String value) { public Criteria andQuestionAnswerGreaterThanOrEqualTo(String value) {
addCriterion("race_lable >=", value, "raceLable"); addCriterion("question_answer >=", value, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableLessThan(String value) { public Criteria andQuestionAnswerLessThan(String value) {
addCriterion("race_lable <", value, "raceLable"); addCriterion("question_answer <", value, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableLessThanOrEqualTo(String value) { public Criteria andQuestionAnswerLessThanOrEqualTo(String value) {
addCriterion("race_lable <=", value, "raceLable"); addCriterion("question_answer <=", value, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableLike(String value) { public Criteria andQuestionAnswerLike(String value) {
addCriterion("race_lable like", value, "raceLable"); addCriterion("question_answer like", value, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableNotLike(String value) { public Criteria andQuestionAnswerNotLike(String value) {
addCriterion("race_lable not like", value, "raceLable"); addCriterion("question_answer not like", value, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableIn(List<String> values) { public Criteria andQuestionAnswerIn(List<String> values) {
addCriterion("race_lable in", values, "raceLable"); addCriterion("question_answer in", values, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableNotIn(List<String> values) { public Criteria andQuestionAnswerNotIn(List<String> values) {
addCriterion("race_lable not in", values, "raceLable"); addCriterion("question_answer not in", values, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableBetween(String value1, String value2) { public Criteria andQuestionAnswerBetween(String value1, String value2) {
addCriterion("race_lable between", value1, value2, "raceLable"); addCriterion("question_answer between", value1, value2, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRaceLableNotBetween(String value1, String value2) { public Criteria andQuestionAnswerNotBetween(String value1, String value2) {
addCriterion("race_lable not between", value1, value2, "raceLable"); addCriterion("question_answer not between", value1, value2, "questionAnswer");
return (Criteria) this; return (Criteria) this;
} }

View File

@ -1,7 +1,6 @@
package club.joylink.rtss.entity.paper.question; package club.joylink.rtss.entity.paper.question;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;
/** /**

View File

@ -36,9 +36,16 @@ public class PagerQuestionService {
@Resource @Resource
private PaperQuestionDAO questionDAO; private PaperQuestionDAO questionDAO;
/**
* 查询列表
* @param queryVO
* @param isPaging
* @param companyIdCanNull 是否允许公司组织id可以为空true=管理使用false = 组织使用
* @return
*/
private Object queryQuestions(QuestionQueryVO queryVO, boolean isPaging,boolean companyIdCanNull){ private Object queryQuestions(QuestionQueryVO queryVO, boolean isPaging,boolean companyIdCanNull){
if(Objects.equals(false,companyIdCanNull)){ if(Objects.equals(false,companyIdCanNull)){
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(queryVO.getCompanyId()),"题目答案不能为空"); BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(queryVO.getOrgId()),"题目答案不能为空");
} }
if(isPaging){ if(isPaging){
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize()); PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
@ -46,14 +53,14 @@ public class PagerQuestionService {
PaperQuestionExample example = new PaperQuestionExample(); PaperQuestionExample example = new PaperQuestionExample();
PaperQuestionExample.Criteria criteria = example.createCriteria(); PaperQuestionExample.Criteria criteria = example.createCriteria();
if (StringUtils.hasText(queryVO.getTopic())) { if (StringUtils.hasText(queryVO.getTopic())) {
criteria.andTopicLike(String.format("%%%s%%", queryVO.getTopic())); criteria.andQuestionLike(String.format("%%%s%%", queryVO.getTopic()));
} }
if (StringUtils.hasText(queryVO.getType())) { if (StringUtils.hasText(queryVO.getType())) {
criteria.andTypeEqualTo(queryVO.getType()); criteria.andTypeEqualTo(queryVO.getType());
} }
if(Objects.nonNull(queryVO.getCompanyId())){ if(Objects.nonNull(queryVO.getOrgId())){
criteria.andCompanyIdEqualTo(queryVO.getCompanyId()); criteria.andOrgIdEqualTo(queryVO.getOrgId());
} }
criteria.andIsDelEqualTo(BusinessConsts.DBLogicDelete.NORMAL.ordinal()); criteria.andIsDelEqualTo(BusinessConsts.DBLogicDelete.NORMAL.ordinal());
return questionDAO.selectByExampleWithBLOBs(example); return questionDAO.selectByExampleWithBLOBs(example);
@ -115,7 +122,6 @@ public class PagerQuestionService {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(newAnswerList.size() == 1 ,"单选,判断题答案只能有一个!"); BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(newAnswerList.size() == 1 ,"单选,判断题答案只能有一个!");
}else if(Objects.equals(BusinessConsts.TheoryType.multi.name(),vo.getType())){ }else if(Objects.equals(BusinessConsts.TheoryType.multi.name(),vo.getType())){
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(newAnswerList.size() > 2 ,"多选题答案最少需要2个"); BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(newAnswerList.size() > 2 ,"多选题答案最少需要2个");
// BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(newAnswerList.size() < optionList.size(),"多选题答案与标准答案数量不匹配");
} }
// List<Integer> sourceOptionList = Lists.newArrayList(); // List<Integer> sourceOptionList = Lists.newArrayList();
// sourceOptionList.addAll(optionList); // sourceOptionList.addAll(optionList);
@ -124,7 +130,7 @@ public class PagerQuestionService {
// return true; // return true;
// } // }
Collections.sort(answerIds); Collections.sort(answerIds);
String answerStr = Joiner.on(",").join(answerIds); String answerStr = Joiner.on(",").skipNulls().join(answerIds);
if(Objects.equals(answerStr,vo.getQuestionAnswer())){ if(Objects.equals(answerStr,vo.getQuestionAnswer())){
return true; return true;
} }
@ -147,13 +153,13 @@ public class PagerQuestionService {
List<Long> ids = this.queryFromProjectCode(projectCode); List<Long> ids = this.queryFromProjectCode(projectCode);
criteria.andCompanyIdIn(ids); criteria.andCompanyIdIn(ids);
}*/ }*/
criteria.andCompanyIdEqualTo(companyId); criteria.andOrgIdEqualTo(companyId);
criteria.andIsDelEqualTo(BusinessConsts.DBLogicDelete.NORMAL.ordinal()); criteria.andIsDelEqualTo(BusinessConsts.DBLogicDelete.NORMAL.ordinal());
List<PaperQuestion> lableList = this.questionDAO.selectByExample(example); List<PaperQuestion> lableList = this.questionDAO.selectByExample(example);
if(CollectionUtils.isEmpty(lableList)){ if(CollectionUtils.isEmpty(lableList)){
return Collections.emptyList(); return Collections.emptyList();
} }
return lableList.stream().map(PaperQuestion::getRaceLable).filter(Objects::nonNull).flatMap(d-> Splitter.on(",").omitEmptyStrings() return lableList.stream().map(PaperQuestion::getTags).filter(Objects::nonNull).flatMap(d-> Splitter.on(",").omitEmptyStrings()
.trimResults().splitToStream(d)).collect(Collectors.toSet()); .trimResults().splitToStream(d)).collect(Collectors.toSet());
} }
@ -183,7 +189,7 @@ public class PagerQuestionService {
* @param accountVO * @param accountVO
*/ */
public void saveOrUpdate(PaperQuestionVO questionVO, AccountVO accountVO) { public void saveOrUpdate(PaperQuestionVO questionVO, AccountVO accountVO) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.isNull(questionVO.getCompanyId()),"组织id不能为空"); BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.isNull(questionVO.getOrgId()),"组织id不能为空");
this.checkQuestionType(questionVO,"题库目前只支持单选,多选和判断"); this.checkQuestionType(questionVO,"题库目前只支持单选,多选和判断");
if (questionVO.isSelect() || questionVO.isJudge()) { if (questionVO.isSelect() || questionVO.isJudge()) {
this.checkQuestionTypeForSelectAndJudge(questionVO,"单选或判断题正确答案有且只有一个!"); this.checkQuestionTypeForSelectAndJudge(questionVO,"单选或判断题正确答案有且只有一个!");
@ -243,7 +249,7 @@ public class PagerQuestionService {
//默认项目导入题考虑是否有单位关联 //默认项目导入题考虑是否有单位关联
PaperQuestionExample example = new PaperQuestionExample(); PaperQuestionExample example = new PaperQuestionExample();
PaperQuestionExample.Criteria criteria = example.createCriteria(); PaperQuestionExample.Criteria criteria = example.createCriteria();
criteria.andCompanyIdEqualTo(companyId); criteria.andOrgIdEqualTo(companyId);
PaperQuestionWithBLOBs pq = new PaperQuestionWithBLOBs(); PaperQuestionWithBLOBs pq = new PaperQuestionWithBLOBs();
pq.setIsDel(BusinessConsts.DBLogicDelete.DELETE.ordinal()); pq.setIsDel(BusinessConsts.DBLogicDelete.DELETE.ordinal());
questionDAO.updateByExampleSelective(pq,example); questionDAO.updateByExampleSelective(pq,example);
@ -253,7 +259,7 @@ public class PagerQuestionService {
// questionVO.setProjectCode(projectCode); // questionVO.setProjectCode(projectCode);
PaperQuestionWithBLOBs question = questionVO.convert2DB(); PaperQuestionWithBLOBs question = questionVO.convert2DB();
// question.setProjectCode(null); // question.setProjectCode(null);
question.setCompanyId(companyId); question.setOrgId(companyId);
question.setCreateUserId(accountVO.getId()); question.setCreateUserId(accountVO.getId());
question.setCreateTime(LocalDateTime.now()); question.setCreateTime(LocalDateTime.now());
questionDAO.insert(question); questionDAO.insert(question);

View File

@ -52,9 +52,9 @@ public class PaperQuestionVO implements Cloneable {
private String createUserName; private String createUserName;
private String projectCode; // private String projectCode;
private Long companyId; private Long orgId;
private String raceLable; private String tags;
private String questionAnswer; private String questionAnswer;
private String answer; private String answer;
@ -68,9 +68,9 @@ public class PaperQuestionVO implements Cloneable {
this.id = question.getId(); this.id = question.getId();
this.type = question.getType(); this.type = question.getType();
this.question = question.getQuestion(); this.question = question.getQuestion();
this.projectCode = question.getProjectCode(); // this.projectCode = question.getProjectCode();
this.companyId = question.getCompanyId(); this.orgId = question.getOrgId();
this.raceLable = question.getRaceLable(); this.tags = question.getTags();
this.optionList = JsonUtils.readCollection(question.getQuestionOption(),ArrayList.class, PaperQuestionOptionVO2.class); this.optionList = JsonUtils.readCollection(question.getQuestionOption(),ArrayList.class, PaperQuestionOptionVO2.class);
String dd = Objects.isNull(question.getQuestionAnswer()) ? "" : question.getQuestionAnswer(); String dd = Objects.isNull(question.getQuestionAnswer()) ? "" : question.getQuestionAnswer();
this.answer = dd; this.answer = dd;
@ -88,8 +88,8 @@ public class PaperQuestionVO implements Cloneable {
question.setId(this.id); question.setId(this.id);
question.setType(type); question.setType(type);
question.setQuestion(this.question); question.setQuestion(this.question);
question.setProjectCode(Project.isDefault(Project.valueOf(projectCode)) ? null : projectCode); // question.setProjectCode(Project.isDefault(Project.valueOf(projectCode)) ? null : projectCode);
question.setCompanyId(companyId); question.setOrgId(this.orgId);
this.setOptionId(question); this.setOptionId(question);
String dd = JsonUtils.writeValueAsString(this.optionList); String dd = JsonUtils.writeValueAsString(this.optionList);
@ -98,7 +98,7 @@ public class PaperQuestionVO implements Cloneable {
listMap.forEach(d->d.remove("correct")); listMap.forEach(d->d.remove("correct"));
question.setQuestionOption(JsonUtils.writeValueAsString(listMap)); question.setQuestionOption(JsonUtils.writeValueAsString(listMap));
question.setRaceLable(this.raceLable); question.setTags(this.tags);
question.setIsDel(BusinessConsts.DBLogicDelete.NORMAL.ordinal()); question.setIsDel(BusinessConsts.DBLogicDelete.NORMAL.ordinal());
// question.setQuestionAnswer(this.answer); // question.setQuestionAnswer(this.answer);
return question; return question;

View File

@ -13,6 +13,6 @@ public class QuestionQueryVO extends PageQueryVO {
private String type; private String type;
// private String projectCode; // private String projectCode;
private Long companyId; private Long orgId;
} }