接口调试

This commit is contained in:
方亮 2026-01-29 18:59:09 +08:00
parent f29cc76714
commit 6e02ace766
26 changed files with 1020 additions and 46 deletions

View File

@ -77,7 +77,7 @@ public interface RemoteAttDataService {
* @param today 日期
*/
@PostMapping(value = "/attInner/getMonthReportFullAtt")
void getMonthReportFullAtt(@RequestParam(value = "today")String today, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
void getMonthReportFullAtt(@RequestParam(value = "month")String month, @RequestParam(value = "today")String today, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* 请假数据回滚

View File

@ -68,7 +68,7 @@ public class RemoteAttDataFallbackFactory implements FallbackFactory<RemoteAttDa
}
@Override
public void getMonthReportFullAtt(String today, String source) {
public void getMonthReportFullAtt(String month, String today, String source) {
return;
}

View File

@ -133,10 +133,13 @@ public class AttJobTask {
*/
// @Scheduled(cron = "0 0 23 * * ?")
@Async
public void getMonthReportFullAttTask() {
public void getMonthReportFullAttTask(String month) {
log.info("--------月报表--是否全勤定时器开启------");
String today = DateUtil.today();
service.getMonthReportFullAtt(today, SecurityConstants.INNER);
String today = "";
if(StringUtils.isEmpty(month)){
today = DateUtil.today();
}
service.getMonthReportFullAtt(month, today, SecurityConstants.INNER);
log.info("--------月报表--是否全勤定时器完毕------");
}

View File

@ -0,0 +1,182 @@
package com.bonus.system.att.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.bonus.common.core.utils.ExcelStyleUtil;
import com.bonus.common.core.utils.StringHelper;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.Log;
import com.bonus.common.log.enums.BusinessType;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.system.att.entity.AttChangeBean;
import com.bonus.system.att.entity.AttRateBean;
import com.bonus.system.att.entity.AttRateExportBean;
import com.bonus.system.att.entity.YearFullAttBean;
import com.bonus.system.att.service.AttAbnormalService;
import com.bonus.system.att.service.AttChangeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 考勤rate
*
* @author fly
*/
@RestController
@RequestMapping("/attRate")
@Slf4j
public class AttAbnormalController extends BaseController {
@Resource(name = "AttAbnormalService")
private AttAbnormalService service;
/**
* 获取考勤率列表
*/
// @RequiresPermissions("att:change:list")
@GetMapping("/getAttRateTypeList")
@Log(title = "考勤报表->月考勤率查询", businessType = BusinessType.QUERY)
public TableDataInfo getAttRateTypeList(AttRateBean bean) {
try{
startPage();
return getDataTable(service.getAttRateTypeList(bean));
}catch (Exception e){
log.error(e.toString(),e);
}
return getDataTableError(new ArrayList<>());
}
@GetMapping("/exportAttRateTypeList")
public void exportAttRateTypeList(HttpServletResponse response, AttRateBean bean) {
try {
List<AttRateBean> workerYearFullAttList = service.getAttRateTypeList(bean);
for (int i = 0; i < workerYearFullAttList.size(); i++) {
AttRateBean o = workerYearFullAttList.get(i);
o.setId(i + 1L);
}
extracted(workerYearFullAttList, AttRateBean.class, "考勤率列表", "考勤率列表", "考勤率列表", response);
} catch (Exception e) {
log.error(e.toString(), e);
}
}
/**
* 获取考勤率详情
*/
// @RequiresPermissions("att:change:list")
@GetMapping("/getAttRateTypeDetailsList")
@Log(title = "考勤报表->月考勤类型详情", businessType = BusinessType.QUERY)
public TableDataInfo getAttRateTypeDetailsList(AttRateBean bean) {
try{
startPage();
return getDataTable(service.getAttRateTypeDetailsList(bean));
}catch (Exception e){
log.error(e.toString(),e);
}
return getDataTableError(new ArrayList<>());
}
/**
* 获取迟到早退旷工列表
*/
// @RequiresPermissions("att:change:list")
@GetMapping("/getAttAbnormalList")
@Log(title = "考勤报表->月考勤率异常(迟到早退旷工)", businessType = BusinessType.QUERY)
public TableDataInfo getAttAbnormalList(AttRateBean bean) {
try{
startPage();
return getDataTable(service.getAttAbnormalList(bean));
}catch (Exception e){
log.error(e.toString(),e);
}
return getDataTableError(new ArrayList<>());
}
@GetMapping("/exportAttAbnormalList")
public void exportAttAbnormalList(HttpServletResponse response, AttRateBean bean) {
try {
List<AttRateBean> workerYearFullAttList = service.getAttAbnormalList(bean);
//
List<AttRateExportBean> exportBeanList = workerYearFullAttList.stream()
.map(source -> {
AttRateExportBean target = new AttRateExportBean();
BeanUtils.copyProperties(source, target);
return target;
})
.collect(Collectors.toList());
for (int i = 0; i < exportBeanList.size(); i++) {
AttRateExportBean o = exportBeanList.get(i);
o.setId(i + 1L);
}
String title = "";
if(bean.getAttCurrentMonth() != null && StringHelper.isEmpty(bean.getAttCurrentMonth())){
title = bean.getAttCurrentMonth() + "月迟到早退旷工列表";
}else if(bean.getYear() != null && StringHelper.isEmpty(bean.getYear())){
title = bean.getYear() + "年迟到早退旷工列表";
}else{
title = "迟到早退旷工列表";
}
extracted(exportBeanList, AttRateExportBean.class, title, "迟到早退旷工列表", "迟到早退旷工列表", response);
} catch (Exception e) {
log.error(e.toString(), e);
}
}
/**
* 获取考勤类型详情
*/
// @RequiresPermissions("att:change:list")
@GetMapping("/getAttAbnormalDetailsList")
@Log(title = "考勤报表->月考勤类型详情", businessType = BusinessType.QUERY)
public TableDataInfo getAttAbnormalDetailsList(AttRateBean bean) {
try{
startPage();
return getDataTable(service.getAttTypeList(bean));
}catch (Exception e){
log.error(e.toString(),e);
}
return getDataTableError(new ArrayList<>());
}
/**
* 导出excel文件
*
* @param list 数据
* @param clazz bean.class
* @param title 标题
* @param sheetName sheet名字
* @param fileName 文件名
* @param response 响应
* @throws IOException
*/
private static void extracted(List<? extends Object> list, Class<? extends Object> clazz, String title, String sheetName, String fileName, HttpServletResponse response) throws IOException {
ExportParams exportParams = new ExportParams(title, sheetName, ExcelType.XSSF);
exportParams.setStyle(ExcelStyleUtil.class);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, clazz, list);
response.setContentType("application/vnd.ms-excel");
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode(fileName + ".xlsx", "UTF-8"));
ServletOutputStream outputStream = response.getOutputStream();
workbook.write(outputStream);
outputStream.close();
workbook.close();
}
}

View File

@ -157,9 +157,12 @@ public class AttInnerController extends BaseController {
*/
@PostMapping("/getMonthReportFullAtt")
@Log(title = "数据拉取(考勤)", businessType = BusinessType.QUERY)
public void getMonthReportFullAtt(String today) {
public void getMonthReportFullAtt(String month,String today) {
try{
attTask.getMonthReportFullAttTask();
List<String> list = attCalService.getNotFullAtt(today,month);
if(!list.isEmpty()){
attCalService.updateMonthReportFullAtt(list,month);
}
}catch (Exception e){
log.error(e.toString(),e);
}

View File

@ -1,5 +1,9 @@
package com.bonus.system.att.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.bonus.common.core.utils.ExcelStyleUtil;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
@ -10,22 +14,25 @@ import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.system.api.domain.MapVo;
import com.bonus.system.api.domain.SysRole;
import com.bonus.system.api.domain.SysUser;
import com.bonus.system.att.entity.AttDataDetailsBean;
import com.bonus.system.att.entity.AttDayReportBean;
import com.bonus.system.att.entity.AttMonthDaysMakeUpBean;
import com.bonus.system.att.entity.AttMonthReportBean;
import com.bonus.system.att.entity.*;
import com.bonus.system.att.service.AttendanceDetailsService;
import com.bonus.system.basic.dao.SysOrgDao;
import com.bonus.system.basic.dao.SysUserMapper;
import com.bonus.system.basic.domain.SysOrg;
import com.bonus.system.basic.domain.SysOrgHistoryBean;
import com.bonus.system.basic.service.SysOrgService;
import com.bonus.system.dept.dao.ProDeptRoleDao;
import com.bonus.system.holiday.dao.WorkReportDao;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -455,4 +462,80 @@ public class AttendanceDetailsController extends BaseController {
}
return error("系统异常");
}
/**
* 获取年全勤情况
*/
@GetMapping("/getWorkerYearFullAttList")
@Log(title = "考勤报表->月报表->年全勤情况", businessType = BusinessType.QUERY)
public TableDataInfo getWorkerYearFullAttList(YearFullAttBean bean) {
try{
startPage();
return getDataTable(attendanceDetailsService.getWorkerYearFullAttList(bean));
}catch (Exception e){
log.error(e.toString(),e);
}
return getDataTableError(new ArrayList<>());
}
/**
* 年全勤导出
*
* @param response
* @param bean
* @return void
* @authorfly
* @date2025-03-07-10:30
*/
// @RequiresPermissions("org:orgHis:export")
@GetMapping("/exportYearFullAtt")
public void exportYearFullAtt(HttpServletResponse response, YearFullAttBean bean) {
try {
List<YearFullAttBean> workerYearFullAttList = attendanceDetailsService.getWorkerYearFullAttList(bean);
for (int i = 0; i < workerYearFullAttList.size(); i++) {
YearFullAttBean o = workerYearFullAttList.get(i);
o.setId(i + 1L);
//
o.setOneMonth("1".equals(o.getOneMonth()) ? "全勤" : "未全勤");
o.setTwoMonth("1".equals(o.getTwoMonth()) ? "全勤" : "未全勤");
o.setThreeMonth("1".equals(o.getThreeMonth()) ? "全勤" : "未全勤");
o.setFourMonth("1".equals(o.getFourMonth()) ? "全勤" : "未全勤");
o.setFiveMonth("1".equals(o.getFiveMonth()) ? "全勤" : "未全勤");
o.setSixMonth("1".equals(o.getSixMonth()) ? "全勤" : "未全勤");
o.setSevenMonth("1".equals(o.getSevenMonth()) ? "全勤" : "未全勤");
o.setEightMonth("1".equals(o.getEightMonth()) ? "全勤" : "未全勤");
o.setNineMonth("1".equals(o.getNineMonth()) ? "全勤" : "未全勤");
o.setTenMonth("1".equals(o.getTenMonth()) ? "全勤" : "未全勤");
o.setElevenMonth("1".equals(o.getElevenMonth()) ? "全勤" : "未全勤");
o.setTwelveMonth("1".equals(o.getTwelveMonth()) ? "全勤" : "未全勤");
}
extracted(workerYearFullAttList, YearFullAttBean.class, bean.getYear() + "年全勤导出", "年全勤导出", "年全勤导出", response);
} catch (Exception e) {
log.error(e.toString(), e);
}
}
/**
* 导出excel文件
*
* @param list 数据
* @param clazz bean.class
* @param title 标题
* @param sheetName sheet名字
* @param fileName 文件名
* @param response 响应
* @throws IOException
*/
private static void extracted(List<? extends Object> list, Class<? extends Object> clazz, String title, String sheetName, String fileName, HttpServletResponse response) throws IOException {
ExportParams exportParams = new ExportParams(title, sheetName, ExcelType.XSSF);
exportParams.setStyle(ExcelStyleUtil.class);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, clazz, list);
response.setContentType("application/vnd.ms-excel");
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode(fileName + ".xlsx", "UTF-8"));
ServletOutputStream outputStream = response.getOutputStream();
workbook.write(outputStream);
outputStream.close();
workbook.close();
}
}

View File

@ -97,7 +97,7 @@ public class WorkerRepairCardController extends BaseController {
}
/**
* 删除组织架构
* 补卡删除
*/
// @RequiresPermissions("att:org:change:remove")
@PostMapping("/delRepairCard")

View File

@ -0,0 +1,30 @@
package com.bonus.system.att.dao;
import com.bonus.system.att.entity.AttChangeBean;
import com.bonus.system.att.entity.AttDetailBean;
import com.bonus.system.att.entity.AttRateBean;
import com.bonus.system.basic.domain.SysOrg;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 考勤规则变更-数据访问层
* @author zys
*/
@Repository("AttAbnormalDao")
public interface AttAbnormalDao {
/**
* 获取考勤率列表
*/
List<AttRateBean> getAttRateTypeList(AttRateBean bean);
List<AttDetailBean> getAttRateTypeDetailsList(AttRateBean bean);
List<AttRateBean> getAttAbnormalList(AttRateBean bean);
List<AttDetailBean> getAttTypeList(AttRateBean bean);
}

View File

@ -250,7 +250,7 @@ public interface AttSourceDataDao {
* @param today
* @return
*/
List<String> getNotFullAtt(String today);
List<String> getNotFullAtt(@Param("today")String today, @Param("month")String month);
int updateMonthReportFullAtt(@Param("list") List<String> list, @Param("month") String month);
}

View File

@ -144,4 +144,13 @@ public interface AttendanceDetailsDao {
List<AttMonthReportBean> getAttMonthReportListSimple(String attCurrentMonth);
void batchUpdateMonthReportRequiredDay(List<AttMonthReportBean> list);
/**
* 获取年满勤列表
* @param bean
* @return List<YearFullAttBean>
* @author cwchen
* @date 2025/2/24 10:05
*/
List<YearFullAttBean> getWorkerYearFullAttList(YearFullAttBean bean);
}

View File

@ -7,6 +7,7 @@ import java.util.List;
/**
* 考勤月报表
*
* @author zys
*/
@Data
@ -130,11 +131,15 @@ public class AttMonthReportBean {
*/
private Double outCount;
/**打卡记录*/
/**
* 打卡记录
*/
@Excel(name = "打卡记录", sort = 14)
private int clockingRecordNum;
/**是否全勤*/
/**
* 是否全勤
*/
// @Excel(name = "是否全勤", sort = 17)
private int isFullAtt;
@ -143,11 +148,26 @@ public class AttMonthReportBean {
*/
private List<String> orgList;
/**开始月份*/
/**
* 开始月份
*/
private String startMonth;
/**结束月份*/
/**
* 结束月份
*/
private String endMonth;
/**考勤组成卑职*/
/**
* 考勤组成卑职
*/
private String requiredDayRemark;
/**
* 请假带薪
*/
private String leavePaidNum;
/**
* 请假不带薪
*/
private String leaveUnpaidNum;
}

View File

@ -0,0 +1,120 @@
package com.bonus.system.att.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* 考勤数据
*
* @author zys
*/
@Data
public class AttRateBean {
/**
* 序号
*/
@Excel(name = "序号", width = 10.0, height = 20.0, orderNum = "0")
private Long id;
/**
* 用户编号
*/
private Long userId;
/**
* 用户名称
*/
@Excel(name = "姓名", width = 10.0, height = 20.0, orderNum = "1")
private String userName;
/**
* 组织编号
*/
private Long orgId;
/**
* 组织名称
*/
@Excel(name = "所属部门", width = 10.0, height = 20.0, orderNum = "2")
private String orgName;
/**
* 考勤月
*/
@Excel(name = "考勤月", width = 10.0, height = 20.0, orderNum = "3")
private String attCurrentMonth;
/**
* 考勤年
*/
private String year;
/**
* 月天数
*/
@Excel(name = "应出勤天数", width = 10.0, height = 20.0, orderNum = "4")
private Double requiredDays;
/**
* 考勤率
*/
@Excel(name = "考勤率", width = 10.0, height = 20.0, orderNum = "5")
private String normalRate;
/**
* 迟到率
*/
@Excel(name = "迟到率", width = 10.0, height = 20.0, orderNum = "6")
private String lateRate;
/**
* 旷工率
*/
@Excel(name = "旷工率", width = 10.0, height = 20.0, orderNum = "7")
private String skippingRate;
/**
* 早退率
*/
@Excel(name = "早退率", width = 10.0, height = 20.0, orderNum = "8")
private String earlyRate;
/**
* 带薪假率
*/
@Excel(name = "带薪假率", width = 10.0, height = 20.0, orderNum = "9")
private String leavePaidRate;
/**
* 不带薪假率
*/
@Excel(name = "不带薪假率", width = 10.0, height = 20.0, orderNum = "10")
private String leaveUnpaidRate;
/**
* 外勤天数
*/
@Excel(name = "外勤天数", width = 10.0, height = 20.0, orderNum = "11")
private String outsideAttNum;
private Double lateNum;
private Double skippingNum;
private Double earlyNum;
private String attStatus;
/**
* 开始月
*/
private String endMonth;
/**
* 结束月
*/
private String startMonth;
}

View File

@ -0,0 +1,98 @@
package com.bonus.system.att.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* 考勤数据
*
* @author zys
*/
@Data
public class AttRateExportBean {
/**
* 序号
*/
@Excel(name = "序号", width = 10.0, height = 20.0, orderNum = "0")
private Long id;
/**
* 用户编号
*/
private Long userId;
/**
* 用户名称
*/
@Excel(name = "姓名", width = 10.0, height = 20.0, orderNum = "1")
private String userName;
/**
* 组织编号
*/
private Long orgId;
/**
* 组织名称
*/
@Excel(name = "所属部门", width = 10.0, height = 20.0, orderNum = "2")
private String orgName;
/**
* 考勤月
*/
private String attCurrentMonth;
/**
* 考勤年
*/
private String year;
/**
* 考勤率
*/
private String normalRate;
/**
* 迟到率
*/
private String lateRate;
/**
* 旷工率
*/
private String skippingRate;
/**
* 早退率
*/
private String earlyRate;
/**
* 带薪假率
*/
private String leavePaidRate;
/**
* 不带薪假率
*/
private String leaveUnpaidRate;
/**
* 外勤天数
*/
private String outsideAttNum;
@Excel(name = "迟到天数", width = 10.0, height = 20.0, orderNum = "3")
private Double lateNum;
@Excel(name = "旷工天数", width = 10.0, height = 20.0, orderNum = "4")
private Double skippingNum;
@Excel(name = "早退天数", width = 10.0, height = 20.0, orderNum = "5")
private Double earlyNum;
private String attStatus;
}

View File

@ -0,0 +1,119 @@
package com.bonus.system.att.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* 考勤数据
*
* @author zys
*/
@Data
public class YearFullAttBean {
/**
* 序号
*/
@Excel(name = "序号", width = 10.0, height = 20.0)
private Long id;
/**
* 用户编号
*/
private Long userId;
/**
* 用户名称
*/
@Excel(name = "姓名", width = 10.0, height = 20.0)
private String userName;
private Integer orgId;
/**
* 组织名称
*/
@Excel(name = "所属部门", width = 10.0, height = 20.0)
private String orgName;
/**
* 年份
*/
private String year;
/**
* 第一月
*/
@Excel(name = "一月", width = 10.0, height = 20.0)
private String oneMonth;
/**
* 第二月
*/
@Excel(name = "二月", width = 10.0, height = 20.0)
private String twoMonth;
/**
* 第三月
*/
@Excel(name = "三月", width = 10.0, height = 20.0)
private String threeMonth;
/**
* 第四月
*/
@Excel(name = "四月", width = 10.0, height = 20.0)
private String fourMonth;
/**
* 第五月
*/
@Excel(name = "五月", width = 10.0, height = 20.0)
private String fiveMonth;
/**
* 第六月
*/
@Excel(name = "六月", width = 10.0, height = 20.0)
private String sixMonth;
/**
* 第七月
*/
@Excel(name = "七月", width = 10.0, height = 20.0)
private String sevenMonth;
/**
* 第八月
*/
@Excel(name = "八月", width = 10.0, height = 20.0)
private String eightMonth;
/**
* 第九月
*/
@Excel(name = "九月", width = 10.0, height = 20.0)
private String nineMonth;
/**
* 第十月
*/
@Excel(name = "十月", width = 10.0, height = 20.0)
private String tenMonth;
/**
* 第十一月
*/
@Excel(name = "十一月", width = 10.0, height = 20.0)
private String elevenMonth;
/**
* 第十二月
*/
@Excel(name = "十二月", width = 10.0, height = 20.0)
private String twelveMonth;
}

View File

@ -0,0 +1,36 @@
package com.bonus.system.att.service;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.system.att.entity.AttChangeBean;
import com.bonus.system.att.entity.AttDetailBean;
import com.bonus.system.att.entity.AttRateBean;
import java.util.List;
/**
* 考勤规则变更-业务层
* @author lsun
*/
public interface AttAbnormalService {
/**
* 获取考勤率列表
*/
List<AttRateBean> getAttRateTypeList(AttRateBean bean);
/**
* 获取考勤率详情
*/
List<AttDetailBean> getAttRateTypeDetailsList(AttRateBean bean);
/**
* 获取考勤异常列表
*/
List<AttRateBean> getAttAbnormalList(AttRateBean bean);
/**
* 获取考勤类型详情
*/
List<AttDetailBean> getAttTypeList(AttRateBean bean);
}

View File

@ -0,0 +1,50 @@
package com.bonus.system.att.service;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.system.att.dao.AttAbnormalDao;
import com.bonus.system.att.dao.AttChangeDao;
import com.bonus.system.att.entity.AttChangeBean;
import com.bonus.system.att.entity.AttDetailBean;
import com.bonus.system.att.entity.AttRateBean;
import com.bonus.system.basic.domain.SysOrg;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
/**
* 考勤
*
* @author fly
*/
@Service("AttAbnormalService")
@Log4j2
public class AttAbnormalServiceImpl implements AttAbnormalService {
@Resource(name = "AttAbnormalDao")
private AttAbnormalDao dao;
@Override
public List<AttRateBean> getAttRateTypeList(AttRateBean bean) {
return dao.getAttRateTypeList(bean);
}
@Override
public List<AttDetailBean> getAttRateTypeDetailsList(AttRateBean bean) {
return dao.getAttRateTypeDetailsList(bean);
}
@Override
public List<AttRateBean> getAttAbnormalList(AttRateBean bean) {
return dao.getAttAbnormalList(bean);
}
@Override
public List<AttDetailBean> getAttTypeList(AttRateBean bean) {
return dao.getAttTypeList(bean);
}
}

View File

@ -149,7 +149,7 @@ public interface AttCalService {
* @param today
* @return
*/
List<String> getNotFullAtt(String today);
List<String> getNotFullAtt(String today, String month);
/**
* 修改全勤

View File

@ -530,8 +530,8 @@ public class AttCalServiceImpl implements AttCalService {
* @return
*/
@Override
public List<String> getNotFullAtt(String today) {
return attSourceDataDao.getNotFullAtt(today);
public List<String> getNotFullAtt(String today,String month) {
return attSourceDataDao.getNotFullAtt(today, month);
}
/**

View File

@ -88,8 +88,8 @@ public class AttChangeServiceImpl implements AttChangeService {
attChangeDao.updateOrgIdByUserId(bean);
//先去判断是否有该人员信息
AttChangeBean o = attChangeDao.getAttPerson(bean);
// 260124 加一个变动时间 changeTime
bean.setUpdateTime("2026-01-18");
// 260124 加一个变动时间 UpdateTime
// bean.setUpdateTime("2026-01-18");
if(o!=null && o.getId()>0){
bean.setId(o.getId());
// 删除旧的添加新的
@ -101,7 +101,7 @@ public class AttChangeServiceImpl implements AttChangeService {
attChangeDao.updateAttSettingHis(bean);
//添加变更记录
bean.setCreateUserId(SecurityUtils.getLoginUser().getSysUser().getUserId()+"");
attChangeDao.addAtt( bean);
attChangeDao.addAtt(bean);
return AjaxResult.success();
}else{
return AjaxResult.error("修改人员信息失败");

View File

@ -95,7 +95,7 @@ public interface AttendanceDetailsService {
* @return list bean
*/
List<AttDataDetailsBean> getAttDayReportDetailsList(AttDataDetailsBean bean);
List<AttDataDetailsBean> getAttDayReportDetailsListData(AttDataDetailsBean bean);
List<AttDataDetailsBean> getOutCountList(AttDataDetailsBean bean);
@ -130,4 +130,13 @@ public interface AttendanceDetailsService {
* @return
*/
AjaxResult updateAttMonthDays(AttMonthDaysMakeUpBean bean);
/**
* 年度全勤统计
* @param bean
* @return
*/
List<YearFullAttBean> getWorkerYearFullAttList(YearFullAttBean bean);
}

View File

@ -475,4 +475,15 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
}
return AjaxResult.success();
}
/**
* 获取年满勤列表
* @param bean
* @return
*/
@Override
public List<YearFullAttBean> getWorkerYearFullAttList(YearFullAttBean bean) {
return attendanceDetailsDao.getWorkerYearFullAttList(bean);
}
}

View File

@ -174,22 +174,6 @@ public class NewAttTask {
log.info("--------报表数据生成--月报表定时器完毕------");
}
/**
* 月报表--是否全勤
*/
@Scheduled(cron = "0 0 23 * * ?")
@Async
public void getMonthReportFullAttTask() {
log.info("--------月报表--是否全勤定时器开启------");
String today = DateUtil.today();
List<String> list = attCalService.getNotFullAtt(today);
if(!list.isEmpty()){
String month = today.substring(0,7);
attCalService.updateMonthReportFullAtt(list,month);
}
log.info("--------月报表--是否全勤定时器完毕------");
}
/**
* 待考勤人员列表

View File

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.system.att.dao.AttAbnormalDao">
<select id="getAttRateTypeList" resultType="com.bonus.system.att.entity.AttRateBean">
SELECT
att_current_month,
user_id,
`name` as userName,
org_name,
required_days,
CONCAT(ROUND((normal_num * 100.0) / required_days, 2), '%') AS normalRate,
CONCAT(ROUND((late_num * 100.0) / required_days, 2), '%') AS lateRate,
CONCAT(ROUND((skipping_num * 100.0) / required_days, 2), '%') AS skippingRate,
CONCAT(ROUND((early_num * 100.0) / required_days, 2), '%') AS earlyRate,
CONCAT(ROUND((leave_paid_num * 100.0) / required_days, 2), '%') AS leavePaidRate,
CONCAT(ROUND((leave_unpaid_num * 100.0) / required_days, 2), '%') AS leaveUnpaidRate,
outside_att_num as outsideAttNum
FROM
att_month_report
WHERE
att_current_month between #{startMonth} AND #{endMonth}
<if test="userName != null and userName != ''">
AND `name` = #{userName}
</if>
<if test="orgId != null ">
AND `org_id` = #{orgId}
</if>
<if test="outsideAttNum == '预警'">
AND `outside_att_num` >= 5
</if>
<if test="outsideAttNum == '未预警'">
AND `outside_att_num` &lt; 5
</if>
</select>
<select id="getAttAbnormalList" resultType="com.bonus.system.att.entity.AttRateBean">
SELECT
att_current_month,
user_id,
`name` as userName,
org_name,
sum(late_num) as lateNum,
sum(skipping_num) as skippingNum,
sum(early_num) as earlyNum
FROM
att_month_report
<where>
<if test="attCurrentMonth != null and attCurrentMonth != '' ">
and att_current_month = #{attCurrentMonth}
</if>
<if test="year != null and year != '' ">
and left(att_current_month,4) = #{year}
</if>
<if test="userName != null and userName != ''">
AND `name` = #{userName}
</if>
<if test="orgId != null ">
AND `org_id` = #{orgId}
</if>
</where>
group by user_id
ORDER BY
IFNULL(sum(late_num), 0) + IFNULL(sum(skipping_num), 0) + IFNULL(sum(early_num), 0)
</select>
<select id="getAttTypeList" resultType="com.bonus.system.att.entity.AttDetailBean">
select
vat.user_id as userId,
su.user_name as name,
vat.org_id as orgId,
so.org_name as orgName,
vat.toWorkAttCurrentTime as goWorkTime ,
vat.toWorkAttStatus as goWorkStatus,
vat.toWorkAttAddress as goWorkAddress,
vat.offWorkAttCurrentTime as offWorkTime,
vat.offWorkAttStatus as offWorkStatus,
vat.offWorkAttAddress as offWorkAddress,
vat.att_current_day as attCurrent
from v_att_update_data vat
left join sys_user su on vat.user_id = su.user_id
left join sys_organization so on vat.org_id = so.id
<where>
<if test="userId != null ">
and vat.user_id = #{userId}
</if>
<if test="userName != null ">
and locate(#{userName},su.user_name) > 0
</if>
<if test='attStatus != null and attStatus != "6"'>
and (vat.toWorkAttStatus = #{attStatus} or vat.offWorkAttStatus = #{attStatus} )
</if>
<if test="orgId != null and orgId != '' ">
and vat.org_id = #{orgId}
</if>
<if test="attCurrentMonth != null and attCurrentMonth != '' ">
and LEFT(vat.att_current_day, 7) = #{attCurrentMonth}
</if>
<if test="year != null and year != '' ">
and LEFT(vat.att_current_day, 4) = #{year}
</if>
</where>
</select>
<select id="getAttRateTypeDetailsList" resultType="com.bonus.system.att.entity.AttDetailBean">
select
vat.user_id as userId,
su.user_name as name,
vat.org_id as orgId,
so.org_name as orgName,
vat.toWorkAttCurrentTime as goWorkTime ,
vat.toWorkAttStatus as goWorkStatus,
vat.toWorkAttAddress as goWorkAddress,
vat.offWorkAttCurrentTime as offWorkTime,
vat.offWorkAttStatus as offWorkStatus,
vat.offWorkAttAddress as offWorkAddress,
vat.att_current_day as attCurrent
from v_att_update_data vat
left join sys_user su on vat.user_id = su.user_id
left join sys_organization so on vat.org_id = so.id
<where>
<if test="userId != null ">
and vat.user_id = #{userId}
</if>
<if test="userName != null ">
and locate(#{userName},su.user_name) > 0
</if>
<if test='leavePaidRate == "1"'>
and (vat.toWorkAttStatus IN (SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' and is_paid = '1')
or vat.offWorkAttStatus IN (SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' and is_paid = '1'))
</if>
<if test='leaveUnpaidRate == "1"'>
and (vat.toWorkAttStatus IN (SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' and is_paid = '0')
or vat.offWorkAttStatus IN (SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' and is_paid = '0'))
</if>
<if test='attStatus != null and attStatus != "6"'>
and (vat.toWorkAttStatus = #{attStatus} or vat.offWorkAttStatus = #{attStatus} )
</if>
<if test="orgId != null and orgId != '' ">
and vat.org_id = #{orgId}
</if>
<if test="attCurrentMonth != null and attCurrentMonth != '' ">
and LEFT(vat.att_current_day, 7) = #{attCurrentMonth}
</if>
</where>
</select>
</mapper>

View File

@ -10,8 +10,8 @@
<insert id="addAtt">
INSERT INTO `att_change`(`user_id`, `old_att_id`, `after_att_id`, `old_org_id`, `after_org_id`,
`create_user_id`)
VALUES (#{userId}, #{oldAttId}, #{afterAttId}, #{oldOrgId}, #{afterOrgId}, #{createUserId})
`create_user_id`, change_date)
VALUES (#{userId}, #{oldAttId}, #{afterAttId}, #{oldOrgId}, #{afterOrgId}, #{createUserId}, #{updateTime})
</insert>
<update id="updateUser">
@ -50,7 +50,8 @@
org2.org_name as afterOrgName,
att.create_user_id,
su2.user_name as createName,
att.create_time as createTime
att.create_time as createTime,
att.change_date as updateTime
FROM att_change att
LEFT JOIN sys_user su ON su.user_id = att.user_id
LEFT JOIN sys_organization org1 on org1.id = att.old_org_id

View File

@ -163,6 +163,8 @@
early_num = #{v.earlyNum},
skipping_num = #{v.skippingNum},
leave_num = #{v.leaveNum},
leave_paid_num = #{v.leavePaidNum},
leave_unpaid_num = #{v.leaveUnpaidNum},
address_error_num = #{v.addressErrorNum},
ein_error_num = #{v.einErrorNum},
rest_num = #{v.restNum},
@ -275,6 +277,25 @@
(offWorkAttStatus IN
(SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1'), 0.5,
0)) AS leaveNum,
sum(
IF
(toWorkAttStatus IN
(SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' and is_paid = '1'), 0.5,
0)) + sum(
IF
(offWorkAttStatus IN
(SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' and is_paid = '1'), 0.5,
0)) AS leavePaidNum,
sum(
IF
(toWorkAttStatus IN
(SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' and is_paid = '0'), 0.5,
0)) + sum(
IF
(offWorkAttStatus IN
(SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' and is_paid = '0'), 0.5,
0)) AS leaveUnpaidNum,
IFNULL(sum(IF(toWorkAttStatus = 7, 0.5, 0)), 0) +
IFNULL(sum(IF(offWorkAttStatus = 7, 0.5, 0)), 0) AS outNum,
IFNULL(sum(IF(toWorkAttStatus = 8, 0.5, 0)), 0) +
@ -613,8 +634,30 @@
leave_apply
WHERE
is_active = 1
AND leave_type not in ('年休假', '婚假', '丧假', '丧假')
AND leave_type IN (SELECT dict_label FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' AND is_paid = '0')
<if test="today != ''">
AND #{today} between leave_start_date and leave_end_date
</if>
<if test="month != ''">
AND #{month} between left(leave_start_date,7) and left(leave_end_date,7)
</if>
UNION
SELECT DISTINCT
user_id
FROM
leave_apply
WHERE
is_active = 1
AND leave_type = '临时外出'
AND is_business != 1
<if test="today != ''">
AND #{today} between leave_start_date and leave_end_date
</if>
<if test="month != ''">
AND #{month} between left(leave_start_date,7) and left(leave_end_date,7)
</if>
</select>
<update id="updateMonthReportFullAtt">

View File

@ -658,4 +658,28 @@
where user_id = #{params.userId} and att_current_month = #{params.month}
</foreach>
</update>
</mapper>
<select id="getWorkerYearFullAttList" resultType="com.bonus.system.att.entity.YearFullAttBean">
SELECT
user_id,
name as userName,
org_id,
org_name,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS oneMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS twoMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS threeMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS fourMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS fiveMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS sixMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS sevenMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS eightMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS nineMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS tenMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS elevenMonth,
COALESCE(MAX(CASE WHEN att_current_month = concat(#{year},'-01') THEN is_full_att END), 2) AS twelveMonth
FROM att_month_report
WHERE att_current_month LIKE concat(#{year},'-%')
GROUP BY user_id
ORDER BY user_id
</select>
</mapper>