parent
26dffb27f9
commit
d4df9cff0f
|
|
@ -20,7 +20,7 @@ public class AttDataDetailsBean {
|
||||||
/**
|
/**
|
||||||
* 组织编号
|
* 组织编号
|
||||||
*/
|
*/
|
||||||
private List<String> orgIds;
|
private List<Long> orgIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织名称
|
* 组织名称
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,11 @@ public class AttDetailBean {
|
||||||
*/
|
*/
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门编号
|
||||||
|
*/
|
||||||
|
private List<Long> orgIds;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 考勤日期
|
* 考勤日期
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.bonus.system.att.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤天数组成
|
||||||
|
* @author fl
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class AttMonthDaysMakeUpBean {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户编号
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 考勤月
|
||||||
|
*/
|
||||||
|
private String attCurrentMonth;
|
||||||
|
/**
|
||||||
|
* 出勤天数
|
||||||
|
*/
|
||||||
|
private Integer attDays;
|
||||||
|
/**
|
||||||
|
* 考勤组
|
||||||
|
*/
|
||||||
|
private String groupName;
|
||||||
|
/**
|
||||||
|
* 考勤规则
|
||||||
|
*/
|
||||||
|
private String attRules;
|
||||||
|
/**
|
||||||
|
* 是否有节假日
|
||||||
|
*/
|
||||||
|
private String isHaveHoliday;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private String attStartDate;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private String attEndDate;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -17,12 +17,19 @@ public class AttMonthReportBean {
|
||||||
*/
|
*/
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织编号
|
||||||
|
*/
|
||||||
|
private List<Long> orgIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织名称
|
* 组织名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "所属部门", sort = 2)
|
@Excel(name = "所属部门", sort = 2)
|
||||||
private String orgName;
|
private String orgName;
|
||||||
|
|
||||||
|
private String orgNames;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户编号
|
* 用户编号
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,12 @@ public class AttSourceDataBean {
|
||||||
*/
|
*/
|
||||||
private String attCurrentDay;
|
private String attCurrentDay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤月
|
||||||
|
*/
|
||||||
|
private String attCurrentMonth;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 考勤时间
|
* 考勤时间
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -808,6 +808,7 @@ public class AttCalServiceImpl implements AttCalService {
|
||||||
longBreakRecord.setName(record.getName());
|
longBreakRecord.setName(record.getName());
|
||||||
longBreakRecord.setOrgId(attGroupBean.getOrgId());
|
longBreakRecord.setOrgId(attGroupBean.getOrgId());
|
||||||
longBreakRecord.setAttCurrentDay(record.getAttCurrentDay());
|
longBreakRecord.setAttCurrentDay(record.getAttCurrentDay());
|
||||||
|
longBreakRecord.setAttCurrentMonth(record.getAttCurrentDay().substring(0, 7));
|
||||||
longBreakRecord.setAttCurrentTime(v.get(i - 1).getAttCurrentTime() + " " + record.getAttCurrentTime());
|
longBreakRecord.setAttCurrentTime(v.get(i - 1).getAttCurrentTime() + " " + record.getAttCurrentTime());
|
||||||
longBreakRecord.setAttAddress(v.get(i - 1).getAttAddress() + " " + record.getAttAddress());
|
longBreakRecord.setAttAddress(v.get(i - 1).getAttAddress() + " " + record.getAttAddress());
|
||||||
longBreakRecords.add(longBreakRecord);
|
longBreakRecords.add(longBreakRecord);
|
||||||
|
|
|
||||||
|
|
@ -683,7 +683,7 @@ public class ExportFileController {
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
map.put("序号", i + 1);
|
map.put("序号", i + 1);
|
||||||
map.put("姓名", attDayReportList.get(i).getUserName());
|
map.put("姓名", attDayReportList.get(i).getUserName());
|
||||||
map.put("所属部门", attDayReportList.get(i).getOrgName());
|
map.put("所属部门", attDayReportList.get(i).getOrgNames());
|
||||||
map.put("考勤月", attDayReportList.get(i).getAttCurrentMonth());
|
map.put("考勤月", attDayReportList.get(i).getAttCurrentMonth());
|
||||||
map.put("打卡记录", attDayReportList.get(i).getClockingRecordNum());
|
map.put("打卡记录", attDayReportList.get(i).getClockingRecordNum());
|
||||||
map.put("应考勤天数", attDayReportList.get(i).getRequiredDays());
|
map.put("应考勤天数", attDayReportList.get(i).getRequiredDays());
|
||||||
|
|
@ -723,8 +723,8 @@ public class ExportFileController {
|
||||||
dayTable.setStartDate(monthFirstAndLast.get(0));
|
dayTable.setStartDate(monthFirstAndLast.get(0));
|
||||||
dayTable.setEndDate(monthFirstAndLast.get(1));
|
dayTable.setEndDate(monthFirstAndLast.get(1));
|
||||||
dayTable.setName(bean.getUserName());
|
dayTable.setName(bean.getUserName());
|
||||||
if (bean.getOrgId() != null) {
|
if (bean.getOrgIds() != null) {
|
||||||
dayTable.setOrgId(bean.getOrgId());
|
dayTable.setOrgIds(bean.getOrgIds());
|
||||||
}else{
|
}else{
|
||||||
//受限于当前登录人
|
//受限于当前登录人
|
||||||
if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){
|
if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){
|
||||||
|
|
@ -738,8 +738,8 @@ public class ExportFileController {
|
||||||
// att.setAttCurrentMonth(bean.getMonth());
|
// att.setAttCurrentMonth(bean.getMonth());
|
||||||
att.setStartDate(monthFirstAndLast.get(0));
|
att.setStartDate(monthFirstAndLast.get(0));
|
||||||
att.setEndDate(monthFirstAndLast.get(1));
|
att.setEndDate(monthFirstAndLast.get(1));
|
||||||
if (bean.getOrgId() != null) {
|
if (bean.getOrgIds() != null) {
|
||||||
att.setOrgId(bean.getOrgId());
|
att.setOrgIds(bean.getOrgIds());
|
||||||
}else{
|
}else{
|
||||||
//受限于当前登录人
|
//受限于当前登录人
|
||||||
if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){
|
if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){
|
||||||
|
|
@ -1359,7 +1359,7 @@ public class ExportFileController {
|
||||||
dayTable.setName(bean.getUserName());
|
dayTable.setName(bean.getUserName());
|
||||||
if (bean.getOrgId() != null || bean.getOrgIds() != null) {
|
if (bean.getOrgId() != null || bean.getOrgIds() != null) {
|
||||||
dayTable.setOrgId(bean.getOrgId());
|
dayTable.setOrgId(bean.getOrgId());
|
||||||
dayTable.setOrgList(bean.getOrgIds());
|
dayTable.setOrgIds(bean.getOrgIds());
|
||||||
}else{
|
}else{
|
||||||
//受限于当前登录人
|
//受限于当前登录人
|
||||||
if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){
|
if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){
|
||||||
|
|
@ -1374,7 +1374,7 @@ public class ExportFileController {
|
||||||
att.setEndDate(bean.getEndDate());
|
att.setEndDate(bean.getEndDate());
|
||||||
if (bean.getOrgId() != null || bean.getOrgIds() != null) {
|
if (bean.getOrgId() != null || bean.getOrgIds() != null) {
|
||||||
att.setOrgId(bean.getOrgId());
|
att.setOrgId(bean.getOrgId());
|
||||||
att.setOrgList(bean.getOrgIds());
|
att.setOrgIds(bean.getOrgIds());
|
||||||
}else{
|
}else{
|
||||||
//受限于当前登录人
|
//受限于当前登录人
|
||||||
if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){
|
if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,13 @@
|
||||||
<if test="orgId != null and orgId != '' ">
|
<if test="orgId != null and orgId != '' ">
|
||||||
and vat.org_id = #{orgId}
|
and vat.org_id = #{orgId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test='orgIds != null and orgIds.size() > 0'>
|
||||||
|
and vat.org_id in (
|
||||||
|
<foreach collection="orgIds" item="item" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
<if test='orgList != null and orgList.size() > 0'>
|
<if test='orgList != null and orgList.size() > 0'>
|
||||||
and vat.org_id in (
|
and vat.org_id in (
|
||||||
<foreach collection="orgList" item="item" separator=",">
|
<foreach collection="orgList" item="item" separator=",">
|
||||||
|
|
|
||||||
|
|
@ -360,8 +360,11 @@
|
||||||
WHERE la.is_active = 1
|
WHERE la.is_active = 1
|
||||||
AND la.examine_status = 1
|
AND la.examine_status = 1
|
||||||
AND sdd.dict_value IS NOT NULL
|
AND sdd.dict_value IS NOT NULL
|
||||||
AND leave_start_date BETWEEN #{pushDate} - INTERVAL 15 DAY
|
AND
|
||||||
|
(leave_start_date BETWEEN #{pushDate} - INTERVAL 15 DAY
|
||||||
and #{pushDate}
|
and #{pushDate}
|
||||||
|
or #{pushDate} between leave_start_date and leave_end_date
|
||||||
|
)
|
||||||
ORDER BY
|
ORDER BY
|
||||||
leave_start_date
|
leave_start_date
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -314,15 +314,27 @@
|
||||||
WHERE adr.att_current_day BETWEEN #{startDate} AND #{endDate}
|
WHERE adr.att_current_day BETWEEN #{startDate} AND #{endDate}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!--orgList与orgIds不同,一个是权限获取的,一个是前端选择的,不放在一起是防止下拉全权限错误导致查询范围变大 -->
|
||||||
<select id="getAttMonthReportList" resultType="com.bonus.system.att.entity.AttMonthReportBean">
|
<select id="getAttMonthReportList" resultType="com.bonus.system.att.entity.AttMonthReportBean">
|
||||||
select v.*, v.name as userName,IF(awa.outCount is null,0,awa.outCount) as outCount
|
SELECT v.*, v.name as userName,
|
||||||
from att_month_report v
|
IFNULL(CONCAT(so2.`org_name`,'/',v.org_name),v.org_name) as orgNames,
|
||||||
left join att_group_person_relation p on p.user_id = v.user_id and p.is_active = 1
|
IF(awa.outCount is null,0,awa.outCount) as outCount
|
||||||
LEFT JOIN (SELECT user_id,count(user_id) as outCount FROM att_work_abnormal WHERE LOCATE(#{bean.month},att_current_day) GROUP BY user_id) awa ON awa.user_id = v.user_id
|
FROM att_month_report v
|
||||||
where v.att_current_month BETWEEN #{bean.startMonth} AND #{bean.endMonth} and p.group_id is not null
|
LEFT JOIN sys_organization so ON v.org_id = so.id
|
||||||
|
LEFT JOIN sys_organization so2 ON so.parent_id = so2.id
|
||||||
|
LEFT JOIN (SELECT user_id,att_current_month, count( user_id ) AS outCount FROM att_work_abnormal WHERE att_current_month BETWEEN #{bean.startMonth}
|
||||||
|
AND #{bean.endMonth} GROUP BY user_id,att_current_month) awa ON awa.user_id = v.user_id and awa.att_current_month = v.att_current_month
|
||||||
|
where v.att_current_month BETWEEN #{bean.startMonth} AND #{bean.endMonth}
|
||||||
<if test="bean.orgId != null and bean.orgId != ''">
|
<if test="bean.orgId != null and bean.orgId != ''">
|
||||||
AND v.org_id = #{bean.orgId}
|
AND v.org_id = #{bean.orgId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test='bean.orgIds != null and bean.orgIds.size() > 0'>
|
||||||
|
and v.org_id in (
|
||||||
|
<foreach collection="bean.orgIds" item="item" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
<if test="bean.userName != null and bean.userName != ''">
|
<if test="bean.userName != null and bean.userName != ''">
|
||||||
AND v.name like concat('%', #{bean.userName}, '%')
|
AND v.name like concat('%', #{bean.userName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -527,6 +539,13 @@
|
||||||
<if test="bean.orgId != null and bean.orgId != ''">
|
<if test="bean.orgId != null and bean.orgId != ''">
|
||||||
and so.id = #{bean.orgId}
|
and so.id = #{bean.orgId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test='bean.orgIds != null and bean.orgIds.size() > 0'>
|
||||||
|
and so.id in (
|
||||||
|
<foreach collection="bean.orgIds" item="item" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
<if test='bean.orgList != null and bean.orgList.size() > 0'>
|
<if test='bean.orgList != null and bean.orgList.size() > 0'>
|
||||||
and so.id in (
|
and so.id in (
|
||||||
<foreach collection="bean.orgList" item="item" separator=",">
|
<foreach collection="bean.orgList" item="item" separator=",">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue