考勤bug修改完毕
This commit is contained in:
parent
c3007d0f5b
commit
5090ce5bb2
|
|
@ -34,70 +34,20 @@ public class AttExceptionHandleController extends BaseController {
|
|||
private AttExceptionHandleService attExceptionHandle;
|
||||
|
||||
@RequiresPermissions("att:exception:query")
|
||||
@GetMapping("/list")
|
||||
@Log(title = "异常处理->轮休临时外出异常数据->列表查询", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo list(AttExceptionBean data) {
|
||||
@GetMapping("/getAttExceptionList")
|
||||
@Log(title = "异常处理->异常数据->列表查询", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo getAttExceptionList(AttExceptionBean data) {
|
||||
startPage();
|
||||
// List<AttExceptionBean> list = attExceptionHandle.selectAttExceptionList(data);
|
||||
return attExceptionHandle.selectAttExceptionList(data);
|
||||
}
|
||||
|
||||
@RequiresPermissions("att:exception:query")
|
||||
@GetMapping("/getDetailException")
|
||||
@Log(title = "异常处理->轮休临时外出异常报表->列表查询", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo getDetailException(AttExceptionBean data) {
|
||||
@GetMapping("/getAttExceptionListByMonth")
|
||||
@Log(title = "异常处理->异常报表->列表查询", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo getAttExceptionListByMonth(AttExceptionBean data) {
|
||||
startPage();
|
||||
List<AttExceptionBean> list = attExceptionHandle.getDetailException(data);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@RequiresPermissions("att:exception:query")
|
||||
@GetMapping("/getDetailExceptionRest")
|
||||
@Log(title = "异常处理->轮休异常报表未申请详情->列表查询", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo getDetailExceptionRest(AttDetailLeaveBean data) {
|
||||
startPage();
|
||||
List<AttDetailLeaveBean> list = attExceptionHandle.getDetailExceptionRest(data);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@RequiresPermissions("att:exception:query")
|
||||
@GetMapping("/getDetailExceptionOut")
|
||||
@Log(title = "异常处理->临时外出异常报表未申请详情->列表查询", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo getDetailExceptionOut(AttDetailLeaveBean data) {
|
||||
startPage();
|
||||
List<AttDetailLeaveBean> list = attExceptionHandle.getDetailExceptionOut(data);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@RequiresPermissions("att:exception:query")
|
||||
@GetMapping("/getDetailExceptionAll")
|
||||
@Log(title = "异常处理->轮休和临时外出异常报表未申请详情->列表查询", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo getDetailExceptionAll(AttDetailLeaveBean data) {
|
||||
startPage();
|
||||
List<AttDetailLeaveBean> list = attExceptionHandle.getDetailExceptionAll(data);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@RequiresPermissions("att:exception:query")
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response, AttExceptionBean data) {
|
||||
try{
|
||||
List<AttExceptionBean> list = attExceptionHandle.getDetailException(data);
|
||||
ExcelUtil<AttExceptionBean> util = new ExcelUtil<AttExceptionBean>(AttExceptionBean.class);
|
||||
util.exportExcel(response, list, "轮休临时外出异常报表");
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批提醒
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/examineRemind")
|
||||
@Log(title = "异常处理->临时外出异常报表->审批提醒", businessType = BusinessType.QUERY)
|
||||
public AjaxResult examineRemind(@Validated @RequestBody AttExRemindBean vo) {
|
||||
return attExceptionHandle.examineRemind(vo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,19 +18,9 @@ public interface AttExceptionHandleDao {
|
|||
* @param data 参数
|
||||
* @return list bean
|
||||
*/
|
||||
AttExceptionBean selectAttExceptionList(AttExceptionBean data);
|
||||
List<AttExceptionBean> selectAttExceptionList(AttExceptionBean data);
|
||||
|
||||
/**
|
||||
* 轮休临时外出异常月份
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> selectAttExceptionMonth();
|
||||
|
||||
/**
|
||||
* 轮休临时外出异常未处理月份
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> selectAttExceptionNoHandleMonth();
|
||||
|
||||
/**
|
||||
* 获取轮休临时外出异常数据详情
|
||||
|
|
@ -39,52 +29,4 @@ public interface AttExceptionHandleDao {
|
|||
*/
|
||||
List<AttExceptionBean> getDetailException(AttExceptionBean data);
|
||||
|
||||
/**
|
||||
* 获取轮休临时外出异常数据详情
|
||||
* @param data 参数
|
||||
* @return list bean
|
||||
*/
|
||||
List<AttExceptionBean> getDetailAllException(AttExceptionBean data);
|
||||
|
||||
/**
|
||||
* 获取轮休异常报表未申请详情
|
||||
* @param data 参数
|
||||
* @return list bean
|
||||
*/
|
||||
List<AttDetailLeaveBean> getDetailExceptionRest(AttDetailLeaveBean data);
|
||||
|
||||
/**
|
||||
* 获取临时外出异常报表未申请详情
|
||||
* @param data 参数
|
||||
* @return list bean
|
||||
*/
|
||||
List<AttDetailLeaveBean> getDetailExceptionOut(AttDetailLeaveBean data);
|
||||
|
||||
/**
|
||||
* 获取轮休和临时外出异常报表未申请详情
|
||||
* @param data 参数
|
||||
* @return list bean
|
||||
*/
|
||||
List<AttDetailLeaveBean> getDetailExceptionAll(AttDetailLeaveBean data);
|
||||
|
||||
/**
|
||||
* 获取部门负责人id数据
|
||||
* @param data 参数
|
||||
* @return list bean
|
||||
*/
|
||||
AttExRemindBean getOrgUserId(AttExRemindBean data);
|
||||
|
||||
/**
|
||||
* 审批提醒
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int examineRemind(AttExRemindBean vo);
|
||||
|
||||
/**
|
||||
* 审批提醒
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int examineRemindTemp(AttExRemindBean vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,17 +44,6 @@ public class AttExceptionBean {
|
|||
private Integer orgId;
|
||||
|
||||
|
||||
/**
|
||||
* 考勤月份的当月一号
|
||||
*/
|
||||
private String attCurrentMonthFirst;
|
||||
|
||||
|
||||
/**
|
||||
* 考勤月份的次月一号
|
||||
*/
|
||||
private String attNextMonthFirst;
|
||||
|
||||
/**
|
||||
* 异常数量
|
||||
*/
|
||||
|
|
@ -71,16 +60,31 @@ public class AttExceptionBean {
|
|||
private int noFinishCount;
|
||||
|
||||
/**
|
||||
* 轮休未审批条数
|
||||
* 迟到数量
|
||||
*/
|
||||
@Excel(name = "轮休未审批条数")
|
||||
private int errorRestCount;
|
||||
private int lateCount;
|
||||
|
||||
/**
|
||||
* 临时外出未审批条数
|
||||
* 早退数量
|
||||
*/
|
||||
@Excel(name = "临时外出未审批条数")
|
||||
private int errorOutCount;
|
||||
private int earlyCount;
|
||||
|
||||
/**
|
||||
* 旷工数量
|
||||
*/
|
||||
private int absenteeismCount;
|
||||
|
||||
/**
|
||||
* 打卡地异常数量
|
||||
*/
|
||||
private int addressCount;
|
||||
|
||||
|
||||
/**
|
||||
* 出入异常数量
|
||||
*/
|
||||
private int goOutCount;
|
||||
|
||||
|
||||
private int[] orgIds;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,48 +47,54 @@ public class AttMonthReportBean {
|
|||
* 打卡地异常人数
|
||||
*/
|
||||
@Excel(name = "打卡地异常次数", sort = 8)
|
||||
private Long addressErrorNum;
|
||||
private Double addressErrorNum;
|
||||
|
||||
/**
|
||||
* 早退人数
|
||||
*/
|
||||
@Excel(name = "早退次数", sort = 6)
|
||||
private Long earlyNum;
|
||||
private Double earlyNum;
|
||||
/**
|
||||
* 出入异常人数
|
||||
*/
|
||||
@Excel(name = "出入异常次数", sort = 9)
|
||||
private Long einErrorNum;
|
||||
private Double einErrorNum;
|
||||
/**
|
||||
* 迟到人数
|
||||
*/
|
||||
@Excel(name = "迟到次数", sort = 5)
|
||||
private Long lateNum;
|
||||
private Double lateNum;
|
||||
/**
|
||||
* 请假人数
|
||||
*/
|
||||
@Excel(name = "请假天数", sort = 10)
|
||||
private Long leaveNum;
|
||||
private Double leaveNum;
|
||||
/**
|
||||
* 正常打卡人数
|
||||
*/
|
||||
@Excel(name = "正常打卡天数", sort = 4)
|
||||
private Long normalNum;
|
||||
private Double normalNum;
|
||||
/**
|
||||
* 临时外出人数
|
||||
*/
|
||||
@Excel(name = "临时外出天数", sort = 12)
|
||||
private Long outNum;
|
||||
private Double outNum;
|
||||
/**
|
||||
* 轮休人数
|
||||
*/
|
||||
@Excel(name = "轮休人数", sort = 11)
|
||||
private Long restNum;
|
||||
private Double restNum;
|
||||
/**
|
||||
* 旷工人数
|
||||
*/
|
||||
@Excel(name = "旷工次数", sort = 7)
|
||||
private Long skippingNum;
|
||||
private Double skippingNum;
|
||||
|
||||
/**
|
||||
* 出差人数
|
||||
*/
|
||||
@Excel(name = "出差人数", sort = 13)
|
||||
private Double businessTripNum;
|
||||
|
||||
/**
|
||||
* 月份
|
||||
|
|
@ -103,7 +109,7 @@ public class AttMonthReportBean {
|
|||
/**
|
||||
* 工作时间外出次数
|
||||
*/
|
||||
private Long outCount;
|
||||
private Double outCount;
|
||||
|
||||
/**
|
||||
* 自己项目部所在分公司下的所有项目部id
|
||||
|
|
|
|||
|
|
@ -47,4 +47,9 @@ public class LeaveBean {
|
|||
*/
|
||||
private String attStatus;
|
||||
|
||||
/**
|
||||
* 考勤状态
|
||||
*/
|
||||
private String attType;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,38 +20,10 @@ public interface AttExceptionHandleService {
|
|||
TableDataInfo selectAttExceptionList(AttExceptionBean data);
|
||||
|
||||
/**
|
||||
* 获取轮休临时外出异常数据详情
|
||||
* 获取异常数据详情
|
||||
* @param data 参数
|
||||
* @return list bean
|
||||
*/
|
||||
List<AttExceptionBean> getDetailException(AttExceptionBean data);
|
||||
|
||||
/**
|
||||
* 获取轮休异常报表未申请详情
|
||||
* @param data 参数
|
||||
* @return list bean
|
||||
*/
|
||||
List<AttDetailLeaveBean> getDetailExceptionRest(AttDetailLeaveBean data);
|
||||
|
||||
/**
|
||||
* 获取临时外出异常报表未申请详情
|
||||
* @param data 参数
|
||||
* @return list bean
|
||||
*/
|
||||
List<AttDetailLeaveBean> getDetailExceptionOut(AttDetailLeaveBean data);
|
||||
|
||||
/**
|
||||
* 获取轮休和临时外出异常报表未申请详情
|
||||
* @param data 参数
|
||||
* @return list bean
|
||||
*/
|
||||
List<AttDetailLeaveBean> getDetailExceptionAll(AttDetailLeaveBean data);
|
||||
|
||||
|
||||
/**
|
||||
* 审批提醒
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult examineRemind(AttExRemindBean vo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,36 +47,14 @@ public class AttExceptionHandleServiceImpl implements AttExceptionHandleService{
|
|||
@Override
|
||||
public TableDataInfo selectAttExceptionList(AttExceptionBean data)
|
||||
{
|
||||
AttExceptionBean attExceptionBean = new AttExceptionBean();
|
||||
List<AttExceptionBean> list = new ArrayList<>();
|
||||
List<Map<String,Object>> mapList = new ArrayList<>();
|
||||
try {
|
||||
if(!StringUtils.isEmpty(data.getAttCurrentMonth())){
|
||||
LocalDate date = LocalDate.parse(data.getAttCurrentMonth() + "-01");
|
||||
LocalDate nextMonth =date.plusMonths(1).withDayOfMonth(1);
|
||||
LocalDate nowMonth =date.withDayOfMonth(1);
|
||||
data.setAttNextMonthFirst(nextMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) ;
|
||||
data.setAttCurrentMonthFirst(nowMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
attExceptionBean = attExceptionHandleDao.selectAttExceptionList(data);
|
||||
list.add(attExceptionBean);
|
||||
}else{
|
||||
mapList = attExceptionHandleDao.selectAttExceptionMonth();
|
||||
if(mapList.size()!=0){
|
||||
for (int i = 0; i < mapList.size(); i++) {
|
||||
LocalDate date = LocalDate.parse(mapList.get(i).get("month") + "-01");
|
||||
LocalDate nextMonth =date.plusMonths(1).withDayOfMonth(1);
|
||||
LocalDate nowMonth =date.withDayOfMonth(1);
|
||||
data.setAttCurrentMonth(String.valueOf(mapList.get(i).get("month")));
|
||||
data.setAttNextMonthFirst(nextMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) ;
|
||||
data.setAttCurrentMonthFirst(nowMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
attExceptionBean = attExceptionHandleDao.selectAttExceptionList(data);
|
||||
list.add(attExceptionBean);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list = attExceptionHandleDao.selectAttExceptionList(data);
|
||||
list.forEach(item -> {
|
||||
item.setNoFinishCount(item.getErrorCount()-item.getFinishCount());
|
||||
});
|
||||
} catch (Exception e) {
|
||||
log.error("查询轮休临时外出异常数据", e);
|
||||
log.error("查询异常数据", e);
|
||||
}
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
|
|
@ -86,251 +64,18 @@ public class AttExceptionHandleServiceImpl implements AttExceptionHandleService{
|
|||
return rspData;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<AttExceptionBean> getDetailException(AttExceptionBean data)
|
||||
// {
|
||||
// List<AttExceptionBean> listPerson = new ArrayList<>();
|
||||
// List<AttExceptionBean> list = new ArrayList<>();
|
||||
// List<Map<String,Object>> mapList = new ArrayList<>();
|
||||
// List<AttDetailByMonthBean> listTemp = new ArrayList<>();
|
||||
// List<Map<String,Object>> parentIdList = new ArrayList<>();
|
||||
// List<Map<String,Object>> sonsIdList = new ArrayList<>();
|
||||
// Map<String,Object> map = new HashMap<>();
|
||||
// try {
|
||||
// if(!StringUtils.isEmpty(data.getAttCurrentMonth())){
|
||||
// LocalDate date = LocalDate.parse(data.getAttCurrentMonth() + "-01");
|
||||
// LocalDate nextMonth =date.plusMonths(1).withDayOfMonth(1);
|
||||
// LocalDate nowMonth =date.withDayOfMonth(1);
|
||||
// data.setAttNextMonthFirst(nextMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) ;
|
||||
// data.setAttCurrentMonthFirst(nowMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
// if(data.getOrgId()==null){
|
||||
// listTemp = attDetailByMonthDao.getAllParentId();
|
||||
// for (int i = 0; i < listTemp.size(); i++) {
|
||||
// findSonsIds(listTemp.get(i).getOrgId(),sonsIdList);
|
||||
// }
|
||||
// }else {
|
||||
// findSonsIds(data.getOrgId(), sonsIdList);
|
||||
// }
|
||||
// for (int i = 0; i < sonsIdList.size(); i++) {
|
||||
// map = sonsIdList.get(i);
|
||||
// findParentIds(map,parentIdList);
|
||||
// sonsIdList.get(i).put("orgName",parentIdList.get(i).get("orgName"));
|
||||
// }
|
||||
// int[] orgIdsTemp = new int[sonsIdList.size()];
|
||||
// for (int i = 0; i < sonsIdList.size(); i++){
|
||||
// orgIdsTemp[i] = (int) sonsIdList.get(i).get("id");
|
||||
// }
|
||||
// data.setOrgIds(orgIdsTemp);
|
||||
// list = attExceptionHandleDao.getDetailException(data);
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// for (int j = 0; j < sonsIdList.size(); j++) {
|
||||
// if(sonsIdList.get(j).get("id")==list.get(i).getOrgId()){
|
||||
// list.get(i).setOrgName((String) sonsIdList.get(j).get("orgName"));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// mapList = attExceptionHandleDao.selectAttExceptionNoHandleMonth();
|
||||
// if(mapList.size()!=0){
|
||||
// String[] monthError = new String[mapList.size()];
|
||||
// for (int i = 0; i < mapList.size(); i++) {
|
||||
// monthError[i] = (String) mapList.get(i).get("month");
|
||||
// }
|
||||
// data.setMonth(monthError);
|
||||
// list = attExceptionHandleDao.getDetailAllException(data);
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// LocalDate date = LocalDate.parse(list.get(i).getAttCurrentMonth());
|
||||
//
|
||||
// // 格式化日期为 "YYYY-MM"
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||
// String formattedDate = date.format(formatter);
|
||||
// list.get(i).setAttCurrentMonth(formattedDate);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// log.error("查询轮休临时外出异常数据详细信息", e);
|
||||
// }
|
||||
// return list;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<AttExceptionBean> getDetailException(AttExceptionBean data)
|
||||
{
|
||||
List<AttExceptionBean> listPerson = new ArrayList<>();
|
||||
List<AttExceptionBean> list = new ArrayList<>();
|
||||
List<Map<String,Object>> mapList = new ArrayList<>();
|
||||
List<AttDetailByMonthBean> listTemp = new ArrayList<>();
|
||||
List<Map<String,Object>> parentIdList = new ArrayList<>();
|
||||
List<Map<String,Object>> sonsIdList = new ArrayList<>();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
try {
|
||||
if(!StringUtils.isEmpty(data.getAttCurrentMonth())){
|
||||
LocalDate date = LocalDate.parse(data.getAttCurrentMonth() + "-01");
|
||||
LocalDate nextMonth =date.plusMonths(1).withDayOfMonth(1);
|
||||
LocalDate nowMonth =date.withDayOfMonth(1);
|
||||
data.setAttNextMonthFirst(nextMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) ;
|
||||
data.setAttCurrentMonthFirst(nowMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
list = attExceptionHandleDao.getDetailException(data);
|
||||
|
||||
}else{
|
||||
list = attExceptionHandleDao.getDetailException(data);
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("查询轮休临时外出异常数据详细信息", e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AttDetailLeaveBean> getDetailExceptionRest(AttDetailLeaveBean data)
|
||||
{
|
||||
List<AttDetailLeaveBean> list = new ArrayList<>();
|
||||
try {
|
||||
LocalDate date = LocalDate.parse(data.getAttCurrentMonth() + "-01");
|
||||
LocalDate nextMonth =date.plusMonths(1).withDayOfMonth(1);
|
||||
LocalDate nowMonth =date.withDayOfMonth(1);
|
||||
data.setAttNextMonthFirst(nextMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) ;
|
||||
data.setAttCurrentMonthFirst(nowMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
list = attExceptionHandleDao.getDetailExceptionRest(data);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("查询轮休异常报表未申请详情", e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AttDetailLeaveBean> getDetailExceptionOut(AttDetailLeaveBean data)
|
||||
{
|
||||
List<AttDetailLeaveBean> list = new ArrayList<>();
|
||||
try {
|
||||
LocalDate date = LocalDate.parse(data.getAttCurrentMonth() + "-01");
|
||||
LocalDate nextMonth =date.plusMonths(1).withDayOfMonth(1);
|
||||
LocalDate nowMonth =date.withDayOfMonth(1);
|
||||
data.setAttNextMonthFirst(nextMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) ;
|
||||
data.setAttCurrentMonthFirst(nowMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
list = attExceptionHandleDao.getDetailExceptionOut(data);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("查询临时外出异常报表未申请详情", e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AttDetailLeaveBean> getDetailExceptionAll(AttDetailLeaveBean data)
|
||||
{
|
||||
List<AttDetailLeaveBean> list = new ArrayList<>();
|
||||
try {
|
||||
LocalDate date = LocalDate.parse(data.getAttCurrentMonth() + "-01");
|
||||
LocalDate nextMonth =date.plusMonths(1).withDayOfMonth(1);
|
||||
LocalDate nowMonth =date.withDayOfMonth(1);
|
||||
data.setAttNextMonthFirst(nextMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) ;
|
||||
data.setAttCurrentMonthFirst(nowMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
list = attExceptionHandleDao.getDetailExceptionAll(data);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("查询轮休和临时外出异常报表未申请详情", e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批提醒
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult examineRemind(AttExRemindBean vo) {
|
||||
try {
|
||||
SysOrg att = orgDao.selectOrgById(vo.getOrgId());
|
||||
if(att==null){
|
||||
return AjaxResult.error("审批提醒失败");
|
||||
}else{
|
||||
String orgIds = att.getOrgHeadUserId();
|
||||
if(orgIds != null){
|
||||
String[] nameArray = orgIds.split(",");
|
||||
Long[] longArray = new Long[nameArray.length];
|
||||
for (int i = 0; i < nameArray.length; i++) {
|
||||
try {
|
||||
longArray[i] = Long.parseLong(nameArray[i].trim());
|
||||
} catch (NumberFormatException e) {
|
||||
longArray[i] = null; // 处理异常情况
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < longArray.length; i++) {
|
||||
vo.setUserId(longArray[i]);
|
||||
int numTemp = attExceptionHandleDao.examineRemindTemp(vo);
|
||||
if(numTemp!=1){
|
||||
return AjaxResult.error("审批提醒失败");
|
||||
}
|
||||
}
|
||||
vo.setUserUpdate(SecurityUtils.getUserId());
|
||||
if("轮休".equals(vo.getLeaveType())){
|
||||
vo.setType(67L);
|
||||
}else{
|
||||
vo.setType(68L);
|
||||
}
|
||||
int num = attExceptionHandleDao.examineRemind(vo);
|
||||
if (num==1) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}else{
|
||||
return AjaxResult.error("部门没有负责人,无法提醒");
|
||||
}
|
||||
}
|
||||
return AjaxResult.error("审批提醒失败");
|
||||
} catch (Exception e) {
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从父级补充所属部门名称
|
||||
* @param parentMap
|
||||
* @param parentIdList
|
||||
*/
|
||||
public void findParentIds(Map<String,Object> parentMap,List<Map<String,Object>> parentIdList) {
|
||||
Map<String, Object> map = attDetailByMonthDao.getDepartmentById(parentMap);
|
||||
if (map!=null && map.get("parentId") != null) {
|
||||
// 递归查找上级部门
|
||||
findParentIds(map,parentIdList);
|
||||
}else if(map!=null){
|
||||
parentMap.put("orgName",map.get("orgName"));
|
||||
parentIdList.add(parentMap);
|
||||
}else{
|
||||
parentIdList.add(parentMap);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取该部门编号下的所有部门编号
|
||||
* @param orgId
|
||||
* @param sonsIdList
|
||||
*/
|
||||
public void findSonsIds(int orgId, List<Map<String,Object>> sonsIdList) {
|
||||
Map<String, Object> mapFinish = new HashMap<>();
|
||||
Map<String, Object> mapTemp = new HashMap<>();
|
||||
List<Map<String, Object>> listSon= attDetailByMonthDao.getSonsById(orgId);
|
||||
if(listSon.size()!=0){
|
||||
for (int i = 0; i < listSon.size(); i++) {
|
||||
mapTemp = listSon.get(i);
|
||||
if(mapTemp.get("parentId")==null){
|
||||
sonsIdList.add(mapTemp);
|
||||
}else{
|
||||
findSonsIds((Integer) mapTemp.get("id"),sonsIdList);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
mapFinish = attDetailByMonthDao.getSonsFinish(orgId);
|
||||
sonsIdList.add(mapFinish);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -287,17 +287,20 @@ public class AttTasks {
|
|||
*/
|
||||
private void threadLeaveData(LeaveBean c, String pushDate) {
|
||||
//1.将请假区间变成日期集合
|
||||
if(c.getUserId() == 263){
|
||||
System.out.println("米娜");
|
||||
}
|
||||
// if(c.getUserId() == 263){
|
||||
// System.out.println("米娜");
|
||||
// }
|
||||
List<String> dateLists = getStrDateListBetween(c.getLeaveStartDate(), c.getLeaveEndDate());
|
||||
if (!dateLists.isEmpty()) {
|
||||
//根据开始时间、结束时间获取节假日的日期集合
|
||||
List<String> holidayList = holidayDao.getHolidayDataByType(c.getLeaveStartDate(), c.getLeaveEndDate());
|
||||
// 使用Stream API去除A中包含在B中的元素
|
||||
List<String> dateList = dateLists.stream().filter(element -> !holidayList.contains(element)).collect(Collectors.toList());
|
||||
|
||||
dateList.forEach(v -> {
|
||||
// //根据开始时间、结束时间获取节假日的日期集合
|
||||
// 1 表示固定打卡
|
||||
if("1".equals(c.getAttType())){
|
||||
//只有固定打卡蒋周六日不算在请假轮休天数中
|
||||
List<String> holidayList = holidayDao.getHolidayDataByType(c.getLeaveStartDate(), c.getLeaveEndDate());
|
||||
// 使用Stream API去除A中包含在B中的元素
|
||||
dateLists = dateLists.stream().filter(element -> !holidayList.contains(element)).collect(Collectors.toList());
|
||||
}
|
||||
dateLists.forEach(v -> {
|
||||
boolean tf = false;
|
||||
AttDataBean toWorkBean = new AttDataBean(v, c.getAttStatus(), "1",
|
||||
c.getOrgId(), c.getUserId());
|
||||
|
|
@ -667,6 +670,9 @@ public class AttTasks {
|
|||
.collect(Collectors.toList())
|
||||
.stream().max(Comparator.comparing(AttSourceDataBean::getAttCurrentTime)).orElse(null);
|
||||
if (tf) {
|
||||
if(v!=null&&v.size()>0&&v.get(0).getName().equals("任荣辉")){
|
||||
System.out.println("11111111111");
|
||||
}
|
||||
//自由打卡不需要去除数据
|
||||
getFreeAttData(newList, frontToWorkBean, backOffWorkBean, attGroupBean);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -556,7 +556,7 @@ public class ExportFileController {
|
|||
List<AttMonthReportBean> attDayReportList = attendanceDetailsService.getAttMonthReportList(bean);
|
||||
Sheet departmentSheet1 = exporter.createSheet("月报表详情");
|
||||
List<String> departmentHeaders1 = Arrays.asList("序号", "姓名", "所属部门", "考勤月", "应考勤天数", "正常打卡天数",
|
||||
"迟到天数", "早退天数", "旷工天数", "请假天数", "打卡地异常天数", "出入异常天数", "轮休天数", "临时外出天数");
|
||||
"迟到天数", "早退天数", "旷工天数", "请假天数", "打卡地异常天数", "出入异常天数", "轮休天数", "临时外出天数", "出差天数");
|
||||
exporter.addHeaderRowAndTitle(departmentSheet1, departmentHeaders1, title);
|
||||
List<Map<String, Object>> departmentData1 = new ArrayList<>();
|
||||
for (int i = 0; i < attDayReportList.size(); i++) {
|
||||
|
|
@ -575,6 +575,7 @@ public class ExportFileController {
|
|||
map.put("出入异常天数", attDayReportList.get(i).getEinErrorNum());
|
||||
map.put("轮休天数", attDayReportList.get(i).getRestNum());
|
||||
map.put("临时外出天数", attDayReportList.get(i).getOutNum());
|
||||
map.put("出差天数", attDayReportList.get(i).getBusinessTripNum());
|
||||
departmentData1.add(map);
|
||||
}
|
||||
exporter.addDataRows(departmentSheet1, departmentData1, departmentHeaders1);
|
||||
|
|
@ -589,6 +590,7 @@ public class ExportFileController {
|
|||
headers.put("7", "临时外出");
|
||||
headers.put("8", "出入异常");
|
||||
headers.put("9", "打卡地异常");
|
||||
headers.put("10", "出差详情");
|
||||
headers.put("99", "工作外出");
|
||||
Map<String, String> attStatus = getStringStringMap();
|
||||
if (StringHelper.isNotEmpty(bean.getMonth())) {
|
||||
|
|
@ -596,14 +598,18 @@ public class ExportFileController {
|
|||
AttDetailBean dayTable = new AttDetailBean();
|
||||
dayTable.setStartDate(monthFirstAndLast.get(0));
|
||||
dayTable.setEndDate(monthFirstAndLast.get(1));
|
||||
dayTable.setOrgId(String.valueOf(bean.getOrgId()));
|
||||
if(bean.getOrgId() != null){
|
||||
dayTable.setOrgId(String.valueOf(bean.getOrgId()));
|
||||
}
|
||||
dayTable.setName(bean.getUserName());
|
||||
headers.entrySet()
|
||||
.forEach(entry -> {
|
||||
if("99".equals(entry.getKey())){
|
||||
AttDataDetailsBean att = new AttDataDetailsBean();
|
||||
att.setAttCurrentMonth(bean.getMonth());
|
||||
att.setOrgId(bean.getOrgId());
|
||||
if(bean.getOrgId() != null){
|
||||
att.setOrgId(bean.getOrgId());
|
||||
}
|
||||
att.setUserName(bean.getUserName());
|
||||
List<AttDataDetailsBean> list = attendanceDetailsService.getOutCountList(att);
|
||||
Sheet departmentSheet2 = exporter.createSheet(entry.getValue());
|
||||
|
|
|
|||
|
|
@ -181,12 +181,7 @@
|
|||
where dict_type = 'att_status' and is_leave = '1'))
|
||||
</if>
|
||||
<if test='attStatis != null and attStatis != "6"'>
|
||||
<if test='attStatis == "1"'>
|
||||
and (vat.toWorkAttStatus = #{attStatis} and vat.offWorkAttStatus = #{attStatis} )
|
||||
</if>
|
||||
<if test='attStatis != "1"'>
|
||||
and (vat.toWorkAttStatus = #{attStatis} or vat.offWorkAttStatus = #{attStatis} )
|
||||
</if>
|
||||
</if>
|
||||
<if test="orgId != null and orgId != '' ">
|
||||
and vat.org_id = #{orgId}
|
||||
|
|
|
|||
|
|
@ -5,246 +5,58 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="com.bonus.system.att.dao.AttExceptionHandleDao">
|
||||
|
||||
<select id="selectAttExceptionList" resultType="com.bonus.system.att.entity.AttExceptionBean">
|
||||
select
|
||||
#{attCurrentMonth} as attCurrentMonth,
|
||||
count(case when (leave_start_date < #{attNextMonthFirst} and leave_start_date >= #{attCurrentMonthFirst}) then 1 END) as errorCount,
|
||||
count(case when (examine_status != 0 and leave_start_date < #{attNextMonthFirst} and leave_start_date >= #{attCurrentMonthFirst}) then 1 end) as finishCount,
|
||||
count(case when (examine_status = 0 and leave_start_date < #{attNextMonthFirst} and leave_start_date >= #{attCurrentMonthFirst}) then 1 end) as noFinishCount
|
||||
from leave_apply as la
|
||||
where la.is_active = 1
|
||||
and (la.leave_type like '%外出%' or la.leave_type like '%轮休%')
|
||||
</select>
|
||||
SELECT
|
||||
DATE_FORMAT( att_current_day, '%Y-%m' ) AS yearMonth,
|
||||
SUM(
|
||||
CASE
|
||||
|
||||
<select id="selectAttExceptionMonth" resultType="java.util.Map">
|
||||
select
|
||||
DATE_FORMAT(leave_start_date,'%Y-%m') as month,
|
||||
count(*) as leaveCount
|
||||
from leave_apply as la
|
||||
where la.is_active = 1
|
||||
and (la.leave_type like '%外出%' or la.leave_type like '%轮休%')
|
||||
group by month
|
||||
</select>
|
||||
WHEN toWorkOriginalAttStatus IN ( 2, 3, 4, 8, 9 )
|
||||
OR offWorkOriginalAttStatus IN ( 2, 3, 4, 8, 9 ) THEN
|
||||
1 ELSE 0
|
||||
END
|
||||
) AS errorCount,
|
||||
SUM(
|
||||
CASE
|
||||
|
||||
<select id="selectAttExceptionNoHandleMonth" resultType="java.util.Map">
|
||||
select
|
||||
DATE_FORMAT(leave_start_date,'%Y-%m') as month,
|
||||
count(*) as leaveCount
|
||||
from leave_apply as la
|
||||
where la.is_active = 1
|
||||
and (la.leave_type like '%外出%' or la.leave_type like '%轮休%')
|
||||
and la.examine_status=3
|
||||
and (examine_time is null or examine_time = '')
|
||||
group by month
|
||||
WHEN (
|
||||
toWorkOriginalAttStatus IN ( 2, 3, 4, 8, 9 )
|
||||
OR offWorkOriginalAttStatus IN ( 2, 3, 4, 8, 9 ))
|
||||
AND is_update = 1
|
||||
AND reviewer_status = 1 THEN
|
||||
1 ELSE 0
|
||||
END
|
||||
) AS finishCount
|
||||
FROM
|
||||
v_att_update_data
|
||||
<where>
|
||||
locate(#{attCurrentMonth},att_current_day)
|
||||
</where>
|
||||
GROUP BY
|
||||
yearMonth
|
||||
</select>
|
||||
|
||||
<select id="getDetailException" resultType="com.bonus.system.att.entity.AttExceptionBean">
|
||||
select
|
||||
user_id as userId,
|
||||
user_name as name,
|
||||
org_id as orgId,
|
||||
org_name as orgName,
|
||||
#{attCurrentMonth} as attCurrentMonth,
|
||||
count(case when la.leave_type like '%轮休%' then 1 END ) as errorRestCount,
|
||||
count(case when la.leave_type like '%外出%' then 1 END) as errorOutCount
|
||||
from leave_apply as la
|
||||
where la.is_active = 1
|
||||
and examine_status = 0
|
||||
and (leave_start_date < #{attNextMonthFirst} and leave_start_date >= #{attCurrentMonthFirst})
|
||||
<if test="orgId != null and orgId != '' ">
|
||||
and la.org_id = #{orgId}
|
||||
</if>
|
||||
<if test="name != null and name != '' ">
|
||||
and INSTR(la.user_name,#{name}) > 0
|
||||
</if>
|
||||
group by user_id
|
||||
SELECT
|
||||
vv.user_id,
|
||||
vv.org_id,
|
||||
su.user_name,
|
||||
so.org_name,
|
||||
sum( IF ( toWorkOriginalAttStatus = 2 OR offWorkOriginalAttStatus = 2, 1, 0 ) ) as lateCount,
|
||||
sum( IF ( toWorkOriginalAttStatus = 3 OR offWorkOriginalAttStatus = 3, 1, 0 ) ) as absenteeismCount,
|
||||
sum( IF ( toWorkOriginalAttStatus = 4 OR offWorkOriginalAttStatus = 4, 1, 0 ) ) as earlyCount,
|
||||
sum( IF ( toWorkOriginalAttStatus = 8 OR offWorkOriginalAttStatus = 8, 1, 0 ) ) as addressCount,
|
||||
sum( IF ( toWorkOriginalAttStatus = 9 OR offWorkOriginalAttStatus = 9, 1, 0 ) ) as goOutCount
|
||||
FROM
|
||||
v_att_update_data vv
|
||||
LEFT JOIN sys_user su ON su.user_id = vv.user_id
|
||||
AND su.is_active = '1'
|
||||
LEFT JOIN sys_organization so ON so.id = vv.org_id
|
||||
AND so.is_active = '1'
|
||||
WHERE
|
||||
locate( #{attCurrentMonth}, att_current_day )
|
||||
GROUP BY
|
||||
user_id,
|
||||
org_id
|
||||
</select>
|
||||
|
||||
<select id="getDetailAllException" resultType="com.bonus.system.att.entity.AttExceptionBean">
|
||||
select
|
||||
user_id as userId,
|
||||
user_name as name,
|
||||
org_id as orgId,
|
||||
org_name as orgName,
|
||||
leave_start_date as attCurrentMonth,
|
||||
count(case when la.leave_type like '%轮休%' then 1 END ) as errorRestCount,
|
||||
count(case when la.leave_type like '%外出%' then 1 END) as errorOutCount
|
||||
from leave_apply as la
|
||||
where
|
||||
<foreach collection="month" item="monthOne" separator="OR">
|
||||
(
|
||||
leave_start_date >= CONCAT(#{monthOne}, '-01') AND
|
||||
leave_start_date < LAST_DAY(CONCAT(#{monthOne}, '-01'))
|
||||
)
|
||||
</foreach>
|
||||
and la.is_active = 1
|
||||
and examine_status = 0
|
||||
<if test="orgId != null and orgId != '' ">
|
||||
and la.org_id in
|
||||
<foreach item="id" collection="orgIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="name != null and name != '' ">
|
||||
and INSTR(la.user_name,#{name}) > 0
|
||||
</if>
|
||||
group by user_id
|
||||
</select>
|
||||
|
||||
<select id="getDetailExceptionRest" resultType="com.bonus.system.att.entity.AttDetailLeaveBean">
|
||||
select
|
||||
id as id,
|
||||
user_id as userId,
|
||||
user_name as name,
|
||||
org_id as orgId,
|
||||
org_name as orgName,
|
||||
leave_type as leaveType,
|
||||
examine_status as examineStatus,
|
||||
concat(leave_start_date,' ',
|
||||
case
|
||||
when leave_start_interval=1 then '上午'
|
||||
when leave_start_interval then '下午'
|
||||
ELSE ''
|
||||
END) as leaveStartDate,
|
||||
concat(leave_end_date,' ',
|
||||
case
|
||||
when leave_end_interval=1 then '上午'
|
||||
when leave_end_interval then '下午'
|
||||
ELSE ''
|
||||
END) as leaveEndDate,
|
||||
leave_duration as leaveDuration
|
||||
from leave_apply as la
|
||||
where la.is_active = 1
|
||||
and examine_status = 0
|
||||
and (leave_start_date < #{attNextMonthFirst} and leave_start_date >= #{attCurrentMonthFirst}) and (la.leave_type like '%轮休%')
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(la.leave_start_date,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(la.leave_end_date,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="userId != null and userId != '' ">
|
||||
and la.user_id=#{userId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDetailExceptionOut" resultType="com.bonus.system.att.entity.AttDetailLeaveBean">
|
||||
select
|
||||
id as id,
|
||||
user_id as userId,
|
||||
user_name as name,
|
||||
org_id as orgId,
|
||||
org_name as orgName,
|
||||
leave_type as leaveType,
|
||||
examine_status as examineStatus,
|
||||
concat(leave_start_date,' ',
|
||||
case
|
||||
when leave_start_interval=1 then '上午'
|
||||
when leave_start_interval then '下午'
|
||||
ELSE ''
|
||||
END) as leaveStartDate,
|
||||
concat(leave_end_date,' ',
|
||||
case
|
||||
when leave_end_interval=1 then '上午'
|
||||
when leave_end_interval then '下午'
|
||||
ELSE ''
|
||||
END) as leaveEndDate,
|
||||
leave_duration as leaveDuration
|
||||
from leave_apply as la
|
||||
where la.is_active = 1
|
||||
and examine_status = 0
|
||||
and (leave_start_date < #{attNextMonthFirst} and leave_start_date >= #{attCurrentMonthFirst}) and (la.leave_type like '%外出%')
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(la.leave_start_date,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(la.leave_end_date,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="userId != null and userId != '' ">
|
||||
and la.user_id=#{userId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDetailExceptionAll" resultType="com.bonus.system.att.entity.AttDetailLeaveBean">
|
||||
select
|
||||
id as id,
|
||||
user_id as userId,
|
||||
user_name as name,
|
||||
org_id as orgId,
|
||||
org_name as orgName,
|
||||
leave_type as leaveType,
|
||||
examine_status as examineStatus,
|
||||
concat(leave_start_date,' ',
|
||||
case
|
||||
when leave_start_interval=1 then '上午'
|
||||
when leave_start_interval then '下午'
|
||||
ELSE ''
|
||||
END) as leaveStartDate,
|
||||
concat(leave_end_date,' ',
|
||||
case
|
||||
when leave_end_interval=1 then '上午'
|
||||
when leave_end_interval then '下午'
|
||||
ELSE ''
|
||||
END) as leaveEndDate,
|
||||
leave_duration as leaveDuration
|
||||
from leave_apply as la
|
||||
where la.is_active = 1
|
||||
and (leave_start_date < #{attNextMonthFirst} and leave_start_date >= #{attCurrentMonthFirst}) and (la.leave_type like '%外出%' or la.leave_type like '%轮休%')
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(la.leave_start_date,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(la.leave_end_date,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="name != null and name != '' ">
|
||||
and INSTR(la.user_name,#{name}) > 0
|
||||
</if>
|
||||
<if test="isExamine != null and isExamine == 1">
|
||||
and la.examine_status = 0
|
||||
</if>
|
||||
<if test="isExamine != null and isExamine == 0">
|
||||
and (la.examine_status = 1 or la.examine_status = 2 or la.examine_status = 3)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getOrgUserId" resultType="com.bonus.system.att.entity.AttExRemindBean">
|
||||
select
|
||||
org_head_user_id as orgHeadId
|
||||
from sys_organization as so
|
||||
where so.id = #{orgId}
|
||||
</select>
|
||||
|
||||
<insert id="examineRemind" parameterType="com.bonus.system.att.entity.AttExRemindBean" >
|
||||
insert into sys_notice(
|
||||
<if test="userUpdate != null">user_id,</if>
|
||||
<if test="title != null and title != ''">title,</if>
|
||||
<if test="content != null and content != '' ">content,</if>
|
||||
type,
|
||||
create_time,
|
||||
update_time,
|
||||
is_active
|
||||
)values(
|
||||
<if test=" userUpdate != null">#{userUpdate},</if>
|
||||
<if test="title != null and title != ''">#{title},</if>
|
||||
<if test="content != null and content != ''">#{content},</if>
|
||||
#{type},
|
||||
now(),
|
||||
now(),
|
||||
1
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="examineRemindTemp" parameterType="com.bonus.system.att.entity.AttExRemindBean" >
|
||||
insert into sys_notice_user(
|
||||
<if test="userId != null">user_id,</if>
|
||||
create_time,
|
||||
update_time,
|
||||
is_active
|
||||
)values(
|
||||
<if test=" userId != null">#{userId},</if>
|
||||
now(),
|
||||
now(),
|
||||
1
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -33,11 +33,11 @@
|
|||
<foreach collection="list" item="params" separator=";">
|
||||
replace 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)
|
||||
leave_num, address_error_num, ein_error_num, rest_num, out_num, business_trip_num)
|
||||
values (#{params.userId}, #{params.userName}, #{params.orgId}, #{params.orgName},
|
||||
#{params.attCurrentMonth}, #{params.requiredDays}, #{params.normalNum}, #{params.lateNum},
|
||||
#{params.earlyNum}, #{params.skippingNum}, #{params.leaveNum},
|
||||
#{params.addressErrorNum}, #{params.einErrorNum}, #{params.restNum}, #{params.outNum})
|
||||
#{params.addressErrorNum}, #{params.einErrorNum}, #{params.restNum}, #{params.outNum}, #{params.businessTripNum})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
|
@ -147,17 +147,17 @@
|
|||
attendance_date as attCurrentDay, attendance_time as attCurrentTime,
|
||||
CASE attendance_type WHEN '上班' THEN 1 ELSE 2 END as attType,
|
||||
'0' as attAddress, lon as attLon, lat as attLat, '1' as dataSource
|
||||
from gz_cloud.fc_sup_attendance sup
|
||||
from gz_cloud_test.fc_sup_attendance sup
|
||||
where sup.attendance_date
|
||||
<if test=' pushType == "1" '>
|
||||
>= (#{pushDate} - INTERVAL 1 DAY)
|
||||
>= #{pushDate}
|
||||
</if>
|
||||
<if test=' pushType == "2" '>
|
||||
= #{pushDate}
|
||||
</if>
|
||||
and is_wechat != 1
|
||||
</select>
|
||||
|
||||
<!-- -->
|
||||
<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
|
||||
from sys_user su
|
||||
|
|
@ -177,20 +177,20 @@
|
|||
<select id="selectAttDayReport" resultType="com.bonus.system.att.entity.AttDayReportBean">
|
||||
select att_current_day,
|
||||
org_id,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 1 and IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 1), 0) as normalNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 2 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 2), 0) as lateNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 3 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 3), 0) as skippingNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 4 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 4), 0) as earlyNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 5 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 5), 0) as restNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) in (SELECT dict_value
|
||||
IFNULL(sum(toWorkAttStatus = 1 and offWorkAttStatus = 1), 0) as normalNum,
|
||||
IFNULL(sum(toWorkAttStatus = 2 or offWorkAttStatus) = 2, 0) as lateNum,
|
||||
IFNULL(sum(toWorkAttStatus = 3 or offWorkAttStatus = 3), 0) as skippingNum,
|
||||
IFNULL(sum(toWorkAttStatus = 4 or offWorkAttStatus = 4), 0) as earlyNum,
|
||||
IFNULL(sum(toWorkAttStatus = 5 or offWorkAttStatus = 5), 0) as restNum,
|
||||
IFNULL(sum(toWorkAttStatus in (SELECT dict_value
|
||||
FROM sys_dict_data
|
||||
where dict_type = 'att_status' and is_leave = '1') or
|
||||
IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) in (SELECT dict_value
|
||||
offWorkAttStatus in (SELECT dict_value
|
||||
FROM sys_dict_data
|
||||
where dict_type = 'att_status' and is_leave = '1')), 0) as leaveNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 7 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 7), 0) as outNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 8 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 8), 0) as einErrorNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 9 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 9), 0) as addressErrorNum
|
||||
IFNULL(sum(toWorkAttStatus = 7 or offWorkAttStatus = 7), 0) as outNum,
|
||||
IFNULL(sum(toWorkAttStatus = 8 or offWorkAttStatus = 8), 0) as einErrorNum,
|
||||
IFNULL(sum(toWorkAttStatus = 9 or offWorkAttStatus = 9), 0) as addressErrorNum
|
||||
from v_att_update_data
|
||||
where att_current_day
|
||||
<if test=' pushType == "1" '>
|
||||
|
|
@ -210,20 +210,20 @@
|
|||
so.org_name,
|
||||
g.group_id,
|
||||
DATE_FORMAT(att_current_day, '%Y-%m') as attCurrentMonth,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 1 and IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 1), 0) as normalNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 2 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 2), 0) as lateNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 3 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 3), 0) as skippingNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 4 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 4), 0) as earlyNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 5 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 5), 0) as restNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) in (SELECT dict_value
|
||||
FROM sys_dict_data
|
||||
where dict_type = 'att_status' and is_leave = '1') or
|
||||
IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) in (SELECT dict_value
|
||||
FROM sys_dict_data
|
||||
where dict_type = 'att_status' and is_leave = '1')), 0) as leaveNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 7 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 7), 0) as outNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 8 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 8), 0) as einErrorNum,
|
||||
IFNULL(sum(IFNULL(toWorkUpdateAttStatus,toWorkAttStatus) = 9 or IFNULL(offWorkUpdateAttStatus,offWorkAttStatus) = 9), 0) as addressErrorNum
|
||||
IFNULL( sum( IF ( toWorkAttStatus = 1, 0.5, 0 )), 0 ) + IFNULL( sum( IF ( offWorkAttStatus = 1, 0.5, 0 )), 0 ) AS normalNum,
|
||||
IFNULL( sum( IF ( toWorkAttStatus = 2, 0.5, 0 )), 0 ) + IFNULL( sum( IF ( offWorkAttStatus = 2, 0.5, 0 )), 0 ) AS lateNum,
|
||||
IFNULL( sum( IF ( toWorkAttStatus = 3, 0.5, 0 )), 0 ) + IFNULL( sum( IF ( offWorkAttStatus = 3, 0.5, 0 )), 0 ) AS skippingNum,
|
||||
IFNULL( sum( IF ( toWorkAttStatus = 4, 0.5, 0 )), 0 ) + IFNULL( sum( IF ( offWorkAttStatus = 4, 0.5, 0 )), 0 ) AS earlyNum,
|
||||
IFNULL( sum( IF ( toWorkAttStatus = 5, 0.5, 0 )), 0 ) + IFNULL( sum( IF ( offWorkAttStatus = 5, 0.5, 0 )), 0 ) AS restNum,
|
||||
sum(
|
||||
IF
|
||||
( toWorkAttStatus IN ( SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' ), 0.5, 0 ))+ sum(
|
||||
IF
|
||||
( offWorkAttStatus IN ( SELECT dict_value FROM sys_dict_data WHERE dict_type = 'att_status' AND is_leave = '1' ), 0.5, 0 )) AS leaveNum,
|
||||
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 ) + IFNULL( sum( IF ( offWorkAttStatus = 8, 0.5, 0 )), 0 ) AS einErrorNum,
|
||||
IFNULL( sum( IF ( toWorkAttStatus = 9, 0.5, 0 )), 0 ) + IFNULL( sum( IF ( offWorkAttStatus = 9, 0.5, 0 )), 0 ) AS addressErrorNum,
|
||||
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
|
||||
|
|
@ -231,7 +231,7 @@
|
|||
on g.user_id = v.user_id and g.is_active = 1
|
||||
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;
|
||||
GROUP BY DATE_FORMAT(att_current_day, '%Y-%m'), v.user_id
|
||||
</select>
|
||||
|
||||
<select id="selectHolidayByMonth" resultType="com.bonus.system.att.entity.Holiday">
|
||||
|
|
@ -267,7 +267,7 @@
|
|||
left join att_group g on g.id = ag.group_id
|
||||
where att_current_day
|
||||
<if test=' pushType == "1" '>
|
||||
>= (#{pushDate} - INTERVAL 1 DAY)
|
||||
>= #{pushDate}
|
||||
</if>
|
||||
<if test=' pushType == "2" '>
|
||||
= #{pushDate}
|
||||
|
|
@ -285,7 +285,7 @@
|
|||
left join att_group g on g.id = ag.group_id
|
||||
where att_current_day
|
||||
<if test=' pushType == "1" '>
|
||||
>= (#{pushDate} - INTERVAL 1 DAY)
|
||||
>= #{pushDate}
|
||||
</if>
|
||||
<if test=' pushType == "2" '>
|
||||
= #{pushDate}
|
||||
|
|
@ -332,7 +332,7 @@
|
|||
left join zkeco.userinfo u on u.userid = c.userid
|
||||
where
|
||||
<if test=' pushType == "1" '>
|
||||
DATE_FORMAT(c.checktime, '%Y-%m-%d') >= (#{pushDate} - INTERVAL 1 DAY)
|
||||
DATE_FORMAT(c.checktime, '%Y-%m-%d') >= #{pushDate}
|
||||
</if>
|
||||
<if test=' pushType == "2" '>
|
||||
DATE_FORMAT(c.checktime, '%Y-%m-%d %H:%i:%s') BETWEEN concat(#{pushDate},' 00:00:00') AND DATE_ADD(DATE_ADD(concat(#{pushDate},' 00:00:00'), INTERVAL 1 DAY), INTERVAL 5 HOUR) - INTERVAL 1 SECOND
|
||||
|
|
@ -341,17 +341,27 @@
|
|||
</select>
|
||||
|
||||
<select id="getLeaveData" resultType="com.bonus.system.att.entity.LeaveBean">
|
||||
SELECT agpr.org_id,la.*,
|
||||
sdd.dict_value AS attStatus
|
||||
FROM leave_apply la
|
||||
LEFT JOIN sys_dict_data sdd ON sdd.dict_label = if(la.leave_type is not null, la.leave_type, la.type)
|
||||
AND sdd.dict_type = 'att_status'
|
||||
LEFT JOIN att_group_person_relation agpr ON la.user_id = agpr.user_id
|
||||
WHERE la.is_active = 1
|
||||
SELECT
|
||||
agpr.org_id,
|
||||
ag.att_type,
|
||||
la.*,
|
||||
sdd.dict_value AS attStatus
|
||||
FROM
|
||||
leave_apply la
|
||||
LEFT JOIN sys_dict_data sdd ON sdd.dict_label =
|
||||
IF
|
||||
( la.leave_type IS NOT NULL, la.leave_type, la.type )
|
||||
AND sdd.dict_type = 'att_status'
|
||||
LEFT JOIN att_group_person_relation agpr ON la.user_id = agpr.user_id
|
||||
LEFT JOIN att_group ag ON ag.id = agpr.group_id
|
||||
AND ag.is_active = '1'
|
||||
WHERE
|
||||
la.is_active = 1
|
||||
AND la.examine_status = 1
|
||||
AND sdd.dict_value IS NOT NULL
|
||||
AND agpr.is_active = 1
|
||||
ORDER BY leave_start_date DESC
|
||||
ORDER BY
|
||||
leave_start_date DESC
|
||||
</select>
|
||||
|
||||
<select id="getSourceAttNoInOutData" resultType="com.bonus.system.att.entity.AttSourceDataBean">
|
||||
|
|
|
|||
Loading…
Reference in New Issue