Compare commits

...

3 Commits

Author SHA1 Message Date
fl 803298ae60 人员数据同步调换一下先后顺序 2025-02-12 09:38:59 +08:00
fl 9117c69c1b 月报表导出问题修改
人员考勤组时间生成修改
2025-02-12 09:37:48 +08:00
fl 9bf8a8b7c8 月报表生成先删除在生成
导出考勤状态问题修改
2025-02-12 09:36:00 +08:00
17 changed files with 230 additions and 76 deletions

View File

@ -21,7 +21,14 @@ public enum AttStatus {
("17"),
("18"),
("19"),
("20");
("20"),
("21"),
("22"),
("23"),
("24"),
其他("25")
;
private String code;

View File

@ -54,7 +54,7 @@ public interface AttSourceDataDao {
* 查询月考勤情况
* @return list bean
*/
List<AttMonthReportBean> selectAttMonthReport(@Param("pushDate")String pushDate);
List<AttMonthReportBean> selectAttMonthReport(@Param("pushDate")String pushDate,@Param("attRuleDate")String attRuleDate);
/**
* 新增月报表
@ -154,4 +154,6 @@ public interface AttSourceDataDao {
void insertWorkAbnormal(List<AttSourceDataBean> longBreakRecords);
int getFirstAttendanceData(String date);
void deleteAttMonthReport(String pushDate);
}

View File

@ -1,5 +1,6 @@
package com.bonus.system.att.dao;
import com.bonus.system.api.domain.MapVo;
import com.bonus.system.att.entity.AttDataDetailsBean;
import com.bonus.system.att.entity.AttDayReportBean;
import com.bonus.system.att.entity.AttMonthReportBean;
@ -7,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* 考勤明细-数据访问层
@ -93,4 +95,6 @@ public interface AttendanceDetailsDao {
List<AttDataDetailsBean> getAttCountList(AttDataDetailsBean bean);
List<AttDataDetailsBean> getOrgUserOutCountList(@Param("bean") AttDataDetailsBean bean);
List<MapVo> getAttStatusList();
}

View File

@ -1,12 +1,14 @@
package com.bonus.system.att.service;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.system.api.domain.MapVo;
import com.bonus.system.att.entity.AttDataDetailsBean;
import com.bonus.system.att.entity.AttDayReportBean;
import com.bonus.system.att.entity.AttMonthReportBean;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 考勤明细-业务层
@ -107,4 +109,6 @@ public interface AttendanceDetailsService {
List<AttDataDetailsBean> getAttCountList(AttDataDetailsBean bean);
List<AttDataDetailsBean> getOrgUserOutCountList(AttDataDetailsBean bean);
List<MapVo> getAttStatusList();
}

View File

@ -235,6 +235,11 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
return attendanceDetailsDao.getOrgUserOutCountList(bean);
}
@Override
public List<MapVo> getAttStatusList() {
return attendanceDetailsDao.getAttStatusList();
}
public List<AttDayReportBean> getAttDayReportListAll(List<AttDayReportBean> list) {
List<AttDayReportBean> allList = new ArrayList<>();
Map<String, AttDayReportBean> map = list.stream()

View File

@ -24,10 +24,7 @@ import javax.annotation.Resource;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.*;
@ -76,7 +73,7 @@ public class AttTasks {
/**
* 历史考勤数据
*/
// @Scheduled(initialDelay = 6000,fixedDelay = 60000 * 30)
@Scheduled(initialDelay = 6000,fixedDelay = 60000 * 30)
@Async
public void getHisAttTasks() {
log.info("--------考勤定时器开启------");
@ -84,8 +81,8 @@ public class AttTasks {
return; // 如果任务已经执行过直接返回
}
executed = true; // 设置标志位表示任务已经执行过
String startDate = "2024-12-21";
String endDate = "2024-12-21";
String startDate = "2025-01-03";
String endDate = "2025-01-31";
List<String> dateList = getStrDateListBetween(startDate, endDate);
// List<String> dateList = new ArrayList<>();
// dateList.add("2024-10-18");
@ -93,6 +90,45 @@ public class AttTasks {
log.info("--------考勤定时器完毕------");
}
/**
* 防止黔送离线数据每月前三天晚上将数据重新执行
*/
@Scheduled(cron = "0 30 22 1-3 * *")
@Async
public void getHisMonthAttTask() {
// 获取当前日期
LocalDate today = LocalDate.now();
// 获取上个月的YearMonth实例
YearMonth previousMonth = YearMonth.from(today).minusMonths(1);
// 上个月的第一天
LocalDate startOfPreviousMonth = previousMonth.atDay(1);
// 上个月的最后一天
LocalDate endOfPreviousMonth = previousMonth.atEndOfMonth();
String startDate = startOfPreviousMonth.toString();
String endDate = endOfPreviousMonth.toString();
List<String> dateList = getStrDateListBetween(startDate, endDate);
hisAttPush(dateList);
log.info("--------考勤定时器完毕------");
}
/**
* 凌晨0-5点得到数据算作昨天将昨天的重新执行
*/
@Scheduled(cron = "0 5 6 * * ?")
@Async
public void getHisYesterdayAttTask() {
// 获取今天的日期
LocalDate today = LocalDate.now();
// 计算昨天的日期
LocalDate yesterday = today.minusDays(1);
String startDate = yesterday.toString();
String endDate = yesterday.toString();
List<String> dateList = getStrDateListBetween(startDate, endDate);
hisAttPush(dateList);
log.info("--------考勤定时器完毕------");
}
public void hisAttPush(List<String> dateList) {
// 创建固定大小的线程池
ExecutorService executorService = Executors.newFixedThreadPool(THREAD_POOL_SIZE);
@ -104,7 +140,7 @@ public class AttTasks {
executorService.submit(() -> {
for (String date : batch) {
try {
delHisData(date);
// delHisData(date);
pushAttData(date, 2);
} catch (Exception e) {
// 记录异常并继续处理下一个日期
@ -142,9 +178,9 @@ public class AttTasks {
*/
private void pushAttData(String pushDate, int pushType) {
//获取黔送云的考勤数据
getQsyAttendanceData(pushDate, pushType);
//获取考勤机中的考勤数据
getMachineAttendanceData(pushDate, pushType);
// getQsyAttendanceData(pushDate, pushType);
// //获取考勤机中的考勤数据
// getMachineAttendanceData(pushDate, pushType);
// //查出每一个考勤组的应出勤天数以及考勤组的规则
List<AttGroupBean> groupList = getGroupData(pushDate, pushType);
// //新增默认考勤数据到考勤数据和修改表
@ -1125,8 +1161,21 @@ public class AttTasks {
List<AttDayReportBean> dayReportList = attSourceDataDao.selectAttDayReport(pushDate, pushType);
//日报表新增
attSourceDataDao.insertAttDayReport(dayReportList);
String attRuleDate;
//月报表查询
List<AttMonthReportBean> monthReportList = attSourceDataDao.selectAttMonthReport(pushDate);
if (pushType == 2) {
//历史数据查询
//如果是当月将最新时间将最新时间存进去如果是之前月将之前月的最后一天存进去
// 当前日期时间
LocalDateTime now = LocalDateTime.now();
// 调用方法获取目标日期
LocalDate targetDate = getTargetDate(now);
attRuleDate = targetDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}else{
//如果更新当天数据查询
attRuleDate = DateUtil.today();
}
List<AttMonthReportBean> monthReportList = attSourceDataDao.selectAttMonthReport(pushDate,attRuleDate);
//人员对应出月出勤天数
monthReportList.forEach(c ->
groupList.stream()
@ -1134,8 +1183,33 @@ public class AttTasks {
.findFirst()
.ifPresent(v -> c.setRequiredDays(v.getAttWorkDayBean().getRequiredDays()))
);
//先将本月数据删除重新生成
attSourceDataDao.deleteAttMonthReport(pushDate);
//月报表新增
attSourceDataDao.insertAttMonthReport(monthReportList);
}
/**
* 根据当前日期计算目标日期
*
* @param now 当前日期时间
* @return 目标日期
*/
public static LocalDate getTargetDate(LocalDateTime now) {
// 获取当前日期的年份和月份
YearMonth currentYearMonth = YearMonth.from(now);
// 获取当前日期的月初日期
LocalDate firstDayOfMonth = currentYearMonth.atDay(1);
// 判断是否是当月
if (now.getMonth().equals(firstDayOfMonth.getMonth())) {
// 如果是当月返回当前日期的日期部分
return now.toLocalDate();
} else {
// 如果是之前月份返回该月份的最后一天
return currentYearMonth.atEndOfMonth();
}
}
}

View File

@ -26,6 +26,8 @@ import java.lang.reflect.InvocationTargetException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -164,15 +166,23 @@ public class MsgTasks {
public void getAttSettingHistoryTask(){
log.info("--------考勤设置历史时间消息推送定时器开启------");
String startDate = DateUtil.today();
// String endDate = "2025-01-19";
String endDate = DateUtil.today();
List<String> dateList = getStrDateListBetween(startDate, endDate);
// 解析 startDate 字符串到 LocalDate 对象
LocalDate date = LocalDate.parse(startDate, DateTimeFormatter.ISO_LOCAL_DATE);
// 向前推30天
LocalDate newDate = date.minusDays(30);
// 如果需要将结果格式化为特定格式的字符串可以使用以下代码
String formattedNewDate = newDate.format(DateTimeFormatter.ISO_LOCAL_DATE);
//向前推2个月的时间检索缺少哪一天推送哪一天
List<String> dateListOne = noticeService.getAttSettingDate(startDate);
List<String> dateList = getStrDateListBetween(formattedNewDate, startDate);
// dateList 中移除所有在 dateListOne 中存在的元素
dateListOne.removeIf(startDate::contains);
dateList.removeIf(dateListOne::contains);
for (String s : dateList) {
List<AttGroupBean> attList = noticeService.getAttSettingHistoryDate(s);
if(!attList.isEmpty()){
noticeService.insertAttSettingHistoryData(attList);
}
}
log.info("--------考勤设置历史时间消息推送定时器开启------");
}

View File

@ -52,36 +52,37 @@ public class WechatTasks {
* 人员基础数据同步定时器
*/
// @Scheduled(cron = "0 0/10 * * * ?")
@Scheduled(initialDelay = 60000,fixedDelay = 60000 * 30)
// @Scheduled(initialDelay = 60000,fixedDelay = 60000 * 30)
@Async
public void pushPersonTask() {
log.info("--------人员基础数据同步定时器开启------");
index=4;
//人脸更新
List<AttFaceBean> faceList = dao.getWebFaceList();
String jsonStr2 = "{}";
String method2 = "getWeChatFaceList";
String string2 = httpPost(method2, jsonStr2);
List<AttFaceBean> wechatFaceList = FastJsonHelper.jsonArrStrToBeanList(string2, AttFaceBean.class);
syncFaceToDatabase(faceList, wechatFaceList);
//考勤库人员
List<SysUser> list = dao.getPersonList();
//考勤小程序库人员
// List<SysUser> wechatList = dao.getWeChatPersonList();
String jsonStr = "{}";
String method = "getWeChatPersonList";
String string = httpPost(method, jsonStr);
List<SysUser> wechatList = FastJsonHelper.jsonArrStrToBeanList(string, SysUser.class);
// //所有字段同步
syncListsToDatabase(list, wechatList);
//人脸更新
List<AttFaceBean> faceList = dao.getWebFaceList();
// List<AttFaceBean> wechatFaceList = dao.getWeChatFaceList();
String jsonStr2 = "{}";
String method2 = "getWeChatFaceList";
String string2 = httpPost(method2, jsonStr2);
List<AttFaceBean> wechatFaceList = FastJsonHelper.jsonArrStrToBeanList(string2, AttFaceBean.class);
syncFaceToDatabase(faceList, wechatFaceList);
log.info("--------人员基础数据同步定时器完毕------");
}
/**
* 休假出差数据同步定时器
*/
@Scheduled(initialDelay = 60000 * 2,fixedDelay = 60000 * 30)
// @Scheduled(initialDelay = 60000 * 2,fixedDelay = 60000 * 30)
@Async
public void leaveTask() {
log.info("--------休假出差数据定时器开启------");
@ -152,7 +153,7 @@ public class WechatTasks {
/**
* 考勤数据同步定时器
*/
@Scheduled(initialDelay = 60000 * 3,fixedDelay = 60000 * 30)
// @Scheduled(initialDelay = 6000 * 3,fixedDelay = 60000 * 30)
@Async
public void wechatAttTask() {
log.info("--------考勤数据定时器开启------");
@ -356,7 +357,6 @@ public class WechatTasks {
* @String isCheck
*/
public int checkWechatIsFace(SysUser user){
// dao.checkWechatIsFace(user);
String jsonStr = FastJsonHelper.beanToJsonStr(user);
String method = "checkWechatIsFace";
String string = httpPost(method, jsonStr);

View File

@ -22,7 +22,7 @@ public class WorkdayCalculator {
public static void main(String[] args) {
List<String> list= getWorkDay("1,1,1,1,1,0,0", 1, getHolidays(), "2024-12-01");
List<String> list= getWorkDay("1,1,1,1,1,0,0", 1, getHolidays(), "2025-01-01");
System.out.print(1);
}
@ -70,15 +70,19 @@ public class WorkdayCalculator {
private static List<Holiday> getHolidays() {
List<Holiday> holidays = new ArrayList<>();
holidays.add(new Holiday("2024-12-01", "", "1"));
holidays.add(new Holiday("2024-12-07", "", "1"));
holidays.add(new Holiday("2024-12-08", "", "1"));
holidays.add(new Holiday("2024-12-14", "", "1"));
holidays.add(new Holiday("2024-12-15", "", "1"));
holidays.add(new Holiday("2024-12-21", "", "1"));
holidays.add(new Holiday("2024-12-22", "", "1"));
holidays.add(new Holiday("2024-12-28", "", "1"));
holidays.add(new Holiday("2024-12-29", "", "1"));
holidays.add(new Holiday("2025-01-01", "", "1"));
holidays.add(new Holiday("2025-01-04", "", "1"));
holidays.add(new Holiday("2025-01-05", "", "1"));
holidays.add(new Holiday("2025-01-11", "", "1"));
holidays.add(new Holiday("2025-01-12", "", "1"));
holidays.add(new Holiday("2025-01-18", "", "1"));
holidays.add(new Holiday("2025-01-19", "", "1"));
holidays.add(new Holiday("2025-01-25", "", "1"));
holidays.add(new Holiday("2025-01-26", "", "2"));
holidays.add(new Holiday("2025-01-28", "", "1"));
holidays.add(new Holiday("2025-01-29", "", "1"));
holidays.add(new Holiday("2025-01-30", "", "1"));
holidays.add(new Holiday("2025-01-31", "", "1"));
return holidays;
}

View File

@ -70,4 +70,6 @@ public interface SysNoticeMapper
List<AttGroupBean> getAttSettingHistoryDate(String currentDay);
void insertAttSettingHistoryData(List<AttGroupBean> attList);
List<String> getAttSettingDate(String startDate);
}

View File

@ -66,4 +66,6 @@ public interface SysNoticeService {
List<AttGroupBean> getAttSettingHistoryDate(String s);
void insertAttSettingHistoryData(List<AttGroupBean> attList);
List<String> getAttSettingDate(String startDate);
}

View File

@ -113,4 +113,9 @@ public class SysNoticeServiceImpl implements SysNoticeService
public void insertAttSettingHistoryData(List<AttGroupBean> attList) {
noticeMapper.insertAttSettingHistoryData(attList);
}
@Override
public List<String> getAttSettingDate(String startDate) {
return noticeMapper.getAttSettingDate(startDate);
}
}

View File

@ -407,7 +407,7 @@ public class ExportFileController {
writer.merge(rowNum + listData.size(), rowNum + listData.size() + 1, 0, 0,
"说明", false);
writer.merge(rowNum + listData.size(), rowNum + listData.size(), 1, 2 + days.size(),
"1.考勤记录:出勤记“√”,出差记“Δ”,年休假记“年”,探亲假记“探”,事假记“事”,法定假记“法”,病假记“病”,产假记“产”,婚假记“婚”,丧假记“丧”,育儿假记“育”,陪护假记“陪”,补休记“补”,旷工记“旷”,迟到记“迟”,早退记“退”,省内工地记“工”,省外工地记“外”,出差需在备注栏备注清楚出差地点。", false);
"1.考勤记录:出勤记“√”,出差记“Δ”,年休假记“年”,探亲假记“探”,事假记“事”,法定假记“法”,病假记“病”,产假记“产”,婚假记“婚”,丧假记“丧”,育儿假记“育”,陪护假记“陪”,补休记“补”,旷工记“旷”,迟到记“迟”,早退记“退”,流产假记“流”,哺乳假记“哺”,节育假记“节”,父母护理假记“护”,其他记“其他”,省内工地记“工”,省外工地记“外”,出差需在备注栏备注清楚出差地点。", false);
writer.merge(rowNum + listData.size() + 1, rowNum + listData.size() + 1, 1, 2 + days.size(),
"2.员工有关请假凭证记录清楚准确与本表于次月3日前一并报人力资源管理部门专业分公司报送时间为30日前", false);
writer.autoSizeColumn(3);
@ -543,7 +543,7 @@ public class ExportFileController {
headers.put("9", "打卡地异常");
//工作外出单独一个序号不占用考勤状态
headers.put("99", "工作外出");
Map<String, String> attStatus = getStringStringMap();
Map<Long, String> attStatus = getStringStringMap();
if (StringHelper.isNotEmpty(bean.getStartDate()) && StringHelper.isNotEmpty(bean.getEndDate())) {
AttDataDetailsBean dayTable = new AttDataDetailsBean();
dayTable.setStartDate(bean.getStartDate());
@ -583,10 +583,10 @@ public class ExportFileController {
map.put("所属部门", list.get(i).getOrgName());
map.put("考勤日期", list.get(i).getAttCurrentDay());
map.put("上班打卡时间", list.get(i).getToWorkAttCurrentTime());
map.put("上班状态", attStatus.get(list.get(i).getToWorkAttStatus()));
map.put("上班状态", attStatus.get(Long.parseLong(list.get(i).getToWorkAttStatus())));
map.put("上班打卡地址", list.get(i).getToWorkAttAddress());
map.put("下班打卡时间", list.get(i).getOffWorkAttCurrentTime());
map.put("下班状态", attStatus.get(list.get(i).getOffWorkAttStatus()));
map.put("下班状态", attStatus.get(Long.parseLong(list.get(i).getOffWorkAttStatus())));
map.put("下班打卡地址", list.get(i).getOffWorkAttAddress());
departmentData2.add(map);
}
@ -604,29 +604,32 @@ public class ExportFileController {
}
private Map<String, String> getStringStringMap() {
Map<String, String> attStatus = new HashMap<>();
attStatus.put("1", "正常");
attStatus.put("2", "迟到");
attStatus.put("3", "旷工");
attStatus.put("4", "早退");
attStatus.put("5", "轮休");
attStatus.put("6", "请假");
attStatus.put("7", "外出");
attStatus.put("8", "出入异常");
attStatus.put("9", "打卡地异常");
attStatus.put("10", "出差");
attStatus.put("11", "法定节假日");
attStatus.put("12", "年休假");
attStatus.put("13", "探亲假");
attStatus.put("14", "事假");
attStatus.put("15", "病假");
attStatus.put("16", "产假");
attStatus.put("17", "婚假");
attStatus.put("18", "丧假");
attStatus.put("19", "育儿假");
attStatus.put("20", "陪护假");
return attStatus;
private Map<Long, String> getStringStringMap() {
// Map<String, String> attStatus = new HashMap<>();
//
// attStatus.put("1", "正常");
// attStatus.put("2", "迟到");
// attStatus.put("3", "旷工");
// attStatus.put("4", "早退");
// attStatus.put("5", "轮休");
// attStatus.put("6", "请假");
// attStatus.put("7", "外出");
// attStatus.put("8", "出入异常");
// attStatus.put("9", "打卡地异常");
// attStatus.put("10", "出差");
// attStatus.put("11", "法定节假日");
// attStatus.put("12", "年休假");
// attStatus.put("13", "探亲假");
// attStatus.put("14", "事假");
// attStatus.put("15", "病假");
// attStatus.put("16", "产假");
// attStatus.put("17", "婚假");
// attStatus.put("18", "丧假");
// attStatus.put("19", "育儿假");
// attStatus.put("20", "陪护假");
List<MapVo> arrayList = attendanceDetailsService.getAttStatusList();
return arrayList.stream()
.collect(Collectors.toMap(MapVo::getId, MapVo::getName, (existing, replacement) -> existing));
}
/**
@ -681,7 +684,7 @@ public class ExportFileController {
map.put("序号", i + 1);
map.put("姓名", attDayReportList.get(i).getUserName());
map.put("所属部门", attDayReportList.get(i).getOrgName());
map.put("考勤月", attDayReportList.get(i).getMonth());
map.put("考勤月", title);
map.put("应考勤天数", attDayReportList.get(i).getRequiredDays());
map.put("正常打卡天数", attDayReportList.get(i).getNormalNum());
map.put("迟到天数", attDayReportList.get(i).getLateNum());
@ -709,12 +712,13 @@ public class ExportFileController {
headers.put("9", "打卡地异常");
headers.put("10", "出差详情");
headers.put("99", "工作外出");
Map<String, String> attStatus = getStringStringMap();
Map<Long, String> attStatus = getStringStringMap();
if (StringHelper.isNotEmpty(bean.getMonth())) {
List<String> monthFirstAndLast = getMonthFirstAndLast(bean.getMonth());
AttDetailBean dayTable = new AttDetailBean();
dayTable.setStartDate(monthFirstAndLast.get(0));
dayTable.setEndDate(monthFirstAndLast.get(1));
dayTable.setName(bean.getUserName());
if (bean.getOrgId() != null) {
dayTable.setOrgId(String.valueOf(bean.getOrgId()));
}else{
@ -769,10 +773,10 @@ public class ExportFileController {
map.put("所属部门", list.get(i).getOrgName());
map.put("考勤日期", list.get(i).getAttCurrent());
map.put("上班打卡时间", list.get(i).getGoWorkTime());
map.put("上班状态", attStatus.get(String.valueOf(list.get(i).getGoWorkStatus())));
map.put("上班状态", attStatus.get(Long.parseLong(String.valueOf(list.get(i).getGoWorkStatus()))));
map.put("上班打卡地址", list.get(i).getGoWorkAddress());
map.put("下班打卡时间", list.get(i).getOffWorkTime());
map.put("下班状态", attStatus.get(String.valueOf(list.get(i).getOffWorkStatus())));
map.put("下班状态", attStatus.get(Long.parseLong(String.valueOf(list.get(i).getOffWorkStatus()))));
map.put("下班打卡地址", list.get(i).getOffWorkAddress());
departmentData2.add(map);
}

View File

@ -177,6 +177,9 @@
<if test="userId != null ">
and vat.user_id = #{userId}
</if>
<if test="name != null ">
and locate(#{name},su.user_name) > 0
</if>
<if test='attStatis != null and attStatis == "6"'>
and (vat.toWorkAttStatus in (SELECT dict_value
FROM sys_dict_data

View File

@ -31,7 +31,7 @@
<insert id="insertAttMonthReport">
<foreach collection="list" item="params" separator=";">
replace into att_month_report(user_id, name, org_id, org_name, att_current_month,
insert into att_month_report(user_id, name, org_id, org_name, att_current_month,
required_days, normal_num, late_num, early_num, skipping_num,
leave_num, address_error_num, ein_error_num, rest_num, out_num, business_trip_num)
values (#{params.userId}, #{params.userName}, #{params.orgId}, #{params.orgName},
@ -141,6 +141,11 @@
from att_data_update
where att_current_day = #{date};
</delete>
<delete id="deleteAttMonthReport">
delete
from att_month_report
where att_current_month = DATE_FORMAT(#{pushDate}, '%Y-%m')
</delete>
<select id="getQsyAttendances" resultType="com.bonus.system.att.entity.AttSourceDataBean">
select name, id_number, '0' as orgId, '0' as orgName,
@ -200,7 +205,7 @@
</select>
<select id="selectAttMonthReport" resultType="com.bonus.system.att.entity.AttMonthReportBean">
select v.org_id,
select g.org_id,
v.user_id,
su.user_name,
so.org_name,
@ -222,9 +227,9 @@
IFNULL( sum( IF ( toWorkAttStatus = 10, 0.5, 0 )), 0 ) + IFNULL( sum( IF ( offWorkAttStatus = 10, 0.5, 0 )), 0 ) AS businessTripNum
from v_att_update_data v
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 att_setting_history g
on g.user_id = v.user_id and g.current_day = CURRENT_DATE()
on g.user_id = v.user_id and g.current_day = #{attRuleDate}
left join sys_organization so on so.id = g.org_id
where DATE_FORMAT(att_current_day, '%Y-%m') = DATE_FORMAT(#{pushDate}, '%Y-%m')
and g.group_id is not null
GROUP BY DATE_FORMAT(att_current_day, '%Y-%m'), v.user_id

View File

@ -450,6 +450,9 @@
<if test="bean.attCurrentMonth != null and bean.attCurrentMonth != ''">
and locate(#{bean.attCurrentMonth},awa.att_current_day)
</if>
<if test="bean.userName != null and bean.userName != ''">
and locate(#{bean.userName},awa.user_name)
</if>
<if test='bean.orgList != null and bean.orgList.size() > 0'>
and so.id in (
<foreach collection="bean.orgList" item="item" separator=",">
@ -461,6 +464,17 @@
ORDER BY
awa.att_current_day DESC
</select>
<select id="getAttStatusList" resultType="com.bonus.system.api.domain.MapVo">
SELECT
dict_sort as id,
dict_label as name
FROM
sys_dict_data
WHERE
dict_type = 'att_status'
ORDER BY
dict_sort ASC
</select>
<update id="updateAttDetailsData">
<foreach collection="list" item="params" separator=";">

View File

@ -140,4 +140,13 @@
GROUP BY
user_id
</select>
<select id="getAttSettingDate" resultType="java.lang.String">
SELECT DISTINCT
current_day
FROM
`att_setting_history` WHERE current_day > DATE_ADD(#{startDate}, INTERVAL -30 DAY)
ORDER BY current_day DESC
</select>
</mapper>