Compare commits
5 Commits
2002d2a45b
...
cb1d56c751
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb1d56c751 | ||
|
|
022bfe4fb4 | ||
|
|
06ee3738f6 | ||
|
|
7393d00710 | ||
|
|
3e70da9fd9 |
@ -51,7 +51,7 @@ public class RzAttendanceDetail extends BaseEntity
|
|||||||
/** 周六标识 */
|
/** 周六标识 */
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
private String photo;
|
// private String photo;
|
||||||
|
|
||||||
/** 删除标记 */
|
/** 删除标记 */
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.evo.attendance.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RzAttendancePhoto
|
||||||
|
*
|
||||||
|
* @author andy.shi
|
||||||
|
* @ClassName:RzAttendancePhoto
|
||||||
|
* @date: 2026年03月17日 8:52
|
||||||
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RzAttendancePhoto {
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long attendanceDetailId;
|
||||||
|
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
}
|
||||||
@ -27,6 +27,8 @@ public class RzAttendanceDetailTimeLineVO {
|
|||||||
|
|
||||||
String size = "large";
|
String size = "large";
|
||||||
|
|
||||||
|
String delFlag;
|
||||||
|
|
||||||
public RzAttendanceDetailTimeLineVO(String content, String photo, String timestamp, String delFlag) {
|
public RzAttendanceDetailTimeLineVO(String content, String photo, String timestamp, String delFlag) {
|
||||||
this.content = content;
|
this.content = content;
|
||||||
this.photo = photo;
|
this.photo = photo;
|
||||||
@ -36,7 +38,7 @@ public class RzAttendanceDetailTimeLineVO {
|
|||||||
this.icon = timeLine.icon;
|
this.icon = timeLine.icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TimeLineEnum{
|
public enum TimeLineEnum{
|
||||||
UP("上班", "primary","el-icon-caret-top"),
|
UP("上班", "primary","el-icon-caret-top"),
|
||||||
OVERTIME("加班", "success","el-icon-plus"),
|
OVERTIME("加班", "success","el-icon-plus"),
|
||||||
DOWN("下班", "warning","el-icon-caret-bottom"),
|
DOWN("下班", "warning","el-icon-caret-bottom"),
|
||||||
@ -46,8 +48,8 @@ public class RzAttendanceDetailTimeLineVO {
|
|||||||
;
|
;
|
||||||
|
|
||||||
String typeWork;
|
String typeWork;
|
||||||
String type;
|
public String type;
|
||||||
String icon;
|
public String icon;
|
||||||
|
|
||||||
TimeLineEnum(String typeWork, String type, String icon) {
|
TimeLineEnum(String typeWork, String type, String icon) {
|
||||||
this.typeWork = typeWork;
|
this.typeWork = typeWork;
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.evo.attendance.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||||
|
import com.evo.attendance.domain.vo.RzAttendanceDetailTimeLineVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -76,4 +77,6 @@ public interface RzAttendanceDetailMapper extends BaseMapper<RzAttendanceDetail>
|
|||||||
public RzAttendanceDetail selectLastRzAttendanceDetailByBk(@Param("staffId") Long staffId, @Param("buttonType") String buttonType, @Param("startDateTime") Date startDateTime, @Param("endDateTime") Date endDateTime);
|
public RzAttendanceDetail selectLastRzAttendanceDetailByBk(@Param("staffId") Long staffId, @Param("buttonType") String buttonType, @Param("startDateTime") Date startDateTime, @Param("endDateTime") Date endDateTime);
|
||||||
|
|
||||||
List<Map<String,Object>> getThreeDayNotCheck();
|
List<Map<String,Object>> getThreeDayNotCheck();
|
||||||
|
|
||||||
|
List<RzAttendanceDetailTimeLineVO> selectListByAttendanceId(@Param("attId")Long attId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.evo.attendance.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.evo.attendance.domain.RzAttendancePhoto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RzAttendancePhotoMapper
|
||||||
|
*
|
||||||
|
* @author andy.shi
|
||||||
|
* @ClassName:RzAttendancePhotoMapper
|
||||||
|
* @date: 2026年03月17日 8:58
|
||||||
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
|
*/
|
||||||
|
public interface RzAttendancePhotoMapper extends BaseMapper<RzAttendancePhoto> {
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package com.evo.attendance.processor.impl;
|
package com.evo.attendance.processor.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.evo.attendance.domain.RzAttendance;
|
import com.evo.attendance.domain.RzAttendance;
|
||||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||||
@ -174,6 +175,7 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
|||||||
//获取员工的工作时长
|
//获取员工的工作时长
|
||||||
RzAttendanceDetail attendanceDetail = rzAttendanceDetailService.addDetail(attendance, rules, sn, date, "", photo);
|
RzAttendanceDetail attendanceDetail = rzAttendanceDetailService.addDetail(attendance, rules, sn, date, "", photo);
|
||||||
if(attendanceDetail.getId() == null){
|
if(attendanceDetail.getId() == null){
|
||||||
|
log.info("[打卡失败]============> 因为没有打卡详情id{}", JSON.toJSONString(attendanceDetail));
|
||||||
return initMessage(1, "打卡失败");
|
return initMessage(1, "打卡失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,10 +203,10 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
|||||||
}
|
}
|
||||||
//上班的下班卡
|
//上班的下班卡
|
||||||
if(rzAttendanceDetail.getButtonType().contains("上班")){
|
if(rzAttendanceDetail.getButtonType().contains("上班")){
|
||||||
|
|
||||||
return KqUtils.workOffDutyCard( date, rzAttendanceDetail.getButtonType(), attendance) ? initMessage(0, "打卡成功") : initMessage(1,"打卡失败");
|
return KqUtils.workOffDutyCard( date, rzAttendanceDetail.getButtonType(), attendance) ? initMessage(0, "打卡成功") : initMessage(1,"打卡失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.info("[打卡失败]============> 走到最后了, 打卡人姓名{}", sysStaff.getName());
|
||||||
return initMessage(1, "打卡失败");
|
return initMessage(1, "打卡失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,6 +235,8 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
|||||||
attendance.setYcsFlag("1");
|
attendance.setYcsFlag("1");
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
log.info("[打卡失败]============> 出现异常了, 异常原因{}", e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
return initMessage(1, "打卡失败,"+e.getMessage());
|
return initMessage(1, "打卡失败,"+e.getMessage());
|
||||||
}
|
}
|
||||||
//查询昨天是否未打卡
|
//查询昨天是否未打卡
|
||||||
@ -248,6 +252,7 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("查询前一天的打卡情况报错了");
|
log.error("查询前一天的打卡情况报错了");
|
||||||
}
|
}
|
||||||
|
log.info("[打卡失败]============> 上班卡模块, 走到最后了, 不知道成功还是失败, 打卡人姓名{}", attendance.getName());
|
||||||
return (rzAttendanceMapper.updateRzAttendance(attendance) > 0) ? initMessage(0, "打卡成功"+notBeforeEndTimeMessage) : initMessage(1, "打卡失败"+notBeforeEndTimeMessage);
|
return (rzAttendanceMapper.updateRzAttendance(attendance) > 0) ? initMessage(0, "打卡成功"+notBeforeEndTimeMessage) : initMessage(1, "打卡失败"+notBeforeEndTimeMessage);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|||||||
@ -0,0 +1,17 @@
|
|||||||
|
package com.evo.attendance.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.evo.attendance.domain.RzAttendancePhoto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口
|
||||||
|
*
|
||||||
|
* @ClassName:RzAttendanceDetailService
|
||||||
|
* @date: 2025年07月07日 13:32
|
||||||
|
* @author: andy.shi
|
||||||
|
* @contact: 17330188597
|
||||||
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
|
*/
|
||||||
|
public interface RzAttendancePhotoService extends IService<RzAttendancePhoto> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.evo.attendance.domain.RzAttendance;
|
import com.evo.attendance.domain.RzAttendance;
|
||||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||||
|
import com.evo.attendance.domain.RzAttendancePhoto;
|
||||||
import com.evo.attendance.domain.vo.RzAttendanceDetailTimeLineVO;
|
import com.evo.attendance.domain.vo.RzAttendanceDetailTimeLineVO;
|
||||||
import com.evo.attendance.mapper.RzAttendanceDetailMapper;
|
import com.evo.attendance.mapper.RzAttendanceDetailMapper;
|
||||||
|
import com.evo.attendance.mapper.RzAttendancePhotoMapper;
|
||||||
import com.evo.attendance.service.RzAttendanceDetailService;
|
import com.evo.attendance.service.RzAttendanceDetailService;
|
||||||
|
import com.evo.attendance.service.RzAttendancePhotoService;
|
||||||
import com.evo.common.constant.Constants;
|
import com.evo.common.constant.Constants;
|
||||||
import com.evo.common.core.domain.entity.SysDept;
|
import com.evo.common.core.domain.entity.SysDept;
|
||||||
import com.evo.common.utils.Collections;
|
import com.evo.common.utils.Collections;
|
||||||
@ -55,6 +58,8 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
|
|||||||
RzLeaveDetailMapper rzLeaveDetailMapper;
|
RzLeaveDetailMapper rzLeaveDetailMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysStaffMapper sysStaffMapper;
|
private SysStaffMapper sysStaffMapper;
|
||||||
|
@Autowired
|
||||||
|
private RzAttendancePhotoMapper rzAttendancePhotoMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RzAttendanceDetail addDetail(RzAttendance attendance, String rules, String sn, Date date, String remark, String photo) {
|
public RzAttendanceDetail addDetail(RzAttendance attendance, String rules, String sn, Date date, String remark, String photo) {
|
||||||
@ -93,17 +98,25 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
|
|||||||
attendanceDetail.setEquipmentCode(sn);
|
attendanceDetail.setEquipmentCode(sn);
|
||||||
attendanceDetail.setCreateTime(new Date());
|
attendanceDetail.setCreateTime(new Date());
|
||||||
attendanceDetail.setRemark(remark);
|
attendanceDetail.setRemark(remark);
|
||||||
if(StringUtils.isNotEmpty(photo)){
|
|
||||||
attendanceDetail.setPhoto(photo);
|
|
||||||
}
|
|
||||||
if(attendanceDetail.getId() == null){
|
if(attendanceDetail.getId() == null){
|
||||||
save(attendanceDetail);
|
save(attendanceDetail);
|
||||||
}else{
|
}else{
|
||||||
updateById(attendanceDetail);
|
updateById(attendanceDetail);
|
||||||
}
|
}
|
||||||
|
if(StringUtils.isNotEmpty(photo)){
|
||||||
|
addPhoto(attendanceDetail.getId(), photo);
|
||||||
|
}
|
||||||
return attendanceDetail;
|
return attendanceDetail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
public void addPhoto(Long detailId, String photo){
|
||||||
|
RzAttendancePhoto rzAttendancePhoto = new RzAttendancePhoto();
|
||||||
|
rzAttendancePhoto.setAttendanceDetailId(detailId);
|
||||||
|
rzAttendancePhoto.setPhoto(photo);
|
||||||
|
rzAttendancePhotoMapper.insert(rzAttendancePhoto);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public RzAttendanceDetail selectLastRzAttendanceDetail(Long staffId) {
|
public RzAttendanceDetail selectLastRzAttendanceDetail(Long staffId) {
|
||||||
return getBaseMapper().selectLastRzAttendanceDetail(staffId);
|
return getBaseMapper().selectLastRzAttendanceDetail(staffId);
|
||||||
@ -121,9 +134,18 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RzAttendanceDetailTimeLineVO> selectListByAttendanceId(Long attId) {
|
public List<RzAttendanceDetailTimeLineVO> selectListByAttendanceId(Long attId) {
|
||||||
return list(new LambdaQueryWrapper<RzAttendanceDetail>().eq(RzAttendanceDetail::getAttendanceId, attId).select(RzAttendanceDetail::getButtonType, RzAttendanceDetail::getPhoto, RzAttendanceDetail::getDateTime,RzAttendanceDetail::getDelFlag)).stream().map(data ->{
|
List<RzAttendanceDetailTimeLineVO> result = getBaseMapper().selectListByAttendanceId(attId);
|
||||||
return new RzAttendanceDetailTimeLineVO(data.getButtonType(), data.getPhoto(), DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",data.getDateTime()), data.getDelFlag());
|
result.stream().forEach(data->{
|
||||||
}).collect(Collectors.toList());
|
RzAttendanceDetailTimeLineVO.TimeLineEnum timeLine = RzAttendanceDetailTimeLineVO.TimeLineEnum.get(data.getContent(), data.getDelFlag());
|
||||||
|
data.setType(timeLine.type);
|
||||||
|
data.setIcon(timeLine.icon);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
//
|
||||||
|
// return getBaseMapper().selectListByAttendanceId(new LambdaQueryWrapper<RzAttendanceDetail>().eq(RzAttendanceDetail::getAttendanceId, attId)
|
||||||
|
// .select(RzAttendanceDetail::getButtonType, RzAttendanceDetail::getPhoto, RzAttendanceDetail::getDateTime,RzAttendanceDetail::getDelFlag)).stream().map(data ->{
|
||||||
|
// return new RzAttendanceDetailTimeLineVO(data.getButtonType(), data.getPhoto(), DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",data.getDateTime()), data.getDelFlag());
|
||||||
|
// }).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
package com.evo.attendance.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.evo.attendance.domain.RzAttendancePhoto;
|
||||||
|
import com.evo.attendance.mapper.RzAttendancePhotoMapper;
|
||||||
|
import com.evo.attendance.service.RzAttendancePhotoService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类
|
||||||
|
*
|
||||||
|
* @ClassName:RzAttendanceDetailServiceimpl
|
||||||
|
* @date: 2025年07月07日 13:33
|
||||||
|
* @author: andy.shi
|
||||||
|
* @contact: 17330188597
|
||||||
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class RzAttendancePhotoServiceImpl extends ServiceImpl<RzAttendancePhotoMapper, RzAttendancePhoto> implements RzAttendancePhotoService {
|
||||||
|
}
|
||||||
@ -116,6 +116,20 @@ public class DingUtils {
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//根据手机号获取用户id
|
||||||
|
public static String getUserInfoByUserId(String userId){
|
||||||
|
try {
|
||||||
|
DingTalkClient client = new DefaultDingTalkClient(DingGlobalParams.getUrl()+"v2/user/get");
|
||||||
|
OapiV2UserGetRequest req = new OapiV2UserGetRequest();
|
||||||
|
req.setUserid(userId);
|
||||||
|
OapiV2UserGetResponse rsp = client.execute(req, "");
|
||||||
|
return rsp.getBody();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
/***
|
/***
|
||||||
* 获取班次信息
|
* 获取班次信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -12,9 +12,14 @@ import com.alibaba.fastjson2.JSONObject;
|
|||||||
*/
|
*/
|
||||||
public interface DingCallBackExchangeProcessor {
|
public interface DingCallBackExchangeProcessor {
|
||||||
|
|
||||||
|
//入职
|
||||||
|
static final String EVENT_TYPE_USER_ADD_ORG = "user_add_org";
|
||||||
|
//离职
|
||||||
|
static final String EVENT_TYPE_USER_LEAVE_ORG = "user_leave_org";
|
||||||
|
|
||||||
//打卡
|
//打卡
|
||||||
static final String EVENT_TYPE_CHECK_RECORD = "attendance_check_record";
|
static final String EVENT_TYPE_CHECK_RECORD = "attendance_check_record";
|
||||||
//审批实例订阅
|
//审批实例订阅-> 补卡
|
||||||
static final String EVENT_TYPE_INSTANCE_CHANGE = "bpms_instance_change";
|
static final String EVENT_TYPE_INSTANCE_CHANGE = "bpms_instance_change";
|
||||||
//请假、加班、出差、外出状态变更事件
|
//请假、加班、出差、外出状态变更事件
|
||||||
static final String EVENT_TYPE_APPROVE_STATUS_CHANGE = "attendance_approve_status_change";
|
static final String EVENT_TYPE_APPROVE_STATUS_CHANGE = "attendance_approve_status_change";
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.evo.ding.processor.callback.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.evo.ding.processor.callback.DingCallBackExchangeProcessor;
|
||||||
|
import com.evo.system.service.ISysStaffService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工离职 DingCallBackUseLeaveOrgExchangeProcessor
|
||||||
|
*
|
||||||
|
* @author andy.shi
|
||||||
|
* @ClassName:DingCallBackUseLeaveOrgExchangeProcessor
|
||||||
|
* @date: 2026年03月12日 9:02
|
||||||
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class DingCallBackUseLeaveOrgExchangeProcessor implements DingCallBackExchangeProcessor {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ISysStaffService sysStaffService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean accept(String eventType) {
|
||||||
|
return EVENT_TYPE_USER_LEAVE_ORG.equals(eventType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exchange(JSONObject json) {
|
||||||
|
log.info("钉钉 员工离职========================>>>{}", json.toString());
|
||||||
|
JSONArray dataList = json.getJSONArray("userId");
|
||||||
|
if(dataList!= null && dataList.size() > 0){
|
||||||
|
dataList.forEach(data->{
|
||||||
|
sysStaffService.sysStaffLeaveByDingUserId(String.valueOf(data));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
package com.evo.ding.processor.callback.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.evo.attendance.service.IRzAttendanceService;
|
||||||
|
import com.evo.common.utils.StringUtils;
|
||||||
|
import com.evo.ding.DingUtils;
|
||||||
|
import com.evo.ding.processor.callback.DingCallBackExchangeProcessor;
|
||||||
|
import com.evo.system.service.ISysStaffService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工入职 DingCallBackUserAddOrgExchangeProcessor
|
||||||
|
*
|
||||||
|
* @author andy.shi
|
||||||
|
* @ClassName:DingCallBackUserAddOrgExchangeProcessor
|
||||||
|
* @date: 2026年03月12日 9:02
|
||||||
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class DingCallBackUserAddOrgExchangeProcessor implements DingCallBackExchangeProcessor {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ISysStaffService sysStaffService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean accept(String eventType) {
|
||||||
|
return EVENT_TYPE_USER_ADD_ORG.equals(eventType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exchange(JSONObject json) {
|
||||||
|
log.info("钉钉 新增员工========================>>>{}", json.toString());
|
||||||
|
JSONArray dataList = json.getJSONArray("userId");
|
||||||
|
if(dataList!= null && dataList.size() > 0){
|
||||||
|
dataList.forEach(data->{
|
||||||
|
DingUtils.getUserInfoByUserId(String.valueOf(data));
|
||||||
|
sysStaffService.sysStaffLeaveByDingUserId(String.valueOf(data));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -110,7 +110,7 @@ public class RzRestaurantStatisticsServiceImpl extends ServiceImpl<RzRestaurantS
|
|||||||
//查询消费情况
|
//查询消费情况
|
||||||
Map<Long,String> dicMap = sysDictDataMapper.selectDictDataByType(Constants.SYS_RESTAUTANT).stream().collect(Collectors.toMap(SysDictData::getDictCode, SysDictData::getDictValue));
|
Map<Long,String> dicMap = sysDictDataMapper.selectDictDataByType(Constants.SYS_RESTAUTANT).stream().collect(Collectors.toMap(SysDictData::getDictCode, SysDictData::getDictValue));
|
||||||
//优先检查是否为住宿
|
//优先检查是否为住宿
|
||||||
Map<Long, Boolean> zsMap = sysStaffMapper.selectSysStaffListAll().stream().collect(Collectors.toMap(SysStaff::getUserId, d->"是".equals(d.getZsFlag())));
|
Map<Long, Boolean> zsMap = sysStaffMapper.selectSysStaffListByRzRestaurantStatistics(rzRestaurantStatistics.getMonth()).stream().collect(Collectors.toMap(SysStaff::getUserId, d->"是".equals(d.getZsFlag())));
|
||||||
List<String> notAccommodationNames = ParamUtils.getInternNotAccommodation();
|
List<String> notAccommodationNames = ParamUtils.getInternNotAccommodation();
|
||||||
//然后在检查是否为日薪
|
//然后在检查是否为日薪
|
||||||
Map<Long, Boolean> rxMap = sysStaffDetailMapper.selectList(new LambdaQueryWrapper<SysStaffDetail>().in(SysStaffDetail::getStaffId, zsMap.keySet().toArray())).stream().collect(Collectors.toMap(SysStaffDetail::getStaffId, d->d.getDailyWage() != null && d.getDailyWage().intValue() > 0));
|
Map<Long, Boolean> rxMap = sysStaffDetailMapper.selectList(new LambdaQueryWrapper<SysStaffDetail>().in(SysStaffDetail::getStaffId, zsMap.keySet().toArray())).stream().collect(Collectors.toMap(SysStaffDetail::getStaffId, d->d.getDailyWage() != null && d.getDailyWage().intValue() > 0));
|
||||||
|
|||||||
@ -51,6 +51,12 @@ public interface SysStaffMapper extends BaseMapper<SysStaff>
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<SysStaff> selectSysStaffListAll();
|
public List<SysStaff> selectSysStaffListAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有的在职员工信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<SysStaff> selectSysStaffListByRzRestaurantStatistics(Date date);
|
||||||
/**
|
/**
|
||||||
* 根据身份证号查询员工信息
|
* 根据身份证号查询员工信息
|
||||||
* @param idCard
|
* @param idCard
|
||||||
|
|||||||
@ -39,6 +39,13 @@ public interface ISysStaffService extends IService<SysStaff>
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public AjaxResult insertSysStaff(SysStaff sysStaff);
|
public AjaxResult insertSysStaff(SysStaff sysStaff);
|
||||||
|
/**
|
||||||
|
* 新增员工管理
|
||||||
|
*
|
||||||
|
* @param result 员工管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public void insertSysStaffByDingDing(String result);
|
||||||
/**
|
/**
|
||||||
* 修改员工管理
|
* 修改员工管理
|
||||||
*
|
*
|
||||||
@ -122,4 +129,10 @@ public interface ISysStaffService extends IService<SysStaff>
|
|||||||
* @return 员工管理
|
* @return 员工管理
|
||||||
*/
|
*/
|
||||||
public SysStaff selectSysStaffByDingUserId(String dingUserId);
|
public SysStaff selectSysStaffByDingUserId(String dingUserId);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 根据钉钉的用户id做用户离职
|
||||||
|
* @param dingUserId
|
||||||
|
*/
|
||||||
|
public void sysStaffLeaveByDingUserId(String dingUserId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -179,6 +181,68 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
|||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertSysStaffByDingDing(String result) {
|
||||||
|
|
||||||
|
JSONObject dingResult = JSONObject.parseObject(result);
|
||||||
|
dingResult.getJSONObject("result");
|
||||||
|
|
||||||
|
// //根据省份证号查询是否已经录入
|
||||||
|
// SysStaff p_staff = getBaseMapper().queryysStaffByIdCard(sysStaff.getIdCard());
|
||||||
|
// if(StringUtils.isNotNull(p_staff)){
|
||||||
|
// return AjaxResult.error("此人录入过!!");
|
||||||
|
// }
|
||||||
|
// //判断是否是领导,是反写部门信息
|
||||||
|
// if("是".equals(sysStaff.getIsLeader())){
|
||||||
|
// //根据ID查询部门信息
|
||||||
|
// SysDept sysDept = deptMapper.selectDeptById(sysStaff.getDeptId());
|
||||||
|
// sysDept.setPhone(sysStaff.getPhone());
|
||||||
|
// sysDept.setLeader(sysStaff.getName());
|
||||||
|
// int i = deptMapper.updateDept(sysDept);
|
||||||
|
// if(i < 1){
|
||||||
|
// return AjaxResult.error("更新部门负责人失败");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// //根据省份证确定性别和年龄
|
||||||
|
// sysStaff.setAge(Long.parseLong(new SimpleDateFormat("yyyy").format(new Date())) - Long.parseLong(sysStaff.getIdCard().substring(6,10)));
|
||||||
|
// //性别
|
||||||
|
// sysStaff.setSex((Integer.parseInt(sysStaff.getIdCard().substring(16,17)) % 2 == 0) ? "1" : "0");
|
||||||
|
// //员工编码
|
||||||
|
// sysStaff.setCode(getCodeByCompanyName());
|
||||||
|
// sysStaff.setSeniority(0l);
|
||||||
|
// sysStaff.setStatus(Constants.JOB_STATIS_0);
|
||||||
|
// sysStaff.setCreateTime(DateUtils.getNowDate());
|
||||||
|
// sysStaff.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
// sysStaff.setDelFlag(Constants.DELETE_FLAG_0);
|
||||||
|
//
|
||||||
|
// if(CollectionUtils.isNotEmpty(sysStaff.getSubsidyList())){
|
||||||
|
// sysStaff.setSubsidys(sysStaff.getSubsidyList().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||||
|
// }
|
||||||
|
// //打卡位置改为多选
|
||||||
|
// if(CollectionUtils.isNotEmpty(sysStaff.getTimeClockList())){
|
||||||
|
// sysStaff.setTimeClock(sysStaff.getTimeClockList().stream().collect(Collectors.joining(",")));
|
||||||
|
// }
|
||||||
|
// //新增员工信息到金蝶
|
||||||
|
// if(StringUtils.isNotEmpty(sysStaff.getJobCode())){
|
||||||
|
// sysStaff.setExtended(KingdeeRequestUtils.employeeSave(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode(), "jobCode", sysStaff.getJobCode().split("_")[0],"deptCode", sysStaff.getJobCode().split("_")[1])));
|
||||||
|
// }else if(StringUtils.isEmpty(sysStaff.getJobCode())){
|
||||||
|
// sysStaff.setExtended(KingdeeRequestUtils.employeeSaveEmptyJob(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode())));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// int i = getBaseMapper().insertSysStaff(sysStaff);
|
||||||
|
// if(i < 1){
|
||||||
|
// return AjaxResult.error("员工添加失败");
|
||||||
|
// }
|
||||||
|
// //员工详情
|
||||||
|
// createStaffDetail(sysStaff);
|
||||||
|
// //打卡统计,打卡详情
|
||||||
|
// rzAttendanceStatisticalService.createRzAttendance(sysStaff, Collections.emptyList(), null);
|
||||||
|
// //处理餐饮信息
|
||||||
|
// rzRestaurantStatisticsService.createRestaurantStatistics(sysStaff, DateUtils.getNowDate());
|
||||||
|
// //处理考勤机相关信息
|
||||||
|
// initCheckDevice(sysStaff);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void initCheckDevice(SysStaff sysStaff){
|
private void initCheckDevice(SysStaff sysStaff){
|
||||||
//如果文件Id不为空, 则需要更新打卡设备信息, 完成后, 同步更新图片的业务Id数据
|
//如果文件Id不为空, 则需要更新打卡设备信息, 完成后, 同步更新图片的业务Id数据
|
||||||
@ -843,4 +907,12 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
|||||||
public SysStaff selectSysStaffByDingUserId(String dingUserId) {
|
public SysStaff selectSysStaffByDingUserId(String dingUserId) {
|
||||||
return getBaseMapper().selectSysStaffByDingUserId(dingUserId);
|
return getBaseMapper().selectSysStaffByDingUserId(dingUserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sysStaffLeaveByDingUserId(String dingUserId) {
|
||||||
|
SysStaff sysStaff = selectSysStaffByDingUserId(dingUserId);
|
||||||
|
//减去一分钟, 防止离职失败
|
||||||
|
sysStaff.setQuitDate(DateUtils.addMinutes(new Date(), -1));
|
||||||
|
updateSysStaff(sysStaff);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,4 +117,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectListByAttendanceId" resultType="com.evo.attendance.domain.vo.RzAttendanceDetailTimeLineVO">
|
||||||
|
select ad.button_type as content, DATE_FORMAT(ad.date_time,"%Y-%m-%d %H:%i:%s") as `timestamp`, ad.del_flag as delFlag , ap.photo
|
||||||
|
from rz_attendance_detail ad
|
||||||
|
left join rz_attendance_photo ap on ap.attendance_detail_id = ad.id
|
||||||
|
where ad.attendance_id = #{attId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -260,6 +260,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectSysStaffVo"/>
|
<include refid="selectSysStaffVo"/>
|
||||||
where del_flag = '0' and status != '-1'
|
where del_flag = '0' and status != '-1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectSysStaffListByRzRestaurantStatistics" resultMap="SysStaffResult">
|
||||||
|
select ss.user_id, ss.zs_flag
|
||||||
|
from sys_staff ss
|
||||||
|
left join rz_restaurant_statistics rrs on rrs.staff_id = ss.user_id
|
||||||
|
where DATE_FORMAT(rrs.month, '%Y%m' ) = DATE_FORMAT( #{date} , '%Y%m' )
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 根据身份证号查询员工 -->
|
<!-- 根据身份证号查询员工 -->
|
||||||
<select id="queryysStaffByIdCard" parameterType="String" resultMap="SysStaffResult">
|
<select id="queryysStaffByIdCard" parameterType="String" resultMap="SysStaffResult">
|
||||||
<include refid="selectSysStaffVo"/>
|
<include refid="selectSysStaffVo"/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user