|
@@ -16,6 +16,7 @@ import org.fouram.entity.SapCheckReport;
|
|
|
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;
|
|
|
|
|
@@ -202,6 +203,14 @@ public class SapCheckService extends BaseService {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ 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);
|
|
|
+ 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 {
|
|
@@ -248,4 +257,11 @@ public class SapCheckService extends BaseService {
|
|
|
pd.put("state", state);
|
|
|
return (Long) findObject("SapCheckMapper.findUserReportTotal", pd);
|
|
|
}
|
|
|
+
|
|
|
+ public static JSONObject getPageResult(List<? extends Object> list, Object total){
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
+ object.put("total", total);// 实际的行数
|
|
|
+ object.put("data", list);// 要以JSON格式返回
|
|
|
+ return object;
|
|
|
+ }
|
|
|
}
|