测评设置,试题查看

hehai
mzh820631607 4 years ago
parent db0af09c4e
commit b4d53f2f5b
  1. 1
      src/main/java/com/msdw/tms/controller/UserController.java
  2. 3
      src/main/java/com/msdw/tms/dao/QuestionsDao.java
  3. 38
      src/main/java/com/msdw/tms/entity/vo/personalFile.java
  4. 16
      src/main/java/com/msdw/tms/service/impl/EvaluationRulesServiceImpl.java
  5. 9
      src/main/resources/mapper/tms/QuestionsDao.xml

@ -57,7 +57,6 @@ public class UserController implements UserControllerApi {
/**
* 保存
*/
@Override
@PostMapping("/save")
public R save(@RequestBody UserEntity userEntity){
userService.save(userEntity);

@ -17,4 +17,7 @@ import java.util.List;
@Mapper
public interface QuestionsDao extends BaseMapper<QuestionsEntity> {
List<Integer> selectIds(@Param("questionType") Integer questionType);
Integer countTotalMultipleNum();
Integer countTotalJudgmentNum();
}

@ -0,0 +1,38 @@
package com.msdw.tms.entity.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Data
@TableName("hr_personal_file")
public class personalFile {
//个人档案
@TableId(type = IdType.AUTO)
private Integer personalFileId;
//个人职业
private Integer personalCareerId;
//学校id
private Integer schoolId;
//学校名称
private String schoolName;
//绑定学科id
private Integer disciplineId;
//绑定学科名称
private String disciplineName;
//绑定专业类id
private Integer professionalClassId;
//绑定专业类名称
private String professionalClassName;
//绑定专业id
private Integer professionalId;
//绑定专业名称
private String professionalName;
//绑定用户id
private Integer userId;
//修改时间
private String updatetime;
}

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.msdw.tms.common.exception.ExceptionCast;
import com.msdw.tms.common.utils.Constant;
import com.msdw.tms.dao.EvaluationRulesDao;
import com.msdw.tms.dao.QuestionsDao;
import com.msdw.tms.entity.EvaluationRulesEntity;
import com.msdw.tms.entity.QuestionsEntity;
import com.msdw.tms.entity.response.CommonCode;
@ -12,6 +13,7 @@ import com.msdw.tms.entity.vo.EvaluationRulesVO;
import com.msdw.tms.service.EvaluationRulesService;
import com.msdw.tms.service.QuestionsService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -22,6 +24,8 @@ public class EvaluationRulesServiceImpl extends ServiceImpl<EvaluationRulesDao,
@Resource
QuestionsService questionsService;
@Autowired
private QuestionsDao questionsDao;
//TODO 此表数据可存在redis中,提高系统性能
@Override
@ -54,13 +58,15 @@ public class EvaluationRulesServiceImpl extends ServiceImpl<EvaluationRulesDao,
.eq("is_enable", Constant.IsEnable.ENABLE.getType()); //启用
evaluationRulesVO.setTotalQuestionNum(questionsService.count(queryWrapper));//总题数
int totalSingleNum = questionsService.count(queryWrapper.eq("question_type",
Constant.QuestionType.SINGLE_CHOICE.getType()));//单选题总数
int totalMultipleNum = questionsService.count(queryWrapper.eq("question_type",
Constant.QuestionType.MULTIPLE_CHOICE.getType()));//多选题总数
int totalJudgmentNum = questionsService.count(queryWrapper.eq("question_type",
Constant.QuestionType.TRUE_OR_FALSE.getType()));//判断题总数
// int totalMultipleNum = questionsService.count(queryWrapper.eq("question_type",
// Constant.QuestionType.MULTIPLE_CHOICE.getType()));//多选题总数
// int totalJudgmentNum = questionsService.count(queryWrapper.eq("question_type",
// Constant.QuestionType.TRUE_OR_FALSE.getType()));//判断题总数
// 2020.09.28
int totalMultipleNum = questionsDao.countTotalMultipleNum();
int totalJudgmentNum = questionsDao.countTotalJudgmentNum();
evaluationRulesVO.setTotalSingleNum(totalSingleNum);
evaluationRulesVO.setTotalMultipleNum(totalMultipleNum);

@ -37,4 +37,13 @@
and question_type = #{questionType}
</if>
</select>
<!--2020.09.28-->
<select id="countTotalMultipleNum" resultType="int">
SELECT COUNT( 1 ) FROM tms_questions WHERE is_del = 0 AND is_enable = 1 AND question_type = 2
</select>
<select id="countTotalJudgmentNum" resultType="int">
SELECT COUNT( 1 ) FROM tms_questions WHERE is_del = 0 AND is_enable = 1 AND question_type = 3
</select>
</mapper>
Loading…
Cancel
Save