|
@@ -16,6 +16,8 @@ import org.fouram.core.plugin.weixin.cp.core.WXCpMailList;
|
|
import org.fouram.core.util.AppUtil;
|
|
import org.fouram.core.util.AppUtil;
|
|
import org.fouram.core.util.AppUtil.ResultConstant;
|
|
import org.fouram.core.util.AppUtil.ResultConstant;
|
|
import org.fouram.core.util.ConfConfig;
|
|
import org.fouram.core.util.ConfConfig;
|
|
|
|
+import org.fouram.core.util.DateUtil;
|
|
|
|
+import org.fouram.core.util.ExcelExportUtil;
|
|
import org.fouram.core.util.LoggerUtil;
|
|
import org.fouram.core.util.LoggerUtil;
|
|
import org.fouram.entity.SapOrg;
|
|
import org.fouram.entity.SapOrg;
|
|
import org.fouram.entity.SapUser;
|
|
import org.fouram.entity.SapUser;
|
|
@@ -98,8 +100,8 @@ public class ApiController extends BaseController {
|
|
SapOrg sapOrg = null;
|
|
SapOrg sapOrg = null;
|
|
if (StringUtils.isBlank(departId) || WebConstants.TOP_DEPART.toString().equals(departId)) {
|
|
if (StringUtils.isBlank(departId) || WebConstants.TOP_DEPART.toString().equals(departId)) {
|
|
departId = WebConstants.TOP_DEPART.toString();
|
|
departId = WebConstants.TOP_DEPART.toString();
|
|
- sapOrg = SapOrg.builder().id(WebConstants.TOP_DEPART.toString()).sapName(WebConstants.TOP_DEPART_NAME).level("1")
|
|
|
|
- .build();
|
|
|
|
|
|
+ sapOrg = SapOrg.builder().id(WebConstants.TOP_DEPART.toString()).sapName(WebConstants.TOP_DEPART_NAME)
|
|
|
|
+ .level("1").build();
|
|
} else {
|
|
} else {
|
|
sapOrg = sapOrgService.selectById(departId);
|
|
sapOrg = sapOrgService.selectById(departId);
|
|
}
|
|
}
|
|
@@ -156,7 +158,7 @@ public class ApiController extends BaseController {
|
|
return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询离职员工列表
|
|
* 查询离职员工列表
|
|
*
|
|
*
|
|
@@ -175,7 +177,7 @@ public class ApiController extends BaseController {
|
|
return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 删除离职员工
|
|
* 删除离职员工
|
|
*
|
|
*
|
|
@@ -189,11 +191,11 @@ public class ApiController extends BaseController {
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
String userId = getPageData().getString("userId");
|
|
String userId = getPageData().getString("userId");
|
|
- if(StringUtils.isBlank(userId)) {
|
|
|
|
|
|
+ if (StringUtils.isBlank(userId)) {
|
|
return AppUtil.error("参数用户ID不可以为空");
|
|
return AppUtil.error("参数用户ID不可以为空");
|
|
}
|
|
}
|
|
SapUser sapUser = sapUserService.selectByUserId(userId);
|
|
SapUser sapUser = sapUserService.selectByUserId(userId);
|
|
- if(sapUser.getDelFlag().intValue() != DelFlagEnum.UNABLE.intValue()) {
|
|
|
|
|
|
+ if (sapUser.getDelFlag().intValue() != DelFlagEnum.UNABLE.intValue()) {
|
|
return AppUtil.error("该用户ID不是离职数据");
|
|
return AppUtil.error("该用户ID不是离职数据");
|
|
}
|
|
}
|
|
// 操作用户ID
|
|
// 操作用户ID
|
|
@@ -219,7 +221,7 @@ public class ApiController extends BaseController {
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@RequestMapping(value = "/findDepartJSON", produces = "application/json;charset=utf-8")
|
|
@RequestMapping(value = "/findDepartJSON", produces = "application/json;charset=utf-8")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public Object findDepartJSON(HttpServletRequest request) {
|
|
public Object findDepartJSON(HttpServletRequest request) {
|
|
@@ -230,8 +232,7 @@ public class ApiController extends BaseController {
|
|
return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
return AppUtil.error(ResultConstant.WEB_ERR_MSG);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
@RequestMapping(value = "/findUserReports", produces = "application/json;charset=utf-8")
|
|
@RequestMapping(value = "/findUserReports", produces = "application/json;charset=utf-8")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public Object findUsers(HttpServletRequest request) {
|
|
public Object findUsers(HttpServletRequest request) {
|
|
@@ -248,4 +249,25 @@ public class ApiController extends BaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
|
+ @RequestMapping(value = "/exportUserReportExcel")
|
|
|
|
+ public Object exportUserReportExcel() {
|
|
|
|
+ try {
|
|
|
|
+ // 开始时间、结束时间、 部门、姓名
|
|
|
|
+ String startDate = getPageData().getString("startDate");
|
|
|
|
+ String endDate = getPageData().getString("endDate");
|
|
|
|
+ String departId = getPageData().getString("departId");
|
|
|
|
+ String name = getPageData().getString("name");
|
|
|
|
+ Object object = sapCheckService.findUserReports(startDate, endDate, departId, name);
|
|
|
|
+ List<Map<String, Object>> dataList = (List<Map<String, Object>>) object;
|
|
|
|
+ String filePath = "/public/excel/userReport" + DateUtil.getTimeStamp() + ".xlsx";
|
|
|
|
+ String haveFilePath = "/public/excel/userReport.xlsx";
|
|
|
|
+ ExcelExportUtil.exportExcelFile(getRootPath() + haveFilePath, dataList, getRootPath() + filePath, 3);
|
|
|
|
+ return AppUtil.success(filePath, null);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ LoggerUtil.error(e);
|
|
|
|
+ return AppUtil.error(AppUtil.ResultConstant.WEB_ERR_MSG);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|