Pārlūkot izejas kodu

考务接口修改

wangliang 5 gadi atpakaļ
vecāks
revīzija
42d5886b19

+ 5 - 2
themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java

@@ -8,6 +8,7 @@ import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.AuthDto;
+import com.qmth.themis.business.entity.TBOrg;
 import com.qmth.themis.business.entity.TBSession;
 import com.qmth.themis.business.entity.TBUser;
 import com.qmth.themis.business.entity.TBUserRole;
@@ -525,7 +526,7 @@ public class TBUserController {
     @RequestMapping(value = "/save", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
-    public Result save(@ApiJsonObject(name = "save", value = {
+    public Result save(@ApiJsonObject(name = "userSave", value = {
             @ApiJsonProperty(key = "id", type = "long", example = "1", description = "新增不需要主键"),
             @ApiJsonProperty(key = "loginName", description = "登录名,新增必须"),
             @ApiJsonProperty(key = "name", description = "姓名,新增必须"),
@@ -541,9 +542,11 @@ public class TBUserController {
         if (Objects.nonNull(roleList) && roleList.size() > 0) {
             roleSet = new HashSet<>(roleList);
         }
-        //todo orgId待从redis取
         if (Objects.isNull(tbUser.getId())) {
+            HttpServletRequest request = ServletUtil.getRequest();
+            TBOrg tbOrg = (TBOrg) ServletUtil.getRequestOrg(request);
             tbUser.setId(Constants.idGen.next());
+            tbUser.setOrgId(tbOrg.getId());
             tbUser.setCreateId(tbUser.getId());
             if (Objects.nonNull(roleSet) && roleSet.size() > 0) {
                 roleSet.forEach(s -> {

+ 5 - 5
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamController.java

@@ -121,10 +121,10 @@ public class TEExamController {
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
     public Result toggle(
-//            @ApiJsonObject(name = "toggle", value = {
-//            @ApiJsonProperty(key = "id", type = "long", example = "1", description = "考试批次ID"),
-//            @ApiJsonProperty(key = "enable", type = "int", example = "1", description = "是否启用")
-//    })
+            @ApiJsonObject(name = "examToggle", value = {
+            @ApiJsonProperty(key = "id", type = "long", example = "1", description = "考试批次ID"),
+            @ApiJsonProperty(key = "enable", type = "int", example = "1", description = "是否启用")
+    })
             @ApiParam(value = "考试批次信息", required = true) @RequestBody Map<String, Object> mapParameter) {
         if (Objects.isNull(mapParameter.get("id")) || Objects.equals(mapParameter.get("id"), "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
@@ -163,7 +163,7 @@ public class TEExamController {
     @RequestMapping(value = "/copy", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
-    public Result copy(@ApiJsonObject(name = "copy", value = {
+    public Result copy(@ApiJsonObject(name = "examCopy", value = {
             @ApiJsonProperty(key = "sourceId", type = "long", example = "1", description = "来源批次ID"),
             @ApiJsonProperty(key = "code", description = "代码"),
             @ApiJsonProperty(key = "name", description = "名称")

+ 4 - 4
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java

@@ -55,10 +55,10 @@ public class TEExamStudentController {
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
     public Result toggle(
-//            @ApiJsonObject(name = "toggle", value = {
-//            @ApiJsonProperty(key = "id", type = "long", example = "1", description = "考生ID"),
-//            @ApiJsonProperty(key = "enable", type = "int", example = "1", description = "是否启用")
-//    })
+            @ApiJsonObject(name = "examStudentToggle", value = {
+            @ApiJsonProperty(key = "id", type = "long", example = "1", description = "考生ID"),
+            @ApiJsonProperty(key = "enable", type = "int", example = "1", description = "是否启用")
+    })
             @ApiParam(value = "考生信息", required = true) @RequestBody Map<String, Object> mapParameter) {
         if (Objects.isNull(mapParameter.get("id")) || Objects.equals(mapParameter.get("id"), "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_ID_IS_NULL);

+ 5 - 5
themis-backend/src/main/java/com/qmth/themis/backend/api/TEStudentController.java

@@ -55,10 +55,10 @@ public class TEStudentController {
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
     public Result toggle(
-//            @ApiJsonObject(name = "toggle", value = {
-//            @ApiJsonProperty(key = "id", type = "long", example = "1", description = "学生ID"),
-//            @ApiJsonProperty(key = "enable", type = "int", example = "1", description = "是否启用")
-//    })
+            @ApiJsonObject(name = "studentToggle", value = {
+            @ApiJsonProperty(key = "id", type = "long", example = "1", description = "学生ID"),
+            @ApiJsonProperty(key = "enable", type = "long", example = "1", description = "是否启用")
+    })
             @ApiParam(value = "学生信息", required = true) @RequestBody Map<String, Object> mapParameter) {
         if (Objects.isNull(mapParameter.get("id")) || Objects.equals(mapParameter.get("id"), "")) {
             throw new BusinessException(ExceptionResultEnum.STUDENT_ID_IS_NULL);
@@ -84,7 +84,7 @@ public class TEStudentController {
     @RequestMapping(value = "/updatePwd", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
     @Transactional
-    public Result updatePwd(@ApiJsonObject(name = "updatePwd", value = {
+    public Result updatePwd(@ApiJsonObject(name = "studentUpdatePwd", value = {
             @ApiJsonProperty(key = "id", type = "long", example = "1", description = "学生ID"),
             @ApiJsonProperty(key = "password", description = "新密码")
     }) @ApiParam(value = "学生信息", required = true) @RequestBody Map<String, Object> mapParameter) {