generated from dxfeng/secondev-wugang-dxfeng
Compare commits
8 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
0312c83823 | |
|
|
57b20384a4 | |
|
|
5bed75960b | |
|
|
ffa436259f | |
|
|
639c906991 | |
|
|
2e6e862846 | |
|
|
77e5d9d367 | |
|
|
9c077137fd |
|
|
@ -0,0 +1,163 @@
|
||||||
|
package com.weaver.seconddev.entry.action;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.weaver.common.base.entity.result.WeaResult;
|
||||||
|
import com.weaver.common.hrm.dao.HrmCommonEmployeeDao;
|
||||||
|
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
|
||||||
|
import com.weaver.seconddev.chapanda.feishu.util.Esb2FeishuOpenIdUtil;
|
||||||
|
import com.weaver.seconddev.chapanda.feishu.util.Esb2FeishuSendMessageUtil;
|
||||||
|
import com.weaver.seconddev.entry.entity.MessageSendConfig;
|
||||||
|
import com.weaver.seconddev.entry.mapper.SendMessageMapper;
|
||||||
|
import com.weaver.seconddev.portal.entity.param.BaseParam;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author:dxfeng
|
||||||
|
* @createTime: 2025/08/26
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service("SendMessageAction")
|
||||||
|
public class SendMessageAction implements EsbServerlessRpcRemoteInterface {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
Esb2FeishuSendMessageUtil esb2FeishuSendMessageUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
SendMessageMapper sendMessageMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
HrmCommonEmployeeDao hrmCommonEmployeeDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
Esb2FeishuOpenIdUtil esb2FeishuOpenIdUtil;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
|
||||||
|
// ID
|
||||||
|
String employeeId = Convert.toStr(params.get("employeeId"), "");
|
||||||
|
//if(null==employeeId){
|
||||||
|
// return WeaResult.fail("动作流配置[employeeId]参数获取异常",true);
|
||||||
|
//}
|
||||||
|
|
||||||
|
// 当前部门ID
|
||||||
|
String departmentId = Convert.toStr(params.get("departmentId"), "");
|
||||||
|
String templateId = (String) params.get("templateId");
|
||||||
|
String templateVersionName = (String) params.get("templateVersionName");
|
||||||
|
String content = (String) params.get("content");
|
||||||
|
|
||||||
|
log.error("params===" + JSON.toJSONString(params));
|
||||||
|
|
||||||
|
BaseParam baseParam = new BaseParam();
|
||||||
|
MessageSendConfig messageSendConfig = sendMessageMapper.getMessageSendConfig(baseParam, departmentId);
|
||||||
|
|
||||||
|
while (messageSendConfig == null && StringUtils.isNotBlank(departmentId)) {
|
||||||
|
String parentDepartmentId = sendMessageMapper.getParentDepartmentId(baseParam, departmentId);
|
||||||
|
// 防止无限循环:如果parentDepartmentId为空或与当前departmentId相同,则跳出循环
|
||||||
|
if (StringUtils.isBlank(parentDepartmentId) || parentDepartmentId.equals(departmentId)) {
|
||||||
|
log.error("部门上下级数据异常,departmentId==" + departmentId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
departmentId = parentDepartmentId;
|
||||||
|
messageSendConfig = sendMessageMapper.getMessageSendConfig(baseParam, departmentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null == messageSendConfig) {
|
||||||
|
return WeaResult.success();
|
||||||
|
}
|
||||||
|
log.error("messageSendConfig===" + JSON.toJSONString(messageSendConfig));
|
||||||
|
|
||||||
|
Set<String> userIdList = new HashSet<>();
|
||||||
|
|
||||||
|
if (1 == messageSendConfig.getZjsj() && StringUtils.isNotBlank(employeeId)) {
|
||||||
|
// 发送消息给直接上级
|
||||||
|
String superior = sendMessageMapper.getSuperior(baseParam, employeeId);
|
||||||
|
if (StringUtils.isBlank(superior)) {
|
||||||
|
superior = sendMessageMapper.getSuperiorFromEntry(baseParam, employeeId);
|
||||||
|
}
|
||||||
|
userIdList.add(superior);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (1 == messageSendConfig.getJgsjzjssj() && StringUtils.isNotBlank(employeeId)) {
|
||||||
|
// 发送消息给间接上级
|
||||||
|
String superior = sendMessageMapper.getSuperior(baseParam, employeeId);
|
||||||
|
if (StringUtils.isBlank(superior)) {
|
||||||
|
superior = sendMessageMapper.getSuperiorFromEntry(baseParam, employeeId);
|
||||||
|
if (StringUtils.isNotBlank(superior)) {
|
||||||
|
superior = sendMessageMapper.getSuperiorFromEntry(baseParam, superior);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
superior = sendMessageMapper.getSuperior(baseParam, superior);
|
||||||
|
}
|
||||||
|
userIdList.add(superior);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (1 == messageSendConfig.getXxsj() && StringUtils.isNotBlank(employeeId)) {
|
||||||
|
// 发送消息给虚线上级
|
||||||
|
String otherSuperior = sendMessageMapper.getOtherSuperior(baseParam, employeeId);
|
||||||
|
if (StringUtils.isBlank(otherSuperior)) {
|
||||||
|
otherSuperior = sendMessageMapper.getOtherSuperiorFromEntry(baseParam, employeeId);
|
||||||
|
}
|
||||||
|
userIdList.add(otherSuperior);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> departmentCustomData = sendMessageMapper.getDepartmentCustomData(baseParam, departmentId);
|
||||||
|
if (1 == messageSendConfig.getBmfzr()) {
|
||||||
|
// 发送消息给部门负责人
|
||||||
|
String bmfzr = Convert.toStr(departmentCustomData.get("bmfzr"), "");
|
||||||
|
userIdList.add(bmfzr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (1 == messageSendConfig.getTbmyg()) {
|
||||||
|
// 发送消息给同部门员工
|
||||||
|
List<String> employeeIdsByDeptId = sendMessageMapper.getEmployeeIdsByDeptId(baseParam, departmentId);
|
||||||
|
userIdList.addAll(employeeIdsByDeptId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (1 == messageSendConfig.getHrbp()) {
|
||||||
|
// 发送消息给HRBP
|
||||||
|
String hrbp = Convert.toStr(departmentCustomData.get("hrbp"), "");
|
||||||
|
userIdList.add(hrbp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (1 == messageSendConfig.getFgld()) {
|
||||||
|
// 发送消息给分管领导
|
||||||
|
String fgld = Convert.toStr(departmentCustomData.get("fgld"), "");
|
||||||
|
userIdList.add(fgld);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (String userId : userIdList) {
|
||||||
|
if (StringUtils.isBlank(userId)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 获取飞书ID
|
||||||
|
String openId = this.esb2FeishuOpenIdUtil.queryFeishuOpenId(userId);
|
||||||
|
if (StringUtils.isBlank(openId)) {
|
||||||
|
log.error("userId=={},未获取到飞书openId", userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送消息
|
||||||
|
if (0 == messageSendConfig.getXxlx()) {
|
||||||
|
// 文本消息
|
||||||
|
esb2FeishuSendMessageUtil.senTextMessage(content, openId);
|
||||||
|
} else if (1 == messageSendConfig.getXxlx()) {
|
||||||
|
// 卡片消息
|
||||||
|
esb2FeishuSendMessageUtil.senCardMessage(templateId, templateVersionName, openId, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return WeaResult.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -27,8 +27,8 @@ public class EntryManageController {
|
||||||
HrComEstService hrComEstService;
|
HrComEstService hrComEstService;
|
||||||
|
|
||||||
@GetMapping("/checkJobNum")
|
@GetMapping("/checkJobNum")
|
||||||
public WeaResult<Map<String, Object>> checkJobNum(@RequestParam("jobNum") String jobNum) {
|
public WeaResult<Map<String, Object>> checkJobNum(@RequestParam("jobNum") String jobNum,@RequestParam("userName") String userName) {
|
||||||
return entryManageService.checkJobNum(jobNum);
|
return entryManageService.checkJobNum(jobNum,userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/uploadFiles")
|
@PostMapping("/uploadFiles")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.weaver.seconddev.entry.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author:dxfeng
|
||||||
|
* @createTime: 2025/08/26
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class MessageSendConfig {
|
||||||
|
private String bm;
|
||||||
|
private Long ry;
|
||||||
|
private int xxlx;
|
||||||
|
private String ms;
|
||||||
|
private int zjsj;
|
||||||
|
private int jgsjzjssj;
|
||||||
|
private int xxsj;
|
||||||
|
private int bmfzr;
|
||||||
|
private int tbmyg;
|
||||||
|
private int hrbp;
|
||||||
|
private int fgld;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -21,6 +21,8 @@ public interface EntryManageMapper {
|
||||||
*/
|
*/
|
||||||
Long getEntryRecordIdByJobNum(@Param("param") BaseParam param, @Param("jobNum") String jobNum);
|
Long getEntryRecordIdByJobNum(@Param("param") BaseParam param, @Param("jobNum") String jobNum);
|
||||||
|
|
||||||
|
Long getEntryRecordIdByJobNumAndName(@Param("param") BaseParam param, @Param("jobNum") String jobNum,@Param("userName") String userName);
|
||||||
|
|
||||||
|
|
||||||
Long updateFilesInfo(@Param("param") BaseParam param, @Param("employeeId") Long employeeId);
|
Long updateFilesInfo(@Param("param") BaseParam param, @Param("employeeId") Long employeeId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.weaver.seconddev.entry.mapper;
|
||||||
|
|
||||||
|
import com.weaver.seconddev.entry.entity.MessageSendConfig;
|
||||||
|
import com.weaver.seconddev.portal.entity.param.BaseParam;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author:dxfeng
|
||||||
|
* @createTime: 2025/08/26
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SendMessageMapper {
|
||||||
|
|
||||||
|
String getParentDepartmentId(@Param("param") BaseParam param, @Param("departmentId") String departmentId);
|
||||||
|
|
||||||
|
MessageSendConfig getMessageSendConfig(@Param("param") BaseParam param, @Param("departmentId") String departmentId);
|
||||||
|
|
||||||
|
String getSuperior(@Param("param") BaseParam param, @Param("employeeId") String employeeId);
|
||||||
|
|
||||||
|
String getOtherSuperior(@Param("param") BaseParam param, @Param("employeeId") String employeeId);
|
||||||
|
|
||||||
|
String getSuperiorFromEntry(@Param("param") BaseParam param, @Param("employeeId") String employeeId);
|
||||||
|
|
||||||
|
String getOtherSuperiorFromEntry(@Param("param") BaseParam param, @Param("employeeId") String employeeId);
|
||||||
|
|
||||||
|
Map<String, Object> getDepartmentCustomData(@Param("param") BaseParam param, @Param("departmentId") String departmentId);
|
||||||
|
|
||||||
|
List<String> getEmployeeIdsByDeptId(@Param("param") BaseParam param, @Param("departmentId") String departmentId);
|
||||||
|
}
|
||||||
|
|
@ -15,9 +15,10 @@ public interface EntryManageService {
|
||||||
* 校验工号
|
* 校验工号
|
||||||
*
|
*
|
||||||
* @param jobNum 工号
|
* @param jobNum 工号
|
||||||
|
* @param userName 姓名
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
WeaResult<Map<String, Object>> checkJobNum(String jobNum);
|
WeaResult<Map<String, Object>> checkJobNum(String jobNum,String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传文件
|
* 上传文件
|
||||||
|
|
|
||||||
|
|
@ -60,14 +60,14 @@ public class EntryManageServiceImpl implements EntryManageService {
|
||||||
BaseParam baseParam = new BaseParam();
|
BaseParam baseParam = new BaseParam();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WeaResult<Map<String, Object>> checkJobNum(String jobNum) {
|
public WeaResult<Map<String, Object>> checkJobNum(String jobNum,String userName) {
|
||||||
Map<String, Object> dataMap = new HashMap<>();
|
Map<String, Object> dataMap = new HashMap<>();
|
||||||
dataMap.put("isExist", false);
|
dataMap.put("isExist", false);
|
||||||
if (StringUtils.isBlank(jobNum)) {
|
if (StringUtils.isBlank(jobNum)) {
|
||||||
return WeaResult.fail("工号获取异常", true);
|
return WeaResult.fail("工号获取异常", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Long empIdByJobNum = entryManageMapper.getEntryRecordIdByJobNum(baseParam, jobNum);
|
Long empIdByJobNum = entryManageMapper.getEntryRecordIdByJobNumAndName(baseParam, jobNum,userName);
|
||||||
dataMap.put("isExist", null != empIdByJobNum);
|
dataMap.put("isExist", null != empIdByJobNum);
|
||||||
dataMap.put("empId", empIdByJobNum);
|
dataMap.put("empId", empIdByJobNum);
|
||||||
return WeaResult.success(dataMap);
|
return WeaResult.success(dataMap);
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,11 @@ package com.weaver.seconddev.portal.controller;
|
||||||
|
|
||||||
import com.weaver.common.authority.annotation.WeaPermission;
|
import com.weaver.common.authority.annotation.WeaPermission;
|
||||||
import com.weaver.common.base.entity.result.WeaResult;
|
import com.weaver.common.base.entity.result.WeaResult;
|
||||||
import com.weaver.seconddev.portal.entity.po.PortalPO;
|
|
||||||
import com.weaver.seconddev.portal.service.LeaderCockpitService;
|
import com.weaver.seconddev.portal.service.LeaderCockpitService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -41,12 +39,12 @@ public class LeaderCockpitController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/getAttendanceRate")
|
@PostMapping("/getAttendanceRate")
|
||||||
private WeaResult<List<PortalPO>> getAttendanceRate(@RequestBody Map<String, String> params) {
|
private WeaResult<Map<String, Object>> getAttendanceRate(@RequestBody Map<String, String> params) {
|
||||||
return leaderCockpitService.getAttendanceRate(params);
|
return leaderCockpitService.getAttendanceRate(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/getFullStaffingRate")
|
@PostMapping("/getFullStaffingRate")
|
||||||
private WeaResult<List<PortalPO>> getFullStaffingRate(@RequestHeader Map<String, String> header, @RequestBody Map<String, String> params) {
|
private WeaResult<Map<String, Object>> getFullStaffingRate(@RequestHeader Map<String, String> header, @RequestBody Map<String, String> params) {
|
||||||
return leaderCockpitService.getFullStaffingRate(header, params);
|
return leaderCockpitService.getFullStaffingRate(header, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/secondev/portal/manager")
|
@RequestMapping("/api/secondev/portal/manager")
|
||||||
@WeaPermission(publicPermission = true)
|
@WeaPermission(publicPermission = true)
|
||||||
public class ManagerPortalController {
|
public class ManagerPortalController {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,17 @@ public class SscPortalController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
SscPortalService sscPortalService;
|
SscPortalService sscPortalService;
|
||||||
|
@PostMapping("/getToDo")
|
||||||
|
private WeaResult<Map<String, Object>> getToDo(@RequestBody Map<String, String> params) {
|
||||||
|
return sscPortalService.getToDo(params);
|
||||||
|
}
|
||||||
@PostMapping("/getExpirationReminder")
|
@PostMapping("/getExpirationReminder")
|
||||||
private WeaResult<ExpirationReminderPo> getExpirationReminder(@RequestBody Map<String, String> params) {
|
private WeaResult<ExpirationReminderPo> getExpirationReminder(@RequestBody Map<String, String> params) {
|
||||||
return sscPortalService.getExpirationReminder(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 e10_other_business = "e10_other_business";
|
||||||
private String ec_secondev = "ec_secondev";
|
private String ec_secondev = "ec_secondev";
|
||||||
private String eteams = "eteams";
|
private String eteams = "eteams";
|
||||||
|
/**
|
||||||
|
* hrbp矩阵id
|
||||||
|
*/
|
||||||
|
private String hrbp_matrix_id = "1174700317532454913";
|
||||||
|
/**
|
||||||
|
* hrbp矩阵hrbp字段id
|
||||||
|
*/
|
||||||
|
private String hrbp_matrix_value_config_id = "1174700536634507265";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门自定义表
|
* 部门自定义表
|
||||||
|
|
@ -29,10 +37,10 @@ public class BaseParam {
|
||||||
* 请假表单
|
* 请假表单
|
||||||
*/
|
*/
|
||||||
private String leaveFormCus = "ft_1151420254779654145";
|
private String leaveFormCus = "ft_1151420254779654145";
|
||||||
///**
|
/**
|
||||||
// * 员工自定义表
|
* 员工自定义表
|
||||||
// */
|
*/
|
||||||
//private String table_emp_cus = "ft_1152026012537184302";
|
private String table_emp_cus = "ft_1152026012537184302";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人事档案-个人信息表
|
* 人事档案-个人信息表
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.weaver.seconddev.portal.entity.param;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -13,7 +14,7 @@ import java.util.Set;
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class BasicPersonnelParam extends BaseParam {
|
public class BasicPersonnelParam extends BaseParam {
|
||||||
private Set<Long> departmentIdList;
|
private Set<String> departmentIdList;
|
||||||
private String searchType;
|
private String searchType;
|
||||||
private String startDate;
|
private String startDate;
|
||||||
private String endDate;
|
private String endDate;
|
||||||
|
|
@ -21,6 +22,7 @@ public class BasicPersonnelParam extends BaseParam {
|
||||||
private Integer startIndex;
|
private Integer startIndex;
|
||||||
private Integer endIndex;
|
private Integer endIndex;
|
||||||
private String belongYear;
|
private String belongYear;
|
||||||
|
private Date paramDate;
|
||||||
|
|
||||||
/*分页查询*/
|
/*分页查询*/
|
||||||
|
|
||||||
|
|
@ -29,8 +31,4 @@ public class BasicPersonnelParam extends BaseParam {
|
||||||
private Integer current;
|
private Integer current;
|
||||||
private Integer offset;
|
private Integer offset;
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
|
|
||||||
public Integer getOffset() {
|
|
||||||
return (current - 1) * pageSize;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.weaver.seconddev.portal.entity.param;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,9 +13,8 @@ import java.util.Set;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class HrbpParam extends com.weaver.seconddev.portal.entity.param.BaseParam {
|
public class HrbpParam extends BaseParam {
|
||||||
private Set<Long> departmentIdList;
|
private Set<String> departmentIdList;
|
||||||
private Long matrixId;
|
private String userId;
|
||||||
private Long matrixValueConfigId;
|
private Date paramDate;
|
||||||
private Long userId;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import java.util.Set;
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class SearchConditionParam extends BaseParam{
|
public class SearchConditionParam extends BaseParam{
|
||||||
private String departmentId;
|
private String departmentId;
|
||||||
private Set<Long> departmentIdList;
|
private Set<String> departmentIdList;
|
||||||
private String searchDate;
|
private String searchDate;
|
||||||
private String startDate;
|
private String startDate;
|
||||||
private String endDate;
|
private String endDate;
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ public class EmployeeBasicInfoPo {
|
||||||
*/
|
*/
|
||||||
private String companyName;
|
private String companyName;
|
||||||
private String departmentName;
|
private String departmentName;
|
||||||
|
private String positionName;
|
||||||
/**
|
/**
|
||||||
* 入职日期
|
* 入职日期
|
||||||
*/
|
*/
|
||||||
|
|
@ -91,4 +92,7 @@ public class EmployeeBasicInfoPo {
|
||||||
*/
|
*/
|
||||||
private String exceptionalAttendance;
|
private String exceptionalAttendance;
|
||||||
private String exceptionalAttendanceUrl;
|
private String exceptionalAttendanceUrl;
|
||||||
|
|
||||||
|
private String reissueCardNum;
|
||||||
|
private String reissueCardNumUrl;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.weaver.seconddev.portal.mapper.portal;
|
||||||
import com.weaver.seconddev.portal.entity.param.HrbpParam;
|
import com.weaver.seconddev.portal.entity.param.HrbpParam;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author:dxfeng
|
* @author:dxfeng
|
||||||
* @createTime: 2025/07/10
|
* @createTime: 2025/07/10
|
||||||
|
|
@ -130,4 +132,27 @@ public interface HrbpPortalMapper {
|
||||||
*/
|
*/
|
||||||
int getKqRequireByBp(HrbpParam param);
|
int getKqRequireByBp(HrbpParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门矩阵可查看的所有今日有打卡人数
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getTodayAllSignByBp(HrbpParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门矩阵可查看的某日迟到人数
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getTotalLateByBp(HrbpParam param);
|
||||||
|
int getTodayNoSign(HrbpParam hrbpParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门矩阵可查看的某日休假人数
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getTotalVacationByBp(HrbpParam param);
|
||||||
|
|
||||||
|
Set<String> getAllDeptIdsByHrbp(HrbpParam param);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public interface LeaderCockpitMapper {
|
||||||
* @param endDate
|
* @param endDate
|
||||||
* @return
|
* @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
|
* @param endDate
|
||||||
* @return
|
* @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
|
* @param endDate
|
||||||
* @return
|
* @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
|
* @param endDate
|
||||||
* @return
|
* @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
|
* @param endDate
|
||||||
* @return
|
* @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
|
* @param endDate
|
||||||
* @return
|
* @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);
|
Position getPositionById(@Param("param") SearchConditionParam param, @Param("positionId") String positionId);
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ public interface ManagerPortalMapper {
|
||||||
* @param emdId
|
* @param emdId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Long> getManageDeptIds(@Param("param") BasicPersonnelParam param, @Param("empId") Long emdId);
|
List<Long> getManageDeptIds(@Param("param") BasicPersonnelParam param, @Param("empId") String emdId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取生日人数
|
* 获取生日人数
|
||||||
|
|
@ -111,7 +111,7 @@ public interface ManagerPortalMapper {
|
||||||
* @param endIndex
|
* @param endIndex
|
||||||
* @return
|
* @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
|
* @param endIndex
|
||||||
* @return
|
* @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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 饼状图配置信息
|
* 饼状图配置信息
|
||||||
|
|
@ -178,4 +178,24 @@ public interface ManagerPortalMapper {
|
||||||
//Integer sumAnnualLeaveCount(@Param("param") BasicPersonnelParam param,@Param("holidayIds") Collection<Long> holidayIds);
|
//Integer sumAnnualLeaveCount(@Param("param") BasicPersonnelParam param,@Param("holidayIds") Collection<Long> holidayIds);
|
||||||
|
|
||||||
Integer sumAnnualLeaveDuration(BasicPersonnelParam param);
|
Integer sumAnnualLeaveDuration(BasicPersonnelParam param);
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
package com.weaver.seconddev.portal.service;
|
package com.weaver.seconddev.portal.service;
|
||||||
|
|
||||||
import com.weaver.common.base.entity.result.WeaResult;
|
import com.weaver.common.base.entity.result.WeaResult;
|
||||||
import com.weaver.seconddev.portal.entity.po.PortalPO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -45,7 +43,7 @@ public interface LeaderCockpitService {
|
||||||
* @param params
|
* @param params
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
WeaResult<List<PortalPO>> getAttendanceRate(Map<String, String> params);
|
WeaResult<Map<String, Object>> getAttendanceRate(Map<String, String> params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取满编率
|
* 获取满编率
|
||||||
|
|
@ -54,7 +52,7 @@ public interface LeaderCockpitService {
|
||||||
* @param header
|
* @param header
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
WeaResult<List<PortalPO>> getFullStaffingRate(Map<String, String> header, Map<String, String> params);
|
WeaResult<Map<String, Object>> getFullStaffingRate(Map<String, String> header, Map<String, String> params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取入职情况
|
* 获取入职情况
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,13 @@ public interface SscPortalService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
WeaResult<ExpirationReminderPo> getExpirationReminder(Map<String, String> params);
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,10 @@ import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.weaver.common.base.entity.result.WeaResult;
|
import com.weaver.common.base.entity.result.WeaResult;
|
||||||
|
import com.weaver.common.cache.tablecache.impl.ComInfoCache;
|
||||||
import com.weaver.common.hr.util.Util;
|
import com.weaver.common.hr.util.Util;
|
||||||
|
import com.weaver.common.hrm.cache.HrmEmployeeComInfo;
|
||||||
|
import com.weaver.common.hrm.cache.HrmPositionComInfo;
|
||||||
import com.weaver.common.hrm.dao.HrmCommonEmployeeDao;
|
import com.weaver.common.hrm.dao.HrmCommonEmployeeDao;
|
||||||
import com.weaver.seconddev.portal.entity.po.EmployeeBasicInfoPo;
|
import com.weaver.seconddev.portal.entity.po.EmployeeBasicInfoPo;
|
||||||
import com.weaver.seconddev.portal.entity.po.PortalUrlDetail;
|
import com.weaver.seconddev.portal.entity.po.PortalUrlDetail;
|
||||||
|
|
@ -45,6 +48,8 @@ public class EmployeePortalServiceImpl implements EmployeePortalService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
DepartMentService departMentService;
|
DepartMentService departMentService;
|
||||||
|
@Autowired
|
||||||
|
private ComInfoCache comInfoCache;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
PortalMapper portalMapper;
|
PortalMapper portalMapper;
|
||||||
|
|
@ -77,7 +82,13 @@ public class EmployeePortalServiceImpl implements EmployeePortalService {
|
||||||
employeeBasicInfoPo.setWorkCode(byId.getJobNum());
|
employeeBasicInfoPo.setWorkCode(byId.getJobNum());
|
||||||
//WeaDepartMent departmentById = departMentService.getDepartMentById(byId.getDepartmentId());
|
//WeaDepartMent departmentById = departMentService.getDepartMentById(byId.getDepartmentId());
|
||||||
//employeeBasicInfoPo.setCompanyName(null != departmentById ? departmentById.getDepartMentName() : "");
|
//employeeBasicInfoPo.setCompanyName(null != departmentById ? departmentById.getDepartMentName() : "");
|
||||||
employeeBasicInfoPo.setDepartmentName(null==department?"":department.getName());
|
HrmEmployeeComInfo hrmEmployeeInfo =
|
||||||
|
comInfoCache.getCacheById(HrmEmployeeComInfo.class, currentUser.getEmployeeId());
|
||||||
|
HrmPositionComInfo positionComInfo = comInfoCache.getCacheById(HrmPositionComInfo.class, hrmEmployeeInfo.getPosition());
|
||||||
|
|
||||||
|
employeeBasicInfoPo.setPositionName(positionComInfo != null ? positionComInfo.getName() : "");
|
||||||
|
|
||||||
|
employeeBasicInfoPo.setDepartmentName(null == department ? "" : department.getName());
|
||||||
|
|
||||||
employeeBasicInfoPo.setHireDate(cn.hutool.core.date.DateUtil.formatDate(byId.getHiredate()));
|
employeeBasicInfoPo.setHireDate(cn.hutool.core.date.DateUtil.formatDate(byId.getHiredate()));
|
||||||
employeeBasicInfoPo.setEmployeeStatus(PersonnelStatusEnum.getShowNameByValue(byId.getPersonnelStatus()));
|
employeeBasicInfoPo.setEmployeeStatus(PersonnelStatusEnum.getShowNameByValue(byId.getPersonnelStatus()));
|
||||||
|
|
@ -103,6 +114,7 @@ public class EmployeePortalServiceImpl implements EmployeePortalService {
|
||||||
employeeBasicInfoPo.setOvertimeUrl(urlMap.get("overtime"));
|
employeeBasicInfoPo.setOvertimeUrl(urlMap.get("overtime"));
|
||||||
employeeBasicInfoPo.setPublicLeaveUrl(urlMap.get("publicLeave"));
|
employeeBasicInfoPo.setPublicLeaveUrl(urlMap.get("publicLeave"));
|
||||||
employeeBasicInfoPo.setExceptionalAttendanceUrl(urlMap.get("exceptionalAttendance"));
|
employeeBasicInfoPo.setExceptionalAttendanceUrl(urlMap.get("exceptionalAttendance"));
|
||||||
|
employeeBasicInfoPo.setReissueCardNumUrl(urlMap.get("reissueCardNum"));
|
||||||
|
|
||||||
|
|
||||||
return WeaResult.success(employeeBasicInfoPo);
|
return WeaResult.success(employeeBasicInfoPo);
|
||||||
|
|
@ -166,6 +178,9 @@ public class EmployeePortalServiceImpl implements EmployeePortalService {
|
||||||
case "OVERTIME":
|
case "OVERTIME":
|
||||||
employeeBasicInfoPo.setOvertime(value);
|
employeeBasicInfoPo.setOvertime(value);
|
||||||
break;
|
break;
|
||||||
|
case "REISSUECARDNUM":
|
||||||
|
employeeBasicInfoPo.setReissueCardNum(value);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.weaver.seconddev.portal.service.impl;
|
package com.weaver.seconddev.portal.service.impl;
|
||||||
|
|
||||||
import com.weaver.common.base.entity.result.WeaResult;
|
import com.weaver.common.base.entity.result.WeaResult;
|
||||||
|
import com.weaver.eb.common.util.TimeUtils;
|
||||||
import com.weaver.seconddev.portal.entity.param.HrbpParam;
|
import com.weaver.seconddev.portal.entity.param.HrbpParam;
|
||||||
import com.weaver.seconddev.portal.entity.po.PortalUrlDetail;
|
import com.weaver.seconddev.portal.entity.po.PortalUrlDetail;
|
||||||
import com.weaver.seconddev.portal.mapper.portal.HrbpPortalMapper;
|
import com.weaver.seconddev.portal.mapper.portal.HrbpPortalMapper;
|
||||||
|
|
@ -8,12 +9,11 @@ import com.weaver.seconddev.portal.mapper.portal.PortalMapper;
|
||||||
import com.weaver.seconddev.portal.service.HrbpPortalService;
|
import com.weaver.seconddev.portal.service.HrbpPortalService;
|
||||||
import com.weaver.teams.security.context.UserContext;
|
import com.weaver.teams.security.context.UserContext;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -40,7 +40,10 @@ public class HrbpPortalServiceImpl implements HrbpPortalService {
|
||||||
HrbpParam hrbpParam = new HrbpParam();
|
HrbpParam hrbpParam = new HrbpParam();
|
||||||
hrbpParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
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 toEntryCount = hrbpPortalMapper.getToEntryCount(hrbpParam);
|
||||||
int toRegularCount = hrbpPortalMapper.getToRegularCount(hrbpParam);
|
int toRegularCount = hrbpPortalMapper.getToRegularCount(hrbpParam);
|
||||||
|
|
@ -78,8 +81,10 @@ public class HrbpPortalServiceImpl implements HrbpPortalService {
|
||||||
|
|
||||||
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(hrbpParam.getTenantKey(), PORTAL_KEY, "getEmployeeData");
|
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(hrbpParam.getTenantKey(), PORTAL_KEY, "getEmployeeData");
|
||||||
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
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);
|
int allEmployeeCount = hrbpPortalMapper.getAllEmployeeCount(hrbpParam);
|
||||||
map.put("allEmployee", allEmployeeCount);
|
map.put("allEmployee", allEmployeeCount);
|
||||||
|
|
@ -112,19 +117,54 @@ public class HrbpPortalServiceImpl implements HrbpPortalService {
|
||||||
return WeaResult.success(map);
|
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
|
@Override
|
||||||
public WeaResult<Map<String, Object>> getTodayOverview(Map<String, String> params) {
|
public WeaResult<Map<String, Object>> getTodayOverview(Map<String, String> params) {
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
|
Date todayDate = TimeUtils.getString2Date(TimeUtils.getCurrentDateString(), "yyyy-MM-dd");
|
||||||
|
if (params.get("date") != null) {
|
||||||
|
String date = params.get("date");
|
||||||
|
todayDate = TimeUtils.getString2Date(date, "yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
|
||||||
//部门矩阵中,hrbp负责的部门
|
//部门矩阵中,hrbp负责的部门
|
||||||
//应出勤人数,部门在职人数
|
|
||||||
HrbpParam hrbpParam = new HrbpParam();
|
HrbpParam hrbpParam = new HrbpParam();
|
||||||
hrbpParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
hrbpParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
||||||
hrbpParam.setMatrixId(Long.valueOf(matrixId));
|
hrbpParam.setUserId(String.valueOf(UserContext.getCurrentUser().getEmployeeId()));
|
||||||
hrbpParam.setMatrixValueConfigId(Long.valueOf(matrixValueConfigId));
|
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(UserContext.getCurrentUser().getTenantKey(), PORTAL_KEY, "getTodayOverview");
|
||||||
hrbpParam.setUserId(UserContext.getCurrentUser().getUserId());
|
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
||||||
|
|
||||||
|
//应出勤人数
|
||||||
int totalRequire = hrbpPortalMapper.getKqRequireByBp(hrbpParam);
|
int totalRequire = hrbpPortalMapper.getKqRequireByBp(hrbpParam);
|
||||||
resultMap.put("totalRequire", totalRequire);
|
resultMap.put("totalRequire", totalRequire);
|
||||||
|
resultMap.put("totalRequireUrl", urlMap.get("totalRequire"));
|
||||||
|
|
||||||
|
//今日实际打卡人数
|
||||||
|
int todayAllSignByBp = hrbpPortalMapper.getTodayAllSignByBp(hrbpParam);
|
||||||
|
resultMap.put("totalSign", todayAllSignByBp);
|
||||||
|
resultMap.put("totalSignUrl", urlMap.get("totalSign"));
|
||||||
|
|
||||||
|
//今日未打卡人数
|
||||||
|
int todayNoSign = hrbpPortalMapper.getTodayNoSign(hrbpParam);
|
||||||
|
resultMap.put("totalNoSign", todayNoSign);
|
||||||
|
resultMap.put("totalNoSignUrl", urlMap.get("totalNoSign"));
|
||||||
|
|
||||||
|
//今日迟到人数
|
||||||
|
hrbpParam.setParamDate(todayDate);
|
||||||
|
int totalLate = hrbpPortalMapper.getTotalLateByBp(hrbpParam);
|
||||||
|
resultMap.put("totalLate", totalLate);
|
||||||
|
resultMap.put("totalLateUrl", urlMap.get("totalLate"));
|
||||||
|
|
||||||
|
//今日休假人数
|
||||||
|
int totalVacation = hrbpPortalMapper.getTotalVacationByBp(hrbpParam);
|
||||||
|
resultMap.put("totalVacation", totalVacation);
|
||||||
|
resultMap.put("totalVacationUrl", urlMap.get("totalVacation"));
|
||||||
|
|
||||||
return WeaResult.success(resultMap);
|
return WeaResult.success(resultMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,20 @@ import com.alibaba.fastjson.JSON;
|
||||||
import com.weaver.common.base.entity.result.WeaResult;
|
import com.weaver.common.base.entity.result.WeaResult;
|
||||||
import com.weaver.common.hrm.dao.HrmCommonEmployeeDao;
|
import com.weaver.common.hrm.dao.HrmCommonEmployeeDao;
|
||||||
import com.weaver.seconddev.portal.entity.bo.EmployeeStaffBo;
|
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.param.SearchConditionParam;
|
||||||
import com.weaver.seconddev.portal.entity.po.PortalData;
|
import com.weaver.seconddev.portal.entity.po.PortalData;
|
||||||
import com.weaver.seconddev.portal.entity.po.PortalPO;
|
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.entity.po.cfg.*;
|
||||||
import com.weaver.seconddev.portal.mapper.portal.LeaderCockpitMapper;
|
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.service.LeaderCockpitService;
|
||||||
import com.weaver.seconddev.portal.util.DateUtil;
|
import com.weaver.seconddev.portal.util.DateUtil;
|
||||||
import com.weaver.teams.security.StringUtils;
|
import com.weaver.teams.security.StringUtils;
|
||||||
import com.weaver.teams.security.context.UserContext;
|
import com.weaver.teams.security.context.UserContext;
|
||||||
|
import com.weaver.teams.security.user.User;
|
||||||
import com.weaver.workflow.common.cfg.org.service.DepartMentService;
|
import com.weaver.workflow.common.cfg.org.service.DepartMentService;
|
||||||
import com.weaver.workflow.common.entity.org.WeaDepartMent;
|
import com.weaver.workflow.common.entity.org.WeaDepartMent;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -22,8 +27,10 @@ import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领导驾驶舱门户
|
* 领导驾驶舱门户
|
||||||
|
|
@ -44,25 +51,41 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
@Autowired
|
@Autowired
|
||||||
DepartMentService departMentService;
|
DepartMentService departMentService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
PortalMapper portalMapper;
|
||||||
|
@Autowired
|
||||||
|
ManagerPortalMapper managerPortalMapper;
|
||||||
|
|
||||||
|
private static final String PORTAL_KEY = "leadershipCockpit";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WeaResult<Map<String, Object>> getOnJobNumber(Map<String, String> params) {
|
public WeaResult<Map<String, Object>> getOnJobNumber(Map<String, String> params) {
|
||||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||||
initSearchConditionParam(searchConditionParam, params, null);
|
initSearchConditionParam(searchConditionParam, params, null);
|
||||||
log.error("searchConditionParam===" + JSON.toJSONString(searchConditionParam));
|
log.error("getOnJobNumber==={}", JSON.toJSONString(searchConditionParam));
|
||||||
List<PortalPO> onJobNumber = leaderCockpitMapper.getOnJobNumber(searchConditionParam);
|
List<PortalPO> onJobNumber = leaderCockpitMapper.getOnJobNumber(searchConditionParam);
|
||||||
Map<String, Object> returnMap = new HashMap<>();
|
Map<String, Object> returnMap = new HashMap<>();
|
||||||
returnMap.put("data", onJobNumber);
|
returnMap.put("data", onJobNumber);
|
||||||
returnMap.put("total", onJobNumber.stream().mapToInt(item -> Convert.toInt(item.getValue(), 0)).sum());
|
returnMap.put("total", onJobNumber.stream().mapToInt(item -> Convert.toInt(item.getValue(), 0)).sum());
|
||||||
|
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));
|
||||||
|
returnMap.put("onJobNumberUrl", urlMap.get("onJobNumber"));
|
||||||
return WeaResult.success(returnMap);
|
return WeaResult.success(returnMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||||
initSearchConditionParam(searchConditionParam, params, null);
|
initSearchConditionParam(searchConditionParam, params, null);
|
||||||
log.error("searchConditionParam===" + JSON.toJSONString(searchConditionParam));
|
|
||||||
|
|
||||||
Map<String, Object> laborCost = leaderCockpitMapper.getLaborCost(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));
|
||||||
|
laborCost.put("laborCostUrl", urlMap.get("laborCost"));
|
||||||
return WeaResult.success(laborCost);
|
return WeaResult.success(laborCost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,7 +93,6 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
public WeaResult<Map<String, Object>> getTurnoverRate(Map<String, String> params) {
|
public WeaResult<Map<String, Object>> getTurnoverRate(Map<String, String> params) {
|
||||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||||
initSearchConditionParam(searchConditionParam, params, null);
|
initSearchConditionParam(searchConditionParam, params, null);
|
||||||
log.error("searchConditionParam===" + JSON.toJSONString(searchConditionParam));
|
|
||||||
// 查询范围内在职人员
|
// 查询范围内在职人员
|
||||||
int onJobCount = leaderCockpitMapper.getOnJobCount(searchConditionParam);
|
int onJobCount = leaderCockpitMapper.getOnJobCount(searchConditionParam);
|
||||||
// 查询范围内离职人员
|
// 查询范围内离职人员
|
||||||
|
|
@ -85,16 +107,103 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
Map<String, Object> returnMap = new HashMap<>(2);
|
Map<String, Object> returnMap = new HashMap<>(2);
|
||||||
returnMap.put("turnoverRate", formatPercentage(turnoverRate));
|
returnMap.put("turnoverRate", formatPercentage(turnoverRate));
|
||||||
returnMap.put("keyTurnoverRate", formatPercentage(keyTurnoverRate));
|
returnMap.put("keyTurnoverRate", formatPercentage(keyTurnoverRate));
|
||||||
|
|
||||||
|
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));
|
||||||
|
returnMap.put("turnoverRateUrl", urlMap.get("turnoverRate"));
|
||||||
return WeaResult.success(returnMap);
|
return WeaResult.success(returnMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WeaResult<List<PortalPO>> getAttendanceRate(Map<String, String> params) {
|
public WeaResult<Map<String, Object>> getAttendanceRate(Map<String, String> params) {
|
||||||
return null;
|
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
|
@Override
|
||||||
public WeaResult<List<PortalPO>> 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");
|
String origin = header.get("origin");
|
||||||
// 人员编制
|
// 人员编制
|
||||||
String employeeStaffUrl = origin + "/api/bs/hr/est/cfg/table";
|
String employeeStaffUrl = origin + "/api/bs/hr/est/cfg/table";
|
||||||
|
|
@ -105,14 +214,17 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
String endDate = DateUtil.getLastDayOfMonth();
|
String endDate = DateUtil.getLastDayOfMonth();
|
||||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||||
initSearchConditionParam(searchConditionParam, params, null);
|
initSearchConditionParam(searchConditionParam, params, null);
|
||||||
log.error("searchConditionParam===" + JSON.toJSONString(searchConditionParam));
|
// postEmployeeStaff(employeeStaffUrl, header, searchConditionParam.getDepartmentIdList(), month);
|
||||||
//postEmployeeStaff(employeeStaffUrl, header, searchConditionParam.getDepartmentIdList(), month);
|
|
||||||
|
|
||||||
|
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));
|
||||||
|
returnMap.put("fullStaffingRateUrl", urlMap.get("fullStaffingRate"));
|
||||||
|
|
||||||
return null;
|
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();
|
FormDatas formDatas = new FormDatas();
|
||||||
FormDatasDetail formDatasDetail = new FormDatasDetail();
|
FormDatasDetail formDatasDetail = new FormDatasDetail();
|
||||||
|
|
@ -134,8 +246,7 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
formDatasDetail.setOverCtrl(Collections.singletonList(overCtrlWrapper));
|
formDatasDetail.setOverCtrl(Collections.singletonList(overCtrlWrapper));
|
||||||
|
|
||||||
|
|
||||||
String resultStr = HttpRequest.post(employeeStaffUrl).headerMap(header, true)
|
String resultStr = HttpRequest.post(employeeStaffUrl).headerMap(header, true).body(JSON.toJSONString(formDatas)).execute().body();
|
||||||
.body(JSON.toJSONString(formDatas)).execute().body();
|
|
||||||
List<EmployeeStaff> employeeStaffs = EmployeeStaffBo.mapEmployeeStaffData(resultStr);
|
List<EmployeeStaff> employeeStaffs = EmployeeStaffBo.mapEmployeeStaffData(resultStr);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -146,28 +257,14 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
public WeaResult<Map<String, Object>> getEmploymentStatus(Map<String, String> params) {
|
public WeaResult<Map<String, Object>> getEmploymentStatus(Map<String, String> params) {
|
||||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||||
initSearchConditionParam(searchConditionParam, params, 0);
|
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> allDataMap = new LinkedHashMap<>(3);
|
||||||
Map<String, Integer> keyDataMap = new LinkedHashMap<>(3);
|
Map<String, Integer> keyDataMap = new LinkedHashMap<>(3);
|
||||||
allDataMap.put(month, leaderCockpitMapper.getEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
|
Map<String, String> monthlyDateRanges = DateUtil.getMonthlyDateRanges(searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||||
keyDataMap.put(month, leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
|
for (String month : monthlyDateRanges.keySet()) {
|
||||||
|
String dateStr = monthlyDateRanges.get(month);
|
||||||
String firstDayOfMonthStr = DateUtil.getFirstDayOfPreviousMonthStr(searchConditionParam.getStartDate());
|
String[] split = dateStr.split(",");
|
||||||
String lastDayOfMonthStr = DateUtil.getLastDayOfPreviousMonthStr(searchConditionParam.getEndDate());
|
allDataMap.put(month, leaderCockpitMapper.getEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), split[0], split[1]));
|
||||||
// 前面5个月
|
keyDataMap.put(month, leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), split[0], split[1]));
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询台账
|
// 查询台账
|
||||||
|
|
@ -190,10 +287,11 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
PortalData portalData = new PortalData();
|
PortalData portalData = new PortalData();
|
||||||
portalData.setDate(currentMonth);
|
portalData.setDate(currentMonth);
|
||||||
portalData.setDepart(departMentById.getDepartMentName());
|
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.setKey(keyEmploymentCount);
|
||||||
portalData.setAll(employmentCount);
|
portalData.setAll(employmentCount);
|
||||||
portalList.add(portalData);
|
portalList.add(portalData);
|
||||||
|
|
@ -206,6 +304,10 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
returnMap.put("dataSource", portalList);
|
returnMap.put("dataSource", portalList);
|
||||||
returnMap.put("all", allDataMap);
|
returnMap.put("all", allDataMap);
|
||||||
returnMap.put("key", keyDataMap);
|
returnMap.put("key", keyDataMap);
|
||||||
|
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));
|
||||||
|
returnMap.put("employmentStatusUrl", urlMap.get("employmentStatus"));
|
||||||
return WeaResult.success(returnMap);
|
return WeaResult.success(returnMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -213,32 +315,16 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
public WeaResult<Map<String, Object>> getResignationSituation(Map<String, String> params) {
|
public WeaResult<Map<String, Object>> getResignationSituation(Map<String, String> params) {
|
||||||
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
SearchConditionParam searchConditionParam = new SearchConditionParam();
|
||||||
initSearchConditionParam(searchConditionParam, params, 0);
|
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> allDataMap = new LinkedHashMap<>(3);
|
||||||
Map<String, Integer> keyDataMap = new LinkedHashMap<>(3);
|
Map<String, Integer> keyDataMap = new LinkedHashMap<>(3);
|
||||||
allDataMap.put(month, leaderCockpitMapper.getResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
|
Map<String, String> monthlyDateRanges = DateUtil.getMonthlyDateRanges(searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
|
||||||
keyDataMap.put(month, leaderCockpitMapper.getKeyResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
|
for (String month : monthlyDateRanges.keySet()) {
|
||||||
|
String dateStr = monthlyDateRanges.get(month);
|
||||||
String firstDayOfMonthStr = DateUtil.getFirstDayOfPreviousMonthStr(searchConditionParam.getStartDate());
|
String[] split = dateStr.split(",");
|
||||||
String lastDayOfMonthStr = DateUtil.getLastDayOfPreviousMonthStr(searchConditionParam.getEndDate());
|
allDataMap.put(month, leaderCockpitMapper.getResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), split[0], split[1]));
|
||||||
// 前五个月
|
keyDataMap.put(month, leaderCockpitMapper.getKeyResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), split[0], split[1]));
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String currentMonth = DateUtil.formatToYearMonth(searchConditionParam.getStartDate());
|
String currentMonth = DateUtil.formatToYearMonth(searchConditionParam.getStartDate());
|
||||||
Set<Long> selectDepartmentId = searchConditionParam.getSelectDepartmentId();
|
Set<Long> selectDepartmentId = searchConditionParam.getSelectDepartmentId();
|
||||||
log.error("selectDepartmentId===" + JSON.toJSONString(selectDepartmentId));
|
log.error("selectDepartmentId===" + JSON.toJSONString(selectDepartmentId));
|
||||||
|
|
@ -256,10 +342,11 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
PortalData portalData = new PortalData();
|
PortalData portalData = new PortalData();
|
||||||
portalData.setDate(currentMonth);
|
portalData.setDate(currentMonth);
|
||||||
portalData.setDepart(departMentById.getDepartMentName());
|
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.setKey(keyEmploymentCount);
|
||||||
portalData.setAll(employmentCount);
|
portalData.setAll(employmentCount);
|
||||||
portalList.add(portalData);
|
portalList.add(portalData);
|
||||||
|
|
@ -273,9 +360,34 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
returnMap.put("dataSource", portalList);
|
returnMap.put("dataSource", portalList);
|
||||||
returnMap.put("all", allDataMap);
|
returnMap.put("all", allDataMap);
|
||||||
returnMap.put("key", keyDataMap);
|
returnMap.put("key", keyDataMap);
|
||||||
|
|
||||||
|
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));
|
||||||
|
returnMap.put("resignationSituationUrl", urlMap.get("resignationSituation"));
|
||||||
return WeaResult.success(returnMap);
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建查询对象
|
* 构建查询对象
|
||||||
|
|
@ -287,15 +399,16 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
private void initSearchConditionParam(SearchConditionParam searchConditionParam, Map<String, String> params, Integer beforeMonth) {
|
private void initSearchConditionParam(SearchConditionParam searchConditionParam, Map<String, String> params, Integer beforeMonth) {
|
||||||
String searchDate = params.get("searchDate");
|
String searchDate = params.get("searchDate");
|
||||||
String departmentId = params.get("departmentId");
|
String departmentId = params.get("departmentId");
|
||||||
|
String startDate = params.get("startDate");
|
||||||
|
String endDate = params.get("endDate");
|
||||||
|
|
||||||
// 租户
|
// 租户
|
||||||
searchConditionParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
searchConditionParam.setTenantKey(UserContext.getCurrentUser().getTenantKey());
|
||||||
// 部门
|
|
||||||
//searchConditionParam.setDepartmentId(departmentId);
|
|
||||||
|
|
||||||
// 获取部门下的所有子部门
|
// 获取部门下的所有子部门
|
||||||
if (StringUtils.isNotBlank(departmentId)) {
|
if (StringUtils.isNotBlank(departmentId)) {
|
||||||
Set<Long> deptIdSet = new HashSet<>();
|
Set<String> deptIdSet = new HashSet<>();
|
||||||
|
deptIdSet.add(departmentId);
|
||||||
Set<Long> selectDepartmentId = new HashSet<>();
|
Set<Long> selectDepartmentId = new HashSet<>();
|
||||||
String[] split = departmentId.split(",");
|
String[] split = departmentId.split(",");
|
||||||
for (String s : split) {
|
for (String s : split) {
|
||||||
|
|
@ -303,46 +416,26 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
long parseLong = Long.parseLong(s);
|
long parseLong = Long.parseLong(s);
|
||||||
log.error("parseLong===" + parseLong);
|
|
||||||
selectDepartmentId.add(parseLong);
|
selectDepartmentId.add(parseLong);
|
||||||
List<Long> beLongDeps = departMentService.getBeLongDeps(parseLong, searchConditionParam.getTenantKey(), false);
|
List<Long> beLongDeps = departMentService.getBeLongDeps(parseLong, searchConditionParam.getTenantKey(), false);
|
||||||
beLongDeps.add(parseLong);
|
beLongDeps.add(parseLong);
|
||||||
log.error("beLongDeps===" + JSON.toJSONString(beLongDeps));
|
Set<String> collect = beLongDeps.stream().map(dept -> String.valueOf(dept)).collect(Collectors.toSet());
|
||||||
deptIdSet.addAll(beLongDeps);
|
deptIdSet.addAll(collect);
|
||||||
}
|
}
|
||||||
searchConditionParam.setDepartmentIdList(deptIdSet);
|
searchConditionParam.setDepartmentIdList(deptIdSet);
|
||||||
searchConditionParam.setSelectDepartmentId(selectDepartmentId);
|
searchConditionParam.setSelectDepartmentId(selectDepartmentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理截止日期
|
if (StringUtils.isNotEmpty(endDate)) {
|
||||||
String endDateStr;
|
searchConditionParam.setEndDate(endDate);
|
||||||
if (StringUtils.isBlank(searchDate)) {
|
|
||||||
endDateStr = DateUtil.getCurrentDateStr();
|
|
||||||
} else {
|
} else {
|
||||||
try {
|
searchConditionParam.setEndDate(DateUtil.getCurrentDateStr());
|
||||||
// 验证日期格式是否合法
|
|
||||||
endDateStr = searchDate;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("日期格式错误,使用当前日期: {}", searchDate, e);
|
|
||||||
endDateStr = DateUtil.getCurrentDateStr();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
searchConditionParam.setEndDate(endDateStr);
|
|
||||||
|
|
||||||
// 处理开始日期
|
if (StringUtils.isNotEmpty(startDate)) {
|
||||||
if (beforeMonth == null) {
|
searchConditionParam.setStartDate(startDate);
|
||||||
// 查询当前年度数据
|
|
||||||
searchConditionParam.setStartDate(DateUtil.getFirstDayOfYearStr(searchConditionParam.getEndDate()));
|
|
||||||
} else {
|
} else {
|
||||||
// 查询前N个月数据
|
searchConditionParam.setStartDate("1999-01-01");
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import com.weaver.common.hrm.cache.HrmDepartmentComInfo;
|
||||||
import com.weaver.common.hrm.dao.HrmCommonDepartmentDao;
|
import com.weaver.common.hrm.dao.HrmCommonDepartmentDao;
|
||||||
import com.weaver.common.hrm.dao.HrmCommonEmployeeDao;
|
import com.weaver.common.hrm.dao.HrmCommonEmployeeDao;
|
||||||
import com.weaver.common.hrm.manage.HrmComInfoCacheHandler;
|
import com.weaver.common.hrm.manage.HrmComInfoCacheHandler;
|
||||||
|
import com.weaver.eb.common.util.TimeUtils;
|
||||||
import com.weaver.seconddev.portal.entity.component.Option;
|
import com.weaver.seconddev.portal.entity.component.Option;
|
||||||
import com.weaver.seconddev.portal.entity.param.BasicPersonnelParam;
|
import com.weaver.seconddev.portal.entity.param.BasicPersonnelParam;
|
||||||
import com.weaver.seconddev.portal.entity.po.*;
|
import com.weaver.seconddev.portal.entity.po.*;
|
||||||
|
|
@ -74,15 +75,13 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
User currentUser = UserContext.getCurrentUser();
|
User currentUser = UserContext.getCurrentUser();
|
||||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||||
Set<Long> allDepartmentIds = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
List<Long> manageDeptIds = managerPortalMapper.getManageDeptIds(basicPersonnelParam, String.valueOf(currentUser.getEmployeeId()));
|
||||||
List<HrmDepartmentComInfo> departmentList = hrmComInfoCacheHandler.getCacheList(HrmDepartmentComInfo.class, allDepartmentIds);
|
List<HrmDepartmentComInfo> departmentList = hrmComInfoCacheHandler.getCacheList(HrmDepartmentComInfo.class, manageDeptIds);
|
||||||
// 获取顶级部门
|
// 获取顶级部门
|
||||||
List<HrmDepartmentComInfo> topDepartmentList = departmentList.stream()
|
// List<HrmDepartmentComInfo> topDepartmentList = departmentList.stream()
|
||||||
.filter(dept -> !allDepartmentIds.contains(dept.getParent()))
|
// .filter(dept -> !allDepartmentIds.contains(dept.getParent()))
|
||||||
.collect(Collectors.toList());
|
// .collect(Collectors.toList());
|
||||||
|
List<String> departmentNames = departmentList.stream().map(HrmDepartmentComInfo::getName).collect(Collectors.toList());
|
||||||
List<String> departmentNames = topDepartmentList.stream().map(HrmDepartmentComInfo::getName).collect(Collectors.toList());
|
|
||||||
|
|
||||||
Map<String, Object> returnMap = new HashMap<>();
|
Map<String, Object> returnMap = new HashMap<>();
|
||||||
returnMap.put("deptNames", StringUtils.join(departmentNames, "、"));
|
returnMap.put("deptNames", StringUtils.join(departmentNames, "、"));
|
||||||
returnMap.put("userName", currentUser.getUsername());
|
returnMap.put("userName", currentUser.getUsername());
|
||||||
|
|
@ -91,8 +90,47 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WeaResult<Map<String, Object>> getTodayOverview(Map<String, String> params) {
|
public WeaResult<Map<String, Object>> getTodayOverview(Map<String, String> params) {
|
||||||
|
HashMap<String, Object> resultMap = new HashMap<>();
|
||||||
|
|
||||||
return null;
|
Date todayDate = TimeUtils.getString2Date(TimeUtils.getCurrentDateString(), "yyyy-MM-dd");
|
||||||
|
if (params.get("date") != null) {
|
||||||
|
String date = params.get("date");
|
||||||
|
todayDate = TimeUtils.getString2Date(date, "yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
User currentUser = UserContext.getCurrentUser();
|
||||||
|
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||||
|
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||||
|
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(currentUser.getTenantKey(), PORTAL_KEY, "getTodayOverview");
|
||||||
|
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
||||||
|
|
||||||
|
//应出勤人数
|
||||||
|
Integer totalRequire = managerPortalMapper.getKqRequire(basicPersonnelParam, String.valueOf(currentUser.getEmployeeId()));
|
||||||
|
resultMap.put("totalRequire", totalRequire);
|
||||||
|
resultMap.put("totalRequireUrl", urlMap.get("totalRequire"));
|
||||||
|
|
||||||
|
//今日实际打卡人数
|
||||||
|
Integer todayAllSign = managerPortalMapper.getTodayAllSign(basicPersonnelParam, String.valueOf(currentUser.getEmployeeId()));
|
||||||
|
resultMap.put("totalSign", todayAllSign);
|
||||||
|
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"));
|
||||||
|
|
||||||
|
//今日迟到人数
|
||||||
|
basicPersonnelParam.setParamDate(todayDate);
|
||||||
|
Integer totalLate = managerPortalMapper.getTotalLate(basicPersonnelParam, String.valueOf(currentUser.getEmployeeId()));
|
||||||
|
resultMap.put("totalLate", 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"));
|
||||||
|
|
||||||
|
return WeaResult.success(resultMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -104,7 +142,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
User currentUser = UserContext.getCurrentUser();
|
User currentUser = UserContext.getCurrentUser();
|
||||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||||
|
|
||||||
// 设置部门范围ID集合
|
// 设置部门范围ID集合
|
||||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||||
|
|
@ -162,7 +200,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
User currentUser = UserContext.getCurrentUser();
|
User currentUser = UserContext.getCurrentUser();
|
||||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||||
StringJoiner andCondition = new StringJoiner(" and ");
|
StringJoiner andCondition = new StringJoiner(" and ");
|
||||||
switch (dataKey) {
|
switch (dataKey) {
|
||||||
case "onJobNumber":
|
case "onJobNumber":
|
||||||
|
|
@ -226,10 +264,11 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
User currentUser = UserContext.getCurrentUser();
|
User currentUser = UserContext.getCurrentUser();
|
||||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||||
|
|
||||||
// 设置部门范围ID集合
|
// 设置部门范围ID集合
|
||||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||||
|
log.error("getTeamMemorialDay:{}", JSON.toJSONString(allDepartmentIdList));
|
||||||
int birthdayNum = managerPortalMapper.getBirthdayNum(basicPersonnelParam);
|
int birthdayNum = managerPortalMapper.getBirthdayNum(basicPersonnelParam);
|
||||||
|
|
||||||
int regularEmployeeNum = managerPortalMapper.getRegularEmployeeNum(basicPersonnelParam);
|
int regularEmployeeNum = managerPortalMapper.getRegularEmployeeNum(basicPersonnelParam);
|
||||||
|
|
@ -261,7 +300,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
User currentUser = UserContext.getCurrentUser();
|
User currentUser = UserContext.getCurrentUser();
|
||||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||||
StringJoiner andCondition = new StringJoiner(" and ");
|
StringJoiner andCondition = new StringJoiner(" and ");
|
||||||
switch (dataKey) {
|
switch (dataKey) {
|
||||||
case "birthdayNum":
|
case "birthdayNum":
|
||||||
|
|
@ -283,7 +322,10 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
case "employmentAnniversary":
|
case "employmentAnniversary":
|
||||||
// 入职周年提醒
|
// 入职周年提醒
|
||||||
if (CollectionUtils.isNotEmpty(allDepartmentIdList)) {
|
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') ) ) ) ");
|
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;
|
break;
|
||||||
|
|
@ -308,7 +350,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
User currentUser = UserContext.getCurrentUser();
|
User currentUser = UserContext.getCurrentUser();
|
||||||
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
|
||||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||||
// 设置部门范围ID集合
|
// 设置部门范围ID集合
|
||||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||||
basicPersonnelParam.setPieType(type);
|
basicPersonnelParam.setPieType(type);
|
||||||
|
|
@ -331,6 +373,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
break;
|
break;
|
||||||
case "grade":
|
case "grade":
|
||||||
// 职级
|
// 职级
|
||||||
|
dealGradeInfo(basicPersonnelParam, returnList);
|
||||||
returnMap.put("url", urlMap.get("grade"));
|
returnMap.put("url", urlMap.get("grade"));
|
||||||
break;
|
break;
|
||||||
case "company":
|
case "company":
|
||||||
|
|
@ -350,6 +393,11 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
return WeaResult.success(returnMap);
|
return WeaResult.success(returnMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void dealGradeInfo(BasicPersonnelParam basicPersonnelParam, List<PortalPO> returnList) {
|
||||||
|
List<PortalPO> gradeDistribution = managerPortalMapper.getGradeDistribution(basicPersonnelParam);
|
||||||
|
returnList.addAll(gradeDistribution);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WeaResult<Map<String, Object>> getAttendanceInfo(Map<String, String> params) {
|
public WeaResult<Map<String, Object>> getAttendanceInfo(Map<String, String> params) {
|
||||||
String type = params.get("type");
|
String type = params.get("type");
|
||||||
|
|
@ -363,7 +411,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
basicPersonnelParam.setStartDate(DateUtil.getFirstDayOfMonth());
|
basicPersonnelParam.setStartDate(DateUtil.getFirstDayOfMonth());
|
||||||
basicPersonnelParam.setEndDate(DateUtil.getLastDayOfMonth());
|
basicPersonnelParam.setEndDate(DateUtil.getLastDayOfMonth());
|
||||||
|
|
||||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||||
// 设置部门范围ID集合
|
// 设置部门范围ID集合
|
||||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
||||||
|
|
||||||
|
|
@ -392,7 +440,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
map3.put("url", urlMap.get("leaveType"));
|
map3.put("url", urlMap.get("leaveType"));
|
||||||
return WeaResult.success(map3);
|
return WeaResult.success(map3);
|
||||||
default:
|
default:
|
||||||
return WeaResult.fail("不支持的统计类型",true);
|
return WeaResult.fail("不支持的统计类型", true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -409,26 +457,23 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
|
||||||
basicPersonnelParam.setCurrent(current);
|
basicPersonnelParam.setCurrent(current);
|
||||||
basicPersonnelParam.setPageSize(pageSize);
|
basicPersonnelParam.setPageSize(pageSize);
|
||||||
|
basicPersonnelParam.setOffset((current - 1) * pageSize);
|
||||||
basicPersonnelParam.setSearchKey(searchKey);
|
basicPersonnelParam.setSearchKey(searchKey);
|
||||||
//log.error("departmentId==={}", departmentId);
|
//log.error("departmentId==={}", departmentId);
|
||||||
basicPersonnelParam.setDepartmentId(departmentId);
|
basicPersonnelParam.setDepartmentId(departmentId);
|
||||||
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
Set<String> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
|
||||||
//log.error("allDepartmentIdList111==={}", JSON.toJSONString(allDepartmentIdList));
|
|
||||||
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
|
|
||||||
if (StringUtils.isNotBlank(departmentId)) {
|
if (StringUtils.isNotBlank(departmentId)) {
|
||||||
List<WeaDepartMent> beLongDeps = departMentService.getBeLongDeps(Long.parseLong(departmentId));
|
List<WeaDepartMent> beLongDeps = departMentService.getBeLongDeps(Long.parseLong(departmentId));
|
||||||
Set<Long> collect = beLongDeps.stream().map(WeaDepartMent::getDepartMentId).collect(Collectors.toSet());
|
Set<String> collect = beLongDeps.stream().map(weaDepartMent -> String.valueOf(weaDepartMent.getDepartMentId())).collect(Collectors.toSet());
|
||||||
collect.add(Long.parseLong(departmentId));
|
collect.add(departmentId);
|
||||||
// 两个set取交集
|
// 两个set取交集
|
||||||
allDepartmentIdList.retainAll(collect);
|
allDepartmentIdList.retainAll(collect);
|
||||||
//log.error("collect==={}", JSON.toJSONString(collect));
|
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(allDepartmentIdList)) {
|
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);
|
List<TeamEmployeePo> teamEmployee = managerPortalMapper.getTeamEmployee(basicPersonnelParam);
|
||||||
int total = managerPortalMapper.getTeamEmployeeTotal(basicPersonnelParam);
|
int total = managerPortalMapper.getTeamEmployeeTotal(basicPersonnelParam);
|
||||||
|
|
@ -637,15 +682,14 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户当前所负责的所有的部门以及下级部门
|
* 获取用户当前所负责的所有的部门以及下级部门
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Set<Long> getAllDepartmentIdList(BasicPersonnelParam basicPersonnelParam, Long employeeId) {
|
private Set<String> getAllDepartmentIdList(BasicPersonnelParam basicPersonnelParam, Long employeeId) {
|
||||||
// 查询所负责的部门
|
// 查询所负责的部门
|
||||||
List<Long> manageDeptIds = managerPortalMapper.getManageDeptIds(basicPersonnelParam, employeeId);
|
List<Long> manageDeptIds = managerPortalMapper.getManageDeptIds(basicPersonnelParam, String.valueOf(employeeId));
|
||||||
// 查询所有的部门、子部门信息
|
// 查询所有的部门、子部门信息
|
||||||
Set<WeaDepartMent> allDepartmentList = new HashSet<>();
|
Set<WeaDepartMent> allDepartmentList = new HashSet<>();
|
||||||
for (Long manageDeptId : manageDeptIds) {
|
for (Long manageDeptId : manageDeptIds) {
|
||||||
|
|
@ -655,6 +699,11 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
||||||
allDepartmentList.addAll(beLongDeps);
|
allDepartmentList.addAll(beLongDeps);
|
||||||
}
|
}
|
||||||
// TODO 判断集合如果为空,不展示数据
|
// TODO 判断集合如果为空,不展示数据
|
||||||
return allDepartmentList.stream().map(WeaDepartMent::getDepartMentId).collect(Collectors.toSet());
|
if (CollectionUtils.isEmpty(allDepartmentList)) {
|
||||||
|
Set<String> set = new HashSet<>();
|
||||||
|
set.add("-1");
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
return allDepartmentList.stream().map(weaDepartMent -> String.valueOf(weaDepartMent.getDepartMentId())).collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,23 @@
|
||||||
package com.weaver.seconddev.portal.service.impl;
|
package com.weaver.seconddev.portal.service.impl;
|
||||||
|
|
||||||
import com.weaver.common.base.entity.result.WeaResult;
|
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.param.SscParam;
|
||||||
import com.weaver.seconddev.portal.entity.po.ExpirationReminderPo;
|
import com.weaver.seconddev.portal.entity.po.ExpirationReminderPo;
|
||||||
import com.weaver.seconddev.portal.entity.po.PortalUrlDetail;
|
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.PortalMapper;
|
||||||
import com.weaver.seconddev.portal.mapper.portal.SscPortalMapper;
|
import com.weaver.seconddev.portal.mapper.portal.SscPortalMapper;
|
||||||
import com.weaver.seconddev.portal.service.SscPortalService;
|
import com.weaver.seconddev.portal.service.SscPortalService;
|
||||||
import com.weaver.teams.security.context.UserContext;
|
import com.weaver.teams.security.context.UserContext;
|
||||||
import com.weaver.teams.security.user.User;
|
import com.weaver.teams.security.user.User;
|
||||||
|
import com.weaver.workflow.common.cfg.org.service.DepartMentService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -32,12 +37,21 @@ public class SscPortalServiceImpl implements SscPortalService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
PortalMapper portalMapper;
|
PortalMapper portalMapper;
|
||||||
|
@Autowired
|
||||||
|
HrbpPortalMapper hrbpPortalMapper;
|
||||||
|
@Autowired
|
||||||
|
DepartMentService departMentService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ManagerPortalMapper managerPortalMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WeaResult<ExpirationReminderPo> getExpirationReminder(Map<String, String> params) {
|
public WeaResult<ExpirationReminderPo> getExpirationReminder(Map<String, String> params) {
|
||||||
User currentUser = UserContext.getCurrentUser();
|
User currentUser = UserContext.getCurrentUser();
|
||||||
SscParam sscParam = new SscParam();
|
SscParam sscParam = new SscParam();
|
||||||
sscParam.setTenantKey(currentUser.getTenantKey());
|
sscParam.setTenantKey(currentUser.getTenantKey());
|
||||||
|
// Set<String> allDepartmentIdList = getAllDepartmentIdList(sscParam, currentUser.getEmployeeId());
|
||||||
|
// sscParam.setDepartmentIdList();
|
||||||
|
|
||||||
ExpirationReminderPo expirationReminderPo = new ExpirationReminderPo();
|
ExpirationReminderPo expirationReminderPo = new ExpirationReminderPo();
|
||||||
|
|
||||||
|
|
@ -62,4 +76,79 @@ public class SscPortalServiceImpl implements SscPortalService {
|
||||||
|
|
||||||
return WeaResult.success(expirationReminderPo);
|
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.ChronoUnit;
|
||||||
import java.time.temporal.TemporalAdjusters;
|
import java.time.temporal.TemporalAdjusters;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author:dxfeng
|
* @author:dxfeng
|
||||||
|
|
@ -217,7 +219,7 @@ public class DateUtil {
|
||||||
if (date == null) {
|
if (date == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return date.toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDate();
|
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LocalDateTime toLocalDateTime(Date date) {
|
public static LocalDateTime toLocalDateTime(Date date) {
|
||||||
|
|
@ -289,6 +291,43 @@ public class DateUtil {
|
||||||
return formatDate(lastDayOfPrevMonth);
|
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 字符串
|
* 将 LocalDate 格式化为 yyyy-MM 字符串
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.weaver.seconddev.entry.mapper.SendMessageMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getParentDepartmentId" resultType="java.lang.String">
|
||||||
|
select parent
|
||||||
|
from ${param.eteams}.department t1
|
||||||
|
where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
||||||
|
and id = #{departmentId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<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 FIND_IN_SET(#{departmentId}, bm) > 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getSuperior" resultType="java.lang.String">
|
||||||
|
select t1.superior from ${param.e10_common}.uf_jcl_employee_information t1
|
||||||
|
where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
||||||
|
and t1.id = #{employeeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getOtherSuperior" resultType="java.lang.String">
|
||||||
|
select t1.other_superior from ${param.e10_common}.uf_jcl_employee_information t1
|
||||||
|
where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
||||||
|
and t1.id = #{employeeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getSuperiorFromEntry" resultType="java.lang.String">
|
||||||
|
select t1.superior from ${param.e10_common}.uf_jcl_rzgl t1
|
||||||
|
where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
||||||
|
and t1.id = #{employeeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getOtherSuperiorFromEntry" resultType="java.lang.String">
|
||||||
|
select t1.other_superior from ${param.e10_common}.uf_jcl_rzgl t1
|
||||||
|
where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
||||||
|
and t1.id = #{employeeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDepartmentCustomData" resultType="java.util.Map">
|
||||||
|
select t2.id as departmentId,t1.* from ${param.eteams}.${param.table_dept_cus} t1
|
||||||
|
inner join ${param.eteams}.department t2 on t1.ID =t2.formdata
|
||||||
|
where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
||||||
|
and t2.tenant_key = #{param.tenantKey} and t2.delete_type = 0
|
||||||
|
and t2.id = #{departmentId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getEmployeeIdsByDeptId" resultType="java.lang.String">
|
||||||
|
select t1.id from ${param.e10_common}.uf_jcl_employee_information t1
|
||||||
|
where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
||||||
|
and t1.department = #{employeeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -26,4 +26,10 @@
|
||||||
where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
||||||
and t1.job_num = #{jobNum}
|
and t1.job_num = #{jobNum}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getEntryRecordIdByJobNumAndName" resultType="java.lang.Long">
|
||||||
|
select t1.id from ${param.e10_common}.uf_jcl_employee_information t1
|
||||||
|
where t1.tenant_key = #{param.tenantKey} and t1.delete_type = 0
|
||||||
|
and t1.job_num = #{jobNum}
|
||||||
|
and t1.username = #{userName}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
select count(t.id) from ${e10_common}.uf_dlqgl t
|
select count(t.id) from ${e10_common}.uf_dlqgl t
|
||||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||||
AND t.ssbm IN
|
AND t.dlqbm IN
|
||||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||||
#{departmentId}
|
#{departmentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
@ -176,20 +176,109 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getKqRequireByBp" resultType="java.lang.Integer">
|
<select id="getKqRequireByBp" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT COUNT(*)
|
||||||
COUNT(DISTINCT b.ID )
|
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||||
FROM
|
JOIN ${eteams}.employee b ON a.employee = b.id
|
||||||
${eteams}.hrm_matrix_value_data a
|
JOIN (SELECT DISTINCT matrix_data_id as id
|
||||||
LEFT JOIN ${eteams}.employee b ON b.DEPARTMENT = a.matrix_data_id
|
FROM ${eteams}.hrm_matrix_value_data a
|
||||||
WHERE
|
WHERE a.matrix_id = #{hrbp_matrix_id}
|
||||||
<!-- 部门矩阵id -->
|
AND a.matrix_value_config_id = #{hrbp_matrix_value_config_id}
|
||||||
a.matrix_id = #{matrixId}
|
AND a.delete_type = 0
|
||||||
<!-- 矩阵配置id(hrbp字段id) hrbpId -->
|
AND a.relate_id = #{userId}) alias ON alias.id = b.department
|
||||||
AND a.matrix_value_config_id = #{matrixValueConfigId}
|
WHERE a.attend_date = CURDATE()
|
||||||
<!-- 当前人员id -->
|
AND a.DAY_TYPE = 'WORK'
|
||||||
AND a.relate_id=#{userId}
|
AND a.delete_type = 0
|
||||||
AND a.delete_type = 0
|
</select>
|
||||||
AND b.accounttype = 0
|
|
||||||
AND b.STATUS = 'normal'
|
<select id="getTodayAllSignByBp" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||||
|
INNER JOIN ${eteams}.employee b ON a.employee = b.id
|
||||||
|
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
|
||||||
|
WHERE a.attend_date = CURDATE()
|
||||||
|
AND a.DAY_TYPE = 'WORK'
|
||||||
|
AND a.delete_type = 0
|
||||||
|
AND (a.SIGN_RANGE_START IS NOT NULL OR a.SIGN_RANGE_END IS NOT NULL)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getTotalLateByBp" 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
|
||||||
|
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
|
||||||
|
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 = CURDATE()
|
||||||
|
AND a.SIGN_IN_RECORD IS NOT NULL
|
||||||
|
AND a.PERIOD_RANGE_START < a.SIGN_RANGE_START
|
||||||
|
AND a.DAY_TYPE = 'WORK'
|
||||||
|
AND a.delete_type = 0
|
||||||
|
</select>
|
||||||
|
<select id="getTodayNoSign" 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
|
||||||
|
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
|
||||||
|
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 = CURDATE()
|
||||||
|
AND a.SIGN_IN_RECORD IS NULL
|
||||||
|
AND a.DAY_TYPE = 'WORK'
|
||||||
|
AND a.delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getTotalVacationByBp" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(DISTINCT a.EMPLOYEE)
|
||||||
|
FROM ${e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||||
|
JOIN ${eteams}.employee b ON a.employee = b.id
|
||||||
|
JOIN ${eteams}.${table_emp_cus} c ON c.form_data_id = b.formdata
|
||||||
|
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 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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
<select id="getOnJobNumber" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
|
<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
|
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}
|
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||||
AND t.department IN
|
AND t.department IN
|
||||||
|
|
@ -14,9 +14,10 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<!--开始日期 <= 结束查询日期-->
|
<!--开始日期 <= 结束查询日期-->
|
||||||
AND t.hiredate <= #{endDate}
|
AND t.personnel_status not in (5,6)
|
||||||
|
AND t.hiredate between #{startDate} and #{endDate}
|
||||||
<!--最后工作日期 > 开始查询日期 OR 最后工作日期为空-->
|
<!--最后工作日期 > 开始查询日期 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
|
group by b.yglxmc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -29,10 +30,11 @@
|
||||||
#{departmentId}
|
#{departmentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
AND t.personnel_status not in (5,6)
|
||||||
<!--开始日期 <= 结束查询日期-->
|
<!--开始日期 <= 结束查询日期-->
|
||||||
AND t.hiredate <= #{endDate}
|
AND t.hiredate between #{startDate} and #{endDate}
|
||||||
<!--最后工作日期 > 开始查询日期 OR 最后工作日期为空-->
|
<!--最后工作日期 > 开始查询日期 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>
|
||||||
|
|
||||||
<select id="getResignCount" resultType="java.lang.Integer">
|
<select id="getResignCount" resultType="java.lang.Integer">
|
||||||
|
|
@ -45,23 +47,21 @@
|
||||||
#{departmentId}
|
#{departmentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
and t.zhgzr >= #{startDate}
|
AND t.zhgzr between #{startDate} and #{endDate}
|
||||||
and t.zhgzr <= #{endDate}
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getKeyResignCount" resultType="java.lang.Integer">
|
<select id="getKeyResignCount" resultType="java.lang.Integer">
|
||||||
select count(id) as value from ${param.e10_common}.uf_jcl_lzxxjl t
|
select count(id) as value from ${param.e10_common}.uf_jcl_lzxxjl t
|
||||||
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
|
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">
|
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||||
AND t.lzqbm IN
|
AND t.lzqbm IN
|
||||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||||
#{departmentId}
|
#{departmentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
and t.sfgjrc = 1
|
AND t.sfgjrc = 1
|
||||||
and t.zhgzr >= #{startDate}
|
AND t.zhgzr between #{startDate} and #{endDate}
|
||||||
and t.zhgzr <= #{endDate}
|
|
||||||
</select>
|
</select>
|
||||||
<select id="getEmploymentCount" resultType="java.lang.Integer">
|
<select id="getEmploymentCount" resultType="java.lang.Integer">
|
||||||
select count(id) as value from ${param.e10_common}.uf_jcl_rzgl t
|
select count(id) as value from ${param.e10_common}.uf_jcl_rzgl t
|
||||||
|
|
@ -73,8 +73,7 @@
|
||||||
#{departmentId}
|
#{departmentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
and t.hiredate >= #{startDate}
|
and t.hiredate between #{startDate} and #{endDate}
|
||||||
and t.hiredate <= #{endDate}
|
|
||||||
</select>
|
</select>
|
||||||
<select id="getKeyEmploymentCount" resultType="java.lang.Integer">
|
<select id="getKeyEmploymentCount" resultType="java.lang.Integer">
|
||||||
select count(id) as value from ${param.e10_common}.uf_jcl_rzgl t
|
select count(id) as value from ${param.e10_common}.uf_jcl_rzgl t
|
||||||
|
|
@ -87,8 +86,7 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
and t.sfgjrc = 1
|
and t.sfgjrc = 1
|
||||||
and t.hiredate >= #{startDate}
|
and t.hiredate between #{startDate} and #{endDate}
|
||||||
and t.hiredate <= #{endDate}
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getEmploymentListByPosition" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
|
<select id="getEmploymentListByPosition" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
|
||||||
|
|
@ -101,21 +99,24 @@
|
||||||
#{departmentId}
|
#{departmentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
and t.hiredate >= #{startDate}
|
and t.hiredate between #{startDate} and #{endDate}
|
||||||
and t.hiredate <= #{endDate}
|
|
||||||
and position !='' and position is not null
|
and position !='' and position is not null
|
||||||
group by position order by value
|
group by position order by value
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getPositionById" resultType="com.weaver.seconddev.portal.entity.po.Position">
|
<select id="getPositionById" resultType="com.weaver.seconddev.portal.entity.po.Position">
|
||||||
select p.id as position_id, p.name as position_name,
|
select p.id as position_id,
|
||||||
d.id as department_id, d.name as department_name,
|
p.name as position_name,
|
||||||
g.id as grade_id, g.name as grade_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
|
from ${param.eteams}.position p
|
||||||
left join ${param.eteams}.department d on p.department = d.id
|
left join ${param.eteams}.department d on p.department = d.id
|
||||||
left join ${param.eteams}.grade g on p.grade_id = g.id
|
left join ${param.eteams}.grade g on p.grade_id = g.id
|
||||||
where p.id = #{positionId} and p.delete_type = 0
|
where p.id = #{positionId}
|
||||||
and p.tenant_key = #{param.tenantKey} limit 1
|
and p.delete_type = 0
|
||||||
|
and p.tenant_key = #{param.tenantKey} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getResignListByPosition" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
|
<select id="getResignListByPosition" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
|
||||||
|
|
@ -136,20 +137,23 @@
|
||||||
<select id="getTopDepartmentIds" resultType="java.lang.Long">
|
<select id="getTopDepartmentIds" resultType="java.lang.Long">
|
||||||
select t.id
|
select t.id
|
||||||
from ${param.eteams}.department t
|
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'
|
where t.type = 'department'
|
||||||
and t1.type = 'subcompany'
|
and t1.type = 'subcompany'
|
||||||
and t.delete_type = 0
|
and t.delete_type = 0
|
||||||
and t.status = 1
|
and t.status = 1
|
||||||
and t.tenant_key = #{param.tenantKey}
|
and t.tenant_key = #{param.tenantKey}
|
||||||
and t1.delete_type = 0
|
and t1.delete_type = 0
|
||||||
and t1.status = 1
|
and t1.status = 1
|
||||||
and t1.tenant_key = #{param.tenantKey}
|
and t1.tenant_key = #{param.tenantKey}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getLaborCost" resultType="java.util.Map">
|
<select id="getLaborCost" resultType="java.util.Map">
|
||||||
select t.yscb,t.sjcb from ${e10_common}.uf_rlcb t
|
select t.yscb, t.sjcb
|
||||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
from ${e10_common}.uf_rlcb t
|
||||||
and t.ny = DATE_FORMAT(#{endDate}, '%Y-%m')
|
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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -86,14 +86,14 @@
|
||||||
<select id="getManageDeptIds" resultType="java.lang.Long">
|
<select id="getManageDeptIds" resultType="java.lang.Long">
|
||||||
select t.id
|
select t.id
|
||||||
from ${param.eteams}.department t
|
from ${param.eteams}.department t
|
||||||
inner join ${param.eteams}.${param.table_dept_cus} t2 on t.formdata = t2.id
|
inner join ${param.eteams}.${param.table_dept_cus} t2 on t.formdata = t2.id
|
||||||
where t.type = 'department'
|
where t.type = 'department'
|
||||||
and t.delete_type = 0
|
and t.delete_type = 0
|
||||||
and t.status = 1
|
and t.status = 1
|
||||||
and t.tenant_key = #{param.tenantKey}
|
and t.tenant_key = #{param.tenantKey}
|
||||||
and t2.tenant_key = #{param.tenantKey}
|
and t2.tenant_key = #{param.tenantKey}
|
||||||
and t2.delete_type = 0
|
and t2.delete_type = 0
|
||||||
and t2.bmfzr = #{empId}
|
and t2.bmfzr = #{empId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBirthdayNum" resultType="java.lang.Integer">
|
<select id="getBirthdayNum" resultType="java.lang.Integer">
|
||||||
|
|
@ -181,11 +181,18 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getPieTypeConfig" resultType="com.weaver.seconddev.portal.entity.po.PieChartConfig">
|
<select id="getPieTypeConfig" resultType="com.weaver.seconddev.portal.entity.po.PieChartConfig">
|
||||||
select t.lx as type,t.flmc as name,t.xlfl as educationIds,
|
select t.lx as type,
|
||||||
t.qsw as startIndex,t.jzw as endIndex,t.zj as gradeIds,t.zssx as orderNum
|
t.flmc as name,
|
||||||
|
t.xlfl as educationIds,
|
||||||
|
t.qsw as startIndex,
|
||||||
|
t.jzw as endIndex,
|
||||||
|
t.zj as gradeIds,
|
||||||
|
t.zssx as orderNum
|
||||||
from ${e10_common}.uf_xlfb t
|
from ${e10_common}.uf_xlfb t
|
||||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
where t.delete_type = 0
|
||||||
and t.lx = #{pieType} order by t.zssx
|
and t.tenant_key = #{tenantKey}
|
||||||
|
and t.lx = #{pieType}
|
||||||
|
order by t.zssx
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAgeCount" resultType="java.lang.Integer">
|
<select id="getAgeCount" resultType="java.lang.Integer">
|
||||||
|
|
@ -229,10 +236,6 @@
|
||||||
#{departmentId}
|
#{departmentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<!-- <if test="departmentId != null and departmentId != ''">-->
|
|
||||||
<!-- and t.department = #{departmentId}-->
|
|
||||||
<!-- </if>-->
|
|
||||||
|
|
||||||
<if test="searchKey != null and searchKey != ''">
|
<if test="searchKey != null and searchKey != ''">
|
||||||
and (t.username like concat('%',#{searchKey},'%') or t.job_num like concat('%',#{searchKey},'%'))
|
and (t.username like concat('%',#{searchKey},'%') or t.job_num like concat('%',#{searchKey},'%'))
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -336,7 +339,8 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getLateAndEarlyRankList" resultType="com.weaver.seconddev.portal.entity.po.LateAndEarlyRankPo">
|
<select id="getLateAndEarlyRankList" resultType="com.weaver.seconddev.portal.entity.po.LateAndEarlyRankPo">
|
||||||
select t1.xm as empId,sum(ifnull(t1.cdcs,0) + ifnull(t1.ztcs,0)) as times,sum(ifnull(t1.cdfzs,0) + ifnull(t1.ztfzs,0)) as minutes
|
select t1.xm as empId,sum(ifnull(t1.cdcs,0) + ifnull(t1.ztcs,0)) as times,sum(ifnull(t1.cdfzs,0) +
|
||||||
|
ifnull(t1.ztfzs,0)) as minutes
|
||||||
from ${e10_common}.uf_attend_day_report t1
|
from ${e10_common}.uf_attend_day_report t1
|
||||||
where t1.delete_type = 0 and t1.tenant_key = #{tenantKey}
|
where t1.delete_type = 0 and t1.tenant_key = #{tenantKey}
|
||||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||||
|
|
@ -443,5 +447,235 @@
|
||||||
and t1.zt = 1
|
and t1.zt = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getKqRequire" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM ${param.e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||||
|
JOIN ${param.eteams}.employee b ON a.employee = b.id
|
||||||
|
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
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getTodayAllSign" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(*)
|
||||||
|
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
|
||||||
|
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
|
||||||
|
INNER 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) depts) alias ON alias.id = b.department
|
||||||
|
LEFT JOIN ${param.eteams}.${param.table_emp_cus} c ON c.form_data_id = b.formdata
|
||||||
|
LEFT JOIN ${param.e10_other_business}.timecard d ON d.id = a.SIGN_IN_RECORD
|
||||||
|
LEFT JOIN ${param.e10_other_business}.timecard e ON e.id = a.SIGN_OUT_RECORD
|
||||||
|
WHERE a.attend_date = CURDATE()
|
||||||
|
AND a.DAY_TYPE = 'WORK'
|
||||||
|
AND a.delete_type = 0
|
||||||
|
AND (a.SIGN_RANGE_START IS NOT NULL OR a.SIGN_RANGE_END IS NOT NULL)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getTotalLate" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(0)
|
||||||
|
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
|
||||||
|
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
|
||||||
|
INNER 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) depts) alias ON alias.id = b.department
|
||||||
|
LEFT JOIN ${param.eteams}.${param.table_emp_cus} c ON c.form_data_id = b.formdata
|
||||||
|
LEFT JOIN ${param.e10_other_business}.timecard d ON d.id = a.SIGN_IN_RECORD
|
||||||
|
LEFT JOIN ${param.e10_other_business}.timecard e ON e.id = a.SIGN_OUT_RECORD
|
||||||
|
LEFT JOIN ${param.e10_other_business}.attend_status_detail_link f
|
||||||
|
ON f.employee = a.employee AND f.attend_date = a.attend_date
|
||||||
|
WHERE a.attend_date = CURDATE()
|
||||||
|
AND a.SIGN_IN_RECORD IS NOT NULL
|
||||||
|
AND a.PERIOD_RANGE_START < a.SIGN_RANGE_START
|
||||||
|
AND a.DAY_TYPE = 'WORK'
|
||||||
|
AND a.delete_type = 0
|
||||||
|
</select>
|
||||||
|
<select id="getTodayNoSign" resultType="java.lang.Integer">
|
||||||
|
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
|
||||||
|
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
|
||||||
|
INNER 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) depts) alias ON alias.id = b.department
|
||||||
|
LEFT JOIN ${param.eteams}.${param.table_emp_cus} c ON c.form_data_id = b.formdata
|
||||||
|
LEFT JOIN ${param.e10_other_business}.timecard d ON d.id = a.SIGN_IN_RECORD
|
||||||
|
LEFT JOIN ${param.e10_other_business}.timecard e ON e.id = a.SIGN_OUT_RECORD
|
||||||
|
LEFT JOIN ${param.e10_other_business}.attend_status_detail_link f
|
||||||
|
ON f.employee = a.employee AND f.attend_date = a.attend_date
|
||||||
|
WHERE a.attend_date = CURDATE()
|
||||||
|
AND a.SIGN_IN_RECORD IS NULL
|
||||||
|
AND a.DAY_TYPE = 'WORK'
|
||||||
|
AND a.delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getTotalVacation" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(DISTINCT a.EMPLOYEE)
|
||||||
|
FROM ${param.e10_other_business}.ATTEND_STATUS_DETAIL a
|
||||||
|
JOIN ${param.eteams}.employee b ON a.employee = b.id
|
||||||
|
JOIN ${param.eteams}.${param.table_emp_cus} c ON c.form_data_id = b.formdata
|
||||||
|
JOIN ${param.e10_other_business}.attend_status_detail_link d
|
||||||
|
ON d.employee = a.employee AND d.attend_date = a.attend_date
|
||||||
|
JOIN ${param.e10_other_business}.attend_vacation_setting e ON e.id = d.VACATION_TYPE
|
||||||
|
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
|
||||||
|
INNER 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
|
||||||
|
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>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,15 @@
|
||||||
<mapper namespace="com.weaver.seconddev.portal.mapper.portal.SscPortalMapper">
|
<mapper namespace="com.weaver.seconddev.portal.mapper.portal.SscPortalMapper">
|
||||||
|
|
||||||
<select id="getExpirationReminderCount" resultType="java.lang.Integer">
|
<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}
|
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||||
AND t.department IN
|
AND t.ssbm IN
|
||||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||||
#{departmentId}
|
#{departmentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</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>
|
||||||
|
|
||||||
<select id="getIdCardExpirationCount" resultType="java.lang.Integer">
|
<select id="getIdCardExpirationCount" resultType="java.lang.Integer">
|
||||||
|
|
@ -23,7 +23,8 @@
|
||||||
#{departmentId}
|
#{departmentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</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>
|
||||||
|
|
||||||
<select id="getHealthCertificateExpirationCount" resultType="java.lang.Integer">
|
<select id="getHealthCertificateExpirationCount" resultType="java.lang.Integer">
|
||||||
|
|
@ -35,7 +36,9 @@
|
||||||
#{departmentId}
|
#{departmentId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</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>
|
||||||
|
|
||||||
<select id="getEmploymentAnniversaryCount" resultType="java.lang.Integer">
|
<select id="getEmploymentAnniversaryCount" resultType="java.lang.Integer">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue