parent
b37c6af313
commit
c8fed6540d
|
|
@ -392,15 +392,6 @@ public class AttendanceDetailsController extends BaseController {
|
||||||
return getDataTableError(new ArrayList<>());
|
return getDataTableError(new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户新增
|
|
||||||
*/
|
|
||||||
@PostMapping("/synchronous")
|
|
||||||
@Log(title = "考勤报表-> 考勤明细->数据同步", businessType = BusinessType.INSERT)
|
|
||||||
public AjaxResult synchronous(@Validated @RequestBody AttDataDetailsBean bean) {
|
|
||||||
return attendanceDetailsService.synchronous(bean);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取日报表-详细记录
|
* 获取日报表-详细记录
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public interface AttSourceDataDao {
|
||||||
Integer getPersonLeaveApplyStatus(AttSourceDataBean bean);
|
Integer getPersonLeaveApplyStatus(AttSourceDataBean bean);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查出最近三天的人员考勤记录
|
* 查出人员考勤记录
|
||||||
* @return list bean
|
* @return list bean
|
||||||
*/
|
*/
|
||||||
List<AttSourceDataBean> getSourceAttData(@Param("pushDate")String pushDate, @Param("pushType")int pushType);
|
List<AttSourceDataBean> getSourceAttData(@Param("pushDate")String pushDate, @Param("pushType")int pushType);
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,16 @@
|
||||||
package com.bonus.system.att.dao;
|
package com.bonus.system.att.dao;
|
||||||
|
|
||||||
import com.bonus.system.api.domain.MapVo;
|
|
||||||
import com.bonus.system.api.domain.SysUser;
|
import com.bonus.system.api.domain.SysUser;
|
||||||
import com.bonus.system.att.entity.AttFaceBean;
|
import com.bonus.system.att.entity.AttFaceBean;
|
||||||
import com.bonus.system.att.entity.AttSourceDataBean;
|
import com.bonus.system.att.entity.AttSourceDataBean;
|
||||||
import com.bonus.system.att.entity.LeaveBean;
|
|
||||||
import com.bonus.system.att.entity.OrgChangeBean;
|
|
||||||
import com.bonus.system.basic.domain.SysOrg;
|
import com.bonus.system.basic.domain.SysOrg;
|
||||||
import com.bonus.system.evection.entity.EvectionBean;
|
import com.bonus.system.evection.entity.EvectionBean;
|
||||||
import com.bonus.system.holiday.entity.HolidayBean;
|
|
||||||
import com.bonus.system.holiday.entity.WorkReportBean;
|
import com.bonus.system.holiday.entity.WorkReportBean;
|
||||||
import com.bonus.system.index.entity.MapBean;
|
import com.bonus.system.index.entity.MapBean;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序同步定时器
|
* 小程序同步定时器
|
||||||
|
|
@ -42,7 +37,7 @@ public interface WechatPushDao {
|
||||||
*/
|
*/
|
||||||
SysOrg getOrgInfoByUserId(Long userId);
|
SysOrg getOrgInfoByUserId(Long userId);
|
||||||
|
|
||||||
void insertWebLeave(EvectionBean bean);
|
int insertWebLeave(EvectionBean bean);
|
||||||
|
|
||||||
List<EvectionBean> getWebLeaveList();
|
List<EvectionBean> getWebLeaveList();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ public class AttSourceDataBean {
|
||||||
/**
|
/**
|
||||||
* 0 默认 1 外勤 2 正常
|
* 0 默认 1 外勤 2 正常
|
||||||
*/
|
*/
|
||||||
private String isOutsideAtt;
|
private String isOutsideAtt = "0";
|
||||||
|
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,8 +103,6 @@ public interface AttendanceDetailsService {
|
||||||
|
|
||||||
List<AttDataDetailsBean> getOutCountList(AttDataDetailsBean bean);
|
List<AttDataDetailsBean> getOutCountList(AttDataDetailsBean bean);
|
||||||
|
|
||||||
AjaxResult synchronous(AttDataDetailsBean bean);
|
|
||||||
|
|
||||||
List<AttDataDetailsBean> getAttDayList(AttDataDetailsBean bean);
|
List<AttDataDetailsBean> getAttDayList(AttDataDetailsBean bean);
|
||||||
|
|
||||||
List<AttDataDetailsBean> getAttCountList(AttDataDetailsBean bean);
|
List<AttDataDetailsBean> getAttCountList(AttDataDetailsBean bean);
|
||||||
|
|
|
||||||
|
|
@ -5,23 +5,17 @@ import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.system.api.domain.MapVo;
|
import com.bonus.system.api.domain.MapVo;
|
||||||
import com.bonus.system.api.domain.SysUser;
|
|
||||||
import com.bonus.system.att.dao.AttendanceDetailsDao;
|
import com.bonus.system.att.dao.AttendanceDetailsDao;
|
||||||
import com.bonus.system.att.entity.*;
|
import com.bonus.system.att.entity.*;
|
||||||
import com.bonus.system.att.tasks.AttTasks;
|
import com.bonus.system.att.tasks.NewAttTask;
|
||||||
import com.bonus.system.att.tasks.WechatTasks;
|
|
||||||
import com.bonus.system.basic.domain.SysNotice;
|
import com.bonus.system.basic.domain.SysNotice;
|
||||||
import com.bonus.system.basic.service.SysNoticeService;
|
import com.bonus.system.basic.service.SysNoticeService;
|
||||||
import com.bonus.system.dept.dao.ProDeptRoleDao;
|
|
||||||
import com.bonus.system.file.service.FileUploadService;
|
import com.bonus.system.file.service.FileUploadService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -36,12 +30,8 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
||||||
|
|
||||||
@Resource(name = "attendanceDetailsDao")
|
@Resource(name = "attendanceDetailsDao")
|
||||||
private AttendanceDetailsDao attendanceDetailsDao;
|
private AttendanceDetailsDao attendanceDetailsDao;
|
||||||
|
|
||||||
@Resource(name = "ProDeptRoleDao")
|
|
||||||
private ProDeptRoleDao proDeptRoleDao;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AttTasks attTasks;
|
private NewAttTask newAttTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息推送库表
|
* 消息推送库表
|
||||||
|
|
@ -142,7 +132,6 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
int i = attendanceDetailsDao.updateAttDetailsDataExamine(list);
|
int i = attendanceDetailsDao.updateAttDetailsDataExamine(list);
|
||||||
// todo 更新月报表和日报表
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
Set<String> keys = new HashSet<>();
|
Set<String> keys = new HashSet<>();
|
||||||
for (AttDataDetailsBean attDataDetailsBean : list) {
|
for (AttDataDetailsBean attDataDetailsBean : list) {
|
||||||
|
|
@ -150,8 +139,8 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
||||||
}
|
}
|
||||||
// 使用增强的 for 循环遍历 Set
|
// 使用增强的 for 循环遍历 Set
|
||||||
for (String item : keys) {
|
for (String item : keys) {
|
||||||
List<AttGroupBean> groupList = attTasks.getGroupData(item);
|
newAttTask.insertDayReportData(item);
|
||||||
attTasks.createReportData(groupList, item, 2);
|
newAttTask.updateMonthReportData(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
|
|
@ -229,29 +218,6 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
||||||
return attendanceDetailsDao.getOutCountList(bean);
|
return attendanceDetailsDao.getOutCountList(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public AjaxResult synchronous(AttDataDetailsBean bean) {
|
|
||||||
try {
|
|
||||||
List<String> dateList = AttTasks.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
|
||||||
//只执行今天之前的时间(包含今天)
|
|
||||||
// 获取今天的日期
|
|
||||||
LocalDate today = LocalDate.now();
|
|
||||||
// 定义日期格式
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
||||||
dateList = dateList.stream()
|
|
||||||
.map(date -> LocalDate.parse(date, formatter)) // 将字符串转换为LocalDate
|
|
||||||
.filter(date -> !date.isAfter(today)) // 筛选出今天及之前的日期
|
|
||||||
.sorted() // 按日期排序(可选)
|
|
||||||
.map(formatter::format) // 将LocalDate转回为字符串
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
attTasks.hisAttPush(dateList);
|
|
||||||
return AjaxResult.success("数据同步成功");
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.toString(), e);
|
|
||||||
return AjaxResult.error("数据同步失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AttDataDetailsBean> getAttDayList(AttDataDetailsBean bean) {
|
public List<AttDataDetailsBean> getAttDayList(AttDataDetailsBean bean) {
|
||||||
return attendanceDetailsDao.getAttDayList(bean);
|
return attendanceDetailsDao.getAttDayList(bean);
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,20 +1,8 @@
|
||||||
package com.bonus.system.att.tasks;
|
package com.bonus.system.att.tasks;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUnit;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.bonus.common.core.utils.DateTimeHelper;
|
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
|
||||||
import com.bonus.system.att.dao.AttGroupDao;
|
|
||||||
import com.bonus.system.att.dao.AttSourceDataDao;
|
|
||||||
import com.bonus.system.att.entity.*;
|
|
||||||
import com.bonus.system.att.service.AttCalService;
|
import com.bonus.system.att.service.AttCalService;
|
||||||
import com.bonus.system.att.utils.AddressCoordinateFormatUtil;
|
|
||||||
import com.bonus.system.att.utils.AttTimeUtil;
|
|
||||||
import com.bonus.system.att.utils.WorkdayCalculator;
|
|
||||||
import com.bonus.system.holiday.dao.HolidayDao;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.beanutils.BeanUtils;
|
|
||||||
import org.mybatis.spring.SqlSessionTemplate;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
|
@ -22,18 +10,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.time.*;
|
import java.time.*;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeParseException;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zys
|
* @author zys
|
||||||
|
|
@ -52,7 +30,6 @@ public class NewAttTask {
|
||||||
* 考勤模版数据定时器 凌晨10分启动一次,一天仅仅一次
|
* 考勤模版数据定时器 凌晨10分启动一次,一天仅仅一次
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 10 0 * * ?")
|
@Scheduled(cron = "0 10 0 * * ?")
|
||||||
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
|
||||||
@Async
|
@Async
|
||||||
public void getAttTempDataTask() {
|
public void getAttTempDataTask() {
|
||||||
log.info("--------考勤模版数据定时器开启------");
|
log.info("--------考勤模版数据定时器开启------");
|
||||||
|
|
@ -68,7 +45,6 @@ public class NewAttTask {
|
||||||
* 2.考勤数据应用(步骤一:考勤数据更新)
|
* 2.考勤数据应用(步骤一:考勤数据更新)
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 5-23 * * ?")
|
@Scheduled(cron = "0 0 5-23 * * ?")
|
||||||
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
|
||||||
@Async
|
@Async
|
||||||
public void getAttDataPullTask() {
|
public void getAttDataPullTask() {
|
||||||
log.info("--------数据拉取(考勤)定时器开启------");
|
log.info("--------数据拉取(考勤)定时器开启------");
|
||||||
|
|
@ -85,7 +61,6 @@ public class NewAttTask {
|
||||||
* 每天晚上22点,将下班未打卡置为旷工
|
* 每天晚上22点,将下班未打卡置为旷工
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 12,22 * * ?")
|
@Scheduled(cron = "0 0 12,22 * * ?")
|
||||||
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
|
||||||
@Async
|
@Async
|
||||||
public void getAbsenteeismDataTask() {
|
public void getAbsenteeismDataTask() {
|
||||||
log.info("--------旷工判断定时器开启------");
|
log.info("--------旷工判断定时器开启------");
|
||||||
|
|
@ -100,7 +75,6 @@ public class NewAttTask {
|
||||||
* 每天7点将昨天数据更新一下
|
* 每天7点将昨天数据更新一下
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 7 * * ?")
|
@Scheduled(cron = "0 0 7 * * ?")
|
||||||
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
|
||||||
@Async
|
@Async
|
||||||
public void getYesterdayAttDataTask() {
|
public void getYesterdayAttDataTask() {
|
||||||
log.info("--------昨日下班卡更新定时器开启------");
|
log.info("--------昨日下班卡更新定时器开启------");
|
||||||
|
|
@ -109,16 +83,16 @@ public class NewAttTask {
|
||||||
// 格式化输出
|
// 格式化输出
|
||||||
String yesterdayStr = yesterday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
String yesterdayStr = yesterday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
updateAttData(yesterdayStr,2);
|
updateAttData(yesterdayStr,2);
|
||||||
//日报表更新 TODO
|
//日报表更新
|
||||||
|
insertDayReportData(yesterdayStr);
|
||||||
log.info("--------昨日下班卡更新定时器完毕------");
|
log.info("--------昨日下班卡更新定时器完毕------");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请假数据应用--法假
|
* 请假数据应用--法假
|
||||||
* 每天更新一次一点更新
|
* 每天更新一次,1点更新
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 1 * * ?")
|
@Scheduled(cron = "0 0 1 * * ?")
|
||||||
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
|
||||||
@Async
|
@Async
|
||||||
public void getLegalHolidayDataTask() {
|
public void getLegalHolidayDataTask() {
|
||||||
log.info("--------请假数据应用--法假定时器开启------");
|
log.info("--------请假数据应用--法假定时器开启------");
|
||||||
|
|
@ -132,7 +106,6 @@ public class NewAttTask {
|
||||||
* 每天更新两次上午8点,下午18点(45天前数据)
|
* 每天更新两次上午8点,下午18点(45天前数据)
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 8,18 * * ?")
|
@Scheduled(cron = "0 0 8,18 * * ?")
|
||||||
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
|
||||||
@Async
|
@Async
|
||||||
public void getLeaveDataTask() {
|
public void getLeaveDataTask() {
|
||||||
log.info("--------请假数据应用--请假定时器开启------");
|
log.info("--------请假数据应用--请假定时器开启------");
|
||||||
|
|
@ -147,7 +120,6 @@ public class NewAttTask {
|
||||||
* 6点10分开始,一小时更新一次
|
* 6点10分开始,一小时更新一次
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 10 6-23 * * ?")
|
@Scheduled(cron = "0 10 6-23 * * ?")
|
||||||
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
|
||||||
@Async
|
@Async
|
||||||
public void getDayReportDataTask() {
|
public void getDayReportDataTask() {
|
||||||
log.info("--------报表数据生成--日报表定时器开启------");
|
log.info("--------报表数据生成--日报表定时器开启------");
|
||||||
|
|
@ -162,7 +134,6 @@ public class NewAttTask {
|
||||||
* 月初生成,之后修改
|
* 月初生成,之后修改
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 15 1 1 * ?")
|
@Scheduled(cron = "0 15 1 1 * ?")
|
||||||
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
|
||||||
@Async
|
@Async
|
||||||
public void getMonthReportDataTempTask() {
|
public void getMonthReportDataTempTask() {
|
||||||
log.info("--------报表数据生成--月报表定时器开启------");
|
log.info("--------报表数据生成--月报表定时器开启------");
|
||||||
|
|
@ -176,7 +147,6 @@ public class NewAttTask {
|
||||||
* 每日数据变化修改之后修改
|
* 每日数据变化修改之后修改
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 8,10,17,19,23 * * ?")
|
@Scheduled(cron = "0 0 8,10,17,19,23 * * ?")
|
||||||
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
|
||||||
@Async
|
@Async
|
||||||
public void getMonthReportDataTask() {
|
public void getMonthReportDataTask() {
|
||||||
log.info("--------报表数据生成--月报表定时器开启------");
|
log.info("--------报表数据生成--月报表定时器开启------");
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import com.bonus.system.att.dao.WechatPushDao;
|
||||||
import com.bonus.system.att.entity.AttFaceBean;
|
import com.bonus.system.att.entity.AttFaceBean;
|
||||||
import com.bonus.system.att.entity.AttSourceDataBean;
|
import com.bonus.system.att.entity.AttSourceDataBean;
|
||||||
import com.bonus.system.att.service.AttCalService;
|
import com.bonus.system.att.service.AttCalService;
|
||||||
|
import com.bonus.system.att.utils.AddressCoordinateFormatUtil;
|
||||||
import com.bonus.system.att.utils.AttTimeUtil;
|
import com.bonus.system.att.utils.AttTimeUtil;
|
||||||
import com.bonus.system.att.utils.DistanceCalculator;
|
import com.bonus.system.att.utils.DistanceCalculator;
|
||||||
import com.bonus.system.att.utils.IpAndPathConfig;
|
import com.bonus.system.att.utils.IpAndPathConfig;
|
||||||
|
|
@ -55,7 +56,7 @@ public class WechatTasks {
|
||||||
* 人员基础数据同步定时器
|
* 人员基础数据同步定时器
|
||||||
*/
|
*/
|
||||||
// @Scheduled(cron = "0 0/10 * * * ?")
|
// @Scheduled(cron = "0 0/10 * * * ?")
|
||||||
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 30)
|
@Scheduled(initialDelay = 60000, fixedDelay = 60000 * 30)
|
||||||
@Async
|
@Async
|
||||||
public void pushPersonTask() {
|
public void pushPersonTask() {
|
||||||
log.info("--------人员基础数据同步定时器开启------");
|
log.info("--------人员基础数据同步定时器开启------");
|
||||||
|
|
@ -83,7 +84,7 @@ public class WechatTasks {
|
||||||
/**
|
/**
|
||||||
* 休假出差数据同步定时器
|
* 休假出差数据同步定时器
|
||||||
*/
|
*/
|
||||||
// @Scheduled(initialDelay = 60000 * 2, fixedDelay = 60000 * 30)
|
// @Scheduled(initialDelay = 600 * 2, fixedDelay = 60000 * 30)
|
||||||
@Async
|
@Async
|
||||||
public void leaveTask() {
|
public void leaveTask() {
|
||||||
log.info("--------休假出差数据定时器开启------");
|
log.info("--------休假出差数据定时器开启------");
|
||||||
|
|
@ -107,18 +108,20 @@ public class WechatTasks {
|
||||||
bean.setOrgId(orgInfo.getId());
|
bean.setOrgId(orgInfo.getId());
|
||||||
bean.setOrgName(orgInfo.getOrgName());
|
bean.setOrgName(orgInfo.getOrgName());
|
||||||
}
|
}
|
||||||
String jsonStr2 = FastJsonHelper.beanToJsonStr(bean);
|
|
||||||
if(bean.getId() != 0L){
|
if(bean.getId() != 0L){
|
||||||
//修改的数据
|
//修改的数据
|
||||||
dao.updateWechatLeave(bean);
|
dao.updateWechatLeave(bean);
|
||||||
}else{
|
}else{
|
||||||
//首次推送的数据
|
//首次推送的数据
|
||||||
dao.insertWebLeave(bean);
|
int i = dao.insertWebLeave(bean);
|
||||||
//根据uuid将小程序id换成考勤端id
|
//根据uuid将小程序id换成考勤端id
|
||||||
|
//返回了id,不能在前面生成
|
||||||
|
String jsonStr2 = FastJsonHelper.beanToJsonStr(bean);
|
||||||
String method2 = "updateWechatLeave";
|
String method2 = "updateWechatLeave";
|
||||||
String string2 = httpPost(method2, jsonStr2);
|
String string2 = httpPost(method2, jsonStr2);
|
||||||
}
|
}
|
||||||
//将所有数据同步限制解除
|
//将所有数据同步限制解除
|
||||||
|
String jsonStr2 = FastJsonHelper.beanToJsonStr(bean);
|
||||||
String method2 = "updateWechatIsSync";
|
String method2 = "updateWechatIsSync";
|
||||||
String string3 = httpPost(method2, jsonStr2);
|
String string3 = httpPost(method2, jsonStr2);
|
||||||
}
|
}
|
||||||
|
|
@ -166,7 +169,7 @@ public class WechatTasks {
|
||||||
/**
|
/**
|
||||||
* 考勤数据同步定时器
|
* 考勤数据同步定时器
|
||||||
*/
|
*/
|
||||||
// @Scheduled(initialDelay = 6000 * 3, fixedDelay = 60000 * 30)
|
@Scheduled(initialDelay = 6000 * 3, fixedDelay = 60000 * 30)
|
||||||
@Async
|
@Async
|
||||||
public void wechatAttTask() {
|
public void wechatAttTask() {
|
||||||
log.info("--------考勤数据定时器开启------");
|
log.info("--------考勤数据定时器开启------");
|
||||||
|
|
@ -202,6 +205,21 @@ public class WechatTasks {
|
||||||
//外勤
|
//外勤
|
||||||
bean.setIsOutsideAtt("1");
|
bean.setIsOutsideAtt("1");
|
||||||
}
|
}
|
||||||
|
//省内省外
|
||||||
|
String address;
|
||||||
|
String province;
|
||||||
|
try {
|
||||||
|
JSONObject result = AddressCoordinateFormatUtil.
|
||||||
|
coordinateToAddress2(bean.getAttLon(), bean.getAttLat());
|
||||||
|
address = result.getString("formatted_address");
|
||||||
|
province = result.getJSONObject("addressComponent").getString("province");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
address = "地址未转化成功";
|
||||||
|
province = "地址未转化成功";
|
||||||
|
}
|
||||||
|
bean.setAttAddress(address);
|
||||||
|
bean.setProvince(province);
|
||||||
});
|
});
|
||||||
//新增数据
|
//新增数据
|
||||||
//新增考勤到考勤来源表(数据过多时分批次插入)
|
//新增考勤到考勤来源表(数据过多时分批次插入)
|
||||||
|
|
@ -387,8 +405,8 @@ public class WechatTasks {
|
||||||
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
||||||
RequestBody body = null;
|
RequestBody body = null;
|
||||||
try {
|
try {
|
||||||
// body = RequestBody.create(mediaType, "username=15240004260&password=GZkq@123456!");
|
body = RequestBody.create(mediaType, "username=15240004260wechat&password=GZkq@123456!");
|
||||||
body = RequestBody.create(mediaType, "username=" + AESCBCUtil.encrypt("15240004260wechat") + "&password=" + AESCBCUtil.encrypt("GZkq@123456!"));
|
// body = RequestBody.create(mediaType, "username=" + AESCBCUtil.encrypt("15240004260wechat") + "&password=" + AESCBCUtil.encrypt("GZkq@123456!"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@
|
||||||
<insert id="insertAttSourceData">
|
<insert id="insertAttSourceData">
|
||||||
<foreach collection="list" item="params" separator=";">
|
<foreach collection="list" item="params" separator=";">
|
||||||
replace into att_source_data(name, id_number, org_id, org_name, att_current_day,
|
replace into att_source_data(name, id_number, org_id, org_name, att_current_day,
|
||||||
att_current_time, att_type, att_address, province, att_lon, att_lat, data_source, remark)
|
att_current_time, att_type, att_address, province,is_outside_att, att_lon, att_lat, data_source, remark)
|
||||||
values (#{params.name}, #{params.idNumber}, #{params.orgId}, #{params.orgName},
|
values (#{params.name}, #{params.idNumber}, #{params.orgId}, #{params.orgName},
|
||||||
#{params.attCurrentDay}, #{params.attCurrentTime}, #{params.attType},
|
#{params.attCurrentDay}, #{params.attCurrentTime}, #{params.attType},
|
||||||
#{params.attAddress}, #{params.province}, #{params.attLon}, #{params.attLat}, #{params.dataSource},
|
#{params.attAddress}, #{params.province},#{params.isOutsideAtt}, #{params.attLon}, #{params.attLat}, #{params.dataSource},
|
||||||
#{params.remark})
|
#{params.remark})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
@ -93,8 +93,10 @@
|
||||||
<update id="updateAttStatusData">
|
<update id="updateAttStatusData">
|
||||||
<foreach collection="list" item="params" separator=";">
|
<foreach collection="list" item="params" separator=";">
|
||||||
update att_data set att_current_time = #{params.attCurrentTime},
|
update att_data set att_current_time = #{params.attCurrentTime},
|
||||||
att_address = #{params.attAddress}, province = #{params.province}, att_lon = #{params.attLon}, att_lat =
|
att_address = #{params.attAddress}, province = #{params.province},
|
||||||
#{params.attLat},
|
is_outside_att = #{params.isOutsideAtt},
|
||||||
|
att_lon = #{params.attLon},
|
||||||
|
att_lat = #{params.attLat},
|
||||||
data_source = #{params.dataSource},
|
data_source = #{params.dataSource},
|
||||||
error_remake = #{params.remark},
|
error_remake = #{params.remark},
|
||||||
att_status = CASE
|
att_status = CASE
|
||||||
|
|
@ -107,8 +109,10 @@
|
||||||
AND att_current_day = #{params.attCurrentDay} and att_type = #{params.attType};
|
AND att_current_day = #{params.attCurrentDay} and att_type = #{params.attType};
|
||||||
|
|
||||||
update att_data_update set att_current_time = #{params.attCurrentTime},
|
update att_data_update set att_current_time = #{params.attCurrentTime},
|
||||||
att_address = #{params.attAddress}, province = #{params.province}, att_lon = #{params.attLon}, att_lat =
|
att_address = #{params.attAddress}, province = #{params.province},
|
||||||
#{params.attLat},
|
is_outside_att = #{params.isOutsideAtt},
|
||||||
|
att_lon = #{params.attLon},
|
||||||
|
att_lat = #{params.attLat},
|
||||||
data_source = #{params.dataSource},
|
data_source = #{params.dataSource},
|
||||||
error_remake = #{params.remark},
|
error_remake = #{params.remark},
|
||||||
att_status = CASE
|
att_status = CASE
|
||||||
|
|
@ -377,7 +381,6 @@
|
||||||
LEFT JOIN att_setting_history ag ON ag.user_id = su.user_id
|
LEFT JOIN att_setting_history ag ON ag.user_id = su.user_id
|
||||||
AND ag.current_day = #{pushDate}
|
AND ag.current_day = #{pushDate}
|
||||||
LEFT JOIN att_group g ON g.id = ag.group_id;
|
LEFT JOIN att_group g ON g.id = ag.group_id;
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAttIsExist" resultType="java.lang.Boolean">
|
<select id="selectAttIsExist" resultType="java.lang.Boolean">
|
||||||
|
|
|
||||||
|
|
@ -116,26 +116,37 @@
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="getPersonList" resultType="com.bonus.system.api.domain.SysUser">
|
<select id="getPersonList" resultType="com.bonus.system.api.domain.SysUser">
|
||||||
SELECT distinct
|
SELECT DISTINCT
|
||||||
su.user_id,
|
su.user_id,
|
||||||
su.user_name,
|
su.user_name,
|
||||||
su.phone,
|
su.phone,
|
||||||
su.`password`,
|
su.`password`,
|
||||||
IF(applied_face is null,1,su.is_face) as isFace,
|
IF
|
||||||
pd.org_id,
|
( applied_face IS NULL, 1, su.is_face ) AS isFace,
|
||||||
IF(pd.org_id IS NOT NULL, 1, 0) isPd,
|
suo.org_id,
|
||||||
su.update_time,
|
IF
|
||||||
su.open_id
|
( pd.user_id IS NOT NULL, 1, 0 ) isPd,
|
||||||
FROM sys_user su
|
su.update_time,
|
||||||
LEFT JOIN (
|
su.open_id
|
||||||
SELECT gp.user_id,gp.org_id
|
FROM
|
||||||
FROM att_group g
|
sys_user su
|
||||||
LEFT JOIN att_group_person_relation gp on g.id = gp.group_id
|
LEFT JOIN sys_user_org suo ON suo.user_id = su.user_id
|
||||||
WHERE g.is_active = 1 and g.att_type = 2
|
AND suo.is_active = 1
|
||||||
) pd ON pd.user_id = su.user_id
|
LEFT JOIN (
|
||||||
LEFT JOIN sys_user_face sw ON sw.user_id = su.user_id
|
SELECT
|
||||||
WHERE is_active = '1'
|
gp.user_id
|
||||||
GROUP BY user_id
|
FROM
|
||||||
|
att_group g
|
||||||
|
LEFT JOIN att_group_person_relation gp ON g.id = gp.group_id
|
||||||
|
WHERE
|
||||||
|
g.is_active = 1
|
||||||
|
AND g.att_type = 2
|
||||||
|
) pd ON pd.user_id = su.user_id
|
||||||
|
LEFT JOIN sys_user_face sw ON sw.user_id = su.user_id
|
||||||
|
WHERE
|
||||||
|
su.is_active = '1'
|
||||||
|
GROUP BY
|
||||||
|
user_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getWebFaceList" resultType="com.bonus.system.att.entity.AttFaceBean">
|
<select id="getWebFaceList" resultType="com.bonus.system.att.entity.AttFaceBean">
|
||||||
|
|
@ -146,20 +157,17 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getOrgInfoByUserId" resultType="com.bonus.system.basic.domain.SysOrg">
|
<select id="getOrgInfoByUserId" resultType="com.bonus.system.basic.domain.SysOrg">
|
||||||
SELECT
|
SELECT DISTINCT
|
||||||
distinct
|
|
||||||
user_id,
|
user_id,
|
||||||
org_id AS id,
|
org_id AS id,
|
||||||
org_name,
|
org_name
|
||||||
att_range,
|
FROM
|
||||||
so.lon,
|
sys_user_org suo
|
||||||
so.lat
|
LEFT JOIN sys_organization so ON so.id = suo.org_id
|
||||||
FROM att_group_person_relation ag
|
AND so.is_active = '1'
|
||||||
LEFT JOIN sys_organization so ON so.id = ag.org_id
|
WHERE
|
||||||
LEFT JOIN att_group_setting agt on agt.group_id = ag.group_id and agt.is_active = '1'
|
suo.user_id = #{userId}
|
||||||
AND so.is_active = '1'
|
LIMIT 1
|
||||||
WHERE ag.user_id = #{userId}
|
|
||||||
limit 1
|
|
||||||
</select>
|
</select>
|
||||||
<select id="getWebLeaveList" resultType="com.bonus.system.evection.entity.EvectionBean">
|
<select id="getWebLeaveList" resultType="com.bonus.system.evection.entity.EvectionBean">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -172,7 +180,7 @@
|
||||||
SELECT
|
SELECT
|
||||||
distinct
|
distinct
|
||||||
ag.user_id,
|
ag.user_id,
|
||||||
ag.org_id AS id,
|
suo.org_id AS id,
|
||||||
so.org_name,
|
so.org_name,
|
||||||
agt.att_range,
|
agt.att_range,
|
||||||
so.lon,
|
so.lon,
|
||||||
|
|
@ -180,12 +188,14 @@
|
||||||
su.id_number
|
su.id_number
|
||||||
FROM
|
FROM
|
||||||
att_group_person_relation ag
|
att_group_person_relation ag
|
||||||
LEFT JOIN sys_organization so ON so.id = ag.org_id AND so.is_active = '1'
|
LEFT JOIN sys_user su ON su.user_id = ag.user_id AND su.is_active = '1'
|
||||||
LEFT JOIN att_group_setting agt on agt.group_id = ag.group_id and agt.is_active = '1'
|
LEFT JOIN sys_user_org suo ON suo.user_id = su.user_id and suo.is_active = '1'
|
||||||
LEFT JOIN sys_user su ON su.user_id = ag.user_id AND su.is_active = '1'
|
LEFT JOIN sys_organization so ON so.id = suo.org_id AND so.is_active = '1'
|
||||||
|
LEFT JOIN att_group_setting agt on agt.group_id = ag.group_id and agt.is_active = '1'
|
||||||
|
|
||||||
WHERE
|
WHERE
|
||||||
su.user_name = #{userName}
|
su.user_name = #{userName}
|
||||||
limit 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
<select id="getProOrgToQsy" resultType="com.bonus.system.index.entity.MapBean">
|
<select id="getProOrgToQsy" resultType="com.bonus.system.index.entity.MapBean">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue