| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.AllArgsConstructor; |
| | | import net.sourceforge.pinyin4j.PinyinHelper; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; |
| | |
| | | import org.springblade.modules.exam.entity.ExamPaper; |
| | | import org.springblade.modules.exam.service.ExamPaperService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | |
| | |
| | | <!--考试报名详情信息--> |
| | | <select id="selectApplyInfo" resultType="org.springblade.modules.apply.vo.ApplyVO"> |
| | | SELECT |
| | | * |
| | | sa.id,sa.user_id userId,sa.candidate_no candidateNo,apply_time,exam_id examId, |
| | | ke.total_score paperScore,ke.exam_type examType,ke.start_time examTime,ke.exam_name examName, |
| | | bu.real_name name, |
| | | bd.dept_name deptName |
| | | FROM |
| | | sys_apply |
| | | sys_apply sa |
| | | left join |
| | | ksxt_exam ke |
| | | on |
| | | sa.exam_id = ke.id |
| | | left join |
| | | blade_user bu |
| | | on |
| | | sa.user_id = bu.id |
| | | left join |
| | | blade_dept bd |
| | | on |
| | | bd.id = bu.dept_id |
| | | WHERE |
| | | 1=1 |
| | | <if test="apply.id!=null"> |
| | |
| | | @PostMapping("/updateExamScore") |
| | | public R updateExamScore(@RequestBody ExamScore examScore) { |
| | | if (null!=examScore.getLearnGrade() && null!=examScore.getTheoryGrade()){ |
| | | examScore.setAllGrade(examScore.getLearnGrade()+examScore.getTheoryGrade()); |
| | | if (examScore.getTheoryGrade()>=60 && examScore.getLearnGrade()>=60){ |
| | | //合格 |
| | | examScore.setQualified(0); |
| | | }else { |
| | | //不合格 |
| | | examScore.setQualified(1); |
| | | } |
| | | int totalSocre = examScore.getLearnGrade()+examScore.getTheoryGrade(); |
| | | examScore.setAllGrade(Math.round(totalSocre/2)); |
| | | } |
| | | return R.status(examScoreService.updateById(examScore)); |
| | | } |
| | |
| | | * 准考证号 |
| | | */ |
| | | @TableField("candidate_no") |
| | | private Long candidateNo; |
| | | private String candidateNo; |
| | | |
| | | /** |
| | | * 理论成绩 |
| | |
| | | @TableField("all_score") |
| | | private Integer allScore; |
| | | |
| | | /** |
| | | * 是否合格 0:合格 1:不合格 2: 暂未录入实操成绩 |
| | | */ |
| | | private Integer qualified; |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | //设置理论得分 |
| | | examScore.setTheoryGrade(theoryGrade); |
| | | //计算总成绩 |
| | | examScore.setAllGrade(theoryGrade + examScore.getLearnGrade()); |
| | | //计算总成绩,此时没有实操成绩,总成绩为实操成绩和理论成绩和的一半 |
| | | examScore.setAllGrade(Math.round(theoryGrade/2)); |
| | | //设置状态 |
| | | if (theoryGrade>=60){ |
| | | examScore.setQualified(2); |
| | | }else { |
| | | examScore.setQualified(1); |
| | | } |
| | | //保存成绩数据 |
| | | int i = baseMapper.insert(examScore); |
| | | if (i>0){ |