历史考勤推送问题
This commit is contained in:
parent
097e271be9
commit
9ed3545405
|
|
@ -256,6 +256,19 @@ public class AttendanceDetailsController extends BaseController {
|
|||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
@RequiresPermissions("att:public:list")
|
||||
@GetMapping("/getOutCountList")
|
||||
@Log(title = "考勤报表->考情明细->打卡次数记录", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo getAttCountList(AttDataDetailsBean bean) {
|
||||
try{
|
||||
startPage();
|
||||
return getDataTable(attendanceDetailsService.getAttCountList(bean));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户新增
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -88,4 +88,6 @@ public interface AttendanceDetailsDao {
|
|||
List<AttDataDetailsBean> getAttDayList(AttDataDetailsBean bean);
|
||||
|
||||
List<AttDataDetailsBean> getAttDayReportDetailsListData(AttDataDetailsBean bean);
|
||||
|
||||
List<AttDataDetailsBean> getAttCountList(AttDataDetailsBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,6 +199,9 @@ public class AttDataDetailsBean {
|
|||
/** 上班时间外出次数 */
|
||||
private Integer outCount;
|
||||
|
||||
/** 打卡次数 */
|
||||
private Integer attCount;
|
||||
|
||||
/**
|
||||
* 角色类型 1:人资专员和管理员;2:部门考勤员,部门负责人 3:普通人员
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -103,4 +103,6 @@ public interface AttendanceDetailsService {
|
|||
AjaxResult synchronous(AttDataDetailsBean bean);
|
||||
|
||||
List<AttDataDetailsBean> getAttDayList(AttDataDetailsBean bean);
|
||||
|
||||
List<AttDataDetailsBean> getAttCountList(AttDataDetailsBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.bonus.common.core.utils.poi.ExcelUtil;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.MapVo;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.att.dao.AttendanceDetailsDao;
|
||||
import com.bonus.system.att.entity.AttDataDetailsBean;
|
||||
import com.bonus.system.att.entity.AttDayReportBean;
|
||||
|
|
@ -111,16 +112,17 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
|||
@Override
|
||||
public List<AttDataDetailsBean> selectAttUpdateList(AttDataDetailsBean bean) {
|
||||
//只能查自己分公司的人
|
||||
List<MapVo> orgList = SecurityUtils.getLoginUser().getSysUser().getOrgList();
|
||||
if(!orgList.isEmpty()){
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
for (MapVo mapVo : orgList) {
|
||||
String id = proDeptRoleDao.getOrgChildById(mapVo.getId());
|
||||
// 使用 Arrays.asList() 将数组转换为 ArrayList
|
||||
ArrayList<String> idList = new ArrayList<>(Arrays.asList(id.split(",")));
|
||||
ids.addAll(idList);
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<String> roleId = sysUser.getRoleList();
|
||||
if (Collections.frequency(roleId, 1L)==0) {
|
||||
List<MapVo> orgList = SecurityUtils.getLoginUser().getSysUser().getOrgList();
|
||||
if(!orgList.isEmpty()){
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
for (MapVo mapVo : orgList) {
|
||||
ids.add(String.valueOf(mapVo.getId()));
|
||||
}
|
||||
bean.setOrgList(ids);
|
||||
}
|
||||
bean.setOrgList(ids);
|
||||
}
|
||||
return attendanceDetailsDao.selectAttUpdateList(bean);
|
||||
}
|
||||
|
|
@ -193,6 +195,11 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
|||
return attendanceDetailsDao.getAttDayList(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AttDataDetailsBean> getAttCountList(AttDataDetailsBean bean) {
|
||||
return attendanceDetailsDao.getAttCountList(bean);
|
||||
}
|
||||
|
||||
public List<AttDayReportBean> getAttDayReportListAll(List<AttDayReportBean> list) {
|
||||
List<AttDayReportBean> allList = new ArrayList<>();
|
||||
Map<String, AttDayReportBean> map = list.stream()
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ public interface SysOrgDao {
|
|||
/**
|
||||
* 查询组织列表
|
||||
*
|
||||
* @param sysOrg 组织信息
|
||||
* @param bean 组织信息
|
||||
* @return 菜单列表
|
||||
*/
|
||||
List<SysOrg> selectOrgList(SysOrg sysOrg);
|
||||
List<SysOrg> selectOrgList(@Param("bean") SysOrg bean);
|
||||
|
||||
/**
|
||||
* 根据组织编号获取详细信息
|
||||
|
|
|
|||
|
|
@ -105,4 +105,10 @@ public class SysOrg {
|
|||
*
|
||||
*/
|
||||
private String idNumber;
|
||||
|
||||
/**
|
||||
* 自己项目部所在分公司下的所有项目部id
|
||||
*/
|
||||
private List<String> orgList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import com.bonus.common.core.utils.poi.ExcelUtil;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.common.security.utils.ValidatorsUtils;
|
||||
import com.bonus.system.api.domain.MapVo;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.att.utils.AddressCoordinateFormatUtil;
|
||||
import com.bonus.system.att.utils.TreeUtils;
|
||||
import com.bonus.system.basic.dao.SysOrgDao;
|
||||
|
|
@ -61,6 +63,19 @@ public class SysOrgServiceImpl implements SysOrgService {
|
|||
|
||||
@Override
|
||||
public List<SysOrg> selectOrgList(SysOrg sysOrg) {
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<String> roleId = sysUser.getRoleList();
|
||||
//管理员与人资角色可以看到所有
|
||||
if (Collections.frequency(roleId, 1L)==0 && Collections.frequency(roleId, 16L)==0) {
|
||||
List<MapVo> orgList = sysUser.getOrgList();
|
||||
if (!orgList.isEmpty()) {
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
for (MapVo mapVo : orgList) {
|
||||
ids.add(String.valueOf(mapVo.getId()));
|
||||
}
|
||||
sysOrg.setOrgList(ids);
|
||||
}
|
||||
}
|
||||
return orgDao.selectOrgList(sysOrg);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,18 +43,12 @@ public class ProDeptRoleServiceImpl implements ProDeptRoleService {
|
|||
//只能查自己分公司的人
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<String> roleId = sysUser.getRoleList();
|
||||
if (Collections.frequency(roleId, 1L)>0) {
|
||||
if (Collections.frequency(roleId, 1L)==0) {
|
||||
List<MapVo> orgList = sysUser.getOrgList();
|
||||
if (!orgList.isEmpty()) {
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
for (MapVo mapVo : orgList) {
|
||||
// Long orgId = proDeptRoleDao.getParentOrgById(mapVo);
|
||||
// String id = proDeptRoleDao.getOrgChildById(orgId);
|
||||
// // 使用 Arrays.asList() 将数组转换为 ArrayList
|
||||
// ArrayList<String> idList = new ArrayList<>(Arrays.asList(id.split(",")));
|
||||
// ids.addAll(idList);
|
||||
ids.add(String.valueOf(mapVo.getId()));
|
||||
|
||||
}
|
||||
bean.setOrgList(ids);
|
||||
}
|
||||
|
|
@ -67,7 +61,7 @@ public class ProDeptRoleServiceImpl implements ProDeptRoleService {
|
|||
//只能查自己分公司的人
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<String> roleId = sysUser.getRoleList();
|
||||
if (Collections.frequency(roleId, 1L)>0) {
|
||||
if (Collections.frequency(roleId, 1L) == 0) {
|
||||
List<MapVo> orgList = sysUser.getOrgList();
|
||||
if (!orgList.isEmpty()) {
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.common.core.constant.UserConstants;
|
|||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.MapVo;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.att.utils.AddressCoordinateFormatUtil;
|
||||
import com.bonus.system.basic.dao.SysOrgDao;
|
||||
import com.bonus.system.basic.domain.SysNotice;
|
||||
|
|
@ -18,10 +19,7 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -53,16 +51,17 @@ public class SubOrgServiceImpl implements SubOrgService {
|
|||
@Override
|
||||
public List<SubOrgBean> selectSubOrgList(SubOrgBean subOrgBean) {
|
||||
//只能查自己分公司的人
|
||||
List<MapVo> orgList = SecurityUtils.getLoginUser().getSysUser().getOrgList();
|
||||
if(!orgList.isEmpty()){
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
for (MapVo mapVo : orgList) {
|
||||
String id = proDeptRoleDao.getOrgChildById(mapVo.getId());
|
||||
// 使用 Arrays.asList() 将数组转换为 ArrayList
|
||||
ArrayList<String> idList = new ArrayList<>(Arrays.asList(id.split(",")));
|
||||
ids.addAll(idList);
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<String> roleId = sysUser.getRoleList();
|
||||
if (Collections.frequency(roleId, 1L)==0) {
|
||||
List<MapVo> orgList = SecurityUtils.getLoginUser().getSysUser().getOrgList();
|
||||
if (!orgList.isEmpty()) {
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
for (MapVo mapVo : orgList) {
|
||||
ids.add(String.valueOf(mapVo.getId()));
|
||||
}
|
||||
subOrgBean.setOrgList(ids);
|
||||
}
|
||||
subOrgBean.setOrgList(ids);
|
||||
}
|
||||
return orgDao.selectOrgList(subOrgBean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,13 +62,17 @@ public class HolidayServiceImpl implements HolidayService {
|
|||
@Override
|
||||
public List<HolidayBean> getHolidayListCheck(HolidayBean bean) {
|
||||
//只能查自己部门的人
|
||||
List<MapVo> orgList = SecurityUtils.getLoginUser().getSysUser().getOrgList();
|
||||
if(!orgList.isEmpty()){
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
for (MapVo mapVo : orgList) {
|
||||
ids.add(String.valueOf(mapVo.getId()));
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<String> roleId = sysUser.getRoleList();
|
||||
if (Collections.frequency(roleId, 1L)==0) {
|
||||
List<MapVo> orgList = SecurityUtils.getLoginUser().getSysUser().getOrgList();
|
||||
if (!orgList.isEmpty()) {
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
for (MapVo mapVo : orgList) {
|
||||
ids.add(String.valueOf(mapVo.getId()));
|
||||
}
|
||||
bean.setOrgList(ids);
|
||||
}
|
||||
bean.setOrgList(ids);
|
||||
}
|
||||
return holidayDao.getHolidayList(bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,14 @@
|
|||
<mapper namespace="com.bonus.system.att.dao.AttendanceDetailsDao">
|
||||
|
||||
<select id="selectAttDetailsList" resultType="com.bonus.system.att.entity.AttDataDetailsBean">
|
||||
select su.user_name, so.org_name,COUNT( awa.user_id ) as outCount, v.* from v_att_update_data v
|
||||
select su.user_name, so.org_name,COUNT( awa.user_id ) as outCount,
|
||||
COUNT(DISTINCT asd.att_current_time ) AS attCount,
|
||||
v.* from v_att_update_data v
|
||||
left join sys_user su on su.user_id = v.user_id
|
||||
left join sys_organization so on so.id = v.org_id
|
||||
LEFT JOIN att_work_abnormal awa ON v.user_id = awa.user_id
|
||||
AND v.att_current_day = awa.att_current_day
|
||||
LEFT JOIN att_source_data asd ON su.user_name = asd.`name` and asd.att_current_day = v.att_current_day
|
||||
where v.att_current_day BETWEEN #{startDate} AND #{endDate}
|
||||
<if test="orgId != null and orgId != ''">
|
||||
AND v.org_id = #{orgId}
|
||||
|
|
@ -285,6 +288,22 @@
|
|||
</where>
|
||||
ORDER BY att_current_day DESC
|
||||
</select>
|
||||
<select id="getAttCountList" resultType="com.bonus.system.att.entity.AttDataDetailsBean">
|
||||
SELECT
|
||||
att_current_day,att_current_time,att_address
|
||||
from
|
||||
att_source_data
|
||||
<where>
|
||||
<if test="attCurrentDay != null and attCurrentDay != ''">
|
||||
and awa.att_current_day = #{attCurrentDay}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
and locate(#{userName},awa.user_name)
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
att_current_time ASC
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateAttDetailsData">
|
||||
|
|
|
|||
|
|
@ -16,11 +16,18 @@
|
|||
GROUP BY o.id
|
||||
) a
|
||||
where 1=1
|
||||
<if test="orgName != null and orgName != ''">
|
||||
AND a.org_name like concat('%', #{orgName}, '%')
|
||||
<if test="bean.orgName != null and bean.orgName != ''">
|
||||
AND a.org_name like concat('%', #{bean.orgName}, '%')
|
||||
</if>
|
||||
<if test="orgHeadUserName != null and orgHeadUserName != ''">
|
||||
AND a.orgHeadUserName like concat('%', #{orgHeadUserName}, '%')
|
||||
<if test="bean.orgHeadUserName != null and bean.orgHeadUserName != ''">
|
||||
AND a.orgHeadUserName like concat('%', #{bean.orgHeadUserName}, '%')
|
||||
</if>
|
||||
<if test='bean.orgList != null and bean.orgList.size() > 0'>
|
||||
and a.id in (
|
||||
<foreach collection="bean.orgList" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -63,53 +63,54 @@
|
|||
|
||||
<select id="getHolidayList" resultType="com.bonus.system.holiday.entity.HolidayBean">
|
||||
SELECT
|
||||
id,
|
||||
user_id,
|
||||
user_name,
|
||||
org_id,
|
||||
org_name,
|
||||
create_time,
|
||||
leave_type,
|
||||
leave_reason,
|
||||
leave_start_date,
|
||||
leave_start_interval,
|
||||
leave_end_date,
|
||||
leave_end_interval,
|
||||
leave_duration,
|
||||
examine_status
|
||||
la.id,
|
||||
la.user_id,
|
||||
la.user_name,
|
||||
la.org_id,
|
||||
la.org_name,
|
||||
la.create_time,
|
||||
la.leave_type,
|
||||
la.leave_reason,
|
||||
la.leave_start_date,
|
||||
la.leave_start_interval,
|
||||
la.leave_end_date,
|
||||
la.leave_end_interval,
|
||||
la.leave_duration,
|
||||
la.examine_status
|
||||
FROM
|
||||
leave_apply
|
||||
leave_apply la
|
||||
left join (select user_Id,GROUP_CONCAT( org_id ) AS org_id FROM sys_user_org where is_active = '1' group by user_id) suo on suo.user_id = la.user_id
|
||||
WHERE
|
||||
is_active = '1'
|
||||
<if test="bean.leaveDate != null and bean.leaveDate != '' ">
|
||||
and locate(#{bean.leaveDate},create_time)
|
||||
and locate(#{bean.leaveDate},la.create_time)
|
||||
</if>
|
||||
<if test="bean.examineStatus != null and bean.examineStatus != '' ">
|
||||
and examine_status = #{bean.examineStatus}
|
||||
and la.examine_status = #{bean.examineStatus}
|
||||
</if>
|
||||
<if test="bean.leaveType != null and bean.leaveType != '' ">
|
||||
and locate(#{bean.leaveType},leave_type)
|
||||
and locate(#{bean.leaveType},la.leave_type)
|
||||
</if>
|
||||
<if test="bean.type != null and bean.type != '' ">
|
||||
and locate(#{bean.type},type)
|
||||
and locate(#{bean.type},la.type)
|
||||
</if>
|
||||
<if test="bean.orgName != null and bean.orgName != '' ">
|
||||
and locate(#{bean.orgName},org_name)
|
||||
and locate(#{bean.orgName},la.org_name)
|
||||
</if>
|
||||
<if test="bean.userName != null and bean.userName != '' ">
|
||||
and locate(#{bean.userName},user_name)
|
||||
and locate(#{bean.userName},la.user_name)
|
||||
</if>
|
||||
<if test="bean.userId != null and bean.userId != '' ">
|
||||
and (user_id = #{bean.userId} or create_user_id = #{bean.userId} )
|
||||
and (la.user_id = #{bean.userId} or la.create_user_id = #{bean.userId} )
|
||||
</if>
|
||||
<if test='bean.orgList != null and bean.orgList.size() > 0'>
|
||||
and org_id in (
|
||||
and suo.org_id in (
|
||||
<foreach collection="bean.orgList" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
ORDER BY update_time DESC
|
||||
ORDER BY la.update_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectHolidayById" resultType="com.bonus.system.holiday.entity.HolidayBean">
|
||||
|
|
|
|||
Loading…
Reference in New Issue