Просмотр исходного кода

考勤查询功能。。。。。。

zhaoxian 4 лет назад
Родитель
Сommit
e97996858c

+ 17 - 0
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -732,6 +732,23 @@ public class DateUtils extends PropertyEditorSupport {
     }
 
 
+    public static String getLastDay(String time) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar calendar = Calendar.getInstance();
+        Date date = null;
+        try {
+            date = sdf.parse(time);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        calendar.setTime(date);
+        int day = calendar.get(Calendar.DATE);
+        //                      此处修改为+1则是获取后一天
+        calendar.set(Calendar.DATE, day - 1);
+
+        String lastDay = sdf.format(calendar.getTime());
+        return lastDay;
+    }
     private static Calendar zeroFromHour(long milliseconds) {
         Calendar calendar = Calendar.getInstance(); // 获得一个日历
 

+ 1 - 1
jeecg-boot-module-system/src/main/resources/logback-test.xml

@@ -50,7 +50,7 @@
     <logger name="net.sh.rgface.serive" level="ERROR"/>
 
     <!-- 日志输出级别 -->
-    <root level="INFO">
+    <root level="DEBUF">
         <appender-ref ref="console"/>
         <appender-ref ref="rollingFile"/>
     </root>

+ 3 - 5
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -19,7 +19,6 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskServ
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
-import cn.com.ctop.oa.modules.entity.WechatAttendance;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
 import cn.com.ctop.oa.modules.service.IWechatDepartmentService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
@@ -41,7 +40,6 @@ import java.text.ParseException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -95,12 +93,12 @@ public class SampleTest {
 //        wechatDepartment.getDepartment();
 //        wechatUserInfoService.getUserList();
 //        wechatCheckinDataService.getCheckinData();
-//        wechatNoListService.getNoDateByNo("1598889600","1600927780");
+        wechatNoListService.getNoDateByNo("1598889600", "1601049600");
 
-        Map<String, Object> map = new HashMap<String, Object>();
+        /*Map<String, Object> map = new HashMap<String, Object>();
         map.put("departId", "9");
         List<WechatAttendance> wechatAttendances = wechatNoListService.queryAttendanceData( map);
-        System.out.println(wechatAttendances);
+        System.out.println(wechatAttendances);*/
         //         kuaishouInterfaceService.getSuZaoList("a34853c230e1b949eddbe569023dbc40", 7022550L, 1, "2020-09-15", "2020-09-16");
 
     }

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/utils/ExportExcelUtils.java

@@ -157,7 +157,7 @@ public class ExportExcelUtils {
                 //迟到时间超过15分钟的考勤记录判断
                 boolean changeColor = false;
                 if (m.contains("迟到")) {
-                    String duration = String.valueOf(m.get(m.size() - 1));
+                    String duration = String.valueOf(m.get(m.size() - 2));
                     if (!Check.isNull(duration) && Integer.valueOf(duration.replace(" min", "")) - 15 > 0) {
                         changeColor = true;
                     }

+ 43 - 6
module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatNoListController.java

@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -267,15 +268,15 @@ public class WechatNoListController {
      * @param requestBody
      * @param response
      */
-    @GetMapping("/excel")
+    @PostMapping("/excel")
     public void getExcelReport(HttpServletResponse response) {
         Map<String, Object> paramsMap = new HashMap<>();
         List<WechatAttendance> excelData = wechatNoListService.queryAttendanceData(paramsMap);
         List<WechatAttendance> overtimeData = wechatNoListService.queryOverTimeData(paramsMap);
-        if (excelData.isEmpty()||overtimeData.isEmpty()) {
+        if (excelData.isEmpty() || overtimeData.isEmpty()) {
             return;
         }
-        String[] titles = {"姓名", "部门", "考勤日期", "考勤类型", "考勤状态", "考勤时间", "审核状态", "状态时长","审批状态"};
+        String[] titles = {"姓名", "部门", "考勤日期", "考勤类型", "考勤状态", "考勤时间", "审核状态", "状态时长", "审批状态"};
         String[] overtimeTitles = {"姓名", "部门", "加班日期", "加班时长"};
         List<List<Object>> excelList = new ArrayList<>();
         List<List<Object>> overtimeExcelList = new ArrayList<>();
@@ -289,9 +290,9 @@ public class WechatNoListController {
             temp.add(data.getCheckinTime());
             temp.add(data.getType());
             temp.add(data.getStateDuration());
-            if(!Check.isNull(data.getStatus())){
-                temp.add("1".equals(data.getStatus())?"审批中":"已通过");
-            }else{
+            if (!Check.isNull(data.getStatus())) {
+                temp.add("1".equals(data.getStatus()) ? "审批中" : "已通过");
+            } else {
                 temp.add("");
             }
             excelList.add(temp);
@@ -318,4 +319,40 @@ public class WechatNoListController {
             log.error(e.getMessage());
         }
     }
+
+    /**
+     * 考勤异常数据查询(分页)
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "考勤异常数据查询")
+    @PostMapping(value = "/selectNoListPage")
+    public Result<PageInfo<WechatAttendance>> selectNoListPage(@RequestBody Map<String, Object> paramsMap) {
+        Result<PageInfo<WechatAttendance>> result = new Result<>();
+        PageInfo<WechatAttendance> pageData = wechatNoListService.selectNoListPage(paramsMap);
+        if (!Check.isNull(pageData)) {
+            result.setResult(pageData);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 加班考勤数据查询(分页)
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "加班异常数据查询")
+    @PostMapping(value = "/selectOverTimePage")
+    public Result<PageInfo<WechatAttendance>> selectOverTimePage(@RequestBody Map<String, Object> paramsMap) {
+        Result<PageInfo<WechatAttendance>> result = new Result<>();
+        PageInfo<WechatAttendance> pageData = wechatNoListService.selectOverTimePage(paramsMap);
+        if (!Check.isNull(pageData)) {
+            result.setResult(pageData);
+            result.setSuccess(true);
+        }
+        return result;
+    }
 }

+ 3 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatCheckinDataMapper.java

@@ -3,6 +3,8 @@ package cn.com.ctop.oa.modules.mapper;
 import cn.com.ctop.oa.modules.entity.WechatCheckinData;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.Map;
+
 /**
  * 企业微信用户
  *
@@ -12,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface WechatCheckinDataMapper extends BaseMapper<WechatCheckinData> {
 
+    WechatCheckinData queryEntityByMap(Map<String, Object> paramsMap);
 }

+ 1 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatNoListMapper.java

@@ -20,4 +20,5 @@ public interface WechatNoListMapper extends BaseMapper<WechatNoList> {
     List<WechatAttendance> queryAttendanceData(Map<String, Object> paramsMap);
 
     List<WechatAttendance> queryOverTimeData(Map<String, Object> paramsMap);
+
 }

+ 19 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatCheckinDataMapper.xml

@@ -1,5 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.oa.modules.mapper.WechatCheckinDataMapper">
+    <select id="queryEntityByMap" resultType="cn.com.ctop.oa.modules.entity.WechatCheckinData">
+        SELECT
+        *
+        FROM ctop_wechat_checkin_data
+        <where>
+        <if test="userId != null and userId != '' " >
+            and user_id = #{userId}
+        </if>
+        <if test="departId != null and departId != '' " >
+            and depart_id = #{departId}
+        </if>
+        <if test="checkinType != null">
+            and checkin_type = #{checkinType}
+        </if>
+        <if test="checkinDate != null ">
+            and checkin_time like concat(#{checkinDate},"%")
+        </if>
+        </where>
+    </select>
 
 </mapper>

+ 33 - 19
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatNoListMapper.xml

@@ -3,38 +3,46 @@
 <mapper namespace="cn.com.ctop.oa.modules.mapper.WechatNoListMapper">
 
     <select id="queryAttendanceData" resultType="cn.com.ctop.oa.modules.entity.WechatAttendance">
-       SELECT DISTINCT
-           us.user_id AS userId,
-           us.user_name AS userName,
-           dpt.depart_id AS departId,
-           dpt.depart_name AS departName,
-           DATE_FORMAT(ck.checkin_time,'%Y-%m-%d') AS checkinDate,
-           ck.checkin_type AS checkinType,
-           ck.exception_type AS exceptionType,
-           nl.status as status,
-           DATE_FORMAT(ck.checkin_time, '%Y-%m-%d %H:%i:%s') AS checkinTime,
-        case  when nl.type !='' THEN  nl.type
+        SELECT DISTINCT
+        us.user_id AS userId,
+        us.user_name AS userName,
+        dpt.depart_id AS departId,
+        dpt.depart_name AS departName,
+        DATE_FORMAT(ck.checkin_time,'%Y-%m-%d') AS checkinDate,
+        ck.checkin_type AS checkinType,
+        ck.exception_type AS exceptionType,
+        nl.status as status,
+        DATE_FORMAT(ck.checkin_time, '%Y-%m-%d %H:%i:%s') AS checkinTime,
+        case when nl.type !='' THEN nl.type
         when ck.checkin_type ='上班打卡' AND exception_type ='时间异常' then '迟到'
         when ck.checkin_type ='下班打卡' AND exception_type ='时间异常' then '早退'
         end AS type,
-		case when nl.type!=''and nl.type !='补卡' then CONCAT(nl.new_duration,' h')
+        case when nl.type!=''and nl.type !='补卡' then CONCAT(nl.new_duration,' h')
         when ck.checkin_type ='上班打卡'and ck.exception_type ='时间异常' then
-        CONCAT(TIMESTAMPDIFF(MINUTE,DATE_FORMAT(CONCAT(DATE_FORMAT(ck.checkin_time,'%Y-%m-%d '),'09:30:00'),'%Y-%m-%d %H:%i:%s'),ck.checkin_time),' min')
+        CONCAT(TIMESTAMPDIFF(MINUTE,DATE_FORMAT(CONCAT(DATE_FORMAT(ck.checkin_time,'%Y-%m-%d '),'09:30:00'),'%Y-%m-%d
+        %H:%i:%s'),ck.checkin_time),' min')
         when ck.checkin_type ='下班打卡'and ck.exception_type ='时间异常' then
-        CONCAT(TIMESTAMPDIFF(MINUTE,ck.checkin_time,DATE_FORMAT(CONCAT(DATE_FORMAT(ck.checkin_time,'%Y-%m-%d '),'19:00:00'),'%Y-%m-%d %H:%i:%s')),' min')
+        CONCAT(TIMESTAMPDIFF(MINUTE,ck.checkin_time,DATE_FORMAT(CONCAT(DATE_FORMAT(ck.checkin_time,'%Y-%m-%d
+        '),'19:00:00'),'%Y-%m-%d %H:%i:%s')),' min')
         end AS stateDuration
         FROM ctop_wechat_user_list AS us
         LEFT JOIN ctop_wechat_department AS dpt ON us.depart_id = dpt.depart_id
         LEFT JOIN ctop_wechat_checkin_data AS ck ON ck.user_id = us.user_id
         LEFT JOIN ctop_wechat_no_list AS nl ON nl.user_id = us.user_id and
-         nl.new_begin Like CONCAT(DATE_FORMAT(ck.checkin_time,'%Y-%m-%d'),'%')
+        nl.new_begin Like CONCAT(DATE_FORMAT(ck.checkin_time,'%Y-%m-%d'),'%')
         WHERE ck.exception_type!='' and ISNULL(ck.exception_type)= 0
-        <if test="userId != null and userId != '' " >
+        <if test="userId != null and userId != '' ">
             and us.user_id = #{userId}
         </if>
-        <if test="departId != null and departId != '' " >
+        <if test="userName != null and userName != '' ">
+            and us.user_Name LIKE CONCAT("%",#{userName},"%")
+        </if>
+        <if test="departId != null and departId != '' ">
             and dpt.depart_id = #{departId}
         </if>
+        <if test="departName != null and departName != '' ">
+            and dpt.depart_name LIKE CONCAT("%",#{departName},"%")
+        </if>
         <if test="startTime != null">
             and ck.checkin_time &gt;= #{startTime}
         </if>
@@ -57,12 +65,18 @@
         LEFT JOIN ctop_wechat_user_list as us ON ck.user_id = us.user_id
         LEFT JOIN ctop_wechat_department as dpt ON dpt.depart_id = us.depart_id
         WHERE ck.overtime_or_not = 1
-        <if test="userId != null and userId != '' " >
+        <if test="userId != null and userId != '' ">
             and us.user_id = #{userId}
         </if>
-        <if test="departId != null and departId != '' " >
+        <if test="userName != null and userName != '' ">
+            and us.user_Name LIKE CONCAT("%",#{userName},"%")
+        </if>
+        <if test="departId != null and departId != '' ">
             and dpt.depart_id = #{departId}
         </if>
+        <if test="departName != null and departName != '' ">
+            and dpt.depart_name LIKE CONCAT("%",#{departName},"%")
+        </if>
         <if test="startTime != null">
             and ck.checkin_time &gt;= #{startTime}
         </if>

+ 6 - 2
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatNoListService.java

@@ -4,7 +4,7 @@ import cn.com.ctop.oa.modules.entity.WechatAttendance;
 import cn.com.ctop.oa.modules.entity.WechatNoList;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.common.api.vo.Result;
+import com.github.pagehelper.PageInfo;
 
 import java.util.List;
 import java.util.Map;
@@ -29,7 +29,7 @@ public interface IWechatNoListService extends IService<WechatNoList> {
     JSONObject getNoList(Integer page, String starttime, String endtime);
 
     /**
-     * 审批申请详情入库
+     * 审批申请数据入库
      *
      * @param starttime 审批单提交的时间范围,开始时间,UNix时间戳
      * @param endtime   批单提交的时间范围,结束时间,Unix时间戳
@@ -42,4 +42,8 @@ public interface IWechatNoListService extends IService<WechatNoList> {
     List<WechatAttendance> queryAttendanceData(Map<String, Object> paramsMap);
 
     List<WechatAttendance> queryOverTimeData(Map<String, Object> paramsMap);
+
+    PageInfo<WechatAttendance> selectNoListPage(Map<String, Object> paramsMap);
+
+    PageInfo<WechatAttendance> selectOverTimePage(Map<String, Object> paramsMap);
 }

+ 21 - 7
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatCheckinDataServiceImpl.java

@@ -17,6 +17,7 @@ import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -57,25 +58,38 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
                 userArr.add(userId);
                 params.put("useridlist", userArr);
                 params.put("starttime", 1598889600);
-                params.put("endtime", 1600927780);
+                params.put("endtime", 1601049600);
                 String resultStr = HttpUtils.httpPostRequestTest(QYWxConstant.QYWX_CHECKIN_DATA + "?access_token=" + qywxAccessToken.get("accessToken"), params.toJSONString(), null);
                 JSONObject resultJson = JSONObject.parseObject(resultStr);
                 Integer errcode = resultJson.getInteger("errcode");
                 if (errcode == 0) {
                     JSONArray checkindata = resultJson.getJSONArray("checkindata");
                     if (!Check.isNull(checkindata)) {
+                        StringBuffer buf = null;
+                        String checkinType = "";
+                        String checkinTypeCode = "";
                         for (int i = 0; i < checkindata.size(); i++) {
                             JSONObject jsonObject = checkindata.getJSONObject(i);
+                            if("JiLei".equals(userId)){
+                                System.out.println(jsonObject);
+                            }
                             if (!Check.isNull(jsonObject)) {
                                 WechatCheckinData checkinData = new WechatCheckinData();
+                                checkinType = jsonObject.getString("checkin_type");
+                                checkinTypeCode = "上班打卡".equals(checkinType) ? "1" : "2";
+                                //下班打卡时间
+                                Long checkinTimeStamp = jsonObject.getLong("checkin_time");
+                                Date checkDate = DateUtils.stampToTime(checkinTimeStamp);
+                                String dateStr = DateUtils.formatDate(checkDate);
+                                long dateLong = DateUtils.timeToStamp(dateStr + " 00:00:00");
+                                buf = new StringBuffer();
+                                String id = buf.append(userId).append("_").append(checkinTypeCode).append("_").append(dateLong).toString();
+                                checkinData.setId(id);
                                 checkinData.setDepartId(departId);
                                 checkinData.setUserId(userId);
-                                checkinData.setCheckinType(jsonObject.getString("checkin_type"));
-                                Long checkinTimeStamp = jsonObject.getLong("checkin_time"); //下班打卡时间
-                                java.util.Date checkDate = DateUtils.stampToTime(checkinTimeStamp);
+                                checkinData.setCheckinType(checkinType);
                                 checkinData.setCheckinTime(checkDate);
-                                String dateStr = DateUtils.formatDate(checkDate) + " 21:30:00";
-                                Long dateStamp = DateUtils.timeToStamp(dateStr); // 每天九点半时间戳
+                                Long dateStamp = DateUtils.timeToStamp(dateStr + " 21:30:00"); // 每天九点半时间戳
                                 if (checkinTimeStamp >= dateStamp) {
                                     checkinData.setOvertimeOrNot(1);
                                     String overtimeStr = DateUtils.formatDate(checkDate) + " 19:00:00";
@@ -94,7 +108,7 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
                                 checkinData.setWifimac(jsonObject.getString("wifimac"));
                                 checkinData.setMediaids(jsonObject.getJSONArray("mediaids").toJSONString());
                                 checkinData.setLat(jsonObject.getString("lat"));
-                                this.save(checkinData);
+                                this.saveOrUpdate(checkinData);
                             }
                         }
                     }

+ 99 - 2
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatNoListServiceImpl.java

@@ -4,14 +4,18 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.oa.modules.constant.QYWxConstant;
 import cn.com.ctop.oa.modules.entity.WechatAttendance;
+import cn.com.ctop.oa.modules.entity.WechatCheckinData;
 import cn.com.ctop.oa.modules.entity.WechatNoList;
 import cn.com.ctop.oa.modules.enums.SpNoEnum;
+import cn.com.ctop.oa.modules.mapper.WechatCheckinDataMapper;
 import cn.com.ctop.oa.modules.mapper.WechatNoListMapper;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
 import cn.com.ctop.oa.modules.service.IWechatTokenService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,6 +40,8 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
     private IWechatTokenService tokenService;
     @Autowired
     private WechatNoListMapper wechatNoListMapper;
+    @Autowired
+    private WechatCheckinDataMapper wechatCheckinDataMapper;
 
     /**
      * 获取审批token
@@ -127,11 +133,14 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
                          * 而且只记录请假、打卡补卡类型
                          **/
                         boolean statusisOK = "2".equals(spStatus) || "1".equals(spStatus);
-                        boolean typeisOK = spName.contains("打卡补卡") || spName.contains("请假");
+                        boolean typeisOK = spName.contains("打卡补卡") || spName.contains("请假") || spName.contains("外出") || spName.contains("出差");
                         if (statusisOK && typeisOK) {
                             JSONObject applyer = info.getJSONObject("applyer");
                             if (!Check.isNull(applyer)) {
                                 userId = applyer.getString("userid");
+                                if ("LiuJing".equals(userId)) {
+                                    System.out.println(info);
+                                }
                             }
                             //审批申请数据
                             JSONObject applyData = info.getJSONObject("apply_data");
@@ -274,11 +283,99 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
 
     @Override
     public List<WechatAttendance> queryAttendanceData(Map<String, Object> paramsMap) {
-        return wechatNoListMapper.queryAttendanceData(paramsMap);
+        List<WechatAttendance> list = wechatNoListMapper.queryAttendanceData(paramsMap);
+        if (!Check.isNull(list)) {
+            checkOverTimeData(list);
+        }
+        return list;
     }
 
     @Override
     public List<WechatAttendance> queryOverTimeData(Map<String, Object> paramsMap) {
         return wechatNoListMapper.queryOverTimeData(paramsMap);
     }
+
+    @Override
+    public PageInfo<WechatAttendance> selectNoListPage(Map<String, Object> paramsMap) {
+        Integer pageNo = (Integer) paramsMap.get("pageNo");
+        if (null == pageNo || pageNo == 0) {
+            pageNo = 1;
+        }
+        Integer pageSize = (Integer) paramsMap.get("pageSize");
+        if (null == pageSize || pageSize == 0) {
+            pageSize = 10;
+        }
+        String startTime = (String) paramsMap.get("startTime");
+        if (!Check.isNull(startTime)) {
+            startTime += " 00:00:00";
+            paramsMap.put("startTime", startTime);
+        }
+        String stopTime = (String) paramsMap.get("stopTime");
+        if (!Check.isNull(stopTime)) {
+            stopTime += " 23:59:59";
+            paramsMap.put("stopTime", stopTime);
+        }
+        PageHelper.startPage(pageNo, pageSize);
+        List<WechatAttendance> list = wechatNoListMapper.queryAttendanceData(paramsMap);
+        if (!Check.isNull(list)) {
+            checkOverTimeData(list);
+        }
+        return new PageInfo<>(list);
+    }
+
+    /**
+     * 筛选10:30以后打卡的迟到数据,判断前一天是否加班,更新迟到时长
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    private void checkOverTimeData(List<WechatAttendance> list) {
+        for (WechatAttendance attendance : list) {
+            if ("迟到".equals(attendance.getType())) {
+                Integer dur = Integer.valueOf(attendance.getStateDuration().replace(" min", ""));
+                if (dur - 60 >= 0) {
+                    String checkinDate = attendance.getCheckinDate();
+                    String lastDay = DateUtils.getLastDay(checkinDate);
+                    Map<String, Object> map = new HashMap<>();
+                    map.put("userId", attendance.getUserId());
+                    map.put("checkinDate", lastDay);
+                    map.put("checkinType", "下班打卡");
+                    WechatCheckinData data = wechatCheckinDataMapper.queryEntityByMap(map);
+                    if (!Check.isNull(data) && 1 == data.getOvertimeOrNot()) {
+                        attendance.setStateDuration((dur - 60) + " min");
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public PageInfo<WechatAttendance> selectOverTimePage(Map<String, Object> paramsMap) {
+        Integer pageNo = (Integer) paramsMap.get("pageNo");
+        if (null == pageNo || pageNo == 0) {
+            pageNo = 1;
+        }
+        Integer pageSize = (Integer) paramsMap.get("pageSize");
+        if (null == pageSize || pageSize == 0) {
+            pageSize = 10;
+        }
+        String startTime = (String) paramsMap.get("startTime");
+        if (!Check.isNull(startTime)) {
+            startTime += " 00:00:00";
+            paramsMap.put("startTime", startTime);
+        }
+        String stopTime = (String) paramsMap.get("stopTime");
+        if (!Check.isNull(stopTime)) {
+            stopTime += " 23:59:59";
+            paramsMap.put("stopTime", stopTime);
+        }
+        PageHelper.startPage(pageNo, pageSize);
+        List<WechatAttendance> list = wechatNoListMapper.queryOverTimeData(paramsMap);
+        if (!Check.isNull(list)) {
+            checkOverTimeData(list);
+        }
+        return new PageInfo<>(list);
+    }
 }