parent
756af47a82
commit
5463501e0d
|
|
@ -76,8 +76,8 @@ public class WechatTasks {
|
|||
/**
|
||||
* 人员基础数据同步定时器
|
||||
*/
|
||||
// @Scheduled(cron = "0 0/10 * * * ?")
|
||||
@Scheduled(initialDelay = 6000,fixedDelay = 60000 * 10)
|
||||
@Scheduled(cron = "0 0/10 * * * ?")
|
||||
// @Scheduled(initialDelay = 6000,fixedDelay = 60000 * 10)
|
||||
@Async
|
||||
public void pushPersonTask() {
|
||||
log.info("--------人员基础数据同步定时器开启------");
|
||||
|
|
|
|||
|
|
@ -52,6 +52,15 @@ public class SysNoticeController extends BaseController {
|
|||
if(sysRole.getRoleName().contains("管理员")){
|
||||
roleCount = 1;
|
||||
break;
|
||||
}else if(sysRole.getRoleName().contains("人资专员")){
|
||||
roleCount = 1;
|
||||
break;
|
||||
} else if(sysRole.getRoleName().contains("部门考勤员")){
|
||||
roleCount = 2;
|
||||
break;
|
||||
}else if(sysRole.getRoleName().contains("考勤员")){
|
||||
roleCount = 2;
|
||||
break;
|
||||
}else if(sysRole.getRoleName().contains("部门负责人")){
|
||||
roleCount = 2;
|
||||
break;
|
||||
|
|
@ -60,17 +69,21 @@ public class SysNoticeController extends BaseController {
|
|||
}
|
||||
if(roleCount==2){
|
||||
String ids = userMapper.getOrg(userId);
|
||||
String userIdList = userMapper.getUserIdList(ids);
|
||||
bean.setRoleType("2");
|
||||
String[] split = userIdList.split(",");
|
||||
bean.setUserIdList(split);
|
||||
String[] split = ids.split(",");
|
||||
bean.setOrgListId(split);
|
||||
//查询是否存在多个部门负责人,
|
||||
List<SysRole> managerList = userMapper.getManagerList(userId);
|
||||
|
||||
if( managerList !=null && managerList.size()>0){
|
||||
bean.setUserIdBr(userId);
|
||||
}
|
||||
}else if(roleCount==1){
|
||||
bean.setRoleType("1");
|
||||
} else{
|
||||
bean.setRoleType("3");
|
||||
bean.setUserId(userId);
|
||||
}
|
||||
|
||||
List<SysNotice> list = noticeService.selectNoticeList(bean);
|
||||
return endPage(list);
|
||||
}catch (Exception e){
|
||||
|
|
|
|||
|
|
@ -232,4 +232,6 @@ public interface SysUserMapper
|
|||
String getOrg(Long userId);
|
||||
|
||||
String getUserIdList(String userIdList);
|
||||
|
||||
List<SysRole> getManagerList(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,4 +74,11 @@ public class SysNotice
|
|||
private String roleType;
|
||||
|
||||
private String[] userIdList;
|
||||
|
||||
private String[] orgListId;
|
||||
|
||||
/**
|
||||
* 用户编号用来判断是否是本人
|
||||
*/
|
||||
private Long userIdBr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,15 @@ import com.bonus.common.log.annotation.Log;
|
|||
import com.bonus.common.log.enums.BusinessType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
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.basic.dao.SysUserMapper;
|
||||
import com.bonus.system.dept.entity.EightRoleBean;
|
||||
import com.bonus.system.dept.entity.ProDeptRoleBean;
|
||||
import com.bonus.system.dept.entity.ProDeptRoleDo;
|
||||
import com.bonus.system.dept.entity.SubOrgBean;
|
||||
import com.bonus.system.holiday.dao.WorkReportDao;
|
||||
import com.bonus.system.holiday.entity.HolidayBean;
|
||||
import com.bonus.system.holiday.service.HolidayService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -19,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -34,6 +40,12 @@ public class HolidayController extends BaseController {
|
|||
@Resource(name = "HolidayService")
|
||||
private HolidayService holidayService;
|
||||
|
||||
@Resource(name = "WorkReportDao")
|
||||
private WorkReportDao dao;
|
||||
|
||||
@Resource
|
||||
private SysUserMapper userMapper;
|
||||
|
||||
/**
|
||||
* 获取假期列表(表格)
|
||||
*/
|
||||
|
|
@ -122,6 +134,42 @@ public class HolidayController extends BaseController {
|
|||
@Log(title = "流程管理->假期管理->列表查询", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo checkList(HolidayBean bean) {
|
||||
try{
|
||||
//根据登录账号获取角色
|
||||
//不是管理员,只能查自己
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysRole> sysRoleList = dao.getRoleListByUserId(userId);
|
||||
int roleCount = 0;
|
||||
if(!sysRoleList.isEmpty()){
|
||||
for (SysRole sysRole : sysRoleList) {
|
||||
if(sysRole.getRoleName().contains("管理员")){
|
||||
roleCount = 1;
|
||||
break;
|
||||
}else if(sysRole.getRoleName().contains("人资专员")){
|
||||
roleCount = 1;
|
||||
break;
|
||||
}else if(sysRole.getRoleName().contains("部门负责人")){
|
||||
roleCount = 2;
|
||||
break;
|
||||
}else if(sysRole.getRoleName().contains("部门考勤员")){
|
||||
roleCount = 2;
|
||||
break;
|
||||
}else if(sysRole.getRoleName().contains("考勤员")){
|
||||
roleCount = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(roleCount==2){
|
||||
String ids = userMapper.getOrg(userId);
|
||||
bean.setRoleType("2");
|
||||
String[] split = ids.split(",");
|
||||
bean.setOrgListId(split);
|
||||
//查询是否存在多个部门负责人,
|
||||
List<SysRole> managerList = userMapper.getManagerList(userId);
|
||||
if( managerList !=null && managerList.size()>0){
|
||||
bean.setUserIds(userId);
|
||||
}
|
||||
}
|
||||
List<HolidayBean> holidayList = holidayService.getHolidayListCheck(bean);
|
||||
return endPage(holidayList);
|
||||
}catch (Exception e){
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ public class HolidayBean extends BaseBean {
|
|||
* 请假人用户编号
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户编号用来判断是否是本人
|
||||
*/
|
||||
private Long userIds;
|
||||
/**
|
||||
* 请假人姓名
|
||||
*/
|
||||
|
|
@ -141,4 +146,10 @@ public class HolidayBean extends BaseBean {
|
|||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 角色类型 1:人资专员和管理员;2:考勤员
|
||||
*/
|
||||
private String roleType;
|
||||
private String[] orgListId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,21 +61,6 @@ public class HolidayServiceImpl implements HolidayService {
|
|||
|
||||
@Override
|
||||
public List<HolidayBean> getHolidayListCheck(HolidayBean bean) {
|
||||
//只能查自己部门的人
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<String> roleId = sysUser.getRoleList();
|
||||
if(roleId !=null && !roleId.isEmpty() ){
|
||||
if (Collections.frequency(roleId, "1")==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);
|
||||
}
|
||||
}
|
||||
}
|
||||
return holidayDao.getHolidayList(bean);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -247,16 +247,20 @@
|
|||
AND att_current_day = #{attCurrentDay}
|
||||
</if>
|
||||
<if test='attStatus == "1"'>
|
||||
and ( toWorkAttStatus = #{attStatus} and offWorkAttStatus = #{attStatus} )
|
||||
and ( toWorkAttStatus = #{attStatus} OR offWorkAttStatus = #{attStatus} )
|
||||
</if>
|
||||
</if>
|
||||
<if test="attendType == 2 || attendType == '2'">
|
||||
<if test="attCurrentDay != null and attCurrentDay != ''">
|
||||
AND su.user_id not in (
|
||||
SELECT su.user_id FROM sys_user su
|
||||
LEFT JOIN v_att_update_data a ON a.user_id = su.user_id
|
||||
LEFT JOIN att_group_person_relation agpr ON agpr.user_id = su.user_id
|
||||
LEFT JOIN sys_user_org org ON org.user_id = su.user_id
|
||||
left join sys_organization so on so.id = org.org_id
|
||||
WHERE su.is_active = 1 AND agpr.is_active = 1
|
||||
AND att_current_day = #{attCurrentDay}
|
||||
</if>
|
||||
<if test='attStatus == "1"'>
|
||||
and ( toWorkAttStatus != #{attStatus} and offWorkAttStatus != #{attStatus} )
|
||||
</if>
|
||||
and ( toWorkAttStatus = #{attStatus} OR offWorkAttStatus = #{attStatus} )
|
||||
)
|
||||
</if>
|
||||
<if test="attStatusToday != null and attStatusToday != ''">
|
||||
and ( toWorkAttStatus = #{attStatusToday} or offWorkAttStatus = #{attStatusToday} )
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
update sys_notice_user
|
||||
set is_read='1'
|
||||
where notice_id = #{noticeId}
|
||||
and user_id = #{userId}
|
||||
|
||||
and is_active = 1
|
||||
</update>
|
||||
|
||||
|
|
@ -55,6 +55,7 @@
|
|||
sys_notice_user snu
|
||||
LEFT JOIN sys_notice sn on sn.id=snu.notice_id and sn.is_active=1
|
||||
LEFT JOIN sys_user su on su.user_id=sn.user_id and su.is_active=1
|
||||
LEFT JOIN sys_user_org suo on suo.user_id=sn.user_id and suo.is_active=1
|
||||
LEFT JOIN sys_dict_data sdd on sdd.dict_code=sn.type and sdd.`status`=0
|
||||
WHERE snu.is_active=1
|
||||
<if test="bean.roleType =='3' || bean.roleType == 3 ">
|
||||
|
|
@ -64,13 +65,19 @@
|
|||
and snu.is_read=#{bean.isRead}
|
||||
</if>
|
||||
<if test="bean.roleType =='2' || bean.roleType == 2 ">
|
||||
<if test="bean.userIdList != null and bean.userIdList.length > 0">
|
||||
and sn.user_id in
|
||||
<foreach item="userId" collection="bean.userIdList" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
<if test="bean.OrgListId != null and bean.OrgListId.length > 0">
|
||||
and suo.org_id in (
|
||||
<foreach collection="bean.OrgListId" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</if>
|
||||
<if test="bean.userIdBr != null and bean.userIdBr != '' ">
|
||||
and sn.user_id != #{bean.userIdBr}
|
||||
</if>
|
||||
GROUP BY snu.notice_id ,
|
||||
sn.user_id
|
||||
order by sn.create_time desc
|
||||
</select>
|
||||
<select id="getDictData" resultType="java.lang.Long">
|
||||
|
|
|
|||
|
|
@ -321,4 +321,15 @@
|
|||
WHERE su.is_active = 1
|
||||
AND suo.org_id in (#{userIdList})
|
||||
</select>
|
||||
|
||||
<select id="getManagerList" resultType="com.bonus.system.api.domain.SysRole">
|
||||
SELECT *
|
||||
FROM sys_organization_head
|
||||
WHERE is_active = '1'
|
||||
AND org_id in (
|
||||
SELECT org_id FROM sys_organization_head
|
||||
WHERE is_active = '1'
|
||||
AND user_id = #{userId}
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
update leave_apply SET is_active = '0' WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getHolidayList" resultType="com.bonus.system.holiday.entity.HolidayBean">
|
||||
<select id="getHolidayList" resultType="com.bonus.system.holiday.entity.HolidayBean" parameterType="com.bonus.system.holiday.entity.HolidayBean">
|
||||
SELECT
|
||||
la.id,
|
||||
la.user_id,
|
||||
|
|
@ -79,9 +79,9 @@
|
|||
la.examine_status
|
||||
FROM
|
||||
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
|
||||
LEFT JOIN sys_user_org suo on suo.user_id=la.user_id and suo.is_active=1
|
||||
WHERE
|
||||
is_active = '1'
|
||||
la.is_active = '1'
|
||||
<if test="bean.leaveDate != null and bean.leaveDate != '' ">
|
||||
and locate(#{bean.leaveDate},la.create_time)
|
||||
</if>
|
||||
|
|
@ -103,9 +103,13 @@
|
|||
<if test="bean.userId != null and 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'>
|
||||
<if test="bean.userIds != null and bean.userIds != '' ">
|
||||
and la.user_id != #{bean.userIds}
|
||||
</if>
|
||||
|
||||
<if test="bean.roleType =='2' || bean.roleType == 2 ">
|
||||
and suo.org_id in (
|
||||
<foreach collection="bean.orgList" item="item" separator=",">
|
||||
<foreach collection="bean.OrgListId" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue