|
@@ -17,6 +17,7 @@ import org.fouram.core.util.AppUtil.ResultConstant;
|
|
|
import org.fouram.core.util.ConfConfig;
|
|
|
import org.fouram.core.util.LoggerUtil;
|
|
|
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;
|
|
@@ -148,6 +149,50 @@ public class ApiController extends BaseController {
|
|
|
return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询离职员工列表
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/getQuitUserList", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object getQuitUserList(HttpServletRequest request) {
|
|
|
+ if (!isLogin(request)) {
|
|
|
+ return AppUtil.error(ResultConstant.NO_TOKEN, ResultConstant.TOKEN_ERR_MSG);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ return AppUtil.success(sapUserService.selectDeleteList(), null);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LoggerUtil.error(e);
|
|
|
+ return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除离职员工
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/deleteQuitUserByUserId", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object deleteQuitUserByUserId(HttpServletRequest request) {
|
|
|
+ if (!isLogin(request)) {
|
|
|
+ return AppUtil.error(ResultConstant.NO_TOKEN, ResultConstant.TOKEN_ERR_MSG);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ String userId = getPageData().getString("userId");
|
|
|
+ SapUser sapUser = sapUserService.selectByUserId(userId);
|
|
|
+ if(!sapUser.getDelFlag()) {
|
|
|
+ return AppUtil.error("该用户ID不是离职数据");
|
|
|
+ }
|
|
|
+ sapUserService.deleteQuitUserByUserId(userId);
|
|
|
+ return AppUtil.success();
|
|
|
+ } catch (Exception e) {
|
|
|
+ LoggerUtil.error(e);
|
|
|
+ return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 判断是否经过授权
|