|
@@ -1,7 +1,19 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
|
|
|
import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
|
+import com.ym.mec.biz.dal.entity.Employee;
|
|
|
import com.ym.mec.biz.dal.entity.SysUserCashAccount;
|
|
|
import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
import com.ym.mec.biz.service.ImGroupService;
|
|
@@ -9,13 +21,6 @@ import com.ym.mec.biz.service.PracticeGroupService;
|
|
|
import com.ym.mec.biz.service.PracticeLessonApplyService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
@RequestMapping("api")
|
|
|
@Api(tags = "对外接口")
|
|
|
@RestController
|
|
@@ -26,14 +31,21 @@ public class APIController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private TeacherDao teacherDao;
|
|
|
-
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private EmployeeDao employeeDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
private PracticeLessonApplyService practiceLessonApplyService;
|
|
|
|
|
|
@Autowired
|
|
|
private PracticeGroupService practiceGroupService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ImGroupService imGroupService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@GetMapping("/createCashAccount")
|
|
|
public Boolean createCashAccount(Integer userId) {
|
|
@@ -67,4 +79,27 @@ public class APIController extends BaseController {
|
|
|
return imGroupService.updateNickName(userId,nickName);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/queryOrganIdByUserId")
|
|
|
+ public String queryOrganIdByUserId(Integer userId, String clientId) {
|
|
|
+
|
|
|
+ if (StringUtils.equalsIgnoreCase("system", clientId) || StringUtils.equalsIgnoreCase("education", clientId)) {
|
|
|
+ Employee employee = employeeDao.get(userId);
|
|
|
+ if (employee != null) {
|
|
|
+ return employee.getOrganIdList();
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if (StringUtils.equalsIgnoreCase("teacher", clientId)) {
|
|
|
+ Teacher teacher = teacherDao.get(userId);
|
|
|
+ if (teacher != null) {
|
|
|
+ return teacher.getOrganId() + "";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ if (user != null) {
|
|
|
+ return user.getOrganId() + "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
}
|