|
@@ -4,14 +4,18 @@ import cn.com.ctop.common.module.utils.Check;
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
import cn.com.ctop.oa.modules.constant.QYWxConstant;
|
|
import cn.com.ctop.oa.modules.constant.QYWxConstant;
|
|
import cn.com.ctop.oa.modules.entity.WechatAttendance;
|
|
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.entity.WechatNoList;
|
|
import cn.com.ctop.oa.modules.enums.SpNoEnum;
|
|
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.mapper.WechatNoListMapper;
|
|
import cn.com.ctop.oa.modules.service.IWechatNoListService;
|
|
import cn.com.ctop.oa.modules.service.IWechatNoListService;
|
|
import cn.com.ctop.oa.modules.service.IWechatTokenService;
|
|
import cn.com.ctop.oa.modules.service.IWechatTokenService;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -36,6 +40,8 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
private IWechatTokenService tokenService;
|
|
private IWechatTokenService tokenService;
|
|
@Autowired
|
|
@Autowired
|
|
private WechatNoListMapper wechatNoListMapper;
|
|
private WechatNoListMapper wechatNoListMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private WechatCheckinDataMapper wechatCheckinDataMapper;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取审批token
|
|
* 获取审批token
|
|
@@ -127,11 +133,14 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
* 而且只记录请假、打卡补卡类型
|
|
* 而且只记录请假、打卡补卡类型
|
|
**/
|
|
**/
|
|
boolean statusisOK = "2".equals(spStatus) || "1".equals(spStatus);
|
|
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) {
|
|
if (statusisOK && typeisOK) {
|
|
JSONObject applyer = info.getJSONObject("applyer");
|
|
JSONObject applyer = info.getJSONObject("applyer");
|
|
if (!Check.isNull(applyer)) {
|
|
if (!Check.isNull(applyer)) {
|
|
userId = applyer.getString("userid");
|
|
userId = applyer.getString("userid");
|
|
|
|
+ if ("LiuJing".equals(userId)) {
|
|
|
|
+ System.out.println(info);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
//审批申请数据
|
|
//审批申请数据
|
|
JSONObject applyData = info.getJSONObject("apply_data");
|
|
JSONObject applyData = info.getJSONObject("apply_data");
|
|
@@ -274,11 +283,99 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<WechatAttendance> queryAttendanceData(Map<String, Object> paramsMap) {
|
|
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
|
|
@Override
|
|
public List<WechatAttendance> queryOverTimeData(Map<String, Object> paramsMap) {
|
|
public List<WechatAttendance> queryOverTimeData(Map<String, Object> paramsMap) {
|
|
return wechatNoListMapper.queryOverTimeData(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);
|
|
|
|
+ }
|
|
}
|
|
}
|