|
@@ -20,6 +20,7 @@ import org.fouram.core.util.ExcelExportUtil;
|
|
|
import org.fouram.core.util.LoggerUtil;
|
|
|
import org.fouram.core.util.ResultUtil;
|
|
|
import org.fouram.dto.GetToBeConfirmedListDTO;
|
|
|
+import org.fouram.dto.UpdateResultDTO;
|
|
|
import org.fouram.entity.SapOrg;
|
|
|
import org.fouram.entity.SapUser;
|
|
|
import org.fouram.enums.DelFlagEnum;
|
|
@@ -30,6 +31,7 @@ import org.fouram.service.SapUserService;
|
|
|
import org.fouram.service.WxDepartService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
@@ -42,8 +44,8 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import me.chanjar.weixin.cp.bean.WxCpOauth2UserInfo;
|
|
|
|
|
|
-@Api(value = "API接口")
|
|
|
@Controller
|
|
|
+@Api(value = "API接口")
|
|
|
@RequestMapping(value = "/API")
|
|
|
public class ApiController extends BaseController {
|
|
|
|
|
@@ -63,7 +65,7 @@ public class ApiController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value = "/getAuthUrl", produces = "application/json;charset=utf-8")
|
|
|
+ @PostMapping(value = "/getAuthUrl", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public Object getAuthUrl(String url) {
|
|
|
try {
|
|
@@ -77,7 +79,7 @@ public class ApiController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/wxCpLogin", produces = "application/json;charset=utf-8")
|
|
|
+ @PostMapping(value = "/wxCpLogin", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public void wxCpLogin(String code, String state, HttpServletRequest request, HttpServletResponse response)
|
|
|
throws Exception {
|
|
@@ -98,7 +100,7 @@ public class ApiController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value = "/getChildDepartAndUserListByDepartId", produces = "application/json;charset=utf-8")
|
|
|
+ @PostMapping(value = "/getChildDepartAndUserListByDepartId", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public Object getChildDepartAndUserListByDepartId(HttpServletRequest request) {
|
|
|
if (!isLogin(request)) {
|
|
@@ -130,7 +132,7 @@ public class ApiController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value = "/getDepartAndUserListByName", produces = "application/json;charset=utf-8")
|
|
|
+ @PostMapping(value = "/getDepartAndUserListByName", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public Object getDepartAndUserListByName(HttpServletRequest request) {
|
|
|
if (!isLogin(request)) {
|
|
@@ -153,7 +155,7 @@ public class ApiController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value = "/getUserInfoByUserId", produces = "application/json;charset=utf-8")
|
|
|
+ @PostMapping(value = "/getUserInfoByUserId", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public Object getUserInfoById(HttpServletRequest request) {
|
|
|
if (!isLogin(request)) {
|
|
@@ -173,7 +175,7 @@ public class ApiController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value = "/getQuitUserList", produces = "application/json;charset=utf-8")
|
|
|
+ @PostMapping(value = "/getQuitUserList", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public Object getQuitUserList(HttpServletRequest request) {
|
|
|
if (!isLogin(request)) {
|
|
@@ -187,9 +189,10 @@ public class ApiController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @ApiImplicitParams({ @ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "Integer") })
|
|
|
+ @ApiImplicitParams({ @ApiImplicitParam(name = "name", value = "用户姓名", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "type", value = "同步类型", dataType = "String", paramType = "query") })
|
|
|
@ApiOperation(value = "查询待确认员工列表")
|
|
|
- @RequestMapping(value = "/getToBeConfirmedList", produces = "application/json;charset=utf-8")
|
|
|
+ @PostMapping(value = "/getToBeConfirmedList", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public Object getToBeConfirmedList(HttpServletRequest request, GetToBeConfirmedListDTO dto) {
|
|
|
if (!isLogin(request)) {
|
|
@@ -203,12 +206,46 @@ public class ApiController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query")})
|
|
|
+ @ApiOperation(value = "更新忽略")
|
|
|
+ @PostMapping(value = "/updateIngore", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object updateIngore(HttpServletRequest request, UpdateResultDTO dto) {
|
|
|
+ if (!isLogin(request)) {
|
|
|
+ return AppUtil.error(ResultConstant.NO_TOKEN, ResultConstant.TOKEN_ERR_MSG);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ sapUserService.updateIngore(dto.getUserId());
|
|
|
+ return AppUtil.success();
|
|
|
+ } catch (Exception e) {
|
|
|
+ LoggerUtil.error(e);
|
|
|
+ return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query")})
|
|
|
+ @ApiOperation(value = "更新同步")
|
|
|
+ @PostMapping(value = "/updateSync", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object updateSync(HttpServletRequest request, UpdateResultDTO dto) {
|
|
|
+ if (!isLogin(request)) {
|
|
|
+ return AppUtil.error(ResultConstant.NO_TOKEN, ResultConstant.TOKEN_ERR_MSG);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ sapUserService.updateSync(dto.getUserId());
|
|
|
+ return AppUtil.success();
|
|
|
+ } catch (Exception e) {
|
|
|
+ LoggerUtil.error(e);
|
|
|
+ return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 删除离职员工
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value = "/deleteQuitUserByUserId", produces = "application/json;charset=utf-8")
|
|
|
+ @PostMapping(value = "/deleteQuitUserByUserId", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public Object deleteQuitUserByUserId(HttpServletRequest request) {
|
|
|
if (!isLogin(request)) {
|
|
@@ -247,7 +284,7 @@ public class ApiController extends BaseController {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/findDepartJSON", produces = "application/json;charset=utf-8")
|
|
|
+ @PostMapping(value = "/findDepartJSON", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public Object findDepartJSON(HttpServletRequest request) {
|
|
|
try {
|
|
@@ -258,7 +295,7 @@ public class ApiController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/findUserReports", produces = "application/json;charset=utf-8")
|
|
|
+ @PostMapping(value = "/findUserReports", produces = "application/json;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
public Object findUsers(HttpServletRequest request, @RequestBody FindUsersDTO dto) {
|
|
|
try {
|
|
@@ -274,7 +311,7 @@ public class ApiController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/exportUserReportExcel")
|
|
|
+ @PostMapping(value = "/exportUserReportExcel")
|
|
|
@ResponseBody
|
|
|
public Object exportUserReportExcel(HttpServletResponse response, @RequestBody FindUsersDTO dto) {
|
|
|
try {
|