修改页面 数据展示, 调整打卡不在推送公众号数据
This commit is contained in:
parent
17b44fef1e
commit
ddb19b7759
@ -227,7 +227,8 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
||||
RzAttendance beforeAttendance = rzAttendanceMapper.queryNowDayAttendanceByStatisticalIdAndDate(Long.valueOf(userId),DateUtils.addDays(date, -1));
|
||||
if(beforeAttendance.getWorkStartTime() != null && beforeAttendance.getWorkEndTime() == null){
|
||||
notBeforeEndTimeMessage = " - 昨天未打下班卡";
|
||||
sendAbnormalAttendance(userId, beforeAttendance.getWorkStartTime());
|
||||
//上班打卡不在推送消息, 影响消息返回, 可能引发打卡异常
|
||||
// sendAbnormalAttendance(userId, beforeAttendance.getWorkStartTime());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -235,19 +236,19 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
||||
}
|
||||
return (rzAttendanceMapper.updateRzAttendance(attendance) > 0) ? initMessage(0, "打卡成功"+notBeforeEndTimeMessage) : initMessage(1, "打卡失败"+notBeforeEndTimeMessage);
|
||||
}
|
||||
|
||||
@Async
|
||||
public void sendAbnormalAttendance(Long userId, Date date){
|
||||
try {
|
||||
SysStaff sysStaff = sysStaffMapper.selectById(userId);
|
||||
if(sysStaff != null && StringUtils.isNotEmpty(sysStaff.getOpenid())){
|
||||
SysDept sysDept = sysDeptMapper.selectById(sysStaff.getDeptId());
|
||||
sendClientService.sendAbnormalAttendance(sysDept != null ? sysDept.getDeptName() : "未知",sysStaff.getName(), "昨天下班未打卡", date, sysStaff.getOpenid());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("推送公众号打卡异常失败, 原因为: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
//
|
||||
// @Async
|
||||
// public void sendAbnormalAttendance(Long userId, Date date){
|
||||
// try {
|
||||
// SysStaff sysStaff = sysStaffMapper.selectById(userId);
|
||||
// if(sysStaff != null && StringUtils.isNotEmpty(sysStaff.getOpenid())){
|
||||
// SysDept sysDept = sysDeptMapper.selectById(sysStaff.getDeptId());
|
||||
// sendClientService.sendAbnormalAttendance(sysDept != null ? sysDept.getDeptName() : "未知",sysStaff.getName(), "昨天下班未打卡", date, sysStaff.getOpenid());
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error("推送公众号打卡异常失败, 原因为: {}", e.getMessage(), e);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/*** 撤销卡
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.evo.common.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.evo.attendance.service.IRzAttendanceService;
|
||||
import com.evo.attendance.service.IRzAttendanceStatisticalService;
|
||||
@ -12,6 +15,10 @@ import com.evo.personnelMatters.mapper.RzOverTimeMapper;
|
||||
import com.evo.restaurant.service.IRzRestaurantStatisticsService;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.service.ISysStaffService;
|
||||
import com.evo.wechat.TemplateMessageUtil;
|
||||
import com.evo.wechat.dto.AbnormalAttendanceTemplate;
|
||||
import com.evo.wechat.dto.MessageTemplate;
|
||||
import com.evo.wechat.service.GZHAccessTokenService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -57,6 +64,10 @@ public class TestController {
|
||||
private IRzAttendanceService rzAttendanceService;
|
||||
@Resource
|
||||
private RzAttendanceDetailService rzAttendanceDetailService;
|
||||
@Resource
|
||||
private GZHAccessTokenService gzhAccessTokenService;
|
||||
|
||||
|
||||
/**
|
||||
* 清洗加班
|
||||
*/
|
||||
@ -84,31 +95,20 @@ public class TestController {
|
||||
|
||||
|
||||
@GetMapping("/message")
|
||||
public String message(Model model, String code) {
|
||||
public String message(String openid) {
|
||||
|
||||
System.out.println(code);
|
||||
// String res = AccessTokenUtil.accessToken2("wx268e32962db19f5f", "84a6065165ec82862c5e03a010a6dc6c", code);
|
||||
// System.out.println(res);
|
||||
// JSONObject obj = JSONObject.parseObject(res);
|
||||
// String openid = obj.getString("openid");
|
||||
SysStaff user = new SysStaff();
|
||||
user.setOpenid(code);
|
||||
model.addAttribute("user", user);
|
||||
//model.addAttribute("openid", openid);
|
||||
// ErrorData templateData = new ErrorData();
|
||||
//
|
||||
// templateData.setThing1((JSONObject)JSON.toJSON(Collections.asMap("value", "研发部")));
|
||||
// templateData.setThing2((JSONObject)JSON.toJSON(Collections.asMap("value", "张三")));//动态跟换车牌号
|
||||
// templateData.setConst4((JSONObject)JSON.toJSON(Collections.asMap("value", "昨天下班未打卡")));//动态跟换车牌号
|
||||
// templateData.setTime6((JSONObject)JSON.toJSON(Collections.asMap("value", DateUtil.format(new Date(), "yyyy年MM月dd日"))));//动态跟换车牌号
|
||||
//
|
||||
// MessageTemplateSendData sendData = new MessageTemplateSendData();
|
||||
// sendData.setTouser(openid);
|
||||
// sendData.setTemplate_id("z9sy-38K-iC5MAWHbxcxwg1c-9oNTFWeCOoy6B6zdKY");
|
||||
// sendData.setData((JSONObject)JSON.toJSON(templateData));
|
||||
// TemplateMessageUtil.templateMessageSend(GZHAccessTokenService.gzhAccessToken(), sendData);
|
||||
AbnormalAttendanceTemplate templateData = new AbnormalAttendanceTemplate();
|
||||
|
||||
return "user_info.html";
|
||||
templateData.setThing1((JSONObject) JSON.toJSON(Collections.asMap("value", "研发部")));
|
||||
templateData.setThing2((JSONObject)JSON.toJSON(Collections.asMap("value", "张三")));//动态跟换车牌号
|
||||
templateData.setConst4((JSONObject)JSON.toJSON(Collections.asMap("value", "昨天下班未打卡")));//动态跟换车牌号
|
||||
templateData.setTime6((JSONObject)JSON.toJSON(Collections.asMap("value", DateUtil.format(new Date(), "yyyy年MM月dd日"))));//动态跟换车牌号
|
||||
|
||||
MessageTemplate sendData = new MessageTemplate();
|
||||
sendData.setTouser(openid);
|
||||
sendData.setTemplate_id("z9sy-38K-iC5MAWHbxcxwg1c-9oNTFWeCOoy6B6zdKY");
|
||||
sendData.setData((JSONObject)JSON.toJSON(templateData));
|
||||
return TemplateMessageUtil.templateMessageSend(gzhAccessTokenService.gzhAccessToken(), sendData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>河北伊特机械设备有限公司-提交失败</title>
|
||||
<title>河北伊特机械设备制造有限公司-提交失败</title>
|
||||
<!-- 引入Tailwind CSS -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<!-- 引入Font Awesome -->
|
||||
@ -50,7 +50,8 @@
|
||||
<div class="p-6 sm:p-8">
|
||||
<!-- 标题区域 -->
|
||||
<div class="text-center mb-6">
|
||||
<h1 class="text-2xl font-bold text-gray-900">河北伊特机械设备有限公司考勤系统</h1>
|
||||
<h1 class="text-2xl font-bold text-gray-900">河北伊特机械设备制造有限公司</h1>
|
||||
<h1 class="text-2xl font-bold text-gray-900">考勤系统</h1>
|
||||
<h2 class="text-2xl font-bold text-gray-900">信息提交结果</h2>
|
||||
</div>
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>河北伊特机械设备有限公司-提交成功</title>
|
||||
<title>河北伊特机械设备制造有限公司-提交成功</title>
|
||||
<!-- 引入Tailwind CSS -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<!-- 引入Font Awesome -->
|
||||
@ -41,7 +41,8 @@
|
||||
<div class="p-6 sm:p-8">
|
||||
<!-- 标题区域 -->
|
||||
<div class="text-center mb-8">
|
||||
<h1 class="text-2xl font-bold text-gray-900">河北伊特机械设备有限公司考勤系统</h1>
|
||||
<h1 class="text-2xl font-bold text-gray-900">河北伊特机械设备制造有限公司</h1>
|
||||
<h1 class="text-2xl font-bold text-gray-900">考勤系统</h1>
|
||||
<h2 class="text-2xl font-bold text-gray-900">信息提交结果</h2>
|
||||
</div>
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>河北伊特机械设备有限公司-用户信息完善</title>
|
||||
<title>河北伊特机械设备制造有限公司-用户信息完善</title>
|
||||
<!-- 引入Tailwind CSS -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<!-- 引入Font Awesome -->
|
||||
@ -48,7 +48,8 @@
|
||||
<div class="w-full max-w-md bg-white rounded-xl shadow-lg overflow-hidden">
|
||||
<div class="p-6 sm:p-8">
|
||||
<div class="text-center mb-6">
|
||||
<h1 class="text-2xl font-bold text-gray-900">河北伊特机械制造有限公司考勤系统</h1>
|
||||
<h1 class="text-2xl font-bold text-gray-900">河北伊特机械设备制造有限公司</h1>
|
||||
<h1 class="text-2xl font-bold text-gray-900">考勤系统</h1>
|
||||
<p class="mt-2 text-sm text-gray-500">请填写以下信息并提交</p>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user