考勤添加时间
This commit is contained in:
parent
fd75c8b95b
commit
a6cd511905
|
|
@ -77,6 +77,8 @@ public interface AttGroupDao {
|
||||||
*/
|
*/
|
||||||
void deleteAttGroupRelationPerson(Long groupId);
|
void deleteAttGroupRelationPerson(Long groupId);
|
||||||
|
|
||||||
|
void deleteAttGroupPersonByUserId(List<AttGroupCheckOrgBean> delList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改考勤组
|
* 修改考勤组
|
||||||
* @param bean 参数
|
* @param bean 参数
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ public interface AttSourceDataDao {
|
||||||
* 查出绑定考勤组的所有人员
|
* 查出绑定考勤组的所有人员
|
||||||
* @return list bean
|
* @return list bean
|
||||||
*/
|
*/
|
||||||
List<AttDataBean> getAllPerson();
|
List<AttDataBean> getAllPerson(String pushDate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增到考勤数据表
|
* 新增到考勤数据表
|
||||||
|
|
@ -136,12 +136,6 @@ public interface AttSourceDataDao {
|
||||||
*/
|
*/
|
||||||
List<LeaveBean> getLeaveData();
|
List<LeaveBean> getLeaveData();
|
||||||
|
|
||||||
/**
|
|
||||||
* 查出最近三天没有进出的人员考勤记录
|
|
||||||
* @return list bean
|
|
||||||
*/
|
|
||||||
List<AttSourceDataBean> getSourceAttNoInOutData();
|
|
||||||
|
|
||||||
void updateHisData(String date);
|
void updateHisData(String date);
|
||||||
|
|
||||||
void delHisData(String date);
|
void delHisData(String date);
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,16 @@ public class AttGroupBean {
|
||||||
*/
|
*/
|
||||||
private PersonAttWorkDayBean attWorkDayBean;
|
private PersonAttWorkDayBean attWorkDayBean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户编号
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*/
|
||||||
|
private String currentDay;
|
||||||
|
|
||||||
public AttGroupBean(Long groupId, String attDay, String toWorkTime, String offWorkTime,
|
public AttGroupBean(Long groupId, String attDay, String toWorkTime, String offWorkTime,
|
||||||
Long todayClockNum, Long lateMinute, Long leaveMinute,
|
Long todayClockNum, Long lateMinute, Long leaveMinute,
|
||||||
Long absenteeismLateMinute, Long absenteeismLeaveMinute,
|
Long absenteeismLateMinute, Long absenteeismLeaveMinute,
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -108,17 +105,74 @@ public class AttGroupServiceImpl implements AttGroupService {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
//新增考勤组设置表
|
//新增考勤组设置表
|
||||||
int j = attGroupDao.updateAttGroupSetting(bean);
|
int j = attGroupDao.updateAttGroupSetting(bean);
|
||||||
//删除考勤组绑定人员
|
|
||||||
attGroupDao.deleteAttGroupRelationPerson(bean.getGroupId());
|
// //删除考勤组绑定人员
|
||||||
//新增考勤组绑定人员表
|
// attGroupDao.deleteAttGroupRelationPerson(bean.getGroupId());
|
||||||
int x = attGroupDao.insertAttGroupPerson(checkOrgAllList);
|
// //新增考勤组绑定人员表
|
||||||
if (j > 0 && (x == bean.getCheckOrgList().size())) {
|
// int x = attGroupDao.insertAttGroupPerson(checkOrgAllList);
|
||||||
result = 1;
|
// if (j > 0 && (x == bean.getCheckOrgList().size())) {
|
||||||
|
// result = 1;
|
||||||
|
// }
|
||||||
|
//代码逻辑修改,改为增量更新
|
||||||
|
//1.先去查目前考勤组有哪些人员
|
||||||
|
List<AttGroupCheckOrgBean> checkOrgList = attGroupDao.selectAttGroupUserById(bean.getGroupId());
|
||||||
|
//2.比较新的人员与目前考勤组人员做对比,如果目前考勤组人员独有,则删除,如果新选人员独有,则新增,两个都有,则不动
|
||||||
|
//2.1对比人员,生成各自的list
|
||||||
|
Map<String, List<AttGroupCheckOrgBean>> stringListMap = compareByUserId(checkOrgAllList, checkOrgList);
|
||||||
|
List<AttGroupCheckOrgBean> addList = stringListMap.get("onlyInList1");
|
||||||
|
List<AttGroupCheckOrgBean> delList = stringListMap.get("onlyInList2");
|
||||||
|
//2.2 删除人员,新增人员
|
||||||
|
if (!delList.isEmpty()) {
|
||||||
|
//删除考勤组绑定人员
|
||||||
|
attGroupDao.deleteAttGroupPersonByUserId(delList);
|
||||||
}
|
}
|
||||||
|
if (!addList.isEmpty()) {
|
||||||
|
//添加考勤组绑定人员
|
||||||
|
attGroupDao.insertAttGroupPerson(addList);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, List<AttGroupCheckOrgBean>> compareByUserId(
|
||||||
|
List<AttGroupCheckOrgBean> list1,
|
||||||
|
List<AttGroupCheckOrgBean> list2) {
|
||||||
|
|
||||||
|
// 创建 userId 到 AttGroupCheckOrgBean 的映射
|
||||||
|
Map<String, AttGroupCheckOrgBean> map1 = new HashMap<>();
|
||||||
|
for (AttGroupCheckOrgBean bean : list1) {
|
||||||
|
map1.put(bean.getUserId(), bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, AttGroupCheckOrgBean> map2 = new HashMap<>();
|
||||||
|
for (AttGroupCheckOrgBean bean : list2) {
|
||||||
|
map2.put(bean.getUserId(), bean);
|
||||||
|
}
|
||||||
|
// 存储结果
|
||||||
|
Map<String, List<AttGroupCheckOrgBean>> resultMap = new HashMap<>();
|
||||||
|
resultMap.put("onlyInList1", new ArrayList<>());
|
||||||
|
resultMap.put("onlyInList2", new ArrayList<>());
|
||||||
|
resultMap.put("intersection", new ArrayList<>());
|
||||||
|
// 计算交集和差集
|
||||||
|
Set<String> allKeys = new HashSet<>(map1.keySet());
|
||||||
|
allKeys.addAll(map2.keySet());
|
||||||
|
for (String key : allKeys) {
|
||||||
|
if (map1.containsKey(key) && map2.containsKey(key)) {
|
||||||
|
// 交集
|
||||||
|
resultMap.get("intersection").add(map1.get(key));
|
||||||
|
} else if (map1.containsKey(key)) {
|
||||||
|
// 仅存在于list1中
|
||||||
|
resultMap.get("onlyInList1").add(map1.get(key));
|
||||||
|
} else if (map2.containsKey(key)) {
|
||||||
|
// 仅存在于list2中
|
||||||
|
resultMap.get("onlyInList2").add(map2.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<AttGroupCheckOrgBean> dealWithOrgUser(AttGroupBean bean, Long bean1) {
|
private List<AttGroupCheckOrgBean> dealWithOrgUser(AttGroupBean bean, Long bean1) {
|
||||||
//只有部门的将部门变成部门下所有人(去除掉其他考勤组选的人)
|
//只有部门的将部门变成部门下所有人(去除掉其他考勤组选的人)
|
||||||
List<AttGroupCheckOrgBean> checkOrgAllList = bean.getCheckOrgList();
|
List<AttGroupCheckOrgBean> checkOrgAllList = bean.getCheckOrgList();
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public class AttTasks {
|
||||||
private volatile boolean executed = false; // 标志位,表示任务是否已经执行过
|
private volatile boolean executed = false; // 标志位,表示任务是否已经执行过
|
||||||
|
|
||||||
// @Scheduled(cron = "0 0/10 * * * ?")
|
// @Scheduled(cron = "0 0/10 * * * ?")
|
||||||
@Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
// @Scheduled(initialDelay = 60000, fixedDelay = 60000 * 10)
|
||||||
@Async
|
@Async
|
||||||
public void getAttTasks() {
|
public void getAttTasks() {
|
||||||
log.info("--------考勤定时器开启------");
|
log.info("--------考勤定时器开启------");
|
||||||
|
|
@ -142,7 +142,7 @@ public class AttTasks {
|
||||||
*/
|
*/
|
||||||
private void pushAttData(String pushDate, int pushType) {
|
private void pushAttData(String pushDate, int pushType) {
|
||||||
//获取黔送云的考勤数据
|
//获取黔送云的考勤数据
|
||||||
getQsyAttendanceData(pushDate, pushType);
|
// getQsyAttendanceData(pushDate, pushType);
|
||||||
//获取考勤机中的考勤数据
|
//获取考勤机中的考勤数据
|
||||||
getMachineAttendanceData(pushDate, pushType);
|
getMachineAttendanceData(pushDate, pushType);
|
||||||
// //查出每一个考勤组的应出勤天数以及考勤组的规则
|
// //查出每一个考勤组的应出勤天数以及考勤组的规则
|
||||||
|
|
@ -383,7 +383,8 @@ public class AttTasks {
|
||||||
*/
|
*/
|
||||||
private void insertAttData(List<AttGroupBean> groupList, String pushDate, int pushType) {
|
private void insertAttData(List<AttGroupBean> groupList, String pushDate, int pushType) {
|
||||||
//获取所有的用户
|
//获取所有的用户
|
||||||
List<AttDataBean> listPerson = attSourceDataDao.getAllPerson();
|
// 2025-01-17 添加时间,查出每个人在对应时间存在的考勤组
|
||||||
|
List<AttDataBean> listPerson = attSourceDataDao.getAllPerson(pushDate);
|
||||||
if (!listPerson.isEmpty()) {
|
if (!listPerson.isEmpty()) {
|
||||||
listPerson.forEach(v -> {
|
listPerson.forEach(v -> {
|
||||||
groupList.stream()
|
groupList.stream()
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -150,4 +153,50 @@ public class MsgTasks {
|
||||||
log.info("--------轮休临时外出异常推送定时器开启------");
|
log.info("--------轮休临时外出异常推送定时器开启------");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤设置历史时间消息推送
|
||||||
|
*每天早七晚十一
|
||||||
|
*/
|
||||||
|
// @Scheduled(cron = "0 10 0,7,10 * * ?")
|
||||||
|
@Scheduled(initialDelay = 6000 * 2,fixedDelay = 60000 * 30)
|
||||||
|
@Async
|
||||||
|
public void getAttSettingHistoryTask(){
|
||||||
|
log.info("--------考勤设置历史时间消息推送定时器开启------");
|
||||||
|
String startDate = "2024-10-01";
|
||||||
|
String endDate = "2025-01-20";
|
||||||
|
List<String> dateList = getStrDateListBetween(startDate, endDate);
|
||||||
|
if(dateList.isEmpty()){
|
||||||
|
dateList.add(DateUtil.today());
|
||||||
|
}
|
||||||
|
for (String s : dateList) {
|
||||||
|
List<AttGroupBean> attList = noticeService.getAttSettingHistoryDate(s);
|
||||||
|
noticeService.insertAttSettingHistoryData(attList);
|
||||||
|
}
|
||||||
|
log.info("--------考勤设置历史时间消息推送定时器开启------");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> getStrDateListBetween(String startDateString, String endDateString) {
|
||||||
|
List<String> dateList = new ArrayList<>();
|
||||||
|
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
try {
|
||||||
|
// 解析开始日期和结束日期
|
||||||
|
Date startDate = dateFormat.parse(startDateString);
|
||||||
|
Date endDate = dateFormat.parse(endDateString);
|
||||||
|
// 创建 Calendar 实例并设置为开始日期
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(startDate);
|
||||||
|
// 循环直到当前日期超过结束日期
|
||||||
|
while (!calendar.getTime().after(endDate)) {
|
||||||
|
// 将日期格式化为字符串,并添加到列表中
|
||||||
|
dateList.add(dateFormat.format(calendar.getTime()));
|
||||||
|
// 将日期加一天
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
}
|
||||||
|
} catch (ParseException ignored) {
|
||||||
|
}
|
||||||
|
return dateList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import com.bonus.system.api.domain.MapVo;
|
||||||
import com.bonus.system.api.domain.SysDictData;
|
import com.bonus.system.api.domain.SysDictData;
|
||||||
import com.bonus.system.api.domain.SysRole;
|
import com.bonus.system.api.domain.SysRole;
|
||||||
import com.bonus.system.api.domain.SysUser;
|
import com.bonus.system.api.domain.SysUser;
|
||||||
|
import com.bonus.system.att.entity.AttGroupBean;
|
||||||
import com.bonus.system.basic.domain.SysNotice;
|
import com.bonus.system.basic.domain.SysNotice;
|
||||||
import com.bonus.system.basic.domain.SysUserOrg;
|
import com.bonus.system.basic.domain.SysUserOrg;
|
||||||
import com.bonus.system.basic.domain.SysUserPost;
|
import com.bonus.system.basic.domain.SysUserPost;
|
||||||
|
|
@ -65,4 +66,8 @@ public interface SysNoticeMapper
|
||||||
List<Long> getAttUserIdByOrgId(List<Long> orgList);
|
List<Long> getAttUserIdByOrgId(List<Long> orgList);
|
||||||
|
|
||||||
int delNotice(SysNotice bean);
|
int delNotice(SysNotice bean);
|
||||||
|
|
||||||
|
List<AttGroupBean> getAttSettingHistoryDate(String currentDay);
|
||||||
|
|
||||||
|
void insertAttSettingHistoryData(List<AttGroupBean> attList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.system.basic.service;
|
||||||
|
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.system.att.entity.AttGroupBean;
|
||||||
import com.bonus.system.basic.domain.SysNotice;
|
import com.bonus.system.basic.domain.SysNotice;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -61,4 +62,8 @@ public interface SysNoticeService {
|
||||||
* @param bean
|
* @param bean
|
||||||
*/
|
*/
|
||||||
AjaxResult delNotice(SysNotice bean);
|
AjaxResult delNotice(SysNotice bean);
|
||||||
|
|
||||||
|
List<AttGroupBean> getAttSettingHistoryDate(String s);
|
||||||
|
|
||||||
|
void insertAttSettingHistoryData(List<AttGroupBean> attList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.system.basic.service.impl;
|
||||||
|
|
||||||
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.att.entity.AttGroupBean;
|
||||||
import com.bonus.system.basic.dao.SysNoticeMapper;
|
import com.bonus.system.basic.dao.SysNoticeMapper;
|
||||||
import com.bonus.system.basic.domain.SysNotice;
|
import com.bonus.system.basic.domain.SysNotice;
|
||||||
import com.bonus.system.basic.domain.SysUserRole;
|
import com.bonus.system.basic.domain.SysUserRole;
|
||||||
|
|
@ -102,4 +103,14 @@ public class SysNoticeServiceImpl implements SysNoticeService
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AttGroupBean> getAttSettingHistoryDate(String currentDay) {
|
||||||
|
return noticeMapper.getAttSettingHistoryDate(currentDay);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertAttSettingHistoryData(List<AttGroupBean> attList) {
|
||||||
|
noticeMapper.insertAttSettingHistoryData(attList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
set is_active = 0
|
set is_active = 0
|
||||||
where group_id = #{groupId};
|
where group_id = #{groupId};
|
||||||
update att_group_person_relation
|
update att_group_person_relation
|
||||||
set is_active = 0
|
set is_active = 0,expiring_time = now()
|
||||||
where group_id = #{groupId};
|
where group_id = #{groupId};
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
@ -114,6 +114,14 @@
|
||||||
where group_id = #{groupId};
|
where group_id = #{groupId};
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteAttGroupPersonByUserId">
|
||||||
|
<foreach item="params" collection="list" separator=",">
|
||||||
|
update att_group_person_relation
|
||||||
|
set is_active = 0,expiring_time = now()
|
||||||
|
where user_id = #{params.userId};
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
<insert id="insertAttGroup" useGeneratedKeys="true" keyColumn="id" keyProperty="groupId">
|
<insert id="insertAttGroup" useGeneratedKeys="true" keyColumn="id" keyProperty="groupId">
|
||||||
insert into att_group(group_name, att_type, create_user_id)
|
insert into att_group(group_name, att_type, create_user_id)
|
||||||
values (#{groupName}, #{attType}, #{createUserId});
|
values (#{groupName}, #{attType}, #{createUserId});
|
||||||
|
|
@ -150,10 +158,10 @@
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertAttGroupPerson">
|
<insert id="insertAttGroupPerson">
|
||||||
insert into att_group_person_relation(group_id, org_id, user_id)
|
insert into att_group_person_relation(group_id, org_id, user_id, effective_time)
|
||||||
values
|
values
|
||||||
<foreach item="params" collection="list" separator=",">
|
<foreach item="params" collection="list" separator=",">
|
||||||
(#{params.groupId}, #{params.orgId}, #{params.userId})
|
(#{params.groupId}, #{params.orgId}, #{params.userId}, now())
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,19 +159,15 @@
|
||||||
</select>
|
</select>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<select id="getAllPerson" resultType="com.bonus.system.att.entity.AttDataBean">
|
<select id="getAllPerson" resultType="com.bonus.system.att.entity.AttDataBean">
|
||||||
select su.user_id, agpr.org_id, g.id as groupId, '1' as attType, '0' as attStatus
|
select su.user_id, agpr.org_id, agpr.group_id, '1' as attType, '0' as attStatus
|
||||||
from sys_user su
|
from sys_user su
|
||||||
left join att_group_person_relation agpr on agpr.user_id = su.user_id and agpr.is_active = 1
|
left join att_setting_history agpr on agpr.user_id = su.user_id and agpr.current_day = #{pushDate}
|
||||||
left join att_group g on g.id = agpr.group_id
|
where su.is_active = 1 and agpr.org_id is not null
|
||||||
where su.is_active = 1
|
|
||||||
and agpr.org_id is not null
|
|
||||||
union
|
union
|
||||||
select su.user_id, agpr.org_id, g.id as groupId, '2' as attType, '0' as attStatus
|
select su.user_id, agpr.org_id, agpr.group_id, '2' as attType, '0' as attStatus
|
||||||
from sys_user su
|
from sys_user su
|
||||||
left join att_group_person_relation agpr on agpr.user_id = su.user_id and agpr.is_active = 1
|
left join att_setting_history agpr on agpr.user_id = su.user_id and agpr.current_day = #{pushDate}
|
||||||
left join att_group g on g.id = agpr.group_id
|
where su.is_active = 1 and agpr.org_id is not null
|
||||||
where su.is_active = 1
|
|
||||||
and agpr.org_id is not null
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAttDayReport" resultType="com.bonus.system.att.entity.AttDayReportBean">
|
<select id="selectAttDayReport" resultType="com.bonus.system.att.entity.AttDayReportBean">
|
||||||
|
|
@ -227,8 +223,8 @@
|
||||||
from v_att_update_data v
|
from v_att_update_data v
|
||||||
left join sys_user su on su.user_id = v.user_id
|
left join sys_user su on su.user_id = v.user_id
|
||||||
left join sys_organization so on so.id = v.org_id
|
left join sys_organization so on so.id = v.org_id
|
||||||
left join att_group_person_relation g
|
left join att_setting_history g
|
||||||
on g.user_id = v.user_id and g.is_active = 1
|
on g.user_id = v.user_id and g.current_day = CURRENT_DATE()
|
||||||
where DATE_FORMAT(att_current_day, '%Y-%m') = DATE_FORMAT(#{pushDate}, '%Y-%m')
|
where DATE_FORMAT(att_current_day, '%Y-%m') = DATE_FORMAT(#{pushDate}, '%Y-%m')
|
||||||
and g.group_id is not null
|
and g.group_id is not null
|
||||||
GROUP BY DATE_FORMAT(att_current_day, '%Y-%m'), v.user_id
|
GROUP BY DATE_FORMAT(att_current_day, '%Y-%m'), v.user_id
|
||||||
|
|
@ -259,11 +255,11 @@
|
||||||
select asd.*,
|
select asd.*,
|
||||||
su.user_id,
|
su.user_id,
|
||||||
ag.org_id as orgId,
|
ag.org_id as orgId,
|
||||||
g.id as groupId,
|
ag.group_id as groupId,
|
||||||
g.att_type as groupType
|
g.att_type as groupType
|
||||||
from att_source_data asd
|
from att_source_data asd
|
||||||
left join sys_user su on su.id_number = asd.id_number
|
left join sys_user su on su.id_number = asd.id_number
|
||||||
left join att_group_person_relation ag on ag.user_id = su.user_id and ag.is_active = 1
|
left join att_setting_history ag on ag.user_id = su.user_id 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
|
||||||
where att_current_day
|
where att_current_day
|
||||||
<if test=' pushType == "1" '>
|
<if test=' pushType == "1" '>
|
||||||
|
|
@ -277,11 +273,11 @@
|
||||||
select asd.*,
|
select asd.*,
|
||||||
su.user_id,
|
su.user_id,
|
||||||
ag.org_id as orgId,
|
ag.org_id as orgId,
|
||||||
g.id as groupId,
|
ag.group_id as groupId,
|
||||||
g.att_type as groupType
|
g.att_type as groupType
|
||||||
from att_source_data asd
|
from att_source_data asd
|
||||||
left join sys_user su on su.user_name = asd.name
|
left join sys_user su on su.user_name = asd.name
|
||||||
left join att_group_person_relation ag on ag.user_id = su.user_id and ag.is_active = 1
|
left join att_setting_history ag on ag.user_id = su.user_id 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
|
||||||
where att_current_day
|
where att_current_day
|
||||||
<if test=' pushType == "1" '>
|
<if test=' pushType == "1" '>
|
||||||
|
|
@ -364,22 +360,6 @@
|
||||||
leave_start_date DESC
|
leave_start_date DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getSourceAttNoInOutData" resultType="com.bonus.system.att.entity.AttSourceDataBean">
|
|
||||||
select asd.*,
|
|
||||||
su.user_id,
|
|
||||||
ag.org_id as orgId,
|
|
||||||
g.id as groupId,
|
|
||||||
g.att_type as groupType
|
|
||||||
from att_source_data asd
|
|
||||||
left join sys_user su on su.user_name = asd.name
|
|
||||||
left join att_group_person_relation ag on ag.user_id = su.user_id and ag.is_active = 1
|
|
||||||
left join att_group g on g.id = ag.group_id
|
|
||||||
where att_current_day >= CURDATE()
|
|
||||||
and g.id is not null
|
|
||||||
and asd.data_source = 2
|
|
||||||
and asd.att_type = 0
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getLeaveDataByUserId" resultType="java.lang.Integer">
|
<select id="getLeaveDataByUserId" resultType="java.lang.Integer">
|
||||||
SELECT count(1)
|
SELECT count(1)
|
||||||
FROM leave_apply la
|
FROM leave_apply la
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,12 @@
|
||||||
(#{item.noticeId},#{item.userId},#{item.leaveApplyId})
|
(#{item.noticeId},#{item.userId},#{item.leaveApplyId})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertAttSettingHistoryData">
|
||||||
|
replace into att_setting_history(user_id, group_id, org_id,current_day) values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.userId},#{item.groupId},#{item.orgId},#{item.currentDay})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
<update id="updateStatus">
|
<update id="updateStatus">
|
||||||
update sys_notice_user
|
update sys_notice_user
|
||||||
set is_read='1'
|
set is_read='1'
|
||||||
|
|
@ -111,4 +117,27 @@
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getAttSettingHistoryDate" resultType="com.bonus.system.att.entity.AttGroupBean">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
org_id,
|
||||||
|
group_id,
|
||||||
|
user_id,
|
||||||
|
#{currentDay} as currentDay
|
||||||
|
FROM
|
||||||
|
att_group_person_relation
|
||||||
|
WHERE
|
||||||
|
#{currentDay} BETWEEN DATE_FORMAT( effective_time, '%Y-%m-%d' )
|
||||||
|
AND DATE_FORMAT( IFNULL(NOW(), expiring_time ), '%Y-%m-%d' )
|
||||||
|
ORDER BY
|
||||||
|
user_id,
|
||||||
|
effective_time DESC
|
||||||
|
LIMIT 10000000
|
||||||
|
) aa
|
||||||
|
GROUP BY
|
||||||
|
user_id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue