Merge remote-tracking branch 'origin/main'

# Conflicts:
#	bonus-modules/bonus-system/src/main/java/com/bonus/system/att/tasks/WechatTasks.java
#	bonus-modules/bonus-system/src/main/resources/mapper/evection/EvectionMapper.xml
This commit is contained in:
史宗金 2025-01-07 01:43:50 +08:00
commit 5739f5c9dd
29 changed files with 341 additions and 175 deletions

View File

@ -91,6 +91,11 @@ public class SysUser extends BaseEntity {
*/
private List<MapVo> orgList;
/**
* 自己项目部所在分公司下的所有项目部id
*/
private List<String> orgIdList;
/**
* 角色组
*/

View File

@ -11,10 +11,14 @@ import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.BusinessType;
import com.bonus.common.log.enums.OperaType;
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.SysUser;
import com.bonus.system.att.entity.*;
import com.bonus.system.att.service.AttDetailByMonthService;
import com.bonus.system.att.service.AttGroupService;
import com.bonus.system.att.service.AttendanceDetailsService;
import com.bonus.system.dept.dao.ProDeptRoleDao;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Sheet;
import org.springframework.web.bind.annotation.*;
@ -41,10 +45,32 @@ public class AttDetailByMonthController extends BaseController {
@Resource(name = "attDetailByMonthService")
private AttDetailByMonthService attDetailByMonthService;
@Resource(name = "ProDeptRoleDao")
private ProDeptRoleDao proDeptRoleDao;
@RequiresPermissions("att:detail:query")
@GetMapping("/list")
@Log(title = "考勤报表->月异常报表->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo list(AttDetailByMonthBean data) {
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
List<MapVo> orgList = sysUser.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);
// ids.add(String.valueOf(mapVo.getId()));
}
data.setOrgList(ids);
}
}
}
startPage();
List<AttDetailByMonthBean> list = attDetailByMonthService.selectAttDetailList(data);
return getDataTable(list);
@ -56,6 +82,25 @@ public class AttDetailByMonthController extends BaseController {
@RequiresPermissions("att:detail:query")
@GetMapping(value = "/getDetail")
public TableDataInfo getDetail(AttDetailBean data) {
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
List<MapVo> orgList = sysUser.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);
// ids.add(String.valueOf(mapVo.getId()));
}
data.setOrgList(ids);
}
}
}
startPage();
List<AttDetailBean> list = attDetailByMonthService.getDetailList(data);
return getDataTable(list);

View File

@ -7,6 +7,7 @@ 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.att.entity.AttDataDetailsBean;
@ -16,15 +17,14 @@ import com.bonus.system.att.service.AttendanceDetailsService;
import com.bonus.system.basic.dao.SysUserMapper;
import com.bonus.system.basic.domain.SysOrg;
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.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.*;
/**
* 考勤统计
@ -45,6 +45,9 @@ public class AttendanceDetailsController extends BaseController {
@Resource(name = "WorkReportDao")
private WorkReportDao dao;
@Resource(name = "ProDeptRoleDao")
private ProDeptRoleDao proDeptRoleDao;
@Resource
private SysUserMapper userMapper;
@ -105,39 +108,25 @@ public class AttendanceDetailsController extends BaseController {
@Log(title = "考勤报表->考勤明细->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo getDetailsList(AttDataDetailsBean bean) {
try{
// 部门负责人和部门考勤员可以在考勤明细页面看到本部门人员的考勤信息管理员和人资专员可以看所有数据普通人员看到自己数据
Long userId = SecurityUtils.getUserId();
List<SysRole> sysRoleList = dao.getRoleListByUserId(userId);
int roleCount = 0;
if(!sysRoleList.isEmpty()){
for (SysRole sysRole : sysRoleList) {
if(sysRole.getRoleId().equals(1L)){
roleCount = 1;
break;
}else if(sysRole.getRoleId().equals(16L)){
roleCount = 1;
break;
}else if(sysRole.getRoleId().equals(14L)){
roleCount = 2;
break;
}else if(sysRole.getRoleId().equals(13L)){
roleCount = 2;
break;
}else if(sysRole.getRoleId().equals(15L)){
roleCount = 3;
break;
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
List<MapVo> orgList = sysUser.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);
// ids.add(String.valueOf(mapVo.getId()));
}
bean.setOrgList(ids);
}
}
}
if(roleCount==2){
String ids = userMapper.getOrg(userId);
bean.setRoleType("2");
bean.setOrgListId(ids);
}else if(roleCount==3){
bean.setRoleType("3");
bean.setUserId(userId);
}
startPage();
return getDataTable(attendanceDetailsService.selectAttDetailsList(bean));
}catch (Exception e){
@ -273,6 +262,25 @@ public class AttendanceDetailsController extends BaseController {
@Log(title = "考勤报表->月报表->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo getAttMonthReportList(AttMonthReportBean bean) {
try{
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if (roleId != null && !roleId.isEmpty()) {
if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) {
List<MapVo> orgList = sysUser.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);
// ids.add(String.valueOf(mapVo.getId()));
}
bean.setOrgList(ids);
}
}
}
startPage();
return getDataTable(attendanceDetailsService.getAttMonthReportList(bean));
}catch (Exception e){

View File

@ -2,6 +2,7 @@ package com.bonus.system.att.dao;
import com.bonus.system.att.entity.*;
import com.bonus.system.basic.domain.SysOrg;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@ -32,7 +33,7 @@ public interface AttDetailByMonthDao {
* @param data 参数
* @return list bean
*/
List<AttDetailByMonthBean> selectAttAllList(AttDetailByMonthBean data);
List<AttDetailByMonthBean> selectAttAllList(@Param("bean") AttDetailByMonthBean data);
/**

View File

@ -3,6 +3,7 @@ package com.bonus.system.att.dao;
import com.bonus.system.att.entity.AttDataDetailsBean;
import com.bonus.system.att.entity.AttDayReportBean;
import com.bonus.system.att.entity.AttMonthReportBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@ -19,7 +20,7 @@ public interface AttendanceDetailsDao {
* @param bean 参数
* @return list bean
*/
List<AttDataDetailsBean> selectAttDetailsList(AttDataDetailsBean bean);
List<AttDataDetailsBean> selectAttDetailsList(@Param("bean")AttDataDetailsBean bean);
/**
* 导出考勤统计列表
* @param bean 参数
@ -74,7 +75,7 @@ public interface AttendanceDetailsDao {
* @param bean 参数
* @return list bean
*/
List<AttMonthReportBean> getAttMonthReportList(AttMonthReportBean bean);
List<AttMonthReportBean> getAttMonthReportList(@Param("bean") AttMonthReportBean bean);
/**
* 获取日报表-详细记录

View File

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -114,4 +115,7 @@ public class AttDetailBean {
{
this.params = params;
}
/** 部门列表 */
private List<String> orgList;
}

View File

@ -103,4 +103,7 @@ public class AttDetailByMonthBean {
*/
private int outCount;
/** 部门列表 */
private List<String> orgList;
}

View File

@ -3,6 +3,8 @@ package com.bonus.system.att.entity;
import com.bonus.common.core.annotation.Excel;
import lombok.Data;
import java.util.List;
/**
* 考勤月报表
* @author zys
@ -103,4 +105,8 @@ public class AttMonthReportBean {
*/
private Long outCount;
/**
* 自己项目部所在分公司下的所有项目部id
*/
private List<String> orgList;
}

View File

@ -659,19 +659,19 @@ public class AttTasks {
// System.out.println("c.getAttCurrentTime() = ");
// }
// 处理逻辑 出入异常的逻辑
try {
Map<Boolean, List<AttSourceDataBean>> result = checkAdjacentAttType1WithGapAndCheckTypesBefore(v, attGroupBean.getEntryAbnormalMinute());
if (result.containsKey(true)) {
List<AttSourceDataBean> matchingItems = result.get(true);
frontToWorkBean = matchingItems.get(0);
frontToWorkBean.setAbnormalAttTime(matchingItems.get(1).getAttCurrentTime());
frontToWorkBean.setAbnormalAttAddress(matchingItems.get(1).getAttAddress());
frontToWorkBean.setAttStatus(8);
}
}catch(Exception e){
e.printStackTrace();
log.error("出入异常处理报错");
}
// try {
// Map<Boolean, List<AttSourceDataBean>> result = checkAdjacentAttType1WithGapAndCheckTypesBefore(v, attGroupBean.getEntryAbnormalMinute());
// if (result.containsKey(true)) {
// List<AttSourceDataBean> matchingItems = result.get(true);
// frontToWorkBean = matchingItems.get(0);
// frontToWorkBean.setAbnormalAttTime(matchingItems.get(1).getAttCurrentTime());
// frontToWorkBean.setAbnormalAttAddress(matchingItems.get(1).getAttAddress());
// frontToWorkBean.setAttStatus(8);
// }
// }catch(Exception e){
// e.printStackTrace();
// log.error("出入异常处理报错");
// }
//没有下班卡则添加第一次打卡数据
newList.add(frontToWorkBean);
//获取工作异常

View File

@ -14,7 +14,7 @@ public class IpAndPathConfig {
*/
// @Value("${environment}")
// public static String environment;
public static String environment = "prod";
public static String environment = "test";
/**
* 小程序相关

View File

@ -15,6 +15,7 @@ import com.bonus.system.att.tasks.WechatTasks;
import com.bonus.system.basic.dao.SysUserMapper;
import com.bonus.system.basic.service.SysMenuService;
import com.bonus.system.basic.service.SysUserService;
import com.bonus.system.dept.dao.ProDeptRoleDao;
import com.bonus.system.dept.entity.ProDeptRoleDo;
import com.bonus.system.holiday.dao.WorkReportDao;
import org.apache.commons.lang3.StringUtils;
@ -35,9 +36,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.*;
/**
* 用户信息
@ -62,38 +61,34 @@ public class SysUserController extends BaseController {
@Resource
private SysUserMapper userMapper;
@Resource(name = "ProDeptRoleDao")
private ProDeptRoleDao proDeptRoleDao;
@RequiresPermissions("system:user:list")
@GetMapping("/list")
@Log(title = "系统管理->人员信息->查询人员列表", businessType = BusinessType.QUERY)
public TableDataInfo list(SysUser bean) {
try{
// List<SysUser> list = userService.selectUserList(bean);
// return endPage(list);
//根据登录账号获取角色
//不是管理员只能查自己
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;
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
List<MapVo> orgList = sysUser.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);
// ids.add(String.valueOf(mapVo.getId()));
}
bean.setOrgIdList(ids);
}
}
}
if(roleCount==2){
String ids = userMapper.getOrg(userId);
bean.setRoleType("2");
bean.setOrgListId(ids);
}
startPage();
List<SysUser> list = userService.selectUserList(bean);
return getDataTable(list);

View File

@ -48,7 +48,7 @@ public interface SysUserMapper
* @param bean
* @return List<SysUser>
*/
List<SysUser> selectUserList(SysUser bean);
List<SysUser> selectUserList(@Param("params") SysUser bean);
/**
* 查询角色列表

View File

@ -22,6 +22,7 @@ import com.bonus.system.basic.domain.SysTree;
import com.bonus.system.basic.domain.vo.TreeSelect;
import com.bonus.system.basic.service.SysNoticeService;
import com.bonus.system.basic.service.SysOrgService;
import com.bonus.system.dept.dao.ProDeptRoleDao;
import com.bonus.system.dept.service.SubOrgService;
import com.bonus.system.dept.service.SubOrgServiceImpl;
import com.bonus.system.holiday.entity.HolidayBean;
@ -61,6 +62,9 @@ public class SysOrgServiceImpl implements SysOrgService {
@Resource
private SysNoticeService noticeService;
@Resource(name = "ProDeptRoleDao")
private ProDeptRoleDao proDeptRoleDao;
@Override
public List<SysOrg> selectOrgList(SysOrg sysOrg) {
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
@ -72,7 +76,11 @@ public class SysOrgServiceImpl implements SysOrgService {
if (!orgList.isEmpty()) {
ArrayList<String> ids = new ArrayList<>();
for (MapVo mapVo : orgList) {
ids.add(String.valueOf(mapVo.getId()));
String id = proDeptRoleDao.getOrgChildById(mapVo.getId());
// 使用 Arrays.asList() 将数组转换为 ArrayList
ArrayList<String> idList = new ArrayList<>(Arrays.asList(id.split(",")));
ids.addAll(idList);
// ids.add(String.valueOf(mapVo.getId()));
}
sysOrg.setOrgList(ids);
}
@ -99,14 +107,14 @@ public class SysOrgServiceImpl implements SysOrgService {
@Override
public int insertOrg(SysOrg org) {
if (org.getLat() == null || org.getLon()== null){
// if (org.getLat() == null || org.getLon()== null){
Map<String, BigDecimal> map = AddressCoordinateFormatUtil.addressToCoordinate(org.getAddress());
if (map == null) {
return 3;
}
org.setLon(map.get("longitude"));
org.setLat(map.get("latitude"));
}
// }
int i = orgDao.insertOrg(org);
if (i > 0) {
msgPush(org);

View File

@ -42,7 +42,7 @@ public class EvectionController extends BaseController {
@Log(title = "流程管理->出差报备->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo list(EvectionBean bean) {
try{
startPage();
//不是管理员只能查自己
Long userId = SecurityUtils.getUserId();
List<SysRole> sysRoleList = dao.getRoleListByUserId(userId);
@ -60,6 +60,7 @@ public class EvectionController extends BaseController {
}else{
bean.setUserId(userId);
}
startPage();
return getDataTable(evectionService.getEvectionList(bean));
}catch (Exception e){
log.error(e.toString(),e);

View File

@ -43,7 +43,6 @@ public class LeaveReportingController extends BaseController {
@Log(title = "流程管理->休假报备->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo list(LeaveReportingBean bean) {
try{
startPage();
//不是管理员只能查自己
Long userId = SecurityUtils.getUserId();
List<SysRole> sysRoleList = dao.getRoleListByUserId(userId);
@ -61,6 +60,7 @@ public class LeaveReportingController extends BaseController {
}else{
bean.setUserId(userId);
}
startPage();
return getDataTable(leaveReportingService.getLeaveReportingList(bean));
}catch (Exception e){
log.error(e.toString(),e);

View File

@ -10,6 +10,9 @@ import com.bonus.common.log.enums.BusinessType;
import com.bonus.common.log.enums.OperaType;
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.SysUser;
import com.bonus.system.dept.dao.ProDeptRoleDao;
import com.bonus.system.holiday.entity.WorkReportBean;
import com.bonus.system.wechat.entity.WechatBean;
import com.bonus.system.wechat.service.WechatService;
@ -35,6 +38,9 @@ public class WechatController extends BaseController {
@Resource(name = "WechatService")
private WechatService wechatService;
@Resource(name = "ProDeptRoleDao")
private ProDeptRoleDao proDeptRoleDao;
/**
* 获取小程序打卡数据列表(表格)
*/
@ -43,6 +49,25 @@ public class WechatController extends BaseController {
@Log(title = "流程管理->小程序打卡数据->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo list(WechatBean bean) {
try{
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
List<MapVo> orgList = sysUser.getOrgList();
if (!orgList.isEmpty()) {
ArrayList<String> ids = new ArrayList<>();
for (MapVo mapVo : orgList) {
// ids.add(String.valueOf(mapVo.getId()));
String id = proDeptRoleDao.getOrgChildById(mapVo.getId());
// 使用 Arrays.asList() 将数组转换为 ArrayList
ArrayList<String> idList = new ArrayList<>(Arrays.asList(id.split(",")));
ids.addAll(idList);
}
bean.setOrgList(ids);
}
}
}
startPage();
return getDataTable(wechatService.getWechatList(bean));
}catch (Exception e){

View File

@ -6,6 +6,10 @@ 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.common.security.utils.SecurityUtils;
import com.bonus.system.api.domain.MapVo;
import com.bonus.system.api.domain.SysUser;
import com.bonus.system.dept.dao.ProDeptRoleDao;
import com.bonus.system.evection.service.EvectionService;
import com.bonus.system.wechat.entity.WechatEvectionBean;
import com.bonus.system.wechat.service.WechatEvectionService;
@ -15,6 +19,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* 数据管理->出差报备
@ -29,6 +36,9 @@ public class WechatEvectionController extends BaseController {
@Resource(name = "WechatEvectionService")
private WechatEvectionService wechatevectionService;
@Resource(name = "ProDeptRoleDao")
private ProDeptRoleDao proDeptRoleDao;
/**
* 获取数据管理出差报备列表(表格)
*/
@ -37,6 +47,25 @@ public class WechatEvectionController extends BaseController {
@Log(title = "流程管理->数据管理->出差报备->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo list(WechatEvectionBean bean) {
try{
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if (roleId != null && !roleId.isEmpty()) {
if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) {
List<MapVo> orgList = sysUser.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);
// ids.add(String.valueOf(mapVo.getId()));
}
bean.setOrgList(ids);
}
}
}
startPage();
return getDataTable(wechatevectionService.getEvectionList(bean));
}catch (Exception e){

View File

@ -6,6 +6,10 @@ 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.common.security.utils.SecurityUtils;
import com.bonus.system.api.domain.MapVo;
import com.bonus.system.api.domain.SysUser;
import com.bonus.system.dept.dao.ProDeptRoleDao;
import com.bonus.system.wechat.entity.WechatLeaveReportingBean;
import com.bonus.system.wechat.service.WechatLeaveReportingService;
import lombok.extern.slf4j.Slf4j;
@ -13,6 +17,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* 数据管理-休假报备
@ -27,6 +34,9 @@ public class WechatLeaveReportingController extends BaseController {
@Resource(name = "WechatLeaveReportingService")
private WechatLeaveReportingService wechatLeaveReportingService;
@Resource(name = "ProDeptRoleDao")
private ProDeptRoleDao proDeptRoleDao;
/**
* 获取休假报备列表(表格)
*/
@ -35,6 +45,25 @@ public class WechatLeaveReportingController extends BaseController {
@Log(title = "流程管理->数据管理->休假报备->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo list(WechatLeaveReportingBean bean) {
try{
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
List<MapVo> orgList = sysUser.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);
// ids.add(String.valueOf(mapVo.getId()));
}
bean.setOrgList(ids);
}
}
}
startPage();
return getDataTable(wechatLeaveReportingService.getLeaveReportingList(bean));
}catch (Exception e){

View File

@ -4,6 +4,7 @@ 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.dept.dao.ProDeptRoleDao;
import com.bonus.system.evection.dao.EvectionDao;
import com.bonus.system.evection.entity.EvectionBean;
import com.bonus.system.evection.service.EvectionService;
@ -29,21 +30,6 @@ public class WechatEvectionServiceImpl implements WechatEvectionService {
@Override
public List<WechatEvectionBean> getEvectionList(WechatEvectionBean bean) {
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
List<MapVo> orgList = sysUser.getOrgList();
if (!orgList.isEmpty()) {
ArrayList<String> ids = new ArrayList<>();
for (MapVo mapVo : orgList) {
ids.add(String.valueOf(mapVo.getId()));
}
bean.setOrgList(ids);
}
}
}
return wechatEvectionDao.getEvectionList(bean);
}

View File

@ -4,6 +4,7 @@ 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.dept.dao.ProDeptRoleDao;
import com.bonus.system.leaveReporting.dao.LeaveReportingDao;
import com.bonus.system.leaveReporting.entity.LeaveReportingBean;
import com.bonus.system.leaveReporting.service.LeaveReportingService;
@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@ -31,21 +33,6 @@ public class WechatLeaveReportingServiceImpl implements WechatLeaveReportingServ
@Override
public List<WechatLeaveReportingBean> getLeaveReportingList(WechatLeaveReportingBean bean) {
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
List<MapVo> orgList = sysUser.getOrgList();
if (!orgList.isEmpty()) {
ArrayList<String> ids = new ArrayList<>();
for (MapVo mapVo : orgList) {
ids.add(String.valueOf(mapVo.getId()));
}
bean.setOrgList(ids);
}
}
}
return wechatLeaveReportingDao.getLeaveReportingList(bean);
}

View File

@ -22,24 +22,8 @@ public class WechatServiceImpl implements WechatService {
@Resource(name = "WechatDao")
private WechatDao wechatDao;
@Override
public List<WechatBean> getWechatList(WechatBean bean) {
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
List<String> roleId = sysUser.getRoleList();
//管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
List<MapVo> orgList = sysUser.getOrgList();
if (!orgList.isEmpty()) {
ArrayList<String> ids = new ArrayList<>();
for (MapVo mapVo : orgList) {
ids.add(String.valueOf(mapVo.getId()));
}
bean.setOrgList(ids);
}
}
}
return wechatDao.getWechatList(bean);
}

View File

@ -62,17 +62,25 @@
from att_month_report amr
where amr.is_active = 1
and amr.required_days != amr.normal_num
<if test="attCurrentMonth != null and attCurrentMonth != '' ">
and amr.att_current_month = #{attCurrentMonth}
<if test="bean.attCurrentMonth != null and bean.attCurrentMonth != '' ">
and amr.att_current_month = #{bean.attCurrentMonth}
</if>
<if test="name != null and name != '' ">
and INSTR(amr.name,#{name}) > 0
<if test="bean.name != null and bean.name != '' ">
and INSTR(amr.name,#{bean.name}) > 0
</if>
<if test="orgId != null and orgId != ''">
AND amr.org_id = #{orgId}
<if test="bean.orgId != null and bean.orgId != ''">
AND amr.org_id = #{bean.orgId}
</if>
<if test="name != null and name != ''">
AND amr.name like concat('%', #{name}, '%')
<if test="bean.name != null and bean.name != ''">
AND amr.name like concat('%', #{bean.name}, '%')
</if>
<if test='bean.orgList != null and bean.orgList.size() > 0'>
and amr.org_id in (
<foreach collection="bean.orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
group by user_id
</select>
@ -183,6 +191,13 @@
<if test="orgId != null and orgId != '' ">
and vat.org_id = #{orgId}
</if>
<if test='orgList != null and orgList.size() > 0'>
and vat.org_id in (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="attCurrentMonth != null and attCurrentMonth != '' ">
and LEFT(vat.att_current_day, 7) = #{attCurrentMonth}
</if>

View File

@ -337,7 +337,7 @@
</select>
<select id="getLeaveData" resultType="com.bonus.system.att.entity.LeaveBean">
SELECT la.*,
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.type is not null, la.type, la.leave_type)

View File

@ -13,34 +13,37 @@
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}
where v.att_current_day BETWEEN #{bean.startDate} AND #{bean.endDate}
<if test="bean.orgId != null and bean.orgId != ''">
AND v.org_id = #{bean.orgId}
</if>
<if test="userName != null and userName != ''">
AND su.user_name like concat('%', #{userName}, '%')
<if test="bean.userName != null and bean.userName != ''">
AND su.user_name like concat('%', #{bean.userName}, '%')
</if>
<if test='attStatus != null and attStatus == "6"'>
<if test='bean.attStatus != null and bean.attStatus == "6"'>
and (v.toWorkAttStatus in (SELECT dict_value
FROM sys_dict_data
where dict_type = 'att_status' and is_leave = '1') or v.offWorkAttStatus in (SELECT dict_value
FROM sys_dict_data
where dict_type = 'att_status' and is_leave = '1'))
</if>
<if test='attStatus != null and attStatus != "6"'>
<if test='attStatus == "1"'>
and ( toWorkAttStatus = #{attStatus} and offWorkAttStatus = #{attStatus} )
<if test='bean.attStatus != null and bean.attStatus != "6"'>
<if test='bean.attStatus == "1"'>
and ( toWorkAttStatus = #{bean.attStatus} and offWorkAttStatus = #{bean.attStatus} )
</if>
<if test='attStatus != "1"'>
and ( toWorkAttStatus = #{attStatus} or offWorkAttStatus = #{attStatus} )
and ( toWorkAttStatus = #{bean.attStatus} or offWorkAttStatus = #{bean.attStatus} )
</if>
</if>
<if test="roleType =='2' || roleType == 2 ">
and v.org_id in (#{orgListId})
</if>
<if test="roleType =='3' || roleType == 3 ">
and su.user_id = #{userId}
<if test='bean.orgList != null and bean.orgList.size() > 0'>
and v.org_id in (
<foreach collection="bean.orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
GROUP BY
v.att_current_day,
v.user_id
@ -172,13 +175,21 @@
<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 from att_month_report v
left join att_group_person_relation p on p.user_id = v.user_id and p.is_active = 1
LEFT JOIN (SELECT user_id,count(user_id) as outCount FROM att_work_abnormal WHERE LOCATE(#{month},att_current_day) GROUP BY user_id) awa ON awa.user_id = v.user_id
where v.att_current_month = #{month} and p.group_id is not null
<if test="orgId != null and orgId != ''">
AND v.org_id = #{orgId}
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
where v.att_current_month = #{bean.month} and p.group_id is not null
<if test="bean.orgId != null and bean.orgId != ''">
AND v.org_id = #{bean.orgId}
</if>
<if test="userName != null and userName != ''">
AND v.name like concat('%', #{userName}, '%')
<if test="bean.userName != null and bean.userName != ''">
AND v.name like concat('%', #{bean.userName}, '%')
</if>
<if test='bean.orgList != null and bean.orgList.size() > 0'>
and v.org_id in (
<foreach collection="bean.orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
</select>

View File

@ -65,7 +65,7 @@
<insert id="pushAttDataToQsy">
<foreach collection="list" item="item" separator=";">
replace INTO gz_cloud.fc_sup_attendance (
replace INTO gz_cloud_test.fc_sup_attendance (
name,
id_number,
org_id,
@ -196,7 +196,7 @@
If(PROJECT_ID is null,0,PROJECT_ID) AS proId,
If(ORG_ID is null,0,ORG_ID) AS orgId
FROM
gz_cloud.bm_sup_attend_history
gz_cloud_test.bm_sup_attend_history
WHERE
ID_NUMBER = #{idNumber}
limit 1

View File

@ -161,25 +161,32 @@
LEFT JOIN att_group_person_relation agpr on agpr.user_id = su.user_id and agpr.is_active = 1
WHERE
su.is_active =1
<if test="userName != null and userName != ''">
AND su.user_name like concat('%', #{userName}, '%')
<if test="params.userName != null and params.userName != ''">
AND su.user_name like concat('%', #{params.userName}, '%')
</if>
<if test="orgId != null and orgId != ''">
AND suo.org_id = #{orgId}
<if test="params.orgId != null and params.orgId != ''">
AND suo.org_id = #{params.orgId}
</if>
<if test="phone != null and phone != ''">
AND su.phone = #{phone}
<if test="params.phone != null and params.phone != ''">
AND su.phone = #{params.phone}
</if>
<if test="userId != null">
AND su.user_id = #{userId}
<if test="params.userId != null">
AND su.user_id = #{params.userId}
</if>
<if test="roleType =='2' || roleType == 2 ">
and suo.org_id in (#{orgListId})
<if test='params.orgIdList != null and params.orgIdList.size() > 0'>
and suo.org_id in (
<foreach collection="params.orgIdList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="isAttend =='1' || isAttend == 1 ">
<!-- <if test="roleType =='2' || roleType == 2 ">-->
<!-- and suo.org_id in (#{orgListId})-->
<!-- </if>-->
<if test="params.isAttend =='1' || params.isAttend == 1 ">
and agpr.user_id is not null
</if>
<if test="isAttend =='0' || isAttend == 0 ">
<if test="params.isAttend =='0' || params.isAttend == 0 ">
and agpr.user_id is null
</if>

View File

@ -39,7 +39,7 @@
LEFT JOIN sys_user_post p ON p.user_id = l.user_id
LEFT JOIN sys_dict_data d on d.dict_code = p.post_id
WHERE
l.is_active = '1' AND l.leave_type = '出差报备' AND (l.source = '1' OR l.source = '3')
l.is_active = '1' AND l.leave_type = '出差' AND (l.source = '1' OR l.source = '3')
<if test="bean.params.beginTime != null and bean.params.beginTime != ''">
and date_format(l.leave_start_date,'%y%m%d') &gt;= date_format(#{bean.params.beginTime},'%y%m%d')
</if>
@ -53,6 +53,12 @@
</foreach>
)
</if>
<if test="bean.userName != null and bean.userName != ''">
AND l.user_name like concat('%', #{bean.userName}, '%')
</if>
<if test="bean.orgId != null and bean.orgId != ''">
AND l.org_id = #{bean.orgId}
</if>
GROUP BY
l.id,
l.user_id,
@ -111,7 +117,7 @@
LEFT JOIN sys_user_post p ON p.user_id = l.user_id
LEFT JOIN sys_dict_data d on d.dict_code = p.post_id
WHERE l.is_active = '1'
AND l.leave_type = '出差报备'
AND l.leave_type = '出差'
and l.leave_form_id = #{uuId}
GROUP BY l.id,
l.user_id,

View File

@ -38,13 +38,19 @@
<if test="params.params.endTime != null and params.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(l.leave_end_date,'%y%m%d') &lt;= date_format(#{params.params.endTime},'%y%m%d')
</if>
<if test='params.orgList != null and bean.orgList.size() > 0'>
<if test='params.orgList != null and params.orgList.size() > 0'>
and l.org_id in (
<foreach collection="params.orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="params.userName != null and params.userName != ''">
AND l.user_name like concat('%', #{params.userName}, '%')
</if>
<if test="params.orgId != null and params.orgId != ''">
AND l.org_id = #{params.orgId}
</if>
GROUP BY
l.id,
l.user_id,

View File

@ -44,6 +44,10 @@
)
</if>
<if test="bean.orgId != null and bean.orgId != ''">
AND ad.org_id = #{bean.orgId}
</if>
GROUP BY ad.user_id,
ad.org_id,
ad.att_current_day