generated from dxfeng/secondev-wugang-dxfeng
代码合并-Lee
This commit is contained in:
parent
5bed75960b
commit
57b20384a4
|
|
@ -54,12 +54,11 @@ public class SendMessageAction implements EsbServerlessRpcRemoteInterface {
|
|||
String templateId = (String) params.get("templateId");
|
||||
String templateVersionName = (String) params.get("templateVersionName");
|
||||
String content = (String) params.get("content");
|
||||
String type = (String) params.get("type");
|
||||
|
||||
log.error("params===" + JSON.toJSONString(params));
|
||||
|
||||
BaseParam baseParam = new BaseParam();
|
||||
MessageSendConfig messageSendConfig = sendMessageMapper.getMessageSendConfig(baseParam, departmentId,type);
|
||||
MessageSendConfig messageSendConfig = sendMessageMapper.getMessageSendConfig(baseParam, departmentId);
|
||||
|
||||
while (messageSendConfig == null && StringUtils.isNotBlank(departmentId)) {
|
||||
String parentDepartmentId = sendMessageMapper.getParentDepartmentId(baseParam, departmentId);
|
||||
|
|
@ -69,7 +68,7 @@ public class SendMessageAction implements EsbServerlessRpcRemoteInterface {
|
|||
break;
|
||||
}
|
||||
departmentId = parentDepartmentId;
|
||||
messageSendConfig = sendMessageMapper.getMessageSendConfig(baseParam, departmentId,type);
|
||||
messageSendConfig = sendMessageMapper.getMessageSendConfig(baseParam, departmentId);
|
||||
}
|
||||
|
||||
if (null == messageSendConfig) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public interface SendMessageMapper {
|
|||
|
||||
String getParentDepartmentId(@Param("param") BaseParam param, @Param("departmentId") String departmentId);
|
||||
|
||||
MessageSendConfig getMessageSendConfig(@Param("param") BaseParam param, @Param("departmentId") String departmentId,@Param("type") String type);
|
||||
MessageSendConfig getMessageSendConfig(@Param("param") BaseParam param, @Param("departmentId") String departmentId);
|
||||
|
||||
String getSuperior(@Param("param") BaseParam param, @Param("employeeId") String employeeId);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,17 @@ public class SscPortalController {
|
|||
|
||||
@Autowired
|
||||
SscPortalService sscPortalService;
|
||||
|
||||
@PostMapping("/getToDo")
|
||||
private WeaResult<Map<String, Object>> getToDo(@RequestBody Map<String, String> params) {
|
||||
return sscPortalService.getToDo(params);
|
||||
}
|
||||
@PostMapping("/getExpirationReminder")
|
||||
private WeaResult<ExpirationReminderPo> getExpirationReminder(@RequestBody Map<String, String> params) {
|
||||
return sscPortalService.getExpirationReminder(params);
|
||||
}
|
||||
|
||||
@PostMapping("/getEmployeeData")
|
||||
private WeaResult<Map<String, Object>> getEmployeeData(@RequestBody Map<String, String> params) {
|
||||
return sscPortalService.getEmployeeData(params);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,14 @@ public class BaseParam {
|
|||
private String e10_other_business = "e10_other_business";
|
||||
private String ec_secondev = "ec_secondev";
|
||||
private String eteams = "eteams";
|
||||
/**
|
||||
* hrbp矩阵id
|
||||
*/
|
||||
private String hrbp_matrix_id = "1174700317532454913";
|
||||
/**
|
||||
* hrbp矩阵hrbp字段id
|
||||
*/
|
||||
private String hrbp_matrix_value_config_id = "1174700536634507265";
|
||||
|
||||
/**
|
||||
* 部门自定义表
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.util.Set;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class BasicPersonnelParam extends BaseParam {
|
||||
private Set<Long> departmentIdList;
|
||||
private Set<String> departmentIdList;
|
||||
private String searchType;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
|
|
@ -31,8 +31,4 @@ public class BasicPersonnelParam extends BaseParam {
|
|||
private Integer current;
|
||||
private Integer offset;
|
||||
private Integer pageSize;
|
||||
|
||||
public Integer getOffset() {
|
||||
return (current - 1) * pageSize;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,9 +14,7 @@ import java.util.Set;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class HrbpParam extends BaseParam {
|
||||
private Set<Long> departmentIdList;
|
||||
private Long matrixId;
|
||||
private Long matrixValueConfigId;
|
||||
private Set<String> departmentIdList;
|
||||
private String userId;
|
||||
private Date paramDate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.util.Set;
|
|||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SearchConditionParam extends BaseParam{
|
||||
private String departmentId;
|
||||
private Set<Long> departmentIdList;
|
||||
private Set<String> departmentIdList;
|
||||
private String searchDate;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.weaver.seconddev.portal.mapper.portal;
|
|||
import com.weaver.seconddev.portal.entity.param.HrbpParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/07/10
|
||||
|
|
@ -152,4 +154,5 @@ public interface HrbpPortalMapper {
|
|||
*/
|
||||
int getTotalVacationByBp(HrbpParam param);
|
||||
|
||||
Set<String> getAllDeptIdsByHrbp(HrbpParam param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public interface LeaderCockpitMapper {
|
|||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
int getEmploymentCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
int getEmploymentCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<String> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
|
||||
/**
|
||||
* 查询入职人数列表
|
||||
|
|
@ -55,7 +55,7 @@ public interface LeaderCockpitMapper {
|
|||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
List<PortalPO> getEmploymentListByPosition(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
List<PortalPO> getEmploymentListByPosition(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<String> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
|
||||
/**
|
||||
* 查询关键入职人数
|
||||
|
|
@ -66,7 +66,7 @@ public interface LeaderCockpitMapper {
|
|||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
int getKeyEmploymentCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
int getKeyEmploymentCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<String> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -78,7 +78,7 @@ public interface LeaderCockpitMapper {
|
|||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
int getResignCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
int getResignCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<String> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
|
||||
/**
|
||||
* 查询关键离职人数
|
||||
|
|
@ -89,7 +89,7 @@ public interface LeaderCockpitMapper {
|
|||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
int getKeyResignCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
int getKeyResignCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<String> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
|
||||
/**
|
||||
* 查询离职人数列表
|
||||
|
|
@ -100,7 +100,7 @@ public interface LeaderCockpitMapper {
|
|||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
List<PortalPO> getResignListByPosition(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
List<PortalPO> getResignListByPosition(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<String> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
|
||||
|
||||
Position getPositionById(@Param("param") SearchConditionParam param, @Param("positionId") String positionId);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public interface ManagerPortalMapper {
|
|||
* @param endIndex
|
||||
* @return
|
||||
*/
|
||||
Integer getAgeCount(@Param("param") BasicPersonnelParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startIndex") Integer startIndex, @Param("endIndex") Integer endIndex);
|
||||
Integer getAgeCount(@Param("param") BasicPersonnelParam param, @Param("departmentIdList") Collection<String> departmentIdList, @Param("startIndex") Integer startIndex, @Param("endIndex") Integer endIndex);
|
||||
|
||||
/**
|
||||
* 获取司龄统计数据
|
||||
|
|
@ -122,7 +122,7 @@ public interface ManagerPortalMapper {
|
|||
* @param endIndex
|
||||
* @return
|
||||
*/
|
||||
Integer getComapnyCount(@Param("param") BasicPersonnelParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startIndex") Integer startIndex, @Param("endIndex") Integer endIndex);
|
||||
Integer getComapnyCount(@Param("param") BasicPersonnelParam param, @Param("departmentIdList") Collection<String> departmentIdList, @Param("startIndex") Integer startIndex, @Param("endIndex") Integer endIndex);
|
||||
|
||||
/**
|
||||
* 饼状图配置信息
|
||||
|
|
@ -181,11 +181,21 @@ public interface ManagerPortalMapper {
|
|||
|
||||
Integer getKqRequire(@Param("param") BasicPersonnelParam param, @Param("userId") String userId);
|
||||
|
||||
Integer getKqRequireByCondition(BasicPersonnelParam basicPersonnelParam);
|
||||
|
||||
Integer getTodayAllSign(@Param("param") BasicPersonnelParam param, @Param("userId") String userId);
|
||||
|
||||
Integer getAllSignByCondition(BasicPersonnelParam basicPersonnelParam);
|
||||
|
||||
Integer getTotalLate(@Param("param") BasicPersonnelParam param, @Param("userId") String userId);
|
||||
|
||||
Integer getLateByCondition(BasicPersonnelParam basicPersonnelParam);
|
||||
|
||||
Integer getTotalVacation(@Param("param") BasicPersonnelParam param, @Param("userId") String userId);
|
||||
|
||||
Integer getTodayNoSign(@Param("param") BasicPersonnelParam param, @Param("userId") String userId);
|
||||
|
||||
Integer getNoSignByCondition(BasicPersonnelParam basicPersonnelParam);
|
||||
|
||||
List<PortalPO> getGradeDistribution(BasicPersonnelParam basicPersonnelParam);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,4 +18,13 @@ public interface SscPortalService {
|
|||
* @return
|
||||
*/
|
||||
WeaResult<ExpirationReminderPo> getExpirationReminder(Map<String, String> params);
|
||||
|
||||
/**
|
||||
* 员工数据
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
WeaResult<Map<String, Object>> getEmployeeData(Map<String, String> params);
|
||||
|
||||
WeaResult<Map<String, Object>> getToDo(Map<String, String> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ public class EmployeePortalServiceImpl implements EmployeePortalService {
|
|||
employeeBasicInfoPo.setOvertimeUrl(urlMap.get("overtime"));
|
||||
employeeBasicInfoPo.setPublicLeaveUrl(urlMap.get("publicLeave"));
|
||||
employeeBasicInfoPo.setExceptionalAttendanceUrl(urlMap.get("exceptionalAttendance"));
|
||||
employeeBasicInfoPo.setReissueCardNumUrl(urlMap.get("reissueCardNum"));
|
||||
|
||||
|
||||
return WeaResult.success(employeeBasicInfoPo);
|
||||
|
|
@ -177,6 +178,9 @@ public class EmployeePortalServiceImpl implements EmployeePortalService {
|
|||
case "OVERTIME":
|
||||
employeeBasicInfoPo.setOvertime(value);
|
||||
break;
|
||||
case "REISSUECARDNUM":
|
||||
employeeBasicInfoPo.setReissueCardNum(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,11 @@ import com.weaver.seconddev.portal.mapper.portal.PortalMapper;
|
|||
import com.weaver.seconddev.portal.service.HrbpPortalService;
|
||||
import com.weaver.teams.security.context.UserContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -35,10 +32,6 @@ public class HrbpPortalServiceImpl implements HrbpPortalService {
|
|||
|
||||
@Autowired
|
||||
PortalMapper portalMapper;
|
||||
@Value("#{'${portal.dept.matrixId}'}")
|
||||
private String matrixId;
|
||||
@Value("#{'${portal.dept.matrixValueConfigId}'}")
|
||||
private String matrixValueConfigId;
|
||||
|
||||
@Override
|
||||
public WeaResult<Map<String, Object>> getToDo(Map<String, String> params) {
|
||||
|
|
@ -47,7 +40,10 @@ public class HrbpPortalServiceImpl implements HrbpPortalService {
|
|||
HrbpParam hrbpParam = new HrbpParam();
|
||||
hrbpParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
||||
// 权限条件
|
||||
|
||||
getAllDepartmentIdsByHrbp(hrbpParam, UserContext.getCurrentUser().getEmployeeId());
|
||||
if (CollectionUtils.isEmpty(hrbpParam.getDepartmentIdList())) {
|
||||
return WeaResult.success(map);
|
||||
}
|
||||
|
||||
int toEntryCount = hrbpPortalMapper.getToEntryCount(hrbpParam);
|
||||
int toRegularCount = hrbpPortalMapper.getToRegularCount(hrbpParam);
|
||||
|
|
@ -85,8 +81,10 @@ public class HrbpPortalServiceImpl implements HrbpPortalService {
|
|||
|
||||
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(hrbpParam.getTenantKey(), PORTAL_KEY, "getEmployeeData");
|
||||
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
||||
|
||||
|
||||
getAllDepartmentIdsByHrbp(hrbpParam, UserContext.getCurrentUser().getEmployeeId());
|
||||
if (CollectionUtils.isEmpty(hrbpParam.getDepartmentIdList())) {
|
||||
return WeaResult.success(map);
|
||||
}
|
||||
// 员工人数
|
||||
int allEmployeeCount = hrbpPortalMapper.getAllEmployeeCount(hrbpParam);
|
||||
map.put("allEmployee", allEmployeeCount);
|
||||
|
|
@ -119,6 +117,12 @@ public class HrbpPortalServiceImpl implements HrbpPortalService {
|
|||
return WeaResult.success(map);
|
||||
}
|
||||
|
||||
private void getAllDepartmentIdsByHrbp(HrbpParam hrbpParam, Long employeeId) {
|
||||
hrbpParam.setUserId(String.valueOf(employeeId));
|
||||
Set<String> allDeptIdsByHrbp = hrbpPortalMapper.getAllDeptIdsByHrbp(hrbpParam);
|
||||
hrbpParam.setDepartmentIdList(allDeptIdsByHrbp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WeaResult<Map<String, Object>> getTodayOverview(Map<String, String> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
|
@ -131,8 +135,6 @@ public class HrbpPortalServiceImpl implements HrbpPortalService {
|
|||
//部门矩阵中,hrbp负责的部门
|
||||
HrbpParam hrbpParam = new HrbpParam();
|
||||
hrbpParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
||||
hrbpParam.setMatrixId(Long.valueOf(matrixId));
|
||||
hrbpParam.setMatrixValueConfigId(Long.valueOf(matrixValueConfigId));
|
||||
hrbpParam.setUserId(String.valueOf(UserContext.getCurrentUser().getEmployeeId()));
|
||||
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(UserContext.getCurrentUser().getTenantKey(), PORTAL_KEY, "getTodayOverview");
|
||||
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
||||
|
|
|
|||
|
|
@ -6,12 +6,14 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.weaver.common.base.entity.result.WeaResult;
|
||||
import com.weaver.common.hrm.dao.HrmCommonEmployeeDao;
|
||||
import com.weaver.seconddev.portal.entity.bo.EmployeeStaffBo;
|
||||
import com.weaver.seconddev.portal.entity.param.BasicPersonnelParam;
|
||||
import com.weaver.seconddev.portal.entity.param.SearchConditionParam;
|
||||
import com.weaver.seconddev.portal.entity.po.PortalData;
|
||||
import com.weaver.seconddev.portal.entity.po.PortalPO;
|
||||
import com.weaver.seconddev.portal.entity.po.PortalUrlDetail;
|
||||
import com.weaver.seconddev.portal.entity.po.cfg.*;
|
||||
import com.weaver.seconddev.portal.mapper.portal.LeaderCockpitMapper;
|
||||
import com.weaver.seconddev.portal.mapper.portal.ManagerPortalMapper;
|
||||
import com.weaver.seconddev.portal.mapper.portal.PortalMapper;
|
||||
import com.weaver.seconddev.portal.service.LeaderCockpitService;
|
||||
import com.weaver.seconddev.portal.util.DateUtil;
|
||||
|
|
@ -25,7 +27,8 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -50,6 +53,8 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
|
||||
@Autowired
|
||||
PortalMapper portalMapper;
|
||||
@Autowired
|
||||
ManagerPortalMapper managerPortalMapper;
|
||||
|
||||
private static final String PORTAL_KEY = "leadershipCockpit";
|
||||
|
||||
|
|
@ -57,7 +62,7 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
public WeaResult<Map<String, Object>> getOnJobNumber(Map<String, String> params) {
|
||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||
initSearchConditionParam(searchConditionParam, params, null);
|
||||
log.error("searchConditionParam===" + JSON.toJSONString(searchConditionParam));
|
||||
log.error("getOnJobNumber==={}", JSON.toJSONString(searchConditionParam));
|
||||
List<PortalPO> onJobNumber = leaderCockpitMapper.getOnJobNumber(searchConditionParam);
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
returnMap.put("data", onJobNumber);
|
||||
|
|
@ -70,12 +75,13 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public WeaResult<Map<String, Object> > getLaborCost(Map<String, String> params) {
|
||||
public WeaResult<Map<String, Object>> getLaborCost(Map<String, String> params) {
|
||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||
initSearchConditionParam(searchConditionParam, params, null);
|
||||
log.error("searchConditionParam===" + JSON.toJSONString(searchConditionParam));
|
||||
|
||||
Map<String, Object> laborCost = leaderCockpitMapper.getLaborCost(searchConditionParam);
|
||||
if (laborCost == null) {
|
||||
laborCost = new HashMap<>();
|
||||
}
|
||||
User currentUser = UserContext.getCurrentUser();
|
||||
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(currentUser.getTenantKey(), PORTAL_KEY, "leaderCockpit");
|
||||
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
||||
|
|
@ -87,7 +93,6 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
public WeaResult<Map<String, Object>> getTurnoverRate(Map<String, String> params) {
|
||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||
initSearchConditionParam(searchConditionParam, params, null);
|
||||
log.error("searchConditionParam===" + JSON.toJSONString(searchConditionParam));
|
||||
// 查询范围内在职人员
|
||||
int onJobCount = leaderCockpitMapper.getOnJobCount(searchConditionParam);
|
||||
// 查询范围内离职人员
|
||||
|
|
@ -113,16 +118,91 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
@Override
|
||||
public WeaResult<Map<String, Object>> getAttendanceRate(Map<String, String> params) {
|
||||
Map<String, Object> returnMap = new HashMap<>(2);
|
||||
|
||||
User currentUser = UserContext.getCurrentUser();
|
||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||
//指定日期和部门
|
||||
String searchDeptIds = params.get("departmentId");
|
||||
getAllBelongDept(currentUser, basicPersonnelParam, searchDeptIds);
|
||||
initSearchConditionParam(basicPersonnelParam, params);
|
||||
ArrayList<Map<String, Object>> mapArrayList = new ArrayList<>();
|
||||
|
||||
//应出勤人数
|
||||
Integer totalRequire = managerPortalMapper.getKqRequireByCondition(basicPersonnelParam);
|
||||
returnMap.put("totalRequire", totalRequire);
|
||||
//实际出勤人数
|
||||
Integer todayAllSign = managerPortalMapper.getAllSignByCondition(basicPersonnelParam);
|
||||
// 计算考勤率并保留两位小数
|
||||
HashMap<String, Object> attendanceRateMap = new HashMap<>();
|
||||
attendanceRateMap.put("name", "出勤率");
|
||||
calculateRate(mapArrayList, totalRequire, todayAllSign, attendanceRateMap);
|
||||
|
||||
//迟到人数
|
||||
Integer totalLate = managerPortalMapper.getLateByCondition(basicPersonnelParam);
|
||||
//迟到比例
|
||||
HashMap<String, Object> LateRateMap = new HashMap<>();
|
||||
LateRateMap.put("name", "迟到占比");
|
||||
returnMap.put("totalLate", totalLate);
|
||||
|
||||
calculateRate(mapArrayList, totalRequire, totalLate, LateRateMap);
|
||||
|
||||
// //未打卡人数
|
||||
// Integer noSign = managerPortalMapper.getNoSignByCondition(basicPersonnelParam);
|
||||
// //未打卡比例
|
||||
// HashMap<String, Object> noSignRateMap = new HashMap<>();
|
||||
// noSignRateMap.put("name", "未打卡");
|
||||
// calculateRate(mapArrayList, totalRequire, noSign, noSignRateMap);
|
||||
|
||||
returnMap.put("data", mapArrayList);
|
||||
|
||||
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(currentUser.getTenantKey(), PORTAL_KEY, "leaderCockpit");
|
||||
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
||||
returnMap.put("attendanceRateUrl", urlMap.get("attendanceRate"));
|
||||
return WeaResult.success(returnMap);
|
||||
}
|
||||
|
||||
|
||||
private static void calculateRate(ArrayList<Map<String, Object>> mapArrayList, Integer total, Integer todayCondition, HashMap<String, Object> rateMap) {
|
||||
BigDecimal rate;
|
||||
if (total != null && total != 0) {
|
||||
// 使用BigDecimal进行精确计算
|
||||
BigDecimal sign = new BigDecimal(todayCondition != null ? todayCondition : 0);
|
||||
BigDecimal require = new BigDecimal(total);
|
||||
// 计算百分比并保留两位小数
|
||||
rate = sign.divide(require, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP);
|
||||
rateMap.put("value", rate + "%");
|
||||
} else {
|
||||
// 如果总数为0或null,设置为0
|
||||
rate = BigDecimal.ZERO;
|
||||
rateMap.put("value", rate + "%");
|
||||
}
|
||||
mapArrayList.add(rateMap);
|
||||
}
|
||||
|
||||
private void getAllBelongDept(User currentUser, BasicPersonnelParam basicPersonnelParam, String searchDeptIds) {
|
||||
// 获取部门下的所有子部门
|
||||
if (StringUtils.isNotBlank(searchDeptIds)) {
|
||||
Set<String> deptIdSet = new HashSet<>();
|
||||
Set<String> selectDepartmentId = new HashSet<>();
|
||||
String[] split = searchDeptIds.split(",");
|
||||
for (String s : split) {
|
||||
if (StringUtils.isBlank(s)) {
|
||||
continue;
|
||||
}
|
||||
long parseLong = Long.parseLong(s);
|
||||
selectDepartmentId.add(s);
|
||||
List<Long> beLongDeps = departMentService.getBeLongDeps(parseLong, currentUser.getTenantKey(), false);
|
||||
beLongDeps.add(parseLong);
|
||||
Set<String> collect = beLongDeps.stream().map(dept -> String.valueOf(dept)).collect(Collectors.toSet());
|
||||
deptIdSet.addAll(collect);
|
||||
}
|
||||
basicPersonnelParam.setDepartmentIdList(deptIdSet);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WeaResult<Map<String, Object>> getFullStaffingRate(Map<String, String> header, Map<String, String> params) {
|
||||
public WeaResult<Map<String, Object>> getFullStaffingRate(Map<String, String> header, Map<String, String> params) {
|
||||
HashMap<String, Object> returnMap = new HashMap<>();
|
||||
String origin = header.get("origin");
|
||||
// 人员编制
|
||||
|
|
@ -134,7 +214,6 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
String endDate = DateUtil.getLastDayOfMonth();
|
||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||
initSearchConditionParam(searchConditionParam, params, null);
|
||||
log.error("searchConditionParam===" + JSON.toJSONString(searchConditionParam));
|
||||
// postEmployeeStaff(employeeStaffUrl, header, searchConditionParam.getDepartmentIdList(), month);
|
||||
|
||||
User currentUser = UserContext.getCurrentUser();
|
||||
|
|
@ -145,7 +224,7 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
return WeaResult.success(returnMap);
|
||||
}
|
||||
|
||||
private void postEmployeeStaff(String employeeStaffUrl,Map<String, String> header, Set<Long> departmentIdList, String month) {
|
||||
private void postEmployeeStaff(String employeeStaffUrl, Map<String, String> header, Set<Long> departmentIdList, String month) {
|
||||
|
||||
FormDatas formDatas = new FormDatas();
|
||||
FormDatasDetail formDatasDetail = new FormDatasDetail();
|
||||
|
|
@ -167,8 +246,7 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
formDatasDetail.setOverCtrl(Collections.singletonList(overCtrlWrapper));
|
||||
|
||||
|
||||
String resultStr = HttpRequest.post(employeeStaffUrl).headerMap(header, true)
|
||||
.body(JSON.toJSONString(formDatas)).execute().body();
|
||||
String resultStr = HttpRequest.post(employeeStaffUrl).headerMap(header, true).body(JSON.toJSONString(formDatas)).execute().body();
|
||||
List<EmployeeStaff> employeeStaffs = EmployeeStaffBo.mapEmployeeStaffData(resultStr);
|
||||
|
||||
|
||||
|
|
@ -179,28 +257,14 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
public WeaResult<Map<String, Object>> getEmploymentStatus(Map<String, String> params) {
|
||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||
initSearchConditionParam(searchConditionParam, params, 0);
|
||||
|
||||
log.error("searchConditionParam===" + JSON.toJSONString(searchConditionParam));
|
||||
String searchDate = params.get("searchDate");
|
||||
if (StringUtils.isBlank(searchDate)) {
|
||||
searchDate = DateUtil.getCurrentDateStr();
|
||||
}
|
||||
LocalDate localDate = DateUtil.parseDate(searchDate);
|
||||
|
||||
String month = DateUtil.formatToYearMonth_ZH(localDate);
|
||||
Map<String, Integer> allDataMap = new LinkedHashMap<>(3);
|
||||
Map<String, Integer> keyDataMap = new LinkedHashMap<>(3);
|
||||
allDataMap.put(month, leaderCockpitMapper.getEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
|
||||
keyDataMap.put(month, leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
|
||||
|
||||
String firstDayOfMonthStr = DateUtil.getFirstDayOfPreviousMonthStr(searchConditionParam.getStartDate());
|
||||
String lastDayOfMonthStr = DateUtil.getLastDayOfPreviousMonthStr(searchConditionParam.getEndDate());
|
||||
// 前面5个月
|
||||
for (int i = 1; i < 7; i++) {
|
||||
allDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
|
||||
keyDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
|
||||
firstDayOfMonthStr = DateUtil.getFirstDayOfPreviousMonthStr(searchConditionParam.getStartDate(), i);
|
||||
lastDayOfMonthStr = DateUtil.getLastDayOfPreviousMonthStr(searchConditionParam.getEndDate(), i);
|
||||
Map<String, String> monthlyDateRanges = DateUtil.getMonthlyDateRanges(searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||
for (String month : monthlyDateRanges.keySet()) {
|
||||
String dateStr = monthlyDateRanges.get(month);
|
||||
String[] split = dateStr.split(",");
|
||||
allDataMap.put(month, leaderCockpitMapper.getEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), split[0], split[1]));
|
||||
keyDataMap.put(month, leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), split[0], split[1]));
|
||||
}
|
||||
|
||||
// 查询台账
|
||||
|
|
@ -223,10 +287,11 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
PortalData portalData = new PortalData();
|
||||
portalData.setDate(currentMonth);
|
||||
portalData.setDepart(departMentById.getDepartMentName());
|
||||
Set<String> belongDprStrs = beLongDeps.stream().map(deptId -> String.valueOf(deptId)).collect(Collectors.toSet());
|
||||
// 关键
|
||||
int keyEmploymentCount = leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam, beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||
int keyEmploymentCount = leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam, belongDprStrs, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||
// 非关键
|
||||
int employmentCount = leaderCockpitMapper.getEmploymentCount(searchConditionParam, beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||
int employmentCount = leaderCockpitMapper.getEmploymentCount(searchConditionParam, belongDprStrs, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||
portalData.setKey(keyEmploymentCount);
|
||||
portalData.setAll(employmentCount);
|
||||
portalList.add(portalData);
|
||||
|
|
@ -250,32 +315,16 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
public WeaResult<Map<String, Object>> getResignationSituation(Map<String, String> params) {
|
||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||
initSearchConditionParam(searchConditionParam, params, 0);
|
||||
log.error("searchConditionParam===" + JSON.toJSONString(searchConditionParam));
|
||||
|
||||
String searchDate = params.get("searchDate");
|
||||
if (StringUtils.isBlank(searchDate)) {
|
||||
searchDate = DateUtil.getCurrentDateStr();
|
||||
}
|
||||
LocalDate localDate = DateUtil.parseDate(searchDate);
|
||||
|
||||
String month = DateUtil.formatToYearMonth_ZH(localDate);
|
||||
Map<String, Integer> allDataMap = new LinkedHashMap<>(3);
|
||||
Map<String, Integer> keyDataMap = new LinkedHashMap<>(3);
|
||||
allDataMap.put(month, leaderCockpitMapper.getResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
|
||||
keyDataMap.put(month, leaderCockpitMapper.getKeyResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
|
||||
|
||||
String firstDayOfMonthStr = DateUtil.getFirstDayOfPreviousMonthStr(searchConditionParam.getStartDate());
|
||||
String lastDayOfMonthStr = DateUtil.getLastDayOfPreviousMonthStr(searchConditionParam.getEndDate());
|
||||
// 前五个月
|
||||
for (int i = 1; i < 7; i++) {
|
||||
allDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
|
||||
keyDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getKeyResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
|
||||
|
||||
firstDayOfMonthStr = DateUtil.getFirstDayOfPreviousMonthStr(searchConditionParam.getStartDate(), i);
|
||||
lastDayOfMonthStr = DateUtil.getLastDayOfPreviousMonthStr(searchConditionParam.getEndDate(), i);
|
||||
Map<String, String> monthlyDateRanges = DateUtil.getMonthlyDateRanges(searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||
for (String month : monthlyDateRanges.keySet()) {
|
||||
String dateStr = monthlyDateRanges.get(month);
|
||||
String[] split = dateStr.split(",");
|
||||
allDataMap.put(month, leaderCockpitMapper.getResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), split[0], split[1]));
|
||||
keyDataMap.put(month, leaderCockpitMapper.getKeyResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), split[0], split[1]));
|
||||
}
|
||||
|
||||
|
||||
String currentMonth = DateUtil.formatToYearMonth(searchConditionParam.getStartDate());
|
||||
Set<Long> selectDepartmentId = searchConditionParam.getSelectDepartmentId();
|
||||
log.error("selectDepartmentId===" + JSON.toJSONString(selectDepartmentId));
|
||||
|
|
@ -293,10 +342,11 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
PortalData portalData = new PortalData();
|
||||
portalData.setDate(currentMonth);
|
||||
portalData.setDepart(departMentById.getDepartMentName());
|
||||
Set<String> belongDprStrs = beLongDeps.stream().map(deptId -> String.valueOf(deptId)).collect(Collectors.toSet());
|
||||
// 关键
|
||||
int keyEmploymentCount = leaderCockpitMapper.getKeyResignCount(searchConditionParam, beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||
int keyEmploymentCount = leaderCockpitMapper.getKeyResignCount(searchConditionParam, belongDprStrs, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||
// 非关键
|
||||
int employmentCount = leaderCockpitMapper.getResignCount(searchConditionParam, beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||
int employmentCount = leaderCockpitMapper.getResignCount(searchConditionParam, belongDprStrs, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||
portalData.setKey(keyEmploymentCount);
|
||||
portalData.setAll(employmentCount);
|
||||
portalList.add(portalData);
|
||||
|
|
@ -318,6 +368,26 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
return WeaResult.success(returnMap);
|
||||
}
|
||||
|
||||
private void initSearchConditionParam(BasicPersonnelParam searchConditionParam, Map<String, String> params) {
|
||||
String startDate = params.get("startDate");
|
||||
String endDate = params.get("endDate");
|
||||
// 租户
|
||||
searchConditionParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
||||
|
||||
if (StringUtils.isNotEmpty(endDate)) {
|
||||
searchConditionParam.setEndDate(endDate);
|
||||
} else {
|
||||
searchConditionParam.setEndDate(DateUtil.getCurrentDateStr());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(startDate)) {
|
||||
searchConditionParam.setStartDate(startDate);
|
||||
} else {
|
||||
// LocalDate endDateLocal = LocalDate.parse(searchConditionParam.getEndDate());
|
||||
// searchConditionParam.setStartDate(DateUtil.getFirstDayOfYearStr(DateUtil.formatDate(endDateLocal)));
|
||||
searchConditionParam.setStartDate("1999-01-01");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建查询对象
|
||||
|
|
@ -329,15 +399,16 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
private void initSearchConditionParam(SearchConditionParam searchConditionParam, Map<String, String> params, Integer beforeMonth) {
|
||||
String searchDate = params.get("searchDate");
|
||||
String departmentId = params.get("departmentId");
|
||||
String startDate = params.get("startDate");
|
||||
String endDate = params.get("endDate");
|
||||
|
||||
// 租户
|
||||
searchConditionParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
||||
// 部门
|
||||
//searchConditionParam.setDepartmentId(departmentId);
|
||||
|
||||
// 获取部门下的所有子部门
|
||||
if (StringUtils.isNotBlank(departmentId)) {
|
||||
Set<Long> deptIdSet = new HashSet<>();
|
||||
Set<String> deptIdSet = new HashSet<>();
|
||||
deptIdSet.add(departmentId);
|
||||
Set<Long> selectDepartmentId = new HashSet<>();
|
||||
String[] split = departmentId.split(",");
|
||||
for (String s : split) {
|
||||
|
|
@ -345,46 +416,26 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
|||
continue;
|
||||
}
|
||||
long parseLong = Long.parseLong(s);
|
||||
log.error("parseLong===" + parseLong);
|
||||
selectDepartmentId.add(parseLong);
|
||||
List<Long> beLongDeps = departMentService.getBeLongDeps(parseLong, searchConditionParam.getTenantKey(), false);
|
||||
beLongDeps.add(parseLong);
|
||||
log.error("beLongDeps===" + JSON.toJSONString(beLongDeps));
|
||||
deptIdSet.addAll(beLongDeps);
|
||||
Set<String> collect = beLongDeps.stream().map(dept -> String.valueOf(dept)).collect(Collectors.toSet());
|
||||
deptIdSet.addAll(collect);
|
||||
}
|
||||
searchConditionParam.setDepartmentIdList(deptIdSet);
|
||||
searchConditionParam.setSelectDepartmentId(selectDepartmentId);
|
||||
}
|
||||
|
||||
// 处理截止日期
|
||||
String endDateStr;
|
||||
if (StringUtils.isBlank(searchDate)) {
|
||||
endDateStr = DateUtil.getCurrentDateStr();
|
||||
if (StringUtils.isNotEmpty(endDate)) {
|
||||
searchConditionParam.setEndDate(endDate);
|
||||
} else {
|
||||
try {
|
||||
// 验证日期格式是否合法
|
||||
endDateStr = searchDate;
|
||||
} catch (Exception e) {
|
||||
log.error("日期格式错误,使用当前日期: {}", searchDate, e);
|
||||
endDateStr = DateUtil.getCurrentDateStr();
|
||||
}
|
||||
searchConditionParam.setEndDate(DateUtil.getCurrentDateStr());
|
||||
}
|
||||
searchConditionParam.setEndDate(endDateStr);
|
||||
|
||||
// 处理开始日期
|
||||
if (beforeMonth == null) {
|
||||
// 查询当前年度数据
|
||||
searchConditionParam.setStartDate(DateUtil.getFirstDayOfYearStr(searchConditionParam.getEndDate()));
|
||||
if (StringUtils.isNotEmpty(startDate)) {
|
||||
searchConditionParam.setStartDate(startDate);
|
||||
} else {
|
||||
// 查询前N个月数据
|
||||
try {
|
||||
LocalDate endDate = LocalDate.parse(endDateStr);
|
||||
LocalDate startDate = endDate.minusMonths(beforeMonth);
|
||||
searchConditionParam.setStartDate(DateUtil.getFirstDayOfMonthStr(DateUtil.formatDate(startDate)));
|
||||
} catch (Exception e) {
|
||||
log.error("计算开始日期失败,使用所选日期年度第一天", e);
|
||||
searchConditionParam.setStartDate(searchConditionParam.getEndDate());
|
||||
}
|
||||
searchConditionParam.setStartDate("1999-01-01");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,15 +75,13 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
User currentUser = UserContext.getCurrentUser();
|
||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||
Set<Long> allDepartmentIds = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
List<HrmDepartmentComInfo> departmentList = hrmComInfoCacheHandler.getCacheList(HrmDepartmentComInfo.class, allDepartmentIds);
|
||||
List<Long> manageDeptIds = managerPortalMapper.getManageDeptIds(basicPersonnelParam, String.valueOf(currentUser.getEmployeeId()));
|
||||
List<HrmDepartmentComInfo> departmentList = hrmComInfoCacheHandler.getCacheList(HrmDepartmentComInfo.class, manageDeptIds);
|
||||
// 获取顶级部门
|
||||
List<HrmDepartmentComInfo> topDepartmentList = departmentList.stream()
|
||||
.filter(dept -> !allDepartmentIds.contains(dept.getParent()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<String> departmentNames = topDepartmentList.stream().map(HrmDepartmentComInfo::getName).collect(Collectors.toList());
|
||||
|
||||
// List<HrmDepartmentComInfo> topDepartmentList = departmentList.stream()
|
||||
// .filter(dept -> !allDepartmentIds.contains(dept.getParent()))
|
||||
// .collect(Collectors.toList());
|
||||
List<String> departmentNames = departmentList.stream().map(HrmDepartmentComInfo::getName).collect(Collectors.toList());
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
returnMap.put("deptNames", StringUtils.join(departmentNames, "、"));
|
||||
returnMap.put("userName", currentUser.getUsername());
|
||||
|
|
@ -114,23 +112,23 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
//今日实际打卡人数
|
||||
Integer todayAllSign = managerPortalMapper.getTodayAllSign(basicPersonnelParam, String.valueOf(currentUser.getEmployeeId()));
|
||||
resultMap.put("totalSign", todayAllSign);
|
||||
resultMap.put("totalSignUrl", urlMap.get("totalSign"));
|
||||
resultMap.put("totalSignUrl", urlMap.get("totalSign"));
|
||||
|
||||
//今日未打卡人数
|
||||
Integer todayNoSign = managerPortalMapper.getTodayNoSign(basicPersonnelParam, String.valueOf(currentUser.getEmployeeId()));
|
||||
resultMap.put("totalNoSign", todayNoSign);
|
||||
resultMap.put("totalNoSignUrl", urlMap.get("totalNoSign"));
|
||||
resultMap.put("totalNoSignUrl", urlMap.get("totalNoSign"));
|
||||
|
||||
//今日迟到人数
|
||||
basicPersonnelParam.setParamDate(todayDate);
|
||||
Integer totalLate = managerPortalMapper.getTotalLate(basicPersonnelParam, String.valueOf(currentUser.getEmployeeId()));
|
||||
resultMap.put("totalLate", totalLate);
|
||||
resultMap.put("totalLateUrl", urlMap.get("totalLate"));
|
||||
resultMap.put("totalLateUrl", urlMap.get("totalLate"));
|
||||
|
||||
//今日休假人数
|
||||
int totalVacation = managerPortalMapper.getTotalVacation(basicPersonnelParam, String.valueOf(currentUser.getEmployeeId()));
|
||||
resultMap.put("totalVacation", totalVacation);
|
||||
resultMap.put("totalVacationUrl", urlMap.get("totalVacation"));
|
||||
resultMap.put("totalVacationUrl", urlMap.get("totalVacation"));
|
||||
|
||||
return WeaResult.success(resultMap);
|
||||
}
|
||||
|
|
@ -144,7 +142,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
User currentUser = UserContext.getCurrentUser();
|
||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
|
||||
// 设置部门范围ID集合
|
||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||
|
|
@ -202,7 +200,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
User currentUser = UserContext.getCurrentUser();
|
||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
StringJoiner andCondition = new StringJoiner(" and ");
|
||||
switch (dataKey) {
|
||||
case "onJobNumber":
|
||||
|
|
@ -266,7 +264,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
User currentUser = UserContext.getCurrentUser();
|
||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
|
||||
// 设置部门范围ID集合
|
||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||
|
|
@ -302,7 +300,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
User currentUser = UserContext.getCurrentUser();
|
||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
StringJoiner andCondition = new StringJoiner(" and ");
|
||||
switch (dataKey) {
|
||||
case "birthdayNum":
|
||||
|
|
@ -324,7 +322,10 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
case "employmentAnniversary":
|
||||
// 入职周年提醒
|
||||
if (CollectionUtils.isNotEmpty(allDepartmentIdList)) {
|
||||
andCondition.add(" t1.department in (" + StringUtils.join(allDepartmentIdList, ",") + ") ");
|
||||
StringBuilder deptIdStr = new StringBuilder();
|
||||
allDepartmentIdList.stream().forEach(departmentId -> deptIdStr.append("'").append(departmentId).append("',"));
|
||||
deptIdStr.deleteCharAt(deptIdStr.lastIndexOf(","));
|
||||
andCondition.add(" t1.department in (" + deptIdStr + ") ");
|
||||
}
|
||||
andCondition.add(" ( ( DATE_FORMAT(t1.hiredate, '%m-%d') between DATE_FORMAT(CURDATE(), '%m-%d') and DATE_FORMAT(DATE_ADD(CURDATE(), interval 7 day), '%m-%d') ) or ( DATE_FORMAT(CURDATE(), '%m-%d') > DATE_FORMAT(DATE_ADD(CURDATE(), interval 7 day), '%m-%d') and ( DATE_FORMAT(t1.hiredate, '%m-%d') >= DATE_FORMAT(CURDATE(), '%m-%d') or DATE_FORMAT(t1.hiredate, '%m-%d') <= DATE_FORMAT(DATE_ADD(CURDATE(), interval 7 day), '%m-%d') ) ) ) ");
|
||||
break;
|
||||
|
|
@ -349,7 +350,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
User currentUser = UserContext.getCurrentUser();
|
||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
// 设置部门范围ID集合
|
||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||
basicPersonnelParam.setPieType(type);
|
||||
|
|
@ -372,6 +373,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
break;
|
||||
case "grade":
|
||||
// 职级
|
||||
dealGradeInfo(basicPersonnelParam, returnList);
|
||||
returnMap.put("url", urlMap.get("grade"));
|
||||
break;
|
||||
case "company":
|
||||
|
|
@ -391,6 +393,11 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
return WeaResult.success(returnMap);
|
||||
}
|
||||
|
||||
private void dealGradeInfo(BasicPersonnelParam basicPersonnelParam, List<PortalPO> returnList) {
|
||||
List<PortalPO> gradeDistribution = managerPortalMapper.getGradeDistribution(basicPersonnelParam);
|
||||
returnList.addAll(gradeDistribution);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WeaResult<Map<String, Object>> getAttendanceInfo(Map<String, String> params) {
|
||||
String type = params.get("type");
|
||||
|
|
@ -404,7 +411,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
basicPersonnelParam.setStartDate(DateUtil.getFirstDayOfMonth());
|
||||
basicPersonnelParam.setEndDate(DateUtil.getLastDayOfMonth());
|
||||
|
||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
// 设置部门范围ID集合
|
||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||
|
||||
|
|
@ -450,26 +457,23 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||
basicPersonnelParam.setCurrent(current);
|
||||
basicPersonnelParam.setPageSize(pageSize);
|
||||
basicPersonnelParam.setOffset((current - 1) * pageSize);
|
||||
basicPersonnelParam.setSearchKey(searchKey);
|
||||
//log.error("departmentId==={}", departmentId);
|
||||
basicPersonnelParam.setDepartmentId(departmentId);
|
||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
//log.error("allDepartmentIdList111==={}", JSON.toJSONString(allDepartmentIdList));
|
||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||
if (StringUtils.isNotBlank(departmentId)) {
|
||||
List<WeaDepartMent> beLongDeps = departMentService.getBeLongDeps(Long.parseLong(departmentId));
|
||||
Set<Long> collect = beLongDeps.stream().map(WeaDepartMent::getDepartMentId).collect(Collectors.toSet());
|
||||
collect.add(Long.parseLong(departmentId));
|
||||
Set<String> collect = beLongDeps.stream().map(weaDepartMent -> String.valueOf(weaDepartMent.getDepartMentId())).collect(Collectors.toSet());
|
||||
collect.add(departmentId);
|
||||
// 两个set取交集
|
||||
allDepartmentIdList.retainAll(collect);
|
||||
//log.error("collect==={}", JSON.toJSONString(collect));
|
||||
|
||||
if (CollectionUtils.isEmpty(allDepartmentIdList)) {
|
||||
allDepartmentIdList.add(-1L);
|
||||
allDepartmentIdList.add("-1");
|
||||
}
|
||||
}
|
||||
//log.error("allDepartmentIdList222==={}", JSON.toJSONString(allDepartmentIdList));
|
||||
|
||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||
log.error("basicPersonnelParam==={}", JSON.toJSONString(basicPersonnelParam));
|
||||
|
||||
List<TeamEmployeePo> teamEmployee = managerPortalMapper.getTeamEmployee(basicPersonnelParam);
|
||||
int total = managerPortalMapper.getTeamEmployeeTotal(basicPersonnelParam);
|
||||
|
|
@ -683,7 +687,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
private Set<Long> getAllDepartmentIdList(BasicPersonnelParam basicPersonnelParam, Long employeeId) {
|
||||
private Set<String> getAllDepartmentIdList(BasicPersonnelParam basicPersonnelParam, Long employeeId) {
|
||||
// 查询所负责的部门
|
||||
List<Long> manageDeptIds = managerPortalMapper.getManageDeptIds(basicPersonnelParam, String.valueOf(employeeId));
|
||||
// 查询所有的部门、子部门信息
|
||||
|
|
@ -695,11 +699,11 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
allDepartmentList.addAll(beLongDeps);
|
||||
}
|
||||
// TODO 判断集合如果为空,不展示数据
|
||||
if(CollectionUtils.isEmpty(allDepartmentList)){
|
||||
Set<Long> set = new HashSet<>();
|
||||
set.add(-1L);
|
||||
if (CollectionUtils.isEmpty(allDepartmentList)) {
|
||||
Set<String> set = new HashSet<>();
|
||||
set.add("-1");
|
||||
return set;
|
||||
}
|
||||
return allDepartmentList.stream().map(WeaDepartMent::getDepartMentId).collect(Collectors.toSet());
|
||||
return allDepartmentList.stream().map(weaDepartMent -> String.valueOf(weaDepartMent.getDepartMentId())).collect(Collectors.toSet());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,23 @@
|
|||
package com.weaver.seconddev.portal.service.impl;
|
||||
|
||||
import com.weaver.common.base.entity.result.WeaResult;
|
||||
import com.weaver.seconddev.portal.entity.param.HrbpParam;
|
||||
import com.weaver.seconddev.portal.entity.param.SscParam;
|
||||
import com.weaver.seconddev.portal.entity.po.ExpirationReminderPo;
|
||||
import com.weaver.seconddev.portal.entity.po.PortalUrlDetail;
|
||||
import com.weaver.seconddev.portal.mapper.portal.HrbpPortalMapper;
|
||||
import com.weaver.seconddev.portal.mapper.portal.ManagerPortalMapper;
|
||||
import com.weaver.seconddev.portal.mapper.portal.PortalMapper;
|
||||
import com.weaver.seconddev.portal.mapper.portal.SscPortalMapper;
|
||||
import com.weaver.seconddev.portal.service.SscPortalService;
|
||||
import com.weaver.teams.security.context.UserContext;
|
||||
import com.weaver.teams.security.user.User;
|
||||
import com.weaver.workflow.common.cfg.org.service.DepartMentService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -32,12 +37,21 @@ public class SscPortalServiceImpl implements SscPortalService {
|
|||
|
||||
@Autowired
|
||||
PortalMapper portalMapper;
|
||||
@Autowired
|
||||
HrbpPortalMapper hrbpPortalMapper;
|
||||
@Autowired
|
||||
DepartMentService departMentService;
|
||||
|
||||
@Autowired
|
||||
ManagerPortalMapper managerPortalMapper;
|
||||
|
||||
@Override
|
||||
public WeaResult<ExpirationReminderPo> getExpirationReminder(Map<String, String> params) {
|
||||
User currentUser = UserContext.getCurrentUser();
|
||||
SscParam sscParam = new SscParam();
|
||||
sscParam.setTenantKey(currentUser.getTenantKey());
|
||||
// Set<String> allDepartmentIdList = getAllDepartmentIdList(sscParam, currentUser.getEmployeeId());
|
||||
// sscParam.setDepartmentIdList();
|
||||
|
||||
ExpirationReminderPo expirationReminderPo = new ExpirationReminderPo();
|
||||
|
||||
|
|
@ -62,4 +76,79 @@ public class SscPortalServiceImpl implements SscPortalService {
|
|||
|
||||
return WeaResult.success(expirationReminderPo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WeaResult<Map<String, Object>> getEmployeeData(Map<String, String> params) {
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
HrbpParam hrbpParam = new HrbpParam();
|
||||
hrbpParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
||||
|
||||
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(hrbpParam.getTenantKey(), PORTAL_KEY, "getEmployeeData");
|
||||
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
||||
|
||||
// 员工人数
|
||||
int allEmployeeCount = hrbpPortalMapper.getAllEmployeeCount(hrbpParam);
|
||||
map.put("allEmployee", allEmployeeCount);
|
||||
map.put("allEmployeeUrl", urlMap.get("allEmployee"));
|
||||
// 正式员工
|
||||
int formalEmployeeCount = hrbpPortalMapper.getFormalEmployeeCount(hrbpParam);
|
||||
map.put("formalEmployee", formalEmployeeCount);
|
||||
map.put("formalEmployeeUrl", urlMap.get("formalEmployee"));
|
||||
// 实习生
|
||||
map.put("internEmployee", hrbpPortalMapper.getInternEmployeeCount(hrbpParam));
|
||||
map.put("internEmployeeUrl", urlMap.get("internEmployee"));
|
||||
// 外包
|
||||
map.put("outsourcing", hrbpPortalMapper.getOutsourcingCount(hrbpParam));
|
||||
map.put("outsourcingUrl", urlMap.get("outsourcing"));
|
||||
// 劳务
|
||||
map.put("labor", hrbpPortalMapper.getLaborCount(hrbpParam));
|
||||
map.put("laborUrl", urlMap.get("labor"));
|
||||
// 试用
|
||||
map.put("probation", hrbpPortalMapper.getProbationCount(hrbpParam));
|
||||
map.put("probationUrl", urlMap.get("probation"));
|
||||
// 正式
|
||||
map.put("formal", hrbpPortalMapper.getFormalCount(hrbpParam));
|
||||
map.put("formalUrl", urlMap.get("formal"));
|
||||
// 实习
|
||||
map.put("intern", hrbpPortalMapper.getInternCount(hrbpParam));
|
||||
map.put("internUrl", urlMap.get("intern"));
|
||||
// 离职
|
||||
map.put("leave", hrbpPortalMapper.getLeaveCount(hrbpParam));
|
||||
map.put("leaveUrl", urlMap.get("leave"));
|
||||
return WeaResult.success(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WeaResult<Map<String, Object>> getToDo(Map<String, String> params) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
HrbpParam hrbpParam = new HrbpParam();
|
||||
hrbpParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
||||
|
||||
int toEntryCount = hrbpPortalMapper.getToEntryCount(hrbpParam);
|
||||
int toRegularCount = hrbpPortalMapper.getToRegularCount(hrbpParam);
|
||||
int toLeaveCount = hrbpPortalMapper.getToLeaveCount(hrbpParam);
|
||||
int toSignCount = hrbpPortalMapper.getToSignCount(hrbpParam);
|
||||
int toProxyCount = hrbpPortalMapper.getToProxyCount(hrbpParam);
|
||||
|
||||
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(hrbpParam.getTenantKey(), PORTAL_KEY, "getToDo");
|
||||
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
||||
|
||||
// 待入职
|
||||
map.put("entry", toEntryCount);
|
||||
map.put("entryUrl", urlMap.get("entry"));
|
||||
// 待转正
|
||||
map.put("regular", toRegularCount);
|
||||
map.put("regularUrl", urlMap.get("regular"));
|
||||
// 待离职
|
||||
map.put("leave", toLeaveCount);
|
||||
map.put("leaveUrl", urlMap.get("leave"));
|
||||
// 待签订
|
||||
map.put("sign", toSignCount);
|
||||
map.put("signUrl", urlMap.get("sign"));
|
||||
// 代理期转正
|
||||
map.put("proxy", toProxyCount);
|
||||
map.put("proxyUrl", urlMap.get("proxy"));
|
||||
return WeaResult.success(map);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import java.time.format.DateTimeFormatter;
|
|||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
|
|
@ -289,6 +291,43 @@ public class DateUtil {
|
|||
return formatDate(lastDayOfPrevMonth);
|
||||
}
|
||||
|
||||
public static Map<String, String> getMonthlyDateRanges(String startDateStr, String endDateStr) {
|
||||
// 将字符串解析为日期对象
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
DateTimeFormatter monthFormatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||
|
||||
LocalDate startDate = LocalDate.parse(startDateStr, formatter);
|
||||
LocalDate endDate = LocalDate.parse(endDateStr, formatter);
|
||||
Map<String, String> rangesMap = new LinkedHashMap<>(); // 使用LinkedHashMap保持插入顺序
|
||||
|
||||
// 从开始日期所在月份的第一天开始
|
||||
LocalDate current = startDate.withDayOfMonth(1);
|
||||
|
||||
while (!current.isAfter(endDate)) {
|
||||
// 当前月的第一天
|
||||
LocalDate monthStart = current;
|
||||
// 当前月的最后一天
|
||||
LocalDate monthEnd = current.with(TemporalAdjusters.lastDayOfMonth());
|
||||
|
||||
// 确定该月实际的开始日期
|
||||
LocalDate rangeStart = monthStart.isBefore(startDate) ? startDate : monthStart;
|
||||
// 确定该月实际的结束日期
|
||||
LocalDate rangeEnd = monthEnd.isAfter(endDate) ? endDate : monthEnd;
|
||||
|
||||
// 只有当开始日期不大于结束日期时才添加(避免无效范围)
|
||||
if (!rangeStart.isAfter(rangeEnd)) {
|
||||
String monthKey = rangeStart.format(monthFormatter);
|
||||
String dateRange = rangeStart.format(formatter) + "," + rangeEnd.format(formatter);
|
||||
rangesMap.put(monthKey, dateRange);
|
||||
}
|
||||
|
||||
// 移动到下个月的第一天
|
||||
current = monthEnd.plusDays(1);
|
||||
}
|
||||
|
||||
return rangesMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 LocalDate 格式化为 yyyy-MM 字符串
|
||||
*
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
<select id="getMessageSendConfig" resultType="com.weaver.seconddev.entry.entity.MessageSendConfig">
|
||||
select bm,ry,xxlx,ms,zjsj,jgsjzjssj,xxsj,bmfzr,tbmyg,hrbp,fgld
|
||||
from ${param.eteams}.uf_xxgzb t1 where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
||||
and xxlx = #{type}
|
||||
and FIND_IN_SET(#{departmentId}, bm) > 0
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
select count(t.id) from ${e10_common}.uf_dlqgl t
|
||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND t.ssbm IN
|
||||
AND t.dlqbm IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
|
|
@ -179,11 +179,12 @@
|
|||
SELECT COUNT(*)
|
||||
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||
JOIN ${eteams}.employee b ON a.employee = b.id
|
||||
JOIN (SELECT id
|
||||
FROM ${eteams}.department
|
||||
WHERE formdata IN (SELECT CAST(id AS CHAR)
|
||||
FROM ${eteams}.${table_dept_cus}
|
||||
WHERE hrbp = #{userId})) alias ON alias.id = b.department
|
||||
JOIN (SELECT DISTINCT matrix_data_id as id
|
||||
FROM ${eteams}.hrm_matrix_value_data a
|
||||
WHERE a.matrix_id = #{hrbp_matrix_id}
|
||||
AND a.matrix_value_config_id = #{hrbp_matrix_value_config_id}
|
||||
AND a.delete_type = 0
|
||||
AND a.relate_id = #{userId}) alias ON alias.id = b.department
|
||||
WHERE a.attend_date = CURDATE()
|
||||
AND a.DAY_TYPE = 'WORK'
|
||||
AND a.delete_type = 0
|
||||
|
|
@ -193,11 +194,13 @@
|
|||
SELECT COUNT(*)
|
||||
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||
INNER JOIN ${eteams}.employee b ON a.employee = b.id
|
||||
INNER JOIN (SELECT id
|
||||
FROM ${eteams}.department
|
||||
WHERE formdata IN (SELECT CAST(id AS CHAR)
|
||||
FROM ${eteams}.${table_dept_cus}
|
||||
WHERE hrbp = #{userId})) alias ON alias.id = b.department
|
||||
INNER JOIN (SELECT DISTINCT matrix_data_id as id
|
||||
FROM ${eteams}.hrm_matrix_value_data a
|
||||
WHERE a.matrix_id = #{hrbp_matrix_id}
|
||||
AND a.matrix_value_config_id = #{hrbp_matrix_value_config_id}
|
||||
AND a.delete_type = 0
|
||||
AND a.relate_id = #{userId}) alias
|
||||
ON alias.id = b.department
|
||||
LEFT JOIN ${eteams}.${table_emp_cus} c ON c.form_data_id = b.formdata
|
||||
LEFT JOIN ${e10_other_business}.timecard d ON d.id = a.SIGN_IN_RECORD
|
||||
LEFT JOIN ${e10_other_business}.timecard e ON e.id = a.SIGN_OUT_RECORD
|
||||
|
|
@ -211,11 +214,13 @@
|
|||
SELECT COUNT(0)
|
||||
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||
INNER JOIN ${eteams}.employee b ON a.employee = b.id
|
||||
INNER JOIN (SELECT id
|
||||
FROM ${eteams}.department
|
||||
WHERE formdata IN (SELECT CAST(id AS CHAR)
|
||||
FROM ${eteams}.${table_dept_cus}
|
||||
WHERE hrbp = #{userId})) alias ON alias.id = b.department
|
||||
INNER JOIN (SELECT DISTINCT matrix_data_id as id
|
||||
FROM ${eteams}.hrm_matrix_value_data a
|
||||
WHERE a.matrix_id = #{hrbp_matrix_id}
|
||||
AND a.matrix_value_config_id = #{hrbp_matrix_value_config_id}
|
||||
AND a.delete_type = 0
|
||||
AND a.relate_id = #{userId}) alias
|
||||
ON alias.id = b.department
|
||||
LEFT JOIN ${eteams}.${table_emp_cus} c ON c.form_data_id = b.formdata
|
||||
LEFT JOIN ${e10_other_business}.timecard d ON d.id = a.SIGN_IN_RECORD
|
||||
LEFT JOIN ${e10_other_business}.timecard e ON e.id = a.SIGN_OUT_RECORD
|
||||
|
|
@ -228,14 +233,16 @@
|
|||
AND a.delete_type = 0
|
||||
</select>
|
||||
<select id="getTodayNoSign" resultType="java.lang.Integer">
|
||||
SELECT COUNT( DISTINCT a.EMPLOYEE)
|
||||
SELECT COUNT(DISTINCT a.EMPLOYEE)
|
||||
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||
INNER JOIN ${eteams}.employee b ON a.employee = b.id
|
||||
INNER JOIN (SELECT id
|
||||
FROM ${eteams}.department
|
||||
WHERE formdata IN (SELECT CAST(id AS CHAR)
|
||||
FROM ${eteams}.${table_dept_cus}
|
||||
WHERE hrbp = #{userId})) alias ON alias.id = b.department
|
||||
INNER JOIN (SELECT DISTINCT matrix_data_id as id
|
||||
FROM ${eteams}.hrm_matrix_value_data a
|
||||
WHERE a.matrix_id = #{hrbp_matrix_id}
|
||||
AND a.matrix_value_config_id = #{hrbp_matrix_value_config_id}
|
||||
AND a.delete_type = 0
|
||||
AND a.relate_id = #{userId}) alias
|
||||
ON alias.id = b.department
|
||||
LEFT JOIN ${eteams}.${table_emp_cus} c ON c.form_data_id = b.formdata
|
||||
LEFT JOIN ${e10_other_business}.timecard d ON d.id = a.SIGN_IN_RECORD
|
||||
LEFT JOIN ${e10_other_business}.timecard e ON e.id = a.SIGN_OUT_RECORD
|
||||
|
|
@ -255,15 +262,23 @@
|
|||
JOIN ${e10_other_business}.attend_status_detail_link d
|
||||
ON d.employee = a.employee AND d.attend_date = a.attend_date
|
||||
JOIN ${e10_other_business}.attend_vacation_setting e ON e.id = d.VACATION_TYPE
|
||||
JOIN (SELECT id
|
||||
FROM ${eteams}.department
|
||||
WHERE formdata IN (SELECT CAST(id AS CHAR)
|
||||
FROM ${eteams}.${table_dept_cus}
|
||||
WHERE hrbp = #{userId})
|
||||
) alias ON alias.id = b.department
|
||||
JOIN (SELECT DISTINCT matrix_data_id as id
|
||||
FROM ${eteams}.hrm_matrix_value_data a
|
||||
WHERE a.matrix_id = #{hrbp_matrix_id}
|
||||
AND a.matrix_value_config_id = #{hrbp_matrix_value_config_id}
|
||||
AND a.delete_type = 0
|
||||
AND a.relate_id = #{userId}) alias ON alias.id = b.department
|
||||
WHERE a.attend_date = CURDATE()
|
||||
AND a.DAY_TYPE = 'WORK'
|
||||
AND a.delete_type = 0
|
||||
AND d.APPEAL_TYPE = 'leave'
|
||||
</select>
|
||||
<select id="getAllDeptIdsByHrbp" resultType="java.lang.String">
|
||||
SELECT DISTINCT CAST(matrix_data_id as CHAR) as id
|
||||
FROM ${eteams}.hrm_matrix_value_data a
|
||||
WHERE a.matrix_id = #{hrbp_matrix_id}
|
||||
AND a.matrix_value_config_id = #{hrbp_matrix_value_config_id}
|
||||
AND a.delete_type = 0
|
||||
AND a.relate_id = #{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<select id="getOnJobNumber" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
|
||||
select count(t.id) as value ,b.yglxmc as name from ${e10_common}.uf_jcl_employee_information t
|
||||
inner join ${e10_common}.uf_jcl_yglx b on t.yglx = b.id
|
||||
LEFT join ${e10_common}.uf_jcl_yglx b on t.yglx = b.id
|
||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND t.department IN
|
||||
|
|
@ -14,9 +14,10 @@
|
|||
</foreach>
|
||||
</if>
|
||||
<!--开始日期 <= 结束查询日期-->
|
||||
AND t.hiredate <= #{endDate}
|
||||
AND t.personnel_status not in (5,6)
|
||||
AND t.hiredate between #{startDate} and #{endDate}
|
||||
<!--最后工作日期 > 开始查询日期 OR 最后工作日期为空-->
|
||||
and (t.zhgzr ='' or t.zhgzr is null or t.zhgzr > #{endDate})
|
||||
and (t.zhgzr ='' or t.zhgzr is null or t.zhgzr between #{startDate} and #{endDate})
|
||||
group by b.yglxmc
|
||||
</select>
|
||||
|
||||
|
|
@ -29,10 +30,11 @@
|
|||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND t.personnel_status not in (5,6)
|
||||
<!--开始日期 <= 结束查询日期-->
|
||||
AND t.hiredate <= #{endDate}
|
||||
AND t.hiredate between #{startDate} and #{endDate}
|
||||
<!--最后工作日期 > 开始查询日期 OR 最后工作日期为空-->
|
||||
and (t.zhgzr ='' or t.zhgzr is null or t.zhgzr > #{endDate})
|
||||
AND (t.zhgzr ='' or t.zhgzr is null or t.zhgzr between #{startDate} and #{endDate})
|
||||
</select>
|
||||
|
||||
<select id="getResignCount" resultType="java.lang.Integer">
|
||||
|
|
@ -45,23 +47,21 @@
|
|||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.zhgzr >= #{startDate}
|
||||
and t.zhgzr <= #{endDate}
|
||||
AND t.zhgzr between #{startDate} and #{endDate}
|
||||
</select>
|
||||
|
||||
<select id="getKeyResignCount" resultType="java.lang.Integer">
|
||||
select count(id) as value from ${param.e10_common}.uf_jcl_lzxxjl t
|
||||
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
|
||||
and t.lzzt = 1
|
||||
AND t.lzzt = 1
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND t.lzqbm IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.sfgjrc = 1
|
||||
and t.zhgzr >= #{startDate}
|
||||
and t.zhgzr <= #{endDate}
|
||||
AND t.sfgjrc = 1
|
||||
AND t.zhgzr between #{startDate} and #{endDate}
|
||||
</select>
|
||||
<select id="getEmploymentCount" resultType="java.lang.Integer">
|
||||
select count(id) as value from ${param.e10_common}.uf_jcl_rzgl t
|
||||
|
|
@ -73,8 +73,7 @@
|
|||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.hiredate >= #{startDate}
|
||||
and t.hiredate <= #{endDate}
|
||||
and t.hiredate between #{startDate} and #{endDate}
|
||||
</select>
|
||||
<select id="getKeyEmploymentCount" resultType="java.lang.Integer">
|
||||
select count(id) as value from ${param.e10_common}.uf_jcl_rzgl t
|
||||
|
|
@ -87,8 +86,7 @@
|
|||
</foreach>
|
||||
</if>
|
||||
and t.sfgjrc = 1
|
||||
and t.hiredate >= #{startDate}
|
||||
and t.hiredate <= #{endDate}
|
||||
and t.hiredate between #{startDate} and #{endDate}
|
||||
</select>
|
||||
|
||||
<select id="getEmploymentListByPosition" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
|
||||
|
|
@ -101,21 +99,24 @@
|
|||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.hiredate >= #{startDate}
|
||||
and t.hiredate <= #{endDate}
|
||||
and t.hiredate between #{startDate} and #{endDate}
|
||||
and position !='' and position is not null
|
||||
group by position order by value
|
||||
</select>
|
||||
|
||||
<select id="getPositionById" resultType="com.weaver.seconddev.portal.entity.po.Position">
|
||||
select p.id as position_id, p.name as position_name,
|
||||
d.id as department_id, d.name as department_name,
|
||||
g.id as grade_id, g.name as grade_name
|
||||
select p.id as position_id,
|
||||
p.name as position_name,
|
||||
d.id as department_id,
|
||||
d.name as department_name,
|
||||
g.id as grade_id,
|
||||
g.name as grade_name
|
||||
from ${param.eteams}.position p
|
||||
left join ${param.eteams}.department d on p.department = d.id
|
||||
left join ${param.eteams}.grade g on p.grade_id = g.id
|
||||
where p.id = #{positionId} and p.delete_type = 0
|
||||
and p.tenant_key = #{param.tenantKey} limit 1
|
||||
left join ${param.eteams}.department d on p.department = d.id
|
||||
left join ${param.eteams}.grade g on p.grade_id = g.id
|
||||
where p.id = #{positionId}
|
||||
and p.delete_type = 0
|
||||
and p.tenant_key = #{param.tenantKey} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getResignListByPosition" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
|
||||
|
|
@ -136,20 +137,23 @@
|
|||
<select id="getTopDepartmentIds" resultType="java.lang.Long">
|
||||
select t.id
|
||||
from ${param.eteams}.department t
|
||||
inner join ${param.eteams}.department t1 on t.parent = t1.id
|
||||
inner join ${param.eteams}.department t1 on t.parent = t1.id
|
||||
where t.type = 'department'
|
||||
and t1.type = 'subcompany'
|
||||
and t.delete_type = 0
|
||||
and t.status = 1
|
||||
and t.tenant_key = #{param.tenantKey}
|
||||
and t1.delete_type = 0
|
||||
and t1.status = 1
|
||||
and t1.tenant_key = #{param.tenantKey}
|
||||
and t1.type = 'subcompany'
|
||||
and t.delete_type = 0
|
||||
and t.status = 1
|
||||
and t.tenant_key = #{param.tenantKey}
|
||||
and t1.delete_type = 0
|
||||
and t1.status = 1
|
||||
and t1.tenant_key = #{param.tenantKey}
|
||||
</select>
|
||||
|
||||
<select id="getLaborCost" resultType="java.util.Map">
|
||||
select t.yscb,t.sjcb from ${e10_common}.uf_rlcb t
|
||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||
and t.ny = DATE_FORMAT(#{endDate}, '%Y-%m')
|
||||
select t.yscb, t.sjcb
|
||||
from ${e10_common}.uf_rlcb t
|
||||
where t.delete_type = 0
|
||||
and t.tenant_key = #{tenantKey}
|
||||
and t.ny BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m') AND DATE_FORMAT(#{endDate}, '%Y-%m')
|
||||
ORDER BY t.ny desc LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -236,10 +236,6 @@
|
|||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- <if test="departmentId != null and departmentId != ''">-->
|
||||
<!-- and t.department = #{departmentId}-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="searchKey != null and searchKey != ''">
|
||||
and (t.username like concat('%',#{searchKey},'%') or t.job_num like concat('%',#{searchKey},'%'))
|
||||
</if>
|
||||
|
|
@ -455,20 +451,21 @@
|
|||
SELECT COUNT(*)
|
||||
FROM ${param.e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||
JOIN ${param.eteams}.employee b ON a.employee = b.id
|
||||
JOIN (WITH RECURSIVE SubDepartments AS (SELECT id
|
||||
FROM ${param.eteams}.department
|
||||
WHERE formdata IN (SELECT CAST(id AS CHAR)
|
||||
FROM ${param.eteams}.${param.table_dept_cus}
|
||||
WHERE bmfzr = #{userId})
|
||||
UNION ALL
|
||||
SELECT d.id
|
||||
FROM ${param.eteams}.department d
|
||||
JOIN SubDepartments sd ON d.parent = sd.id
|
||||
WHERE d.IS_DELETE = 0
|
||||
AND d.`type` = 'department'
|
||||
AND d.STATUS = 1)
|
||||
SELECT id
|
||||
FROM SubDepartments) alias ON alias.id = b.department
|
||||
JOIN (SELECT DISTINCT id
|
||||
FROM (WITH RECURSIVE SubDepartments AS (SELECT id
|
||||
FROM ${param.eteams}.department
|
||||
WHERE formdata IN (SELECT CAST(id AS CHAR)
|
||||
FROM ${param.eteams}.${param.table_dept_cus}
|
||||
WHERE bmfzr = #{userId})
|
||||
UNION ALL
|
||||
SELECT d.id
|
||||
FROM ${param.eteams}.department d
|
||||
JOIN SubDepartments sd ON d.parent = sd.id
|
||||
WHERE d.IS_DELETE = 0
|
||||
AND d.`type` = 'department'
|
||||
AND d.STATUS = 1)
|
||||
SELECT id
|
||||
FROM SubDepartments) as subquery_alias) alias ON alias.id = b.department
|
||||
WHERE a.attend_date = CURDATE()
|
||||
AND a.DAY_TYPE = 'WORK'
|
||||
AND a.delete_type = 0
|
||||
|
|
@ -533,7 +530,7 @@
|
|||
AND a.delete_type = 0
|
||||
</select>
|
||||
<select id="getTodayNoSign" resultType="java.lang.Integer">
|
||||
SELECT COUNT( DISTINCT a.EMPLOYEE)
|
||||
SELECT COUNT(DISTINCT a.EMPLOYEE)
|
||||
FROM ${param.e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||
INNER JOIN ${param.eteams}.employee b ON a.employee = b.id
|
||||
INNER JOIN (SELECT DISTINCT id
|
||||
|
|
@ -590,5 +587,95 @@
|
|||
AND a.delete_type = 0
|
||||
AND d.APPEAL_TYPE = 'leave'
|
||||
</select>
|
||||
<select id="getKqRequireByCondition" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*)
|
||||
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||
JOIN ${eteams}.employee b ON a.employee = b.id
|
||||
WHERE a.attend_date between #{startDate} and #{endDate}
|
||||
AND a.DAY_TYPE = 'WORK'
|
||||
AND a.delete_type = 0
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND b.department IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getAllSignByCondition" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*)
|
||||
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||
INNER JOIN ${eteams}.employee b ON a.employee = b.id
|
||||
LEFT JOIN ${eteams}.${table_emp_cus} c ON c.form_data_id = b.formdata
|
||||
LEFT JOIN ${e10_other_business}.timecard d ON d.id = a.SIGN_IN_RECORD
|
||||
LEFT JOIN ${e10_other_business}.timecard e ON e.id = a.SIGN_OUT_RECORD
|
||||
WHERE a.attend_date between #{startDate} and #{endDate}
|
||||
AND a.DAY_TYPE = 'WORK'
|
||||
AND a.delete_type = 0
|
||||
AND a.WORK_LENGTH_DAY > 0
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND b.department IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getLateByCondition" resultType="java.lang.Integer">
|
||||
SELECT COUNT(0)
|
||||
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||
INNER JOIN ${eteams}.employee b ON a.employee = b.id
|
||||
LEFT JOIN ${eteams}.${table_emp_cus} c ON c.form_data_id = b.formdata
|
||||
LEFT JOIN ${e10_other_business}.timecard d ON d.id = a.SIGN_IN_RECORD
|
||||
LEFT JOIN ${e10_other_business}.timecard e ON e.id = a.SIGN_OUT_RECORD
|
||||
LEFT JOIN ${e10_other_business}.attend_status_detail_link f
|
||||
ON f.employee = a.employee AND f.attend_date = a.attend_date
|
||||
WHERE a.attend_date between #{startDate} and #{endDate}
|
||||
AND a.FINAL_SIGN_IN_STATUS ='SIGN_IN_LATE'
|
||||
AND a.DAY_TYPE = 'WORK'
|
||||
AND a.delete_type = 0
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND b.department IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getNoSignByCondition" resultType="java.lang.Integer">
|
||||
SELECT COUNT(DISTINCT a.EMPLOYEE)
|
||||
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||
INNER JOIN ${eteams}.employee b ON a.employee = b.id
|
||||
LEFT JOIN ${eteams}.${table_emp_cus} c ON c.form_data_id = b.formdata
|
||||
LEFT JOIN ${e10_other_business}.timecard d ON d.id = a.SIGN_IN_RECORD
|
||||
LEFT JOIN ${e10_other_business}.timecard e ON e.id = a.SIGN_OUT_RECORD
|
||||
LEFT JOIN ${e10_other_business}.attend_status_detail_link f
|
||||
ON f.employee = a.employee AND f.attend_date = a.attend_date
|
||||
WHERE a.attend_date between #{startDate} and #{endDate}
|
||||
AND a.SIGN_IN_RECORD IS NULL
|
||||
AND a.DAY_TYPE = 'WORK'
|
||||
AND a.delete_type = 0
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND b.department IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getGradeDistribution" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
|
||||
SELECT
|
||||
a.grade,
|
||||
case WHEN b.name is null then '无' ELSE b.name end as name,
|
||||
count(0) as value
|
||||
FROM ${e10_common}.uf_jcl_employee_information a
|
||||
LEFT JOIN ${eteams}.grade b ON a.grade = b.id
|
||||
WHERE a.personnel_status NOT IN (5,6)
|
||||
AND a.DELETE_TYPE=0
|
||||
AND a.username != '外部联系人(系统)'
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND a.department IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY a.grade,b.name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
<mapper namespace="com.weaver.seconddev.portal.mapper.portal.SscPortalMapper">
|
||||
|
||||
<select id="getExpirationReminderCount" resultType="java.lang.Integer">
|
||||
select count(t.id) as value from ${e10_common}.uf_jcl_employee_information t
|
||||
select count(t.id) as value from ${e10_common}.uf_jcl_rshtgl t
|
||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND t.department IN
|
||||
AND t.ssbm IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.htzzrq <![CDATA[ <= ]]> DATE_ADD(CURDATE(), INTERVAL 30 DAY)
|
||||
and t.zzrq BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY)
|
||||
</select>
|
||||
|
||||
<select id="getIdCardExpirationCount" resultType="java.lang.Integer">
|
||||
|
|
@ -23,7 +23,8 @@
|
|||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.sfzyxjsrq <![CDATA[ <= ]]> DATE_ADD(CURDATE(), INTERVAL 7 DAY)
|
||||
AND t.sfzyxjsrq BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY)
|
||||
AND t.personnel_status not in(5,6)
|
||||
</select>
|
||||
|
||||
<select id="getHealthCertificateExpirationCount" resultType="java.lang.Integer">
|
||||
|
|
@ -35,7 +36,9 @@
|
|||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.jkzdqrq <![CDATA[ <= ]]> DATE_ADD(CURDATE(), INTERVAL 7 DAY)
|
||||
and t.jkzdqrq BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY)
|
||||
AND t.personnel_status not in(5,6)
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getEmploymentAnniversaryCount" resultType="java.lang.Integer">
|
||||
|
|
|
|||
Loading…
Reference in New Issue