|
@@ -17,6 +17,7 @@ import org.fouram.entity.SapEmployeeTime;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Sets;
|
|
import com.google.common.collect.Sets;
|
|
|
|
|
|
@@ -211,8 +212,17 @@ public class SapCheckService extends BaseService {
|
|
return false;
|
|
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 {
|
|
Integer pageSize, Integer pageNumber) throws Exception {
|
|
|
|
+ List<Map<String, String>> list = findUserReports(startDate, endDate, departId, name, state, pageSize,
|
|
|
|
+ pageNumber);
|
|
|
|
+ Long total = findUserReportTotal(startDate, endDate, departId, name, state);
|
|
|
|
+ return getPageResult(list, total);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @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(",")) {
|
|
if (StringUtils.isNotBlank(departId) && departId.endsWith(",")) {
|
|
departId = departId.substring(0, departId.length() - 1);
|
|
departId = departId.substring(0, departId.length() - 1);
|
|
}
|
|
}
|
|
@@ -233,6 +243,27 @@ public class SapCheckService extends BaseService {
|
|
pd.put("pageCurrent", String.valueOf(pageSize * (pageNumber - 1)));
|
|
pd.put("pageCurrent", String.valueOf(pageSize * (pageNumber - 1)));
|
|
pd.put("pageSize", String.valueOf(pageSize));
|
|
pd.put("pageSize", String.valueOf(pageSize));
|
|
}
|
|
}
|
|
- return findList("SapCheckMapper.findUserReports", pd);
|
|
|
|
|
|
+ return (List<Map<String, String>>) findList("SapCheckMapper.findUserReports", pd);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public Long findUserReportTotal(String startDate, String endDate, String departId, String name,
|
|
|
|
+ String state) throws Exception {
|
|
|
|
+ if (StringUtils.isNotBlank(departId) && departId.endsWith(",")) {
|
|
|
|
+ departId = departId.substring(0, departId.length() - 1);
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(state)) {
|
|
|
|
+ if ("1".equals(state)) {
|
|
|
|
+ state = "正常";
|
|
|
|
+ } else {
|
|
|
|
+ state = "异常";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Map<String, String> pd = Maps.newHashMap();
|
|
|
|
+ pd.put("startDate", startDate);
|
|
|
|
+ pd.put("endDate", endDate);
|
|
|
|
+ pd.put("departId", departId);
|
|
|
|
+ pd.put("name", name);
|
|
|
|
+ pd.put("state", state);
|
|
|
|
+ return (Long) findObject("SapCheckMapper.findUserReportTotal", pd);
|
|
}
|
|
}
|
|
}
|
|
}
|