|
@@ -8,7 +8,9 @@ import org.fouram.core.util.AppUtil.ResultConstant;
|
|
|
import org.fouram.core.util.LoggerUtil;
|
|
|
import org.fouram.core.util.TreeUtil;
|
|
|
import org.fouram.entity.SapOrg;
|
|
|
+import org.fouram.entity.SapUser;
|
|
|
import org.fouram.service.SapOrgService;
|
|
|
+import org.fouram.service.SapUserService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -20,6 +22,8 @@ public class ApiController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private SapOrgService sapOrgService;
|
|
|
+ @Autowired
|
|
|
+ private SapUserService sapUserService;
|
|
|
|
|
|
@RequestMapping(value = "/getDepartTree", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
@@ -32,4 +36,30 @@ public class ApiController extends BaseController {
|
|
|
return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping(value = "/getDepartListByName", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object getDepartListByName() {
|
|
|
+ try {
|
|
|
+ String name = getPageData().getString("name");
|
|
|
+ List<SapOrg> orgs = sapOrgService.getDepartListByName(name);
|
|
|
+ return AppUtil.success(orgs, null);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LoggerUtil.error(e);
|
|
|
+ return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/getUserListByName", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object getUserListByName() {
|
|
|
+ try {
|
|
|
+ String name = getPageData().getString("name");
|
|
|
+ List<SapUser> users = sapUserService.getUserListByName(name);
|
|
|
+ return AppUtil.success(users, null);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LoggerUtil.error(e);
|
|
|
+ return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|