xiatian 4 سال پیش
والد
کامیت
5a93fa9b0d

+ 142 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/exam/StudentBean.java

@@ -0,0 +1,142 @@
+package com.qmth.themis.business.bean.exam;
+
+import java.util.Date;
+
+import com.qmth.themis.business.enums.GenderEnum;
+public class StudentBean  {
+    private Long id;
+
+    private Long createId;
+
+    private Date createTime;
+
+    private Long updateId;
+
+    private Date updateTime;
+    
+    private Long orgId;
+
+    private String identity;
+
+    private String idcardNumber;
+
+    private String mobileNumber;
+
+    private String name;
+
+    private GenderEnum gender;
+
+    private String basePhotoPath;
+
+    private Integer enable;
+
+    public StudentBean() {
+
+    }
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getCreateId() {
+		return createId;
+	}
+
+	public void setCreateId(Long createId) {
+		this.createId = createId;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Long getUpdateId() {
+		return updateId;
+	}
+
+	public void setUpdateId(Long updateId) {
+		this.updateId = updateId;
+	}
+
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public Long getOrgId() {
+		return orgId;
+	}
+
+	public void setOrgId(Long orgId) {
+		this.orgId = orgId;
+	}
+
+	public String getIdentity() {
+		return identity;
+	}
+
+	public void setIdentity(String identity) {
+		this.identity = identity;
+	}
+
+	public String getIdcardNumber() {
+		return idcardNumber;
+	}
+
+	public void setIdcardNumber(String idcardNumber) {
+		this.idcardNumber = idcardNumber;
+	}
+
+	public String getMobileNumber() {
+		return mobileNumber;
+	}
+
+	public void setMobileNumber(String mobileNumber) {
+		this.mobileNumber = mobileNumber;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public GenderEnum getGender() {
+		return gender;
+	}
+
+	public void setGender(GenderEnum gender) {
+		this.gender = gender;
+	}
+
+	public String getBasePhotoPath() {
+		return basePhotoPath;
+	}
+
+	public void setBasePhotoPath(String basePhotoPath) {
+		this.basePhotoPath = basePhotoPath;
+	}
+
+	public Integer getEnable() {
+		return enable;
+	}
+
+	public void setEnable(Integer enable) {
+		this.enable = enable;
+	}
+    
+    
+}

+ 49 - 13
themis-exam/src/main/java/com/qmth/themis/exam/api/TEStudentController.java

@@ -1,17 +1,37 @@
 package com.qmth.themis.exam.api;
 
+import java.security.NoSuchAlgorithmException;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.google.gson.Gson;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
 import com.qmth.themis.business.bean.exam.ExamActivityUnFinishBean;
 import com.qmth.themis.business.bean.exam.ExamUnFinishBean;
+import com.qmth.themis.business.bean.exam.StudentBean;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
 import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
+import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.AuthDto;
 import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
@@ -21,8 +41,20 @@ import com.qmth.themis.business.dto.response.TEExamResultDto;
 import com.qmth.themis.business.entity.TBSession;
 import com.qmth.themis.business.entity.TEConfig;
 import com.qmth.themis.business.entity.TEStudent;
-import com.qmth.themis.business.enums.*;
-import com.qmth.themis.business.service.*;
+import com.qmth.themis.business.enums.ExamModeEnum;
+import com.qmth.themis.business.enums.ExamRecordStatusEnum;
+import com.qmth.themis.business.enums.FinishTypeEnum;
+import com.qmth.themis.business.enums.MqTagEnum;
+import com.qmth.themis.business.enums.MqTopicEnum;
+import com.qmth.themis.business.enums.SystemOperationEnum;
+import com.qmth.themis.business.service.CacheService;
+import com.qmth.themis.business.service.MqDtoService;
+import com.qmth.themis.business.service.TEConfigService;
+import com.qmth.themis.business.service.TEExamActivityService;
+import com.qmth.themis.business.service.TEExamCourseService;
+import com.qmth.themis.business.service.TEExamService;
+import com.qmth.themis.business.service.TEExamStudentService;
+import com.qmth.themis.business.service.TEStudentService;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.business.util.ServletUtil;
 import com.qmth.themis.business.util.SessionUtil;
@@ -36,16 +68,12 @@ import com.qmth.themis.common.signature.SignatureType;
 import com.qmth.themis.common.util.AesUtil;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
-import io.swagger.annotations.*;
-import org.apache.commons.lang3.RandomStringUtils;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.Resource;
-import java.security.NoSuchAlgorithmException;
-import java.util.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
 
 /**
  * @Description: 考生 前端控制器
@@ -85,6 +113,9 @@ public class TEStudentController {
 
     @Resource
     TEExamCourseService teExamCourseService;
+    
+    @Resource
+    SystemConfig systemConfig;
 
     @ApiOperation(value = "学生登录接口")
     @RequestMapping(value = "/login", method = RequestMethod.POST)
@@ -124,13 +155,18 @@ public class TEStudentController {
         if (Objects.isNull(user)) {
             throw new BusinessException(ExceptionResultEnum.STUDENT_NO);
         }
+        StudentBean student=new StudentBean();
+        BeanUtils.copyProperties(user, student);
+        if(StringUtils.isNotBlank(student.getBasePhotoPath())) {
+        	student.setBasePhotoPath(systemConfig.getProperty("aliyun.oss.url") + "/" + student.getBasePhotoPath());
+        }
         String loginPassword = AesUtil.decryptCs7(password, Constants.AES_RULE);
         //密码错误
         String aesPassword = AesUtil.decryptCs7(user.getPassword(), Constants.AES_RULE);
         if (!Objects.equals(loginPassword, aesPassword)) {
             throw new BusinessException(ExceptionResultEnum.PASSWORD_ERROR);
         }
-        return userLoginCommon(user, examId, orgId);
+        return userLoginCommon(student, examId, orgId);
     }
 
     /**
@@ -142,7 +178,7 @@ public class TEStudentController {
      * @return
      * @throws NoSuchAlgorithmException
      */
-    public Result userLoginCommon(TEStudent teStudent, Long examId, Long orgId) throws NoSuchAlgorithmException {
+    public Result userLoginCommon(StudentBean teStudent, Long examId, Long orgId) throws NoSuchAlgorithmException {
         //停用
         if (teStudent.getEnable().intValue() == 0) {
             throw new BusinessException(ExceptionResultEnum.STUDENT_ENABLE);