Merge remote-tracking branch 'remotes/origin/master' into dingding

This commit is contained in:
andy 2026-03-18 09:06:22 +08:00
commit 022bfe4fb4
13 changed files with 149 additions and 12 deletions

View File

@ -51,7 +51,7 @@ public class RzAttendanceDetail extends BaseEntity
/** 周六标识 */
private String remark;
private String photo;
// private String photo;
/** 删除标记 */
private String delFlag;

View File

@ -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;
}

View File

@ -27,6 +27,8 @@ public class RzAttendanceDetailTimeLineVO {
String size = "large";
String delFlag;
public RzAttendanceDetailTimeLineVO(String content, String photo, String timestamp, String delFlag) {
this.content = content;
this.photo = photo;
@ -36,7 +38,7 @@ public class RzAttendanceDetailTimeLineVO {
this.icon = timeLine.icon;
}
enum TimeLineEnum{
public enum TimeLineEnum{
UP("上班", "primary","el-icon-caret-top"),
OVERTIME("加班", "success","el-icon-plus"),
DOWN("下班", "warning","el-icon-caret-bottom"),
@ -46,8 +48,8 @@ public class RzAttendanceDetailTimeLineVO {
;
String typeWork;
String type;
String icon;
public String type;
public String icon;
TimeLineEnum(String typeWork, String type, String icon) {
this.typeWork = typeWork;

View File

@ -2,6 +2,7 @@ package com.evo.attendance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.evo.attendance.domain.RzAttendanceDetail;
import com.evo.attendance.domain.vo.RzAttendanceDetailTimeLineVO;
import org.apache.ibatis.annotations.Param;
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);
List<Map<String,Object>> getThreeDayNotCheck();
List<RzAttendanceDetailTimeLineVO> selectListByAttendanceId(@Param("attId")Long attId);
}

View File

@ -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> {
}

View File

@ -1,5 +1,6 @@
package com.evo.attendance.processor.impl;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.evo.attendance.domain.RzAttendance;
import com.evo.attendance.domain.RzAttendanceDetail;
@ -174,6 +175,7 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
//获取员工的工作时长
RzAttendanceDetail attendanceDetail = rzAttendanceDetailService.addDetail(attendance, rules, sn, date, "", photo);
if(attendanceDetail.getId() == null){
log.info("[打卡失败]============> 因为没有打卡详情id{}", JSON.toJSONString(attendanceDetail));
return initMessage(1, "打卡失败");
}
@ -201,10 +203,10 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
}
//上班的下班卡
if(rzAttendanceDetail.getButtonType().contains("上班")){
return KqUtils.workOffDutyCard( date, rzAttendanceDetail.getButtonType(), attendance) ? initMessage(0, "打卡成功") : initMessage(1,"打卡失败");
}
log.info("[打卡失败]============> 走到最后了, 打卡人姓名{}", sysStaff.getName());
return initMessage(1, "打卡失败");
}
@ -233,6 +235,8 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
attendance.setYcsFlag("1");
}
}catch (Exception e){
log.info("[打卡失败]============> 出现异常了, 异常原因{}", e.getMessage());
e.printStackTrace();
return initMessage(1, "打卡失败,"+e.getMessage());
}
//查询昨天是否未打卡
@ -248,6 +252,7 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
e.printStackTrace();
log.error("查询前一天的打卡情况报错了");
}
log.info("[打卡失败]============> 上班卡模块, 走到最后了, 不知道成功还是失败, 打卡人姓名{}", attendance.getName());
return (rzAttendanceMapper.updateRzAttendance(attendance) > 0) ? initMessage(0, "打卡成功"+notBeforeEndTimeMessage) : initMessage(1, "打卡失败"+notBeforeEndTimeMessage);
}
//

View File

@ -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> {
}

View File

@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.evo.attendance.domain.RzAttendance;
import com.evo.attendance.domain.RzAttendanceDetail;
import com.evo.attendance.domain.RzAttendancePhoto;
import com.evo.attendance.domain.vo.RzAttendanceDetailTimeLineVO;
import com.evo.attendance.mapper.RzAttendanceDetailMapper;
import com.evo.attendance.mapper.RzAttendancePhotoMapper;
import com.evo.attendance.service.RzAttendanceDetailService;
import com.evo.attendance.service.RzAttendancePhotoService;
import com.evo.common.constant.Constants;
import com.evo.common.core.domain.entity.SysDept;
import com.evo.common.utils.Collections;
@ -55,6 +58,8 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
RzLeaveDetailMapper rzLeaveDetailMapper;
@Autowired
private SysStaffMapper sysStaffMapper;
@Autowired
private RzAttendancePhotoMapper rzAttendancePhotoMapper;
@Override
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.setCreateTime(new Date());
attendanceDetail.setRemark(remark);
if(StringUtils.isNotEmpty(photo)){
attendanceDetail.setPhoto(photo);
}
if(attendanceDetail.getId() == null){
save(attendanceDetail);
}else{
updateById(attendanceDetail);
}
if(StringUtils.isNotEmpty(photo)){
addPhoto(attendanceDetail.getId(), photo);
}
return attendanceDetail;
}
@Async
public void addPhoto(Long detailId, String photo){
RzAttendancePhoto rzAttendancePhoto = new RzAttendancePhoto();
rzAttendancePhoto.setAttendanceDetailId(detailId);
rzAttendancePhoto.setPhoto(photo);
rzAttendancePhotoMapper.insert(rzAttendancePhoto);
}
@Override
public RzAttendanceDetail selectLastRzAttendanceDetail(Long staffId) {
return getBaseMapper().selectLastRzAttendanceDetail(staffId);
@ -121,9 +134,18 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
@Override
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 ->{
return new RzAttendanceDetailTimeLineVO(data.getButtonType(), data.getPhoto(), DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",data.getDateTime()), data.getDelFlag());
}).collect(Collectors.toList());
List<RzAttendanceDetailTimeLineVO> result = getBaseMapper().selectListByAttendanceId(attId);
result.stream().forEach(data->{
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");

View File

@ -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 {
}

View File

@ -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, 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();
//然后在检查是否为日薪
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));

View File

@ -51,6 +51,12 @@ public interface SysStaffMapper extends BaseMapper<SysStaff>
* @return
*/
public List<SysStaff> selectSysStaffListAll();
/**
* 查询所有的在职员工信息
* @return
*/
public List<SysStaff> selectSysStaffListByRzRestaurantStatistics(Date date);
/**
* 根据身份证号查询员工信息
* @param idCard

View File

@ -117,4 +117,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</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>

View File

@ -260,6 +260,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectSysStaffVo"/>
where del_flag = '0' and status != '-1'
</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">
<include refid="selectSysStaffVo"/>