|
@@ -17,6 +17,7 @@ import org.fouram.entity.SapEmployeeTime;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.google.common.collect.Sets;
|
|
|
|
|
@@ -210,8 +211,17 @@ public class SapCheckService extends BaseService {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- public Object findUserReports(String startDate, String endDate, String departId, String name, String state,
|
|
|
+ public JSONObject findUserReportPage(String startDate, String endDate, String departId, String name, String state,
|
|
|
Integer pageSize, Integer pageNumber) throws Exception {
|
|
|
+ List<Map<String, String>> list = findUserReports(startDate, endDate, departId, name, state, pageSize,
|
|
|
+ pageNumber);
|
|
|
+ List<Map<String, String>> totalList = findUserReports(startDate, endDate, departId, name, state, null, null);
|
|
|
+ return getPageResult(list, totalList.size());
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ public List<Map<String, String>> findUserReports(String startDate, String endDate, String departId, String name,
|
|
|
+ String state, Integer pageSize, Integer pageNumber) throws Exception {
|
|
|
if (StringUtils.isNotBlank(departId) && departId.endsWith(",")) {
|
|
|
departId = departId.substring(0, departId.length() - 1);
|
|
|
}
|
|
@@ -228,10 +238,10 @@ public class SapCheckService extends BaseService {
|
|
|
pd.put("departId", departId);
|
|
|
pd.put("name", name);
|
|
|
pd.put("state", state);
|
|
|
- if(pageSize != null) {
|
|
|
+ if (pageSize != null) {
|
|
|
pd.put("pageCurrent", String.valueOf(pageSize * (pageNumber - 1)));
|
|
|
pd.put("pageSize", String.valueOf(pageSize));
|
|
|
}
|
|
|
- return findList("SapCheckMapper.findUserReports", pd);
|
|
|
+ return (List<Map<String, String>>) findList("SapCheckMapper.findUserReports", pd);
|
|
|
}
|
|
|
}
|