zouxuan 5 年之前
父節點
當前提交
7211cf1746

+ 3 - 6
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/EduUserFeignService.java

@@ -5,16 +5,13 @@ import com.keao.edu.common.config.FeignConfiguration;
 import com.keao.edu.user.api.client.fallback.EduUserFeignServiceFallback;
 import com.keao.edu.user.api.entity.ExamRoom;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-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.*;
 
 @FeignClient(contextId = "eduUserFeignService", name = "user-server", configuration = { FeignConfiguration.class }, fallback = EduUserFeignServiceFallback.class)
 public interface EduUserFeignService {
 
-	@RequestMapping(value = "examRoom/get", method = RequestMethod.GET)
-	ExamRoom getExamRoom(Integer id);
+	@GetMapping(value = "examRoom/get")
+	ExamRoom getExamRoom(@RequestParam("id") Integer id);
 
 	@PostMapping(value = "student/apply")
 	Object studentApply(@RequestParam("organId") Integer organId, @RequestParam("phone") String phone);

+ 6 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomController.java

@@ -1,7 +1,5 @@
 package com.keao.edu.user.controller;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.keao.edu.auth.api.client.SysUserFeignService;
 import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.controller.BaseController;
@@ -71,4 +69,10 @@ public class ExamRoomController extends BaseController {
         examRoomService.deleteExamRooms(examRoomIds);
         return succeed();
     }
+
+    @ApiModelProperty("获取教室")
+    @GetMapping(value = "/get")
+    public ExamRoom deleteExamRooms(Long id){
+        return examRoomService.get(id);
+    }
 }

+ 3 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/OrganizationServiceImpl.java

@@ -60,10 +60,11 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 		SysUser user = sysUserDao.queryByPhone(sysUser.getPhone());
 		organ.setParentOrganId(queryUserInfo.getId());
 		organ.setLevel(currentOrganization.getLevel() + 1);
-		organ.setParentOrganIdTag(currentOrganization.getParentOrganIdTag() + "," + queryUserInfo.getId());
+
 		if(user != null && user.getId() != null){
 			Organization organization = organDao.get(user.getId());
 			if(organization == null){
+				organ.setParentOrganIdTag(currentOrganization.getParentOrganIdTag() + "," + user.getId());
 				if(StringUtils.isEmpty(user.getPassword())){
 					sysUser.setPassword(new BCryptPasswordEncoder().encode("123456"));
 				}
@@ -91,6 +92,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 		sysUser.setPhone(organ.getContactPhone());
 		sysUserDao.insert(sysUser);
 
+		organ.setParentOrganIdTag(currentOrganization.getParentOrganIdTag() + "," + sysUser.getId());
 		organ.setId(sysUser.getId());
 		organDao.insert(organ);
 		//新增用户角色