|
@@ -64,7 +64,7 @@ public class SapCheckService extends BaseService {
|
|
|
update("SapCheckMapper.saveCheckoutStart1", null);
|
|
|
update("SapCheckMapper.saveCheckoutStart2", null);
|
|
|
update("SapCheckMapper.saveCheckoutEnd", null);
|
|
|
-
|
|
|
+
|
|
|
// 删除重复数据
|
|
|
updateRepeatCheckDelete();
|
|
|
}
|
|
@@ -240,9 +240,35 @@ public class SapCheckService extends BaseService {
|
|
|
}
|
|
|
return (List<Map<String, String>>) findList("SapCheckMapper.findUserReports", pd);
|
|
|
}
|
|
|
-
|
|
|
- public Long findUserReportTotal(String startDate, String endDate, String departId, String name,
|
|
|
- String state) throws Exception {
|
|
|
+
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ public List<Map<String, String>> selectReportDayList(String startDate, String endDate, String departId, String name)
|
|
|
+ throws Exception {
|
|
|
+ if (StringUtils.isNotBlank(departId) && departId.endsWith(",")) {
|
|
|
+ departId = departId.substring(0, departId.length() - 1);
|
|
|
+ }
|
|
|
+ Map<String, String> pd = Maps.newHashMap();
|
|
|
+ pd.put("startDate", startDate);
|
|
|
+ pd.put("endDate", endDate);
|
|
|
+ pd.put("departId", departId);
|
|
|
+ pd.put("name", name);
|
|
|
+ pd.put("reportDaySql", getReportDaySql(startDate, endDate));
|
|
|
+ return (List<Map<String, String>>) findList("SapCheckMapper.selectReportDayList", pd);
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getReportDaySql(String startDate, String endDate) throws Exception {
|
|
|
+ String baseSql = "replace(group_concat(case when a.checkinDay = '%s' then a.result else '' end ),',','') as '%s',";
|
|
|
+ List<String> days = DateUtil.getSubDateList(startDate, endDate);
|
|
|
+ String reportDaySql = "";
|
|
|
+ for (String day : days) {
|
|
|
+ reportDaySql += String.format(baseSql, day, day);
|
|
|
+ }
|
|
|
+ reportDaySql = reportDaySql.substring(0, reportDaySql.length() - 1);
|
|
|
+ return reportDaySql;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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);
|
|
|
}
|
|
@@ -261,8 +287,8 @@ 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){
|
|
|
+
|
|
|
+ public static JSONObject getPageResult(List<? extends Object> list, Object total) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("total", total);
|
|
|
object.put("data", list);
|