|
@@ -6,6 +6,7 @@ import java.util.Map;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.fouram.core.base.service.BaseService;
|
|
|
import org.fouram.core.util.DateUtil;
|
|
|
+import org.fouram.dto.input.FindUsersDTO;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -15,11 +16,9 @@ import com.google.common.collect.Maps;
|
|
|
@Service
|
|
|
public class SapCheckReportService extends BaseService {
|
|
|
|
|
|
- public JSONObject findUserReportPage(String startDate, String endDate, String departId, String name, String state,
|
|
|
- Integer pageSize, Integer pageNumber) throws Exception {
|
|
|
- List<Map<String, Object>> list = findUserReports(startDate, endDate, departId, name, state, pageSize,
|
|
|
- pageNumber);
|
|
|
- Long total = findUserReportTotal(startDate, endDate, departId, name, state);
|
|
|
+ public JSONObject findUserReportPage(FindUsersDTO dto) throws Exception {
|
|
|
+ List<Map<String, Object>> list = findUserReports(dto);
|
|
|
+ Long total = findUserReportTotal(dto);
|
|
|
return getPageResult(list, total);
|
|
|
}
|
|
|
|
|
@@ -31,8 +30,14 @@ public class SapCheckReportService extends BaseService {
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- public List<Map<String, Object>> findUserReports(String startDate, String endDate, String departId, String name,
|
|
|
- String state, Integer pageSize, Integer pageNumber) throws Exception {
|
|
|
+ public List<Map<String, Object>> findUserReports(FindUsersDTO dto) throws Exception {
|
|
|
+ String startDate = dto.getStartDate();
|
|
|
+ String endDate = dto.getEndDate();
|
|
|
+ String departId = dto.getDepartId();
|
|
|
+ String name = dto.getName();
|
|
|
+ String state = dto.getStatus();
|
|
|
+ Integer pageSize = dto.getPageSize();
|
|
|
+ Integer pageNumber = dto.getPageNumber();
|
|
|
if (StringUtils.isNotBlank(departId) && departId.endsWith(",")) {
|
|
|
departId = departId.substring(0, departId.length() - 1);
|
|
|
}
|
|
@@ -87,10 +92,10 @@ public class SapCheckReportService extends BaseService {
|
|
|
for (int i = 0; i < result.size(); i++) {
|
|
|
int count = 0;
|
|
|
for (String vkey : list.get(i).keySet()) {
|
|
|
- if(count >= 5) {
|
|
|
+ if (count >= 5) {
|
|
|
result.get(i).put(vkey, list.get(i).get(vkey));
|
|
|
}
|
|
|
- count ++;
|
|
|
+ count++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -128,8 +133,12 @@ public class SapCheckReportService extends BaseService {
|
|
|
return reportDaySql;
|
|
|
}
|
|
|
|
|
|
- public Long findUserReportTotal(String startDate, String endDate, String departId, String name, String state)
|
|
|
- throws Exception {
|
|
|
+ public Long findUserReportTotal(FindUsersDTO dto) throws Exception {
|
|
|
+ String startDate = dto.getStartDate();
|
|
|
+ String endDate = dto.getEndDate();
|
|
|
+ String departId = dto.getDepartId();
|
|
|
+ String name = dto.getName();
|
|
|
+ String state = dto.getStatus();
|
|
|
if (StringUtils.isNotBlank(departId) && departId.endsWith(",")) {
|
|
|
departId = departId.substring(0, departId.length() - 1);
|
|
|
}
|