|
@@ -1,12 +1,26 @@
|
|
|
package com.qmth.themis.backend.api;
|
|
|
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+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.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.qmth.themis.business.annotation.ApiJsonObject;
|
|
|
import com.qmth.themis.business.annotation.ApiJsonProperty;
|
|
|
import com.qmth.themis.business.base.BasePage;
|
|
|
-import com.qmth.themis.business.constant.SystemConstant;
|
|
|
import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
|
|
|
import com.qmth.themis.business.dto.response.TEStudentDto;
|
|
|
import com.qmth.themis.business.dto.response.TEStudentExamRecordDto;
|
|
@@ -14,22 +28,18 @@ import com.qmth.themis.business.entity.TBUser;
|
|
|
import com.qmth.themis.business.entity.TEStudent;
|
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
|
import com.qmth.themis.business.service.TEStudentService;
|
|
|
-import com.qmth.themis.business.util.JacksonUtil;
|
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
|
import com.qmth.themis.business.util.ServletUtil;
|
|
|
import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.themis.common.exception.BusinessException;
|
|
|
import com.qmth.themis.common.util.Result;
|
|
|
import com.qmth.themis.common.util.ResultUtil;
|
|
|
-import io.swagger.annotations.*;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
+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: 学生档案 前端控制器
|
|
@@ -129,4 +139,23 @@ public class TEStudentController {
|
|
|
BasePage basePage = new BasePage(teStudentExamRecordDtoIPage.getRecords(), teStudentExamRecordDtoIPage.getCurrent(), teStudentExamRecordDtoIPage.getSize(), teStudentExamRecordDtoIPage.getTotal());
|
|
|
return ResultUtil.ok(basePage);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "底照上传")
|
|
|
+ @RequestMapping(value = "/photo/upload", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
|
|
|
+ public Result photoUpload(@ApiParam(value = "证件号", required = true) @RequestParam String identity,
|
|
|
+ @ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
|
|
|
+ @ApiParam(value = "md5", required = true) @RequestParam String md5) {
|
|
|
+ if (StringUtils.isBlank(identity)) {
|
|
|
+ throw new BusinessException("证件号不能为空");
|
|
|
+ }
|
|
|
+ if (file==null) {
|
|
|
+ throw new BusinessException("文件不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(md5)) {
|
|
|
+ throw new BusinessException("md5不能为空");
|
|
|
+ }
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ return ResultUtil.ok(teStudentService.photoUpload(tbUser.getOrgId(), identity, file, md5));
|
|
|
+ }
|
|
|
}
|